def recv_end(the_socket, SOCKET_END_TAG):
    """通过寻找接收的协议数据中的尾标识字符串，获取完整的数据的数据报文"""
    total_data = []
    while True:
        data = the_socket.recv(8192)
        if SOCKET_END_TAG in data:
            total_data.append(data[:data.find(SOCKET_END_TAG)])
            break
        total_data.append(data)
        if len(total_data) > 1:
            last_pair = total_data[-2] + total_data[-1]
            if SOCKET_END_TAG in last_pair:
                total_data[-2] = last_pair[:last_pair.find(SOCKET_END_TAG)]
                total_data.pop()
                break
    if len(total_data) == 0:
        return None
    return b''.join(total_data)
