WO2015055010A1 - Data transmission method, device and storage medium - Google Patents

Data transmission method, device and storage medium Download PDF

Info

Publication number
WO2015055010A1
WO2015055010A1 PCT/CN2014/078523 CN2014078523W WO2015055010A1 WO 2015055010 A1 WO2015055010 A1 WO 2015055010A1 CN 2014078523 W CN2014078523 W CN 2014078523W WO 2015055010 A1 WO2015055010 A1 WO 2015055010A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
protocol
receiving end
server
receiving
Prior art date
Application number
PCT/CN2014/078523
Other languages
French (fr)
Chinese (zh)
Inventor
冯锋
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2015055010A1 publication Critical patent/WO2015055010A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Definitions

  • the present invention relates to the field of computer communication technologies, and in particular, to a data transmission method, apparatus, and storage medium.
  • network service operators provide more and more business services for users.
  • network service operators usually provide different services to users through their independent platform servers. service.
  • platform servers of different service types are relatively independent, the implementation principles are different, especially the communication protocol formats are different from each other, so cross-platform data transmission is inconvenient.
  • it is generally required to configure multiple protocol formats in the user terminal.
  • the user terminal requests different service data from different platform servers, it is necessary to construct different protocols according to different protocol formats. Protocol package.
  • such a transmission method is costly.
  • the user terminal needs to be able to understand various service protocol formats, which leads to high cost of software development of the user terminal; on the other hand, for the platform server, The platform server is required to provide support for multiple protocol formats externally, which leads to high cost of maintenance of the platform server.
  • an embodiment of the present invention provides a data transmission method, including: receiving, by a server, first data sent by a sending end, where the first data includes information about a protocol used by a receiving end; And the information of the protocol is: converting the first data into second data that conforms to a protocol format used by the receiving end; and transmitting the second data after converting the protocol format to the receiving end.
  • an embodiment of the present invention provides a data transmission apparatus, including: a receiving module, configured to receive, by a sending end, first data, where the first data includes information about a protocol used by a receiving end; And converting the first data into second data conforming to a protocol format used by the receiving end according to the information of the protocol used by the receiving end received by the receiving module; and a transmitting module, configured to: use the converting module Transmitting the second data after the protocol format is transmitted to the receiving end.
  • an embodiment of the present invention provides a storage medium including computer executable instructions for performing a data transmission method when executed by a computer processor, wherein the method includes:
  • the server converts the first data into second data conforming to a protocol format used by the receiving end according to information of a protocol used by the receiving end;
  • the server transmits the second data after converting the protocol format to the receiving end.
  • the data transmission method and device and the storage medium provided by the embodiment of the present invention convert the first data sent by the sending end into the second data conforming to the protocol format used by the receiving end by the server as a proxy, and then send the second data to the receiving end, so that the sending end Only one protocol needs to be understood to access the receiving end of different service platforms, thereby reducing the cost of cross-platform data transmission.
  • FIG. 1 is a flowchart of a data transmission method according to an embodiment of the present invention.
  • FIG. 2 is an application environment diagram of a data transmission method according to another embodiment of the present invention.
  • FIG. 3 is a flowchart of a data transmission method according to another embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a practical application of a data transmission method according to another embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a data transmission apparatus according to still another embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a data transmission apparatus according to still another embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a conversion module in a data transmission apparatus according to still another embodiment of the present invention.
  • the data transmission method provided by the embodiment of the present invention can be applied to implement processing for transmitting data across platforms.
  • FIG. 1 is a flowchart of a data transmission method according to an embodiment of the present invention. As shown in FIG. 1, the data transmission method of this embodiment includes the following steps:
  • Step S11 The server receives the first data sent by the sending end, where the first data includes information about a protocol used by the receiving end.
  • the sending end may include: a smart phone, a tablet computer, an e-book reader, an MP3 player (Moving Picture Exper s Group Audio Layer III, a dynamic image expert compressing standard audio layer 3) , MP4 (Mov ing Picture Exper ts Group Audio Layer IV, motion picture expert compression standard audio layer 4) player, or laptop portable computer and so on.
  • the server may agree with the sender to use the protocol used for data transmission between the sender and the sender, and send the format of the protocol and the service data transmission protocol list used by the receiver. To the sender.
  • the sending end may construct a packet of the first data according to a protocol format pre-agreed by the server, and may also encapsulate the information of the protocol used by the receiving end in the packet of the first data, for example, the information of the protocol used by the receiving end may be encapsulated in the first
  • the header of a data packet and then the encapsulated first data is sent to the server.
  • the pre-agreed protocol is preferably a general-purpose protocol, and may specifically include: a binary protocol, a PB protocol (Protocol Buffers protocol), or a TDR protocol (Tencent Data Representation, an internal transmission protocol for entertainment interactive data transmission), and the like.
  • Step S12 The server converts the first data into second data that conforms to a protocol format used by the receiving end according to the information of the protocol used by the receiving end.
  • the server parses the received packet of the first data, extracts content data of the first data loaded in the packet, and information about a protocol used by the receiving end, and then obtains a corresponding protocol format according to the information of the protocol used by the receiving end, According to the protocol format, the content data of the first data loaded in the extracted packet of the first data is converted into the second data conforming to the protocol format used by the receiving end.
  • Step S13 The server transmits the second data after converting the protocol format to the receiving end.
  • the receiving end may be a platform server.
  • Different platform servers exchange data with other terminal devices using their respective service data transmission protocols (for example: binary protocol, PB protocol, or TDR protocol, etc.).
  • the server transmits the converted second data conforming to the protocol format used by the receiving end to the receiving end, so that the receiving end can process the cross-platform data between the transmitting end and the receiving end by parsing the second data and processing the parsed data. Transmission.
  • the data transmission method provided by the embodiment of the present invention converts the first data sent by the sending end into the second data conforming to the protocol format used by the receiving end by the server as a proxy, and then sends the second data to the receiving end, so that the sending end only needs to understand one type.
  • the protocol can access the receiving end of different service platforms, thereby reducing the cost of cross-platform data transmission.
  • the platform server A, the platform server B, the platform server C, the (protocol proxy) server 102, the user terminal, and the user terminal B are located in a wireless or wired network, through the wireless or wired
  • the platform server C can provide various service services for the user terminal A and the user terminal B through the server 102, for example, a data storage service, a microblog service, a voice communication service, or a web browsing service.
  • the receiving end 103 in FIG. 2 includes only the platform server A, the platform server B, and the platform server C.
  • the transmitting end 101 includes only the user terminal A and the user terminal B, but the specific embodiment of the present invention is Not limited to this.
  • FIG. 3 is a flowchart of a data transmission method according to another embodiment of the present invention. As shown in FIG. 3, the data transmission method of this embodiment includes the following steps:
  • Step S201 The server receives the first data sent by the sending end, where the first data includes information about a protocol used by the receiving end.
  • the information about the protocol used by the receiving end may include: an identifier of a protocol used by the receiving end.
  • the identifier of the protocol may be a protocol command word or a protocol type identifier.
  • the sender 101 When the sender 101 applies for the proxy data transmission service to the server 102, it agrees with the server 102 on the protocol used for data transmission, and obtains the format of the agreed protocol from the server 102 and the service data transmission protocol used by the receiver 103. List.
  • the service data transmission protocol list is as shown in Table 1 below, and may include the identifiers of the platform server A, the platform server B, and the platform server C as the receiving end 103, and the platform server A, the platform server B, and the platform server C respectively use The identity of the protocol (the value of the command word or protocol type of the protocol used), and the correspondence between the identity of the protocol and the identity of the three platform servers above.
  • the value of the protocol type can be the number of the protocol type, which is used to identify the protocol type.
  • the data transmission protocol agreed between the sender 101 and the server 102 may be identical or inconsistent with the data transmission protocol used by the receiver 103.
  • the sender 101 may query the service data transmission protocol list according to the keyword of the platform server corresponding to the service to be acquired, obtain the value of the command word or protocol type of the corresponding protocol, and then write the obtained command word or protocol type value.
  • the content of the first data is configured by the sending end 101 according to a preset configuration rule.
  • the transmitting end 101 acquires the configuration rule from the receiving end 103 when applying for a service to the receiving end 103.
  • the packet of the first data may further include: a service type of the receiving end 103, or an identifier of the receiving end 103.
  • the service type of the receiving end 103 or the identifier of the receiving end 103 is used to enable the server 102 to obtain the address of the receiving end 103 according to the service type of the receiving end 103 or the identifier of the receiving end 103, and then convert according to the obtained address.
  • the first data after is sent to the receiving end 103.
  • Step S202 the server extracts, from the first data, a protocol of the protocol used by the receiving end, and the server 102 parses the received packet of the first data, and extracts content data of the first data loaded in the packet. And the value of the command word or protocol type in a particular field of the packet header. It can be understood that the server 102 can also obtain the service type of the receiving end 103 or the identifier of the receiving end 103 by parsing the received packet of the first data.
  • Step S203 The server obtains the protocol used by the receiving end by querying the correspondence between the identifier of the protocol used by the receiving end and the protocol used by the receiving end in the protocol database.
  • the server 102 is configured with a protocol database
  • the protocol database can store: identifiers, addresses, and addresses of the platform server A, the platform server B, and the platform server C as the receiving end 103.
  • the identifier of the protocol (the value of the command word or protocol type of the protocol used), the corresponding protocol, the corresponding protocol format or the storage path of the protocol format, and the corresponding relationship of the above five.
  • the protocol database can also be configured in other cloud servers.
  • the specific form of storage can be as shown in Table 2 below:
  • the server 102 obtains the corresponding protocol (i.e., the protocol used by the receiving end 103) by querying the protocol database from the value of the command word or protocol type extracted from the specific field of the packet header of the first data.
  • the corresponding protocol i.e., the protocol used by the receiving end 103
  • Step S204 The server determines whether the protocol used in the first data transmission is consistent with the protocol used by the receiving end.
  • the server 102 determines whether the protocol used by the first data (that is, the protocol pre-agreed by the server 102 and the transmitting end 101) is consistent with the protocol used by the queried receiving end 102.
  • step S205 the server transmits the first data to the receiving end. If not, step S206 is performed, the server acquires a protocol format used by the receiving end, and converts the first data into a second data that conforms to a protocol format used by the receiving end according to the protocol format.
  • the server 102 obtains a corresponding query database by using a command word or a protocol type value extracted from the packet of the first data.
  • the protocol format is then converted according to the protocol format, the content data of the first data extracted from the packet of the first data into the second data conforming to the protocol format used by the receiving terminal 103.
  • the server 102 can also query the protocol database by using the value of the command word or the protocol type, obtain the storage path of the corresponding protocol format, and then obtain the corresponding protocol from the local storage or the cloud storage of the server 102 according to the obtained storage path. format.
  • Step S207 The server transmits the second data after converting the protocol format to the receiving end.
  • the server 102 may obtain the address of the receiving end 103 according to the identifier query protocol database of the receiving end 103 extracted from the packet of the first data, and then according to the address of the receiving end 103, and then according to The queried address transmits the second data to the receiving end 103.
  • the server 102 may also obtain a corresponding receiving end 103 according to the service type query protocol database of the receiving end 103 extracted from the packet of the first data, and the corresponding receiving end 103
  • the server 102 may also obtain a corresponding receiving end 103 according to the service type query protocol database of the receiving end 103 extracted from the packet of the first data, and the corresponding receiving end 103
  • the preset selection rules select the most suitable one (for example: the best network environment) as the destination, and then The filtered destination address is used as the address of the receiving end 103, and the second data is transmitted to the receiving end 103.
  • Step S208 the server receives the third data returned by the receiving end according to the second data.
  • the third data is the service data returned by the receiving end 103 in response to the second data transmitted by the server 102.
  • the receiving end 103 encapsulates the third data according to the protocol corresponding to the provided service type, and then sends the encapsulated third data packet to the server 102.
  • Step S209 when the protocol used by the third data is inconsistent with the protocol used by the sending end, the server converts the third data into fourth data conforming to a protocol format used by the sending end, and converts the protocol.
  • the fourth data after the format is transmitted to the transmitting end.
  • the transmitting end 101 cannot pass the parsing of the third data packet.
  • the server 102 obtains the content data of the third data by parsing the packet of the third data, and then converting the content data of the acquired third data into conformity according to a protocol format agreed in advance with the transmitting end 101.
  • the fourth data of the protocol format used by the transmitting end 101, and the fourth data after the conversion protocol format is transmitted to the transmitting end 101.
  • Step S210 When the protocol used by the third data is consistent with the protocol used by the sending end, the server directly transmits the third data to the sending end.
  • the sender 101 is illustrated. It is capable of parsing the content data of the third data from the packet of the third data, and the server 102 directly transmits the third data to the transmitting end 101.
  • FIG. 4 is assumed to be a user terminal
  • the receiving end includes a platform server, a platform server B, and a platform server C.
  • the protocols used by the platform server, platform server B and platform server C are: binary protocol, TDR protocol and PB protocol.
  • the platform server A, the platform server B and the platform server C respectively provide three different business services for the user terminal, B and C.
  • the user terminal and the protocol proxy server pre-arrange a binary protocol as a general protocol for data transmission between the two.
  • the user terminal When the user terminal requests the A service from the platform server A, the user terminal sends a protocol packet including the first data of the command word of the platform server A constructed in a binary protocol format to the protocol proxy server; the protocol proxy server is configured according to the received first data.
  • the command word query protocol database included in the protocol package determines that the protocol used by the platform server A is a binary protocol. Since the universal protocol agreed by the user terminal and the protocol proxy server and the protocol used by the platform server A are binary protocols, the protocol proxy server directly receives the protocol.
  • the protocol packet of the first data is forwarded to the platform server A; the platform server A replies to the protocol proxy server the protocol packet of the A service data constructed in the binary protocol format according to the protocol packet of the received first data; and then the protocol proxy server The protocol packet of the A service data is returned to the user terminal.
  • the user terminal When the user terminal requests the B service from the platform server B, the user terminal sends a protocol packet including the first data of the command word of the platform server B constructed in a binary protocol format to the protocol proxy server; the protocol proxy server is configured according to the received first data.
  • the command word query protocol database included in the protocol package determines that the protocol used by the platform server B is the TDR protocol. Since the universal protocol agreed by the user terminal and the protocol proxy server is inconsistent with the protocol used by the platform server B, the protocol proxy server receives the first data.
  • the protocol packet is parsed, the content data of the first data is obtained, and then the protocol packet of the second data is constructed according to the format of the TDR protocol and the content data of the obtained first data, and then forwarded to the platform server B; the platform server B Parsing the received protocol packet of the second data, acquiring and processing the content data of the second data in the protocol packet (that is, the content data of the first data), and then processing the result constructed by the TDR protocol (ie, the user Data related to the B service requested by the terminal).
  • the protocol packet is replied to the protocol proxy server; the protocol proxy server converts the protocol packet of the service data in the TDR protocol format replied by the platform server B into a protocol packet in a binary protocol format, and then replies to the user terminal, so that the user terminal can obtain the protocol from the protocol
  • the relevant data of the B service is extracted from the package and processed.
  • the user terminal When the user terminal requests the C service from the platform server C, the user terminal sends a protocol packet including the first data of the command word of the platform server C constructed in a binary protocol format to the protocol proxy server;
  • the protocol proxy server determines, according to the command word query protocol database included in the protocol packet of the received first data, that the protocol used by the platform server C is the PB protocol, because the universal protocol agreed by the user terminal and the protocol proxy server is inconsistent with the protocol used by the platform server C.
  • the protocol proxy server parses the received protocol packet of the first data, obtains the content data of the first data, and then constructs a protocol packet of the second data according to the format of the PB protocol and the content data of the acquired first data, and then Forwarding to the platform server C; the platform server C parses the received protocol packet of the second data, acquires and processes the content data of the second data in the protocol package (that is, the content data of the first data), and then The protocol packet of the processing result of the PB protocol (that is, the data related to the C service requested by the user terminal) is replied to the protocol proxy server; the protocol proxy server converts the protocol packet of the service data of the PB protocol format replied by the platform server C into a binary protocol. Formatted protocol package, and then reply to the user terminal, User terminal C can be extracted from the protocol packet traffic related data and processes.
  • the service request of the user terminal is converted by the protocol proxy server according to the service type of the platform server into a data packet conforming to the corresponding protocol (for example, the binary protocol is converted into the TDR protocol, the TDR protocol is converted into the PB protocol, etc.), and then forwarded to the receiving end, so that The user terminal only needs to configure a general protocol agreed with the protocol proxy server, and can perform data interaction with different platform servers, thereby simplifying the program of data transmission on the user terminal side and reducing the cost of software development of the user terminal.
  • the sending end and the receiving end may also be platform servers.
  • the sending end and the receiving end are respectively platform servers using different protocols, the sending end and the receiving end pass the protocol proxy.
  • the principle of data interaction between the server and the sending end is the same as the user terminal, and the receiving end is the platform server.
  • the platform server can provide data services for other platform servers or user terminals, so it is usually used as a receiving end.
  • the technical solution of the embodiment is also applicable to the case where the user terminal of the data server can be provided as the receiving end. For details, refer to the above description, which is not mentioned here.
  • the data transmission method provided by the embodiment of the present invention converts the first data sent by the sending end into the second data conforming to the protocol format used by the receiving end by the server as a proxy, and then sends the second data to the receiving end, so that different sending ends only need to understand A protocol can access the receiving end using different protocols, thereby reducing the code complexity of the user terminal software development and the workload of the developer.
  • each receiving end can keep the original protocol format unchanged, and the protocol compatibility is transferred to the server. To ensure that the receiver can be lowered The maintenance cost, which reduces the overall cost of cross-platform data transmission, and improves the efficiency of cross-platform data interaction.
  • FIG. 5 is a schematic structural diagram of a data transmission apparatus according to still another embodiment of the present invention.
  • the data transmission apparatus provided in this embodiment can be used to implement the data transmission method in the above embodiment.
  • the data transmission device 30 includes: a receiving module 31, a conversion module 32, and a transmission module 33.
  • the receiving module 31 is configured to receive first data sent by the sending end, where the first data includes information about a protocol used by the receiving end.
  • the converting module 32 is configured to convert the first data into second data conforming to a protocol format used by the receiving end according to the information of the protocol used by the receiving end received by the receiving module 31.
  • the transmission module 33 is configured to transmit the second data after the conversion module 32 converts the protocol format to the receiving end.
  • the data transmission apparatus converts the first data sent by the receiving sender to the second data conforming to the protocol format used by the receiving end, and then sends the data to the receiving end, so that the sending end only needs to understand one protocol.
  • the receivers of different service platforms can be accessed, thereby reducing the cost of cross-platform data transmission.
  • FIG. 6 is a schematic structural diagram of a data transmission apparatus according to still another embodiment of the present invention.
  • the data transmission apparatus provided in this embodiment can be used to implement the data transmission method in the above embodiment.
  • the data transmission device 40 includes: a receiving module 41, a conversion module 42, a transmission module 43, a determination module 44, and a processing module 45.
  • the receiving module 41 is configured to receive first data sent by the sending end, where the first data includes information about a protocol used by the receiving end.
  • the conversion module 42 is configured to convert the first data into second data conforming to a protocol format used by the receiving end according to the information of the protocol used by the receiving end received by the receiving module 41. As shown in FIG. 7, the conversion module 42 includes an extraction unit 421, a query unit 422, and a conversion unit 423.
  • the extracting unit 421 is configured to extract, from the first data received by the receiving module 41, an identifier of a protocol used by the receiving end, and the querying unit 422 is configured to use the receiving end in the query protocol database.
  • the converting unit 423 is configured to convert the first data into the receiving end according to the protocol format The second data of the protocol format used.
  • the transmission module 43 is configured to transmit the second data after the conversion module 42 converts the protocol format to the receiving end.
  • the determining module 44 is configured to determine whether the protocol used in the first data transmission is consistent with the protocol used by the receiving end.
  • the processing module 45 is configured to, if the determination result of the determining module 44 is inconsistent, invoke the conversion module 42 to execute the information according to the protocol used by the receiving end, and convert the first data into the receiving The step of using the second data of the protocol format used by the terminal, if the judgment result of the determining module 44 is consistent, transmitting the first data to the receiving end.
  • the information of the protocol used by the receiving end includes: an identifier of a protocol used by the receiving end.
  • the receiving module 41 is further configured to receive third data returned by the receiving end according to the second data.
  • the converting module 42 is further configured to convert the third data received by the receiving module 41 into fourth data that conforms to a protocol format used by the transmitting end.
  • the transmission module 43 is further configured to transmit the fourth data after the conversion module 42 converts the protocol format to the sending end.
  • the data transmission apparatus converts the first data sent by the transmitting end into the second data conforming to the protocol format used by the receiving end, and then sends the data to the receiving end, so that different transmitting ends only need to understand one protocol. It can access the receiving end using different protocols, which can reduce the code complexity of the user terminal software development and the workload of the developer. At the same time, each receiving end can keep the original protocol format unchanged, and the protocol compatibility is guaranteed by the server. Thereby, the maintenance cost of the receiving end can be reduced, thereby reducing the overall cost of cross-platform data transmission and improving the efficiency of cross-platform data interaction.
  • An embodiment of the present invention further provides a storage medium including computer executable instructions for executing a data transmission method when executed by a computer processor, the method comprising: receiving, by a server, a a data, where the first data includes information of a protocol used by the receiving end;
  • the server converts the first data into second data conforming to a protocol format used by the receiving end according to information of a protocol used by the receiving end;
  • the server transmits the second data after converting the protocol format to the receiving end.
  • the information about the protocol used by the receiving end preferably includes: an identifier of a protocol used by the receiving end.
  • the step of the server converting the first data into the second data conforming to the protocol format used by the receiving end according to the information of the protocol used by the receiving end may specifically include:
  • the server extracts, from the first data, an identifier of a protocol used by the receiving end, where the server searches for a correspondence between an identifier of a protocol used by the receiving end in the protocol database and a protocol format used by the receiving end. Obtaining a protocol format used by the receiving end;
  • the server converts the first data into second data conforming to a protocol format used by the receiving end according to the protocol format.
  • the server may further include:
  • the server performs the step of converting the first data into second data conforming to a protocol format used by the receiving end according to the information of the protocol used by the receiving end;
  • the server directly transmits the first data to the receiving end.
  • the method may further include:
  • the server converts the third data into fourth data that conforms to a protocol format used by the sending end;
  • the server transmits the fourth data after converting the protocol format to the sending end.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Abstract

A data transmission method comprises: a server receives first data including the information of the protocol used by a receiving terminal and sent from a sending terminal, transforms the first data into a second data conforming to the protocol format used by the receiving terminal according to the information of the protocol used by the receiving terminal, and transmits to the receiving terminal the second data, the protocol format of which has been transformed. Furthermore, the present invention also provides a data transmission device and storage medium. The data transmission method, device and storage medium can reduce the cost of cross-platform data transmission.

Description

数据传输方法 ^置和存储介质 本专利申请要求于 2013年 10月 15 日提交的、 申请号为 201310481937.0、 申请人为腾讯科技(深圳)有限公司、 发明名称为 "数据传输方法及装置" 的 中国专利申请的优先权, 该申请的全文以引用的方式并入本申请中。  Data transmission method and storage medium This patent application claims Chinese patent filed on October 15, 2013, application number 201310481937.0, applicant Tencent Technology (Shenzhen) Co., Ltd., invention name "data transmission method and device" Priority of the application, the entire contents of which are hereby incorporated by reference.
技术领域 本发明实施例涉及计算机通信技术领域, 尤其涉及一种数据传输方法及装 置和存储介质。 The present invention relates to the field of computer communication technologies, and in particular, to a data transmission method, apparatus, and storage medium.
背景技术 Background technique
随着互联网技术的发展, 网络服务运营商为用户提供的业务服务也越来越 多, 为了更好对业务服务进行管理, 网络服务运营商通常通过各自独立的平台 服务器来为用户提供不同的业务服务。 但由于不同业务类型的平台服务器之间 相对独立, 其实现原理各不相同, 尤其是通信协议格式互不相同, 因此跨平台 的数据传输不便实现。 现有的数据传输技术中, 为实现跨平台数据交互, 通常 需要在用户终端配置多个协议格式, 当用户终端向不同的平台服务器请求不同 的业务数据时, 需要根据不同的协议格式构造不同的协议包。 但是这样的传输 方式成本较高, 一方面对于用户终端来说, 需要用户终端能够理解多种业务协 议格式, 这就会导致用户终端的软件开发的高成本; 另一方面对于平台服务器 来说, 需要平台服务器对外提供多种协议格式的支持, 这就会导致平台服务器 的维护的高成本。  With the development of Internet technology, network service operators provide more and more business services for users. In order to better manage business services, network service operators usually provide different services to users through their independent platform servers. service. However, because the platform servers of different service types are relatively independent, the implementation principles are different, especially the communication protocol formats are different from each other, so cross-platform data transmission is inconvenient. In the existing data transmission technology, in order to implement cross-platform data interaction, it is generally required to configure multiple protocol formats in the user terminal. When the user terminal requests different service data from different platform servers, it is necessary to construct different protocols according to different protocol formats. Protocol package. However, such a transmission method is costly. On the one hand, for the user terminal, the user terminal needs to be able to understand various service protocol formats, which leads to high cost of software development of the user terminal; on the other hand, for the platform server, The platform server is required to provide support for multiple protocol formats externally, which leads to high cost of maintenance of the platform server.
发明内容 Summary of the invention
有鉴于此, 本发明实施例提供一种数据传输方法及装置和存储介质, 可降 低跨平台数据传输的成本。 第一方面, 本发明实施例提供了一种数据传输方法, 包括: 服务器接收发 送端发送的第一数据, 所述第一数据中包含接收端使用的协议的信息; 根据所 述接收端使用的协议的信息, 将所述第一数据转换为符合所述接收端使用的协 议格式的第二数据; 将转换协议格式后的所述第二数据传输给所述接收端。 In view of this, the embodiments of the present invention provide a data transmission method and apparatus, and a storage medium, which can reduce the cost of cross-platform data transmission. In a first aspect, an embodiment of the present invention provides a data transmission method, including: receiving, by a server, first data sent by a sending end, where the first data includes information about a protocol used by a receiving end; And the information of the protocol is: converting the first data into second data that conforms to a protocol format used by the receiving end; and transmitting the second data after converting the protocol format to the receiving end.
第二方面, 本发明实施例提供了一种数据传输装置, 包括: 接收模块, 用 于接收发送端发送的第一数据所述第一数据中包含接收端使用的协议的信息; 转换模块, 用于根据所述接收模块接收的所述接收端使用的协议的信息, 将所 述第一数据转换为符合所述接收端使用的协议格式的第二数据; 传输模块, 用 于将所述转换模块转换协议格式后的所述第二数据传输给所述接收端。  In a second aspect, an embodiment of the present invention provides a data transmission apparatus, including: a receiving module, configured to receive, by a sending end, first data, where the first data includes information about a protocol used by a receiving end; And converting the first data into second data conforming to a protocol format used by the receiving end according to the information of the protocol used by the receiving end received by the receiving module; and a transmitting module, configured to: use the converting module Transmitting the second data after the protocol format is transmitted to the receiving end.
第三方面, 本发明实施例提供了一种包含计算机可执行指令的存储介质, 所述计算机可执行指令在由计算机处理器执行时用于执行一种数据传输方法, 其中, 该方法包括:  In a third aspect, an embodiment of the present invention provides a storage medium including computer executable instructions for performing a data transmission method when executed by a computer processor, wherein the method includes:
服务器接收发送端发送的第一数据, 所述第一数据中包含接收端使用的协 议的信息;  Receiving, by the server, first data sent by the sending end, where the first data includes information about a protocol used by the receiving end;
服务器根据所述接收端使用的协议的信息, 将所述第一数据转换为符合所 述接收端使用的协议格式的第二数据;  The server converts the first data into second data conforming to a protocol format used by the receiving end according to information of a protocol used by the receiving end;
服务器将转换协议格式后的所述第二数据传输给所述接收端。  The server transmits the second data after converting the protocol format to the receiving end.
本发明实施例提供的数据传输方法及装置和存储介质, 通过服务器作为代 理将发送端发送的第一数据转换为符合接收端使用的协议格式的第二数据, 然 后发送给接收端 , 使得发送端只需要理解一种协议即可访问不同业务平台的接 收端, 从而可降低跨平台数据传输的成本。  The data transmission method and device and the storage medium provided by the embodiment of the present invention convert the first data sent by the sending end into the second data conforming to the protocol format used by the receiving end by the server as a proxy, and then send the second data to the receiving end, so that the sending end Only one protocol needs to be understood to access the receiving end of different service platforms, thereby reducing the cost of cross-platform data transmission.
为让本发明的上述和其他目的、 特征和优点能更明显易懂, 下文特举较佳 实施例, 并配合所附图式, 作详细说明如下。  The above and other objects, features, and advantages of the present invention will be apparent from the description and appended claims appended claims
附图说明 DRAWINGS
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中所 需使用的附图作简单地介绍, 当然, 以下描述中的附图仅仅是本发明的一些实 施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 对这些附图进行修改和替换。 In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings to be used in the description of the embodiments will be briefly described below. Of course, the drawings in the following description are only some of the embodiments of the present invention. For example, those skilled in the art can modify and replace these drawings without any creative work.
图 1为本发明一实施例提供的数据传输方法的流程图。  FIG. 1 is a flowchart of a data transmission method according to an embodiment of the present invention.
图 2为本发明另一实施例提供的数据传输方法的应用环境图。  2 is an application environment diagram of a data transmission method according to another embodiment of the present invention.
图 3为本发明另一实施例提供的数据传输方法的流程图。  FIG. 3 is a flowchart of a data transmission method according to another embodiment of the present invention.
图 4为本发明另一实施例提供的数据传输方法的一实际应用示例图。  FIG. 4 is a schematic diagram of a practical application of a data transmission method according to another embodiment of the present invention.
图 5为本发明再一实施例提供的数据传输装置的结构示意图。  FIG. 5 is a schematic structural diagram of a data transmission apparatus according to still another embodiment of the present invention.
图 6为本发明又一实施例提供的数据传输装置的结构示意图。  FIG. 6 is a schematic structural diagram of a data transmission apparatus according to still another embodiment of the present invention.
图 7为本发明又一实施例提供的数据传输装置中转换模块的结构示意图。  FIG. 7 is a schematic structural diagram of a conversion module in a data transmission apparatus according to still another embodiment of the present invention.
具体实施方式 detailed description
下面将结合附图对本发明实施例中的技术方案进行清楚、 完整地描述, 显 然, 所描述的实施例是本发明的一部分实施例, 而不是全部的实施例, 是为了 阐述本发明的原理, 而不是要将本发明限制于这些具体的实施例。 基于本发明 中的实施例, 本领域普通技术人员在没有做出创造性劳动前提下所获得的所有 其他实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings, and the embodiments of the present invention are, Rather than limiting the invention to these specific embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例所提供的数据传输方法可应用于实现对跨平台传输数据的处 理。  The data transmission method provided by the embodiment of the present invention can be applied to implement processing for transmitting data across platforms.
图 1为本发明一实施例提供的数据传输方法的流程图。 如图 1所示, 本实 施例的数据传输方法包括以下步骤:  FIG. 1 is a flowchart of a data transmission method according to an embodiment of the present invention. As shown in FIG. 1, the data transmission method of this embodiment includes the following steps:
步骤 S11 ,服务器接收发送端发送的第一数据,所述第一数据中包含接收端 使用的协议的信息。  Step S11: The server receives the first data sent by the sending end, where the first data includes information about a protocol used by the receiving end.
于本实施例一具体实施方式中, 发送端可包括: 智能手机、 平板电脑、 电 子书阅读器、 MP 3播放器 ( Moving P icture Exper t s Group Audio Layer I I I , 动态影像专家压缩标准音频层面 3 )、 MP4 ( Mov ing Picture Exper t s Group Audio Layer IV, 动态影像专家压缩标准音频层面 4 )播放器、 或膝上型便携计算机等 等。 服务器在发送端向服务器申请代理数据传输业务时, 可以与发送端约定自 己与发送端之间进行数据传输所使用的协议, 并将该协议的格式以及接收端所 使用的业务数据传输协议列表发送给发送端。 发送端可以根据与服务器预先约 定的协议格式构造第一数据的封包, 还可以将接收端使用的协议的信息封装在 第一数据的封包中, 例如可以将接收端使用的协议的信息封装在第一数据的封 包的首部, 然后将封装后的第一数据发送给服务器。 该预先约定的协议优选为 通用协议, 具体可包括: 二进制协议、 PB协议(Protocol Buffers协议)、 或 TDR协议 ( Tencent Data Representat ion,娱乐互动数据传输的内部传输协议 ) 等等。 In a specific implementation manner of the embodiment, the sending end may include: a smart phone, a tablet computer, an e-book reader, an MP3 player (Moving Picture Exper s Group Audio Layer III, a dynamic image expert compressing standard audio layer 3) , MP4 (Mov ing Picture Exper ts Group Audio Layer IV, motion picture expert compression standard audio layer 4) player, or laptop portable computer and so on. When the server requests the proxy data transmission service from the server, the server may agree with the sender to use the protocol used for data transmission between the sender and the sender, and send the format of the protocol and the service data transmission protocol list used by the receiver. To the sender. The sending end may construct a packet of the first data according to a protocol format pre-agreed by the server, and may also encapsulate the information of the protocol used by the receiving end in the packet of the first data, for example, the information of the protocol used by the receiving end may be encapsulated in the first The header of a data packet, and then the encapsulated first data is sent to the server. The pre-agreed protocol is preferably a general-purpose protocol, and may specifically include: a binary protocol, a PB protocol (Protocol Buffers protocol), or a TDR protocol (Tencent Data Representation, an internal transmission protocol for entertainment interactive data transmission), and the like.
步骤 S12 ,服务器根据所述接收端使用的协议的信息,将所述第一数据转换 为符合所述接收端使用的协议格式的第二数据。  Step S12: The server converts the first data into second data that conforms to a protocol format used by the receiving end according to the information of the protocol used by the receiving end.
具体地, 服务器解析接收的第一数据的封包, 提取该封包中负载的第一数 据的内容数据以及接收端使用的协议的信息, 然后根据该接收端使用的协议的 信息获取对应的协议格式, 按照该协议格式, 将提取的第一数据的封包中负载 的第一数据的内容数据转换为符合接收端使用的协议格式的第二数据。  Specifically, the server parses the received packet of the first data, extracts content data of the first data loaded in the packet, and information about a protocol used by the receiving end, and then obtains a corresponding protocol format according to the information of the protocol used by the receiving end, According to the protocol format, the content data of the first data loaded in the extracted packet of the first data is converted into the second data conforming to the protocol format used by the receiving end.
步骤 S 13 , 服务器将转换协议格式后的所述第二数据传输给所述接收端。 于本实施例一具体实施方式中, 接收端可为平台服务器。 不同的平台服务 器分别使用各自的业务数据传输协议(例如: 二进制协议、 PB协议、 或 TDR协 议等等)与其它终端设备进行数据交换。 服务器将转换后的符合接收端使用的 协议格式的第二数据传输给接收端, 使得接收端可以通过解析第二数据并将解 析后的数据进行处理, 实现发送端与接收端之间跨平台数据的传输。  Step S13: The server transmits the second data after converting the protocol format to the receiving end. In a specific implementation manner of this embodiment, the receiving end may be a platform server. Different platform servers exchange data with other terminal devices using their respective service data transmission protocols (for example: binary protocol, PB protocol, or TDR protocol, etc.). The server transmits the converted second data conforming to the protocol format used by the receiving end to the receiving end, so that the receiving end can process the cross-platform data between the transmitting end and the receiving end by parsing the second data and processing the parsed data. Transmission.
本发明实施例提供的数据传输方法, 通过服务器作为代理将发送端发送的 第一数据转换为符合接收端使用的协议格式的第二数据, 然后发送给接收端, 使得发送端只需要理解一种协议即可访问不同业务平台的接收端, 从而可降低 跨平台数据传输的成本。  The data transmission method provided by the embodiment of the present invention converts the first data sent by the sending end into the second data conforming to the protocol format used by the receiving end by the server as a proxy, and then sends the second data to the receiving end, so that the sending end only needs to understand one type. The protocol can access the receiving end of different service platforms, thereby reducing the cost of cross-platform data transmission.
请参阅图 2 , 所示为本发明另一实施例提供的数据传输方法的应用环境图。 如图 2所示, 平台服务器 A、 平台服务器 B、 平台服务器 C、 (协议代理)服务器 102、 用户终端 、 以及用户终端 B位于无线或有线网络中, 通过该无线或有线 网络,用户终端 A与用户终端 B作为发送端 101通过服务器 1 02 ,与作为接收端 1 03的平台服务器 A、 平台服务器 B、 以及平台服务器 C进行数据交换, 平台服 务器 A、 平台服务器 B、 以及平台服务器 C通过服务器 102可为用户终端 A与用 户终端 B提供各种业务服务, 例如: 数据存储服务、微博服务、语音通讯服务、 或网页浏览服务等。 Referring to FIG. 2, an application environment diagram of a data transmission method according to another embodiment of the present invention is shown. As shown in FIG. 2, the platform server A, the platform server B, the platform server C, the (protocol proxy) server 102, the user terminal, and the user terminal B are located in a wireless or wired network, through the wireless or wired The network, the user terminal A and the user terminal B as the transmitting end 101, through the server 102, exchange data with the platform server A, the platform server B, and the platform server C as the receiving end 103, the platform server A, the platform server B, and The platform server C can provide various service services for the user terminal A and the user terminal B through the server 102, for example, a data storage service, a microblog service, a voice communication service, or a web browsing service.
可以理解的, 作为示例, 图 2中的接收端 103仅包括平台服务器 A、 平台服 务器 B、 以及平台服务器 C , 发送端 101仅包括用户终端 A与用户终端 B, 但本 发明的具体实施方式并不以此为限。  It can be understood that, as an example, the receiving end 103 in FIG. 2 includes only the platform server A, the platform server B, and the platform server C. The transmitting end 101 includes only the user terminal A and the user terminal B, but the specific embodiment of the present invention is Not limited to this.
图 3为本发明另一实施例提供的数据传输方法的流程图。 如图 3所示, 本 实施例的数据传输方法包括以下步骤:  FIG. 3 is a flowchart of a data transmission method according to another embodiment of the present invention. As shown in FIG. 3, the data transmission method of this embodiment includes the following steps:
步骤 S201 , 服务器接收发送端发送的第一数据, 所述第一数据中包含接收 端使用的协议的信息。  Step S201: The server receives the first data sent by the sending end, where the first data includes information about a protocol used by the receiving end.
于本实施例一具体实施方式中, 接收端使用的协议的信息可包括: 接收端 使用的协议的标识。 具体地, 该协议的标识可以是协议命令字, 也可以是协议 类型标识。  In a specific implementation manner of this embodiment, the information about the protocol used by the receiving end may include: an identifier of a protocol used by the receiving end. Specifically, the identifier of the protocol may be a protocol command word or a protocol type identifier.
发送端 1 01在向服务器 102申请代理数据传输业务时, 与服务器 102约定 数据传输所使用的协议, 并从服务器 1 02获取约定的该协议的格式以及接收端 1 03所使用的业务数据传输协议列表。  When the sender 101 applies for the proxy data transmission service to the server 102, it agrees with the server 102 on the protocol used for data transmission, and obtains the format of the agreed protocol from the server 102 and the service data transmission protocol used by the receiver 103. List.
该业务数据传输协议列表中如下表 1所示, 可包含作为接收端 1 03的平台 服务器 A、 平台服务器 B与平台服务器 C的标识, 平台服务器 A、 平台服务器 B 与平台服务器 C各自所使用的协议的标识(所使用的协议的命令字或协议类型 的值), 以及该协议的标识与上述三个平台服务器的标识的对应关系。 其中, 协 议类型的值可为协议类型的编号, 用于标识协议类型。  The service data transmission protocol list is as shown in Table 1 below, and may include the identifiers of the platform server A, the platform server B, and the platform server C as the receiving end 103, and the platform server A, the platform server B, and the platform server C respectively use The identity of the protocol (the value of the command word or protocol type of the protocol used), and the correspondence between the identity of the protocol and the identity of the three platform servers above. The value of the protocol type can be the number of the protocol type, which is used to identify the protocol type.
表 1  Table 1
接收端标识 协议的标识(协议命令字或协议类型 ) 平台服务器 A 1  Receiver identification Protocol identification (protocol command word or protocol type) Platform server A 1
平台服务器 B 2 平台服务器 c 3 Platform server B 2 Platform server c 3
可以理解的, 发送端 101与服务器 102之间约定的数据传输协议与接收端 1 03所使用的数据传输协议可以是一致的, 也可以是不一致的。  It can be understood that the data transmission protocol agreed between the sender 101 and the server 102 may be identical or inconsistent with the data transmission protocol used by the receiver 103.
发送端 101 可以根据待获取的业务对应的平台服务器的关键字, 查询业务 数据传输协议列表, 获取对应的协议的命令字或协议类型的值, 然后将获取的 命令字或协议类型的值写入待传输的第一数据的封包的首部的特定字段中。  The sender 101 may query the service data transmission protocol list according to the keyword of the platform server corresponding to the service to be acquired, obtain the value of the command word or protocol type of the corresponding protocol, and then write the obtained command word or protocol type value. The specific field of the header of the packet of the first data to be transmitted.
其中,第一数据的内容由发送端 101根据预置的配置规则配置。发送端 101 在向接收端 103申请业务时, 从接收端 1 03获取该配置规则。 可以理解的, 第 一数据的封包中还可包括: 接收端 103的业务类型、 或接收端 103的标识。 该 接收端 103的业务类型、 或接收端 103的标识用于使服务器 102根据该接收端 103的业务类型、或接收端 1 03的标识获取接收端 1 03的地址, 然后根据获取的 地址将转换后的第一数据发送给接收端 1 03。  The content of the first data is configured by the sending end 101 according to a preset configuration rule. The transmitting end 101 acquires the configuration rule from the receiving end 103 when applying for a service to the receiving end 103. It can be understood that the packet of the first data may further include: a service type of the receiving end 103, or an identifier of the receiving end 103. The service type of the receiving end 103 or the identifier of the receiving end 103 is used to enable the server 102 to obtain the address of the receiving end 103 according to the service type of the receiving end 103 or the identifier of the receiving end 103, and then convert according to the obtained address. The first data after is sent to the receiving end 103.
步骤 S202 , 所述服务器从所述第一数据中提取所述接收端使用的协议的标 具体地, 服务器 1 02解析接收的第一数据的封包, 提取该封包中负载的第 一数据的内容数据、 以及该封包首部的特定字段中的命令字或协议类型的值。 可以理解的,服务器 1 02还可通过解析接收的第一数据的封包,获取接收端 1 03 的业务类型、 或接收端 103的标识。  Step S202, the server extracts, from the first data, a protocol of the protocol used by the receiving end, and the server 102 parses the received packet of the first data, and extracts content data of the first data loaded in the packet. And the value of the command word or protocol type in a particular field of the packet header. It can be understood that the server 102 can also obtain the service type of the receiving end 103 or the identifier of the receiving end 103 by parsing the received packet of the first data.
步骤 S203 , 服务器通过查询协议数据库中所述接收端使用的协议的标识与 所述接收端使用的协议的对应关系 , 获得所述接收端使用的协议。  Step S203: The server obtains the protocol used by the receiving end by querying the correspondence between the identifier of the protocol used by the receiving end and the protocol used by the receiving end in the protocol database.
于本实施例一具体实施方式中, 服务器 102 中配置有协议数据库, 协议数 据库中可存储: 包含作为接收端 103的平台服务器 A、平台服务器 B与平台服务 器 C的标识, 地址, 各自所使用的协议的标识(所使用的协议的命令字或协议 类型的值), 对应的协议, 对应的协议格式或协议格式的存储路径, 以及上述五 者的对应关系。 可以理解的, 协议数据库也可配置于其它云端服务器中。 存储 的具体形式可如下表 2所示:  In a specific implementation of the embodiment, the server 102 is configured with a protocol database, and the protocol database can store: identifiers, addresses, and addresses of the platform server A, the platform server B, and the platform server C as the receiving end 103. The identifier of the protocol (the value of the command word or protocol type of the protocol used), the corresponding protocol, the corresponding protocol format or the storage path of the protocol format, and the corresponding relationship of the above five. As can be understood, the protocol database can also be configured in other cloud servers. The specific form of storage can be as shown in Table 2 below:
表 2 协议的标识(协 协议格式 (协 接收端标识 地址 议命令字或协 协议 议格式存储路 议类型) 径) Table 2 The identification of the protocol (co-protocol format (co-receiving end identification address negotiation command word or association agreement format storage path type))
平台服务器 A ht tp: II…… 1 二进制协议 Platform server A ht tp: II... 1 binary protocol
平台服务器 B ht tp: II…… 2 TDR协议 Platform Server B ht tp: II... 2 TDR Protocol
平台服务器 C ht tp: II…… 3 PB协议 Platform Server C ht tp: II... 3 PB Protocol
具体地, 服务器 1 02通过从第一数据的封包首部的特定字段中提取出的命 令字或协议类型的值查询协议数据库, 获取对应的协议(也即接收端 103所使 用的协议)。  Specifically, the server 102 obtains the corresponding protocol (i.e., the protocol used by the receiving end 103) by querying the protocol database from the value of the command word or protocol type extracted from the specific field of the packet header of the first data.
步骤 S204 , 服务器判断所述第一数据传输时使用的协议是否与所述接收端 使用的协议一致。  Step S204: The server determines whether the protocol used in the first data transmission is consistent with the protocol used by the receiving end.
具体地, 服务器 102判断第一数据使用的协议(也即服务器 102与发送端 1 01预先约定的协议) 与查询出的接收端 102使用的协议是否一致。  Specifically, the server 102 determines whether the protocol used by the first data (that is, the protocol pre-agreed by the server 102 and the transmitting end 101) is consistent with the protocol used by the queried receiving end 102.
若一致, 则执行步骤 S205 : 服务器将所述第一数据传输给所述接收端。 若不一致, 则执行步骤 S206 , 服务器获取所述接收端使用的协议格式, 根 据所述协议格式, 将所述第一数据转换为符合所述接收端使用的协议格式的第 二数据。  If yes, step S205 is performed: the server transmits the first data to the receiving end. If not, step S206 is performed, the server acquires a protocol format used by the receiving end, and converts the first data into a second data that conforms to a protocol format used by the receiving end according to the protocol format.
具体地,若第一数据使用的协议与查询出的接收端 1 02使用的协议不一致, 则服务器 102通过从第一数据的封包中提取出的命令字或协议类型的值查询协 议数据库, 获取对应的协议格式, 然后根据该协议格式, 将从第一数据的封包 中提取出的第一数据的内容数据转换为符合接收端 1 03使用的协议格式的第二 数据。 可以理解的, 服务器 102也可通过命令字或协议类型的值查询协议数据 库, 获取对应的协议格式的存储路径, 然后根据获取的存储路径, 从服务器 102 的本地存储器或云端存储器中获取对应的协议格式。  Specifically, if the protocol used by the first data is inconsistent with the protocol used by the queried receiver 102, the server 102 obtains a corresponding query database by using a command word or a protocol type value extracted from the packet of the first data. The protocol format is then converted according to the protocol format, the content data of the first data extracted from the packet of the first data into the second data conforming to the protocol format used by the receiving terminal 103. It can be understood that the server 102 can also query the protocol database by using the value of the command word or the protocol type, obtain the storage path of the corresponding protocol format, and then obtain the corresponding protocol from the local storage or the cloud storage of the server 102 according to the obtained storage path. format.
步骤 S 207 , 服务器将转换协议格式后的所述第二数据传输给所述接收端。 于本实施例一具体实施方式中, 服务器 1 02可根据从第一数据的封包中提 取出的接收端 103的标识查询协议数据库, 获取接收端 103的地址, 然后根据 查询出的地址, 将第二数据传输给接收端 103。 Step S207: The server transmits the second data after converting the protocol format to the receiving end. In an embodiment of the present embodiment, the server 102 may obtain the address of the receiving end 103 according to the identifier query protocol database of the receiving end 103 extracted from the packet of the first data, and then according to the address of the receiving end 103, and then according to The queried address transmits the second data to the receiving end 103.
于本实施例另一具体实施方式中, 服务器 102也可根据从第一数据的封包 中提取出的接收端 103的业务类型查询协议数据库,获取对应的接收端 103 , 当 对应的接收端 1 03为多个(也即可提供相同业务类型的业务服务的平台服务器 有多个) 时, 根据预置的选择规则, 选择其中最合适的一个(例如: 网络环境 最佳)作为目的端, 然后将筛选出的该目的端的地址作为接收端 103的地址, 将第二数据传输给接收端 103。  In another embodiment of the present embodiment, the server 102 may also obtain a corresponding receiving end 103 according to the service type query protocol database of the receiving end 103 extracted from the packet of the first data, and the corresponding receiving end 103 When there are multiple (or multiple platform servers that can provide business services of the same business type), according to the preset selection rules, select the most suitable one (for example: the best network environment) as the destination, and then The filtered destination address is used as the address of the receiving end 103, and the second data is transmitted to the receiving end 103.
步骤 S208 ,所述服务器接收所述接收端根据所述第二数据返回的第三数据。 第三数据为接收端 103响应于服务器 102发送的第二数据而返回的业务数 据。 接收端 103根据提供的业务类型对应的协议对第三数据进行封装, 然后将 封装后的第三数据的封包发送给服务器 1 02。  Step S208, the server receives the third data returned by the receiving end according to the second data. The third data is the service data returned by the receiving end 103 in response to the second data transmitted by the server 102. The receiving end 103 encapsulates the third data according to the protocol corresponding to the provided service type, and then sends the encapsulated third data packet to the server 102.
步骤 S209 ,当所述第三数据使用的协议与所述发送端使用的协议不一致时, 服务器将所述第三数据转换为符合所述发送端使用的协议格式的第四数据, 并 将转换协议格式后的所述第四数据传输给所述发送端。  Step S209, when the protocol used by the third data is inconsistent with the protocol used by the sending end, the server converts the third data into fourth data conforming to a protocol format used by the sending end, and converts the protocol. The fourth data after the format is transmitted to the transmitting end.
具体地, 当第三数据使用的协议与发送端 101使用的协议不一致时, 或者 可以理解为第二数据是经服务器 102转换过的数据时, 说明发送端 1 01无法通 过解析第三数据的封包获取第三数据的内容数据, 于是服务器 102通过解析第 三数据的封包获取第三数据的内容数据, 然后根据与发送端 101预先约定的协 议格式, 将获取的第三数据的内容数据转换为符合发送端 101使用的协议格式 的第四数据, 并将转换协议格式后的第四数据传输给发送端 101。  Specifically, when the protocol used by the third data is inconsistent with the protocol used by the sending end 101, or can be understood as the second data is the data converted by the server 102, the transmitting end 101 cannot pass the parsing of the third data packet. Obtaining the content data of the third data, the server 102 obtains the content data of the third data by parsing the packet of the third data, and then converting the content data of the acquired third data into conformity according to a protocol format agreed in advance with the transmitting end 101. The fourth data of the protocol format used by the transmitting end 101, and the fourth data after the conversion protocol format is transmitted to the transmitting end 101.
步骤 S210 , 当所述第三数据使用的协议与所述发送端使用的协议一致时, 服务器直接将所述第三数据传输给所述发送端。  Step S210: When the protocol used by the third data is consistent with the protocol used by the sending end, the server directly transmits the third data to the sending end.
具体地, 当第三数据使用的协议与发送端 101使用的协议一致时, 或者可 以理解为接收端 1 03接收的第二数据是未经服务器 102转换过的第一数据时, 说明发送端 101有能力从第三数据的封包中解析出第三数据的内容数据, 于是 服务器 102直接将该第三数据传输给发送端 101。  Specifically, when the protocol used by the third data is consistent with the protocol used by the sender 101, or the second data received by the receiver 1300 is the first data that has not been converted by the server 102, the sender 101 is illustrated. It is capable of parsing the content data of the third data from the packet of the third data, and the server 102 directly transmits the third data to the transmitting end 101.
为进一步说明本实施例提供的数据传输方法, 举例来说, 请参阅图 4 , 假设 发送端为用户终端, 接收端包括平台服务器 、 平台服务器 B与平台服务器 C , 其中平台服务器 、平台服务器 B与平台服务器 C使用的协议分别为: 二进制协 议、 TDR协议与 PB协议。 平台服务器 A、 平台服务器 B与平台服务器 C分别可 为用户终端提供 、 B、 C三种不同的业务服务。 用户终端与协议代理服务器预 先约定以二进制协议作为二者之间数据传输的通用协议。 To further illustrate the data transmission method provided by this embodiment, for example, refer to FIG. 4, which is assumed to be a user terminal, and the receiving end includes a platform server, a platform server B, and a platform server C. The protocols used by the platform server, platform server B and platform server C are: binary protocol, TDR protocol and PB protocol. The platform server A, the platform server B and the platform server C respectively provide three different business services for the user terminal, B and C. The user terminal and the protocol proxy server pre-arrange a binary protocol as a general protocol for data transmission between the two.
当用户终端向平台服务器 A请求 A业务时, 用户终端向协议代理服务器发 送以二进制协议格式构造的包含平台服务器 A的命令字的第一数据的协议包; 协议代理服务器根据接收的第一数据的协议包中包含的命令字查询协议数据库 确定平台服务器 A使用的协议为二进制协议, 由于用户终端与协议代理服务器 约定的通用协议与平台服务器 A使用的协议均为二进制协议, 协议代理服务器 直接将接收的第一数据的协议包转发给平台服务器 A;平台服务器 A根据接收的 第一数据的协议包, 将以二进制协议格式构造的 A业务数据的协议包回复给协 议代理服务器; 然后由协议代理服务器将该 A业务数据的协议包转回复给用户 终端。  When the user terminal requests the A service from the platform server A, the user terminal sends a protocol packet including the first data of the command word of the platform server A constructed in a binary protocol format to the protocol proxy server; the protocol proxy server is configured according to the received first data. The command word query protocol database included in the protocol package determines that the protocol used by the platform server A is a binary protocol. Since the universal protocol agreed by the user terminal and the protocol proxy server and the protocol used by the platform server A are binary protocols, the protocol proxy server directly receives the protocol. The protocol packet of the first data is forwarded to the platform server A; the platform server A replies to the protocol proxy server the protocol packet of the A service data constructed in the binary protocol format according to the protocol packet of the received first data; and then the protocol proxy server The protocol packet of the A service data is returned to the user terminal.
当用户终端向平台服务器 B请求 B业务时, 用户终端向协议代理服务器发 送以二进制协议格式构造的包含平台服务器 B的命令字的第一数据的协议包; 协议代理服务器根据接收的第一数据的协议包中包含的命令字查询协议数据库 确定平台服务器 B使用的协议为 TDR协议, 由于用户终端与协议代理服务器约 定的通用协议与平台服务器 B使用的协议不一致, 协议代理服务器对接收的第 一数据的协议包进行解析, 获取第一数据的内容数据, 然后根据 TDR协议的格 式与获取的第一数据的内容数据, 构造第二数据的协议包, 然后将其转发给平 台服务器 B; 平台服务器 B对接收的第二数据的协议包进行解析,获取并处理该 协议包中的第二数据的内容数据(也即第一数据的内容数据), 然后将以 TDR协 议构造的处理结果(也即用户终端请求的 B业务的相关数据) 的协议包回复给 协议代理服务器; 协议代理服务器将平台服务器 B回复的 TDR协议格式的业务 数据的协议包转换为二进制协议格式的协议包, 然后回复给用户终端, 以使用 户终端能够从该协议包中提取 B业务的相关数据并对其进行处理。  When the user terminal requests the B service from the platform server B, the user terminal sends a protocol packet including the first data of the command word of the platform server B constructed in a binary protocol format to the protocol proxy server; the protocol proxy server is configured according to the received first data. The command word query protocol database included in the protocol package determines that the protocol used by the platform server B is the TDR protocol. Since the universal protocol agreed by the user terminal and the protocol proxy server is inconsistent with the protocol used by the platform server B, the protocol proxy server receives the first data. The protocol packet is parsed, the content data of the first data is obtained, and then the protocol packet of the second data is constructed according to the format of the TDR protocol and the content data of the obtained first data, and then forwarded to the platform server B; the platform server B Parsing the received protocol packet of the second data, acquiring and processing the content data of the second data in the protocol packet (that is, the content data of the first data), and then processing the result constructed by the TDR protocol (ie, the user Data related to the B service requested by the terminal The protocol packet is replied to the protocol proxy server; the protocol proxy server converts the protocol packet of the service data in the TDR protocol format replied by the platform server B into a protocol packet in a binary protocol format, and then replies to the user terminal, so that the user terminal can obtain the protocol from the protocol The relevant data of the B service is extracted from the package and processed.
当用户终端向平台服务器 C请求 C业务时, 用户终端向协议代理服务器发 送以二进制协议格式构造的包含平台服务器 C的命令字的第一数据的协议包; 协议代理服务器根据接收的第一数据的协议包中包含的命令字查询协议数据库 确定平台服务器 C使用的协议为 PB协议, 由于用户终端与协议代理服务器约定 的通用协议与平台服务器 C使用的协议不一致, 协议代理服务器对接收的第一 数据的协议包进行解析, 获取第一数据的内容数据, 然后根据 PB协议的格式与 获取的第一数据的内容数据, 构造第二数据的协议包, 然后将其转发给平台服 务器 C; 平台服务器 C对接收的第二数据的协议包进行解析,获取并处理该协议 包中的第二数据的内容数据(也即第一数据的内容数据), 然后将以 PB协议构 造的处理结果(也即用户终端请求的 C业务的相关数据) 的协议包回复给协议 代理服务器; 协议代理服务器将平台服务器 C回复的 PB协议格式的业务数据的 协议包转换为二进制协议格式的协议包, 然后回复给用户终端, 以使用户终端 能够从该协议包中提取 C业务的相关数据并对其进行处理。 When the user terminal requests the C service from the platform server C, the user terminal sends a protocol packet including the first data of the command word of the platform server C constructed in a binary protocol format to the protocol proxy server; The protocol proxy server determines, according to the command word query protocol database included in the protocol packet of the received first data, that the protocol used by the platform server C is the PB protocol, because the universal protocol agreed by the user terminal and the protocol proxy server is inconsistent with the protocol used by the platform server C. The protocol proxy server parses the received protocol packet of the first data, obtains the content data of the first data, and then constructs a protocol packet of the second data according to the format of the PB protocol and the content data of the acquired first data, and then Forwarding to the platform server C; the platform server C parses the received protocol packet of the second data, acquires and processes the content data of the second data in the protocol package (that is, the content data of the first data), and then The protocol packet of the processing result of the PB protocol (that is, the data related to the C service requested by the user terminal) is replied to the protocol proxy server; the protocol proxy server converts the protocol packet of the service data of the PB protocol format replied by the platform server C into a binary protocol. Formatted protocol package, and then reply to the user terminal, User terminal C can be extracted from the protocol packet traffic related data and processes.
由于通过协议代理服务器将用户终端的业务请求根据平台服务器的业务类 型转换为符合相应协议(例如: 二进制协议转换为 TDR协议、 TDR协议转换为 PB协议等) 的数据封包然后转发给接收端, 使得用户终端只需要配置一种与协 议代理服务器约定的通用协议, 即可与不同的平台服务器进行数据交互, 从而 可简化用户终端一侧数据传输的程序, 降低用户终端软件开发的成本。  Because the service request of the user terminal is converted by the protocol proxy server according to the service type of the platform server into a data packet conforming to the corresponding protocol (for example, the binary protocol is converted into the TDR protocol, the TDR protocol is converted into the PB protocol, etc.), and then forwarded to the receiving end, so that The user terminal only needs to configure a general protocol agreed with the protocol proxy server, and can perform data interaction with different platform servers, thereby simplifying the program of data transmission on the user terminal side and reducing the cost of software development of the user terminal.
可以理解的, 于本实施例一具体实施方式中, 发送端与接收端也可均为平 台服务器, 当发送端与接收端分别为使用不同协议的平台服务器时, 发送端与 接收端通过协议代理服务器进行数据交互的原理与发送端为用户终端, 接收端 为平台服务器时的原理相同。 平台服务器能够为其他平台服务器或用户终端提 供数据服务, 所以通常作为接收端。 但是, 本实施例的技术方案也同样适用于 能够提供数据服务器的用户终端作为接收端的情况。 具体实施方式请参考上述 说明, 此处不再赘述。  It can be understood that, in a specific implementation manner of the embodiment, the sending end and the receiving end may also be platform servers. When the sending end and the receiving end are respectively platform servers using different protocols, the sending end and the receiving end pass the protocol proxy. The principle of data interaction between the server and the sending end is the same as the user terminal, and the receiving end is the platform server. The platform server can provide data services for other platform servers or user terminals, so it is usually used as a receiving end. However, the technical solution of the embodiment is also applicable to the case where the user terminal of the data server can be provided as the receiving end. For details, refer to the above description, which is not mentioned here.
本发明实施例提供的数据传输方法, 通过服务器作为代理将发送端发送的 第一数据转换为符合接收端使用的协议格式的第二数据, 然后发送给接收端, 使得不同的发送端只需要理解一种协议即可访问使用不同协议的接收端, 从而 可降低用户终端软件开发的代码复杂度以及开发者的工作量, 同时各接收端可 保持原有协议格式不变, 将协议兼容性交由服务器来保证, 从而可降低接收端 的维护成本, 进而降低跨平台数据传输的整体成本, 提高跨平台数据交互的效 率。 The data transmission method provided by the embodiment of the present invention converts the first data sent by the sending end into the second data conforming to the protocol format used by the receiving end by the server as a proxy, and then sends the second data to the receiving end, so that different sending ends only need to understand A protocol can access the receiving end using different protocols, thereby reducing the code complexity of the user terminal software development and the workload of the developer. At the same time, each receiving end can keep the original protocol format unchanged, and the protocol compatibility is transferred to the server. To ensure that the receiver can be lowered The maintenance cost, which reduces the overall cost of cross-platform data transmission, and improves the efficiency of cross-platform data interaction.
图 5为本发明再一实施例提供的数据传输装置的结构示意图。 本实施例提 供的数据传输装置可用于实现上述实施例中的数据传输方法。 如图 5所示, 数 据传输装置 30包括: 接收模块 31、 转换模块 32、 以及传输模块 33。  FIG. 5 is a schematic structural diagram of a data transmission apparatus according to still another embodiment of the present invention. The data transmission apparatus provided in this embodiment can be used to implement the data transmission method in the above embodiment. As shown in FIG. 5, the data transmission device 30 includes: a receiving module 31, a conversion module 32, and a transmission module 33.
其中 , 接收模块 31用于接收发送端发送的第一数据 , 所述第一数据中包含 接收端使用的协议的信息。  The receiving module 31 is configured to receive first data sent by the sending end, where the first data includes information about a protocol used by the receiving end.
转换模块 32用于根据所述接收模块 31接收的所述接收端使用的协议的信 息, 将所述第一数据转换为符合所述接收端使用的协议格式的第二数据。  The converting module 32 is configured to convert the first data into second data conforming to a protocol format used by the receiving end according to the information of the protocol used by the receiving end received by the receiving module 31.
传输模块 33用于将所述转换模块 32转换协议格式后的所述第二数据传输 给所述接收端。  The transmission module 33 is configured to transmit the second data after the conversion module 32 converts the protocol format to the receiving end.
本实施例对数据传输装置 30的各功能模块实现各自功能的具体过程,请参 见上述图 1至图 4所示实施例中描述的具体内容, 此处不再赘述。  For the specific process of implementing the respective functions of the function modules of the data transmission device 30, refer to the specific content described in the embodiment shown in FIG. 1 to FIG. 4, and details are not described herein again.
本发明实施例提供的数据传输装置, 通过将接收的发送端发送的第一数据 转换为符合接收端使用的协议格式的第二数据, 然后发送给接收端, 使得发送 端只需要理解一种协议即可访问不同业务平台的接收端, 从而可降低跨平台数 据传输的成本。  The data transmission apparatus provided by the embodiment of the present invention converts the first data sent by the receiving sender to the second data conforming to the protocol format used by the receiving end, and then sends the data to the receiving end, so that the sending end only needs to understand one protocol. The receivers of different service platforms can be accessed, thereby reducing the cost of cross-platform data transmission.
图 6为本发明又一实施例提供的数据传输装置的结构示意图。 本实施例提 供的数据传输装置可以用于实现上述实施例中的数据传输方法。 如图 6所示, 数据传输装置 40包括: 接收模块 41、 转换模块 42、 传输模块 43、 判断模块 44 以及处理模块 45。  FIG. 6 is a schematic structural diagram of a data transmission apparatus according to still another embodiment of the present invention. The data transmission apparatus provided in this embodiment can be used to implement the data transmission method in the above embodiment. As shown in FIG. 6, the data transmission device 40 includes: a receiving module 41, a conversion module 42, a transmission module 43, a determination module 44, and a processing module 45.
其中 , 接收模块 41用于接收发送端发送的第一数据 , 所述第一数据中包含 接收端使用的协议的信息。  The receiving module 41 is configured to receive first data sent by the sending end, where the first data includes information about a protocol used by the receiving end.
转换模块 42用于根据所述接收模块 41接收的所述接收端使用的协议的信 息,将所述第一数据转换为符合所述接收端使用的协议格式的第二数据。如图 7 所示,所述转换模块 42包括:提取单元 421、查询单元 422以及转换单元 423。 提取单元 421用于从所述接收模块 41接收的所述第一数据中提取所述接收端使 用的协议的标识; 查询单元 422用于通过查询协议数据库中所述接收端使用的 协议的标识与所述接收端使用的协议格式的对应关系, 获得所述接收端使用的 协议格式; 转换单元 423用于根据所述协议格式, 将所述第一数据转换为符合 所述接收端使用的协议格式的第二数据。 The conversion module 42 is configured to convert the first data into second data conforming to a protocol format used by the receiving end according to the information of the protocol used by the receiving end received by the receiving module 41. As shown in FIG. 7, the conversion module 42 includes an extraction unit 421, a query unit 422, and a conversion unit 423. The extracting unit 421 is configured to extract, from the first data received by the receiving module 41, an identifier of a protocol used by the receiving end, and the querying unit 422 is configured to use the receiving end in the query protocol database. Corresponding relationship between the identifier of the protocol and the protocol format used by the receiving end, obtaining a protocol format used by the receiving end; the converting unit 423 is configured to convert the first data into the receiving end according to the protocol format The second data of the protocol format used.
传输模块 43用于将所述转换模块 42转换协议格式后的所述第二数据传输 给所述接收端。  The transmission module 43 is configured to transmit the second data after the conversion module 42 converts the protocol format to the receiving end.
判断模块 44用于判断所述第一数据传输时使用的协议是否与所述接收端使 用的协议一致。  The determining module 44 is configured to determine whether the protocol used in the first data transmission is consistent with the protocol used by the receiving end.
处理模块 45用于若所述判断模块 44的判断结果为不一致, 则调用所述转 换模块 42执行所述根据所述接收端使用的协议的信息,将所述第一数据转换为 符合所述接收端使用的协议格式的第二数据的步骤,若所述判断模块 44的判断 结果为一致, 则将所述第一数据传输给所述接收端。  The processing module 45 is configured to, if the determination result of the determining module 44 is inconsistent, invoke the conversion module 42 to execute the information according to the protocol used by the receiving end, and convert the first data into the receiving The step of using the second data of the protocol format used by the terminal, if the judgment result of the determining module 44 is consistent, transmitting the first data to the receiving end.
优选地, 所述接收端使用的协议的信息包括: 所述接收端使用的协议的标 识。  Preferably, the information of the protocol used by the receiving end includes: an identifier of a protocol used by the receiving end.
优选地, 所述接收模块 41还用于接收所述接收端根据所述第二数据返回的 第三数据。  Preferably, the receiving module 41 is further configured to receive third data returned by the receiving end according to the second data.
优选地, 所述转换模块 42还用于将所述接收模块 41接收的所述第三数据 转换为符合所述发送端使用的协议格式的第四数据。  Preferably, the converting module 42 is further configured to convert the third data received by the receiving module 41 into fourth data that conforms to a protocol format used by the transmitting end.
优选地, 所述传输模块 43还用于将所述转换模块 42转换协议格式后的所 述第四数据传输给所述发送端。  Preferably, the transmission module 43 is further configured to transmit the fourth data after the conversion module 42 converts the protocol format to the sending end.
本实施例对数据传输装置 40的各功能模块实现各自功能的具体过程,请参 见上述图 1至图 4所示实施例中描述的具体内容, 此处不再赘述。  For the specific process of implementing the respective functions of the function modules of the data transmission device 40, refer to the specific content described in the embodiment shown in FIG. 1 to FIG. 4, and details are not described herein again.
本发明实施例提供的数据传输装置, 通过将发送端发送的第一数据转换为 符合接收端使用的协议格式的第二数据, 然后发送给接收端, 使得不同的发送 端只需要理解一种协议即可访问使用不同协议的接收端 , 从而可降低用户终端 软件开发的代码复杂度以及开发者的工作量, 同时各接收端可保持原有协议格 式不变, 将协议兼容性交由服务器来保证, 从而可降低接收端的维护成本, 进 而降低跨平台数据传输的整体成本, 提高跨平台数据交互的效率。 本发明实施例还提供一种包含计算机可执行指令的存储介质, 所述计算机 可执行指令在由计算机处理器执行时用于执行一种数据传输方法, 该方法包括: 服务器接收发送端发送的第一数据, 所述第一数据中包含接收端使用的协 议的信息; The data transmission apparatus provided by the embodiment of the present invention converts the first data sent by the transmitting end into the second data conforming to the protocol format used by the receiving end, and then sends the data to the receiving end, so that different transmitting ends only need to understand one protocol. It can access the receiving end using different protocols, which can reduce the code complexity of the user terminal software development and the workload of the developer. At the same time, each receiving end can keep the original protocol format unchanged, and the protocol compatibility is guaranteed by the server. Thereby, the maintenance cost of the receiving end can be reduced, thereby reducing the overall cost of cross-platform data transmission and improving the efficiency of cross-platform data interaction. An embodiment of the present invention further provides a storage medium including computer executable instructions for executing a data transmission method when executed by a computer processor, the method comprising: receiving, by a server, a a data, where the first data includes information of a protocol used by the receiving end;
服务器根据所述接收端使用的协议的信息, 将所述第一数据转换为符合所 述接收端使用的协议格式的第二数据;  The server converts the first data into second data conforming to a protocol format used by the receiving end according to information of a protocol used by the receiving end;
服务器将转换协议格式后的所述第二数据传输给所述接收端。  The server transmits the second data after converting the protocol format to the receiving end.
上述方法中, 所述接收端使用的协议的信息优选包括: 所述接收端使用的 协议的标识。  In the above method, the information about the protocol used by the receiving end preferably includes: an identifier of a protocol used by the receiving end.
上述方法中, 服务器根据所述接收端使用的协议的信息, 将所述第一数据 转换为符合所述接收端使用的协议格式的第二数据的步骤可具体包括:  In the above method, the step of the server converting the first data into the second data conforming to the protocol format used by the receiving end according to the information of the protocol used by the receiving end may specifically include:
所述服务器从所述第一数据中提取所述接收端使用的协议的标识; 所述服务器通过查询协议数据库中所述接收端使用的协议的标识与所述 接收端使用的协议格式的对应关系, 获得所述接收端使用的协议格式;  And the server extracts, from the first data, an identifier of a protocol used by the receiving end, where the server searches for a correspondence between an identifier of a protocol used by the receiving end in the protocol database and a protocol format used by the receiving end. Obtaining a protocol format used by the receiving end;
所述服务器根据所述协议格式, 将所述第一数据转换为符合所述接收端使 用的协议格式的第二数据。  And the server converts the first data into second data conforming to a protocol format used by the receiving end according to the protocol format.
上述方法中, 所述服务器接收发送端发送的第一数据, 所述第一数据中包 含接收端使用的协议的信息的步骤之后, 还可进一步包括:  In the above method, after the step of receiving, by the server, the first data sent by the sending end, where the first data includes the information of the protocol used by the receiving end, the server may further include:
所述服务器判断所述第一数据使用的协议是否与所述接收端使用的协议 一致;  Determining, by the server, that the protocol used by the first data is consistent with a protocol used by the receiving end;
若不一致, 则所述服务器执行所述根据所述接收端使用的协议的信息, 将 所述第一数据转换为符合所述接收端使用的协议格式的第二数据的步骤;  If not, the server performs the step of converting the first data into second data conforming to a protocol format used by the receiving end according to the information of the protocol used by the receiving end;
若一致, 则所述服务器直接将所述第一数据传输给所述接收端。  If they are consistent, the server directly transmits the first data to the receiving end.
上述方法中, 所述方法还可进一步包括:  In the above method, the method may further include:
所述服务器接收所述接收端根据所述第二数据返回的第三数据;  Receiving, by the server, third data returned by the receiving end according to the second data;
所述服务器将所述第三数据转换为符合所述发送端使用的协议格式的第 四数据;  The server converts the third data into fourth data that conforms to a protocol format used by the sending end;
所述服务器将转换协议格式后的所述第四数据传输给所述发送端。 通过以上关于实施方式的描述, 所属领域的技术人员可以清楚地了解到, 本发明可借助软件及必需的通用硬件来实现, 当然也可以通过硬件实现, 但很 多情况下前者是更佳的实施方式。 基于这样的理解, 本发明的技术方案本质上 软件产品可以存储在计算机可读存储介质中, 如计算机的软盘、 只读存储器The server transmits the fourth data after converting the protocol format to the sending end. Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by software and necessary general hardware, and can also be implemented by hardware, but in many cases, the former is a better implementation. . Based on such understanding, the technical solution of the present invention can be stored in a computer readable storage medium, such as a floppy disk or a read only memory of a computer.
( Read-Only Memory, ROM )、随机存取存储器( Random Access Memory, RAM )、 闪存( FLASH )、 硬盘或光盘等, 包括若干指令用以使得一台计算机设备 (可以 是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。 需要说明的是, 本说明书中的各个实施例均釆用递进的方式描述, 每个实施例 重点说明的都是与其他实施例的不同之处, 各个实施例之间相同相似的部分互 相参见即可。 对于装置类实施例而言, 由于其与方法实施例基本相似, 所以描 述的比较简单, 相关之处参见方法实施例的部分说明即可。 (Read-Only Memory, ROM), Random Access Memory (RAM), Flash (FLASH), hard disk or optical disk, etc., including a number of instructions to make a computer device (can be a personal computer, a server, or Network devices, etc.) perform the methods described in various embodiments of the present invention. It should be noted that each embodiment in the specification is described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the embodiments are referred to each other. Just fine. For the device type embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
需要说明的是, 在本文中, 诸如第一和第二等之类的关系术语仅仅用来将 一个实体或者操作与另一个实体或操作区分开来, 而不一定要求或者暗示这些 实体或操作之间存在任何这种实际的关系或者顺序。 而且, 术语 "包括"、 "包 含" 或者其任何其他变体意在涵盖非排他性的包含, 从而使得包括一系列要素 的过程、 方法、 物品或者装置不仅包括那些要素, 而且还包括没有明确列出的 其他要素, 或者是还包括为这种过程、 方法、 物品或者装置所固有的要素。 在 没有更多限制的情况下, 由语句 "包括一个 ... ... " 限定的要素, 并不排除在包 括所述要素的过程、 方法、 物品或者装置中还存在另外的相同要素。  It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is any such actual relationship or order between them. Furthermore, the terms "comprises" or "comprising" or "comprising" or "includes" or "includes" or "includes" or "includes" Other elements, or elements that are inherent to such a process, method, article, or device. An element that is defined by the phrase "comprising a" does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过 硬件来完成, 也可以通过程序来指令相关的硬件完成, 所述的程序可以存储于 一种计算机可读存储介质中, 上述提到的存储介质可以是只读存储器, 磁盘或 光盘等。  A person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium. The storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.
以上所述, 仅是本发明的较佳实施例而已, 并非对本发明作任何形式上的 限制, 虽然本发明已以较佳实施例揭露如上, 然而并非用以限定本发明, 任何 熟悉本专业的技术人员, 在不脱离本发明技术方案范围内, 当可利用上述揭示 的技术内容做出些许更动或修饰为等同变化的等效实施例 , 但凡是未脱离本发 明技术方案内容, The above is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Although the present invention has been disclosed in the above preferred embodiments, it is not intended to limit the invention, any The skilled person can make some modifications or modifications to the equivalent embodiment by using the technical content disclosed above, without departing from the present invention, without departing from the scope of the present invention. Ming technical program content,
等同变化与修饰, 均仍属于本发明技术方案的范围内 Equivalent changes and modifications are still within the scope of the technical solution of the present invention.

Claims

权 利 要 求 书 claims
1、 一种数据传输方法, 其特征在于, 包括: 1. A data transmission method, characterized by including:
服务器接收发送端发送的第一数据, 所述第一数据中包含接收端使用的协 议的信息; The server receives the first data sent by the sending end, where the first data contains information about the protocol used by the receiving end;
服务器根据所述接收端使用的协议的信息, 将所述第一数据转换为符合所 述接收端使用的协议格式的第二数据; The server converts the first data into second data that conforms to the protocol format used by the receiving end according to the information of the protocol used by the receiving end;
服务器将转换协议格式后的所述第二数据传输给所述接收端。 The server transmits the second data after converting the protocol format to the receiving end.
2、 根据权利要求 1 所述的方法, 其特征在于, 所述接收端使用的协议的 信息包括: 所述接收端使用的协议的标识。 2. The method according to claim 1, characterized in that the information about the protocol used by the receiving end includes: an identifier of the protocol used by the receiving end.
3、 根据权利要求 2所述的方法, 其特征在于, 服务器根据所述接收端使 用的协议的信息, 将所述第一数据转换为符合所述接收端使用的协议格式的第 二数据的步骤包括: 3. The method according to claim 2, characterized in that the server converts the first data into second data conforming to the protocol format used by the receiving end according to the information of the protocol used by the receiving end. include:
所述服务器从所述第一数据中提取所述接收端使用的协议的标识; 所述服务器通过查询协议数据库中所述接收端使用的协议的标识与所述 接收端使用的协议格式的对应关系, 获得所述接收端使用的协议格式; The server extracts the identifier of the protocol used by the receiving end from the first data; the server queries the corresponding relationship between the identifier of the protocol used by the receiving end and the protocol format used by the receiving end in the protocol database. , obtain the protocol format used by the receiving end;
所述服务器根据所述协议格式, 将所述第一数据转换为符合所述接收端使 用的协议格式的第二数据。 The server converts the first data into second data that conforms to the protocol format used by the receiving end according to the protocol format.
4、 根据权利要求 1 所述的方法, 其特征在于, 所述服务器接收发送端发 送的第一数据, 所述第一数据中包含接收端使用的协议的信息的步驟之后, 还 包括: 4. The method according to claim 1, characterized in that, after the step of the server receiving the first data sent by the sending end, and the first data containing the information of the protocol used by the receiving end, it further includes:
所述服务器判断所述第一数据传输时使用的协议是否与所述接收端使用 的协议一致; The server determines whether the protocol used when transmitting the first data is consistent with the protocol used by the receiving end;
若不一致, 则所述服务器执行所述根据所述接收端使用的协议的信息, 将 所述第一数据转换为符合所述接收端使用的协议格式的第二数据的步驟; 若一致, 则所述 务器将所述第一数据传输给所述接收端。 If they are inconsistent, the server executes the step of converting the first data into second data that conforms to the protocol format used by the receiving end based on the information of the protocol used by the receiving end; if they are consistent, then the The server transmits the first data to the receiving end.
5、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 所述服务器接收所述接收端根据所述第二数据返回的第三数据; 所述服务器将所述第三数据转换为符合所述发送端使用的协议格式的第 四数据; 所述服务器将转换协议格式后的所述第四数据传输给所述发送端。 5. The method according to claim 1, characterized in that, the method further includes: the server receiving the third data returned by the receiving end according to the second data; the server converting the third data Converting into fourth data that conforms to the protocol format used by the sending end; The server transmits the fourth data after converting the protocol format to the sending end.
6、 一种数据传输装置, 其特征在于, 包括: 6. A data transmission device, characterized by including:
接收模块, 用于接收发送端发送的第一数据, 所述第一数据中包含接收端 使用的协议的信息; A receiving module, configured to receive the first data sent by the sending end, where the first data contains information about the protocol used by the receiving end;
转换模块, 用于根据所述接收模块接收的所述接收端使用的协议的信息, 将所述第一数据转换为符合所述接收端使用的协议格式的第二数据; A conversion module, configured to convert the first data into second data that conforms to the protocol format used by the receiving end according to the information of the protocol used by the receiving end received by the receiving module;
传输模块, 用于将所述转换模块转换协议格式后的所述第二数据传输给所 述接收端。 A transmission module, configured to transmit the second data converted into a protocol format by the conversion module to the receiving end.
7、 根据权利要求 6所述的装置, 其特征在于, 所述接收端使用的协议的 信息包括: 所述接收端使用的协议的标识。 7. The device according to claim 6, wherein the information about the protocol used by the receiving end includes: an identifier of the protocol used by the receiving end.
8、 根据权利要求 7所述的装置, 其特征在于, 所述转换模块包括: 提取单元, 用于从所述接收模块接收的所述第一数据中提取所述接收端使 用的协议的标识; 8. The device according to claim 7, wherein the conversion module includes: an extraction unit, configured to extract the identifier of the protocol used by the receiving end from the first data received by the receiving module;
查询单元, 用于通过查询协议数据库中所述接收端使用的协议的标识与所 述接收端使用的协议格式的对应关系, 获得所述接收端使用的协议格式; A query unit configured to obtain the protocol format used by the receiving end by querying the correspondence between the identifier of the protocol used by the receiving end and the protocol format used by the receiving end in the protocol database;
转换单元, 用于根据所述协议格式, 将所述第一数据转换为符合所述接收 端使用的协议格式的第二数据。 A conversion unit configured to convert the first data into second data that conforms to the protocol format used by the receiving end according to the protocol format.
9、 根据权利要求 6所述的装置, 其特征在于, 所述装置还包括: 9. The device according to claim 6, characterized in that, the device further includes:
判断模块, 用于判断所述第一数据传输时使用的协议是否与所述接收端使 用的协议一致; A judgment module, used to judge whether the protocol used in the first data transmission is consistent with the protocol used by the receiving end;
处理模块, 用于若所述判断模块的判断结果为不一致, 则调用所述转换模 块执行所述根据所述接收端使用的协议的信息, 将所述第一数据转换为符合所 述接收端使用的协议格式的第二数据的步骤, 若所述判断模块的判断结果为一 致, 则将所述第一数据传输给所述接收端。 A processing module, configured to, if the judgment result of the judgment module is inconsistent, call the conversion module to execute the information according to the protocol used by the receiving end, and convert the first data into a format that conforms to the protocol used by the receiving end. In the step of sending the second data in the protocol format, if the judgment results of the judgment module are consistent, the first data is transmitted to the receiving end.
10、 根据权利要求 6所述的装置, 其特征在于, 10. The device according to claim 6, characterized in that,
所述接收模块, 还用于接收所述接收端根据所述第二数据返回的第三数据; 所述转换模块, 还用于将所述接收模块接收的所述第三数据转换为符合所 述发送端使用的协议格式的第四数据; 所述传输模块, 还用于将所述转换模块转换协议格式后的所述第四数据传 输给所述发送端。 The receiving module is also used to receive the third data returned by the receiving end according to the second data; the conversion module is also used to convert the third data received by the receiving module into conforming to the The fourth data in the protocol format used by the sending end; The transmission module is also configured to transmit the fourth data converted into the protocol format by the conversion module to the sending end.
11、 一种包含计算机可执行指令的存储介质, 所述计算机可执行指令在由 计算机处理器执行时用于执行一种数据传输方法, 其特征在于, 该方法包括: 服务器接收发送端发送的第一数据, 所述第一数据中包含接收端使用的协 议的信息; 11. A storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform a data transmission method. The method is characterized in that the method includes: the server receives the first data sent by the sending end. One data, the first data includes information about the protocol used by the receiving end;
服务器根据所述接收端使用的协议的信息, 将所述第一数据转换为符合所 述接收端使用的协议格式的第二数据; The server converts the first data into second data that conforms to the protocol format used by the receiving end according to the information of the protocol used by the receiving end;
服务器将转换协议格式后的所述第二数据传输给所述接收端。 The server transmits the second data after converting the protocol format to the receiving end.
PCT/CN2014/078523 2013-10-15 2014-05-27 Data transmission method, device and storage medium WO2015055010A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310481937.0A CN104125208B (en) 2013-10-15 2013-10-15 Data transmission method and device
CN201310481937.0 2013-10-15

Publications (1)

Publication Number Publication Date
WO2015055010A1 true WO2015055010A1 (en) 2015-04-23

Family

ID=51770474

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/078523 WO2015055010A1 (en) 2013-10-15 2014-05-27 Data transmission method, device and storage medium

Country Status (2)

Country Link
CN (1) CN104125208B (en)
WO (1) WO2015055010A1 (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105407084B (en) * 2015-10-26 2018-09-25 浪潮软件股份有限公司 A kind of network transmission device, method and system
CN105868364B (en) * 2016-03-29 2020-06-12 中国电子科技集团公司第二十八研究所 Byte stream-based structured data representation method
CN105978860B (en) * 2016-04-26 2019-09-10 国网山东省电力公司经济技术研究院 A kind of implementation method of electric system software interface adapter
CN107819543A (en) * 2016-09-12 2018-03-20 北京百度网讯科技有限公司 Data transmission method and device
CN108076110B (en) * 2016-11-14 2021-02-26 北京京东尚科信息技术有限公司 Electronic data exchange system and apparatus comprising an electronic data exchange system
TWI646805B (en) * 2016-11-23 2019-01-01 財團法人資訊工業策進會 Network communication protocol translation system and method
CN106993039A (en) * 2017-03-31 2017-07-28 深圳市金溢科技股份有限公司 Communication means, information management subsystem, cloud platform and managing system of car parking
CN106951270B (en) * 2017-04-06 2023-04-07 腾讯科技(深圳)有限公司 Code processing method, system and server
CN107145535A (en) * 2017-04-19 2017-09-08 畅捷通信息技术股份有限公司 Instant communicating method and device and server
CN109218261B (en) * 2017-07-03 2022-06-28 腾讯科技(深圳)有限公司 Data processing method and data processing device
CN109428851B (en) * 2017-07-06 2021-08-10 阿里巴巴(中国)有限公司 Data transmission assembly and method
CN108833191B (en) * 2018-08-03 2021-03-02 云丁智能科技(北京)有限公司 Gateway equipment configuration method and device
WO2020007339A1 (en) 2018-07-04 2020-01-09 Yunding Network Technology (Beijing) Co., Ltd. Method and system for operating an electronic device
CN109462455B (en) * 2018-10-25 2021-06-29 广东电网有限责任公司 Cross-network short data mutual transmission method, device, equipment and readable storage medium
CN109547474A (en) * 2018-12-21 2019-03-29 深圳市创梦天地科技有限公司 A kind of data transmission method and device
CN109815214B (en) * 2018-12-29 2022-05-17 深圳云天励飞技术有限公司 Database access method, system, device and storage medium
CN109874055B (en) * 2019-03-12 2021-08-17 深圳市天威视讯股份有限公司 Data acquisition method and system suitable for intelligent set top box
CN110351283B (en) * 2019-07-16 2022-05-06 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and storage medium
CN111914011A (en) * 2020-08-06 2020-11-10 上海智众医疗科技有限公司 Cross-platform data conversion method and system
CN113691584B (en) * 2021-07-15 2024-03-15 广州三七互娱科技有限公司 Data transmission method, device and network bridge
CN115225728A (en) * 2022-07-20 2022-10-21 江苏天拓龙川数字科技有限公司 Method and device for carrying out unified data docking

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101448335A (en) * 2008-12-23 2009-06-03 腾讯科技(深圳)有限公司 Mobile terminal based networking games realization method and game server
CN102244765A (en) * 2011-07-05 2011-11-16 华平信息技术股份有限公司 Multi-protocol-supported conference terminal interaction system and method
CN102546827A (en) * 2012-02-24 2012-07-04 深圳市长宇电器有限公司 Method and device for receiving and transmitting multiple protocol data of vehicle-mounting terminals on server

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101136877A (en) * 2007-09-28 2008-03-05 腾讯科技(深圳)有限公司 Method and system of instant communication
JP2009094832A (en) * 2007-10-10 2009-04-30 Nec Access Technica Ltd Multicast data distribution apparatus, distribution method therefor, and distribution control program thereof
CN102377636B (en) * 2010-08-06 2014-12-17 北京乾唐视联网络科技有限公司 Service communication method of access network device and system thereof
CN102148863A (en) * 2011-01-27 2011-08-10 华为技术有限公司 Method and device for delivering M2M (machine to machine) service messages
CN103024059B (en) * 2012-12-19 2015-08-26 北京时代凌宇科技有限公司 A kind of middleware system for Internet of things

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101448335A (en) * 2008-12-23 2009-06-03 腾讯科技(深圳)有限公司 Mobile terminal based networking games realization method and game server
CN102244765A (en) * 2011-07-05 2011-11-16 华平信息技术股份有限公司 Multi-protocol-supported conference terminal interaction system and method
CN102546827A (en) * 2012-02-24 2012-07-04 深圳市长宇电器有限公司 Method and device for receiving and transmitting multiple protocol data of vehicle-mounting terminals on server

Also Published As

Publication number Publication date
CN104125208B (en) 2015-08-12
CN104125208A (en) 2014-10-29

Similar Documents

Publication Publication Date Title
WO2015055010A1 (en) Data transmission method, device and storage medium
US10587544B2 (en) Message processing method, processing server, terminal, and storage medium
US11871333B2 (en) Wireless network service type
KR20180091708A (en) Device identifier-dependent operation processing of packet-based data communication
WO2017114206A1 (en) Method and device for processing short link, and short link server
US9554276B2 (en) System and method for on the fly protocol conversion in obtaining policy enforcement information
WO2019144742A1 (en) Binding method for user terminal and device, apparatus, and system
CN107395742B (en) Network communication method based on intelligent sound box and intelligent sound box
WO2017114190A1 (en) File uploading processing method and device
WO2015021873A1 (en) Method, platform server, and system of data pushing
CN111093262A (en) Method, network element equipment and storage medium for realizing 5G user registration
WO2016086755A1 (en) Packet processing method and transparent proxy server
CN110933193B (en) Domain name resolution method and device, electronic equipment and computer readable storage medium
JP4780345B2 (en) COMMUNICATION SYSTEM, CONNECTION DEVICE, CONNECTION METHOD, AND PROGRAM
WO2013120315A1 (en) Method for processing domain name information, wireless router, and client
US20130268662A1 (en) Hypertext transfer protocol http stream association method and device
US9344834B2 (en) Communication method in wireless access network and wireless access network device
WO2014166078A1 (en) Data sending and processing method and router
KR20190069284A (en) Method of converting and interworking ocf resourse of internet service, and an apparatus performing the same
WO2012159291A1 (en) Method for identifying type of terminal and wireless access network device
JP2007035053A (en) Method for maintaining session between different-terminals
US20160149855A1 (en) Service processing method, system, and relevant device
WO2018153231A1 (en) Information processing method and device, and storage medium
CN111131398B (en) Method, device, electronic equipment and medium based on direct communication of video network
CN114827197B (en) Service communication method, device, equipment and medium based on Internet of things

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14854700

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 21/06/2016)

122 Ep: pct application non-entry in european phase

Ref document number: 14854700

Country of ref document: EP

Kind code of ref document: A1