WO2011091731A1 - Data transmission device, data transmission method and data synchronization method - Google Patents

Data transmission device, data transmission method and data synchronization method Download PDF

Info

Publication number
WO2011091731A1
WO2011091731A1 PCT/CN2011/070380 CN2011070380W WO2011091731A1 WO 2011091731 A1 WO2011091731 A1 WO 2011091731A1 CN 2011070380 W CN2011070380 W CN 2011070380W WO 2011091731 A1 WO2011091731 A1 WO 2011091731A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
data
synchronization
data transmission
routing
Prior art date
Application number
PCT/CN2011/070380
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 WO2011091731A1 publication Critical patent/WO2011091731A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Definitions

  • Data transmission device Data transmission method and data synchronization method
  • the present invention relates to the field of computer technologies, and in particular, to a data transmission device, a data transmission method, and a data synchronization method. Background technique
  • a distributed system is a software system built on a computer network with a high degree of cohesion and transparency. With the widespread use of distributed systems, the interaction between systems becomes more and more complex, and the integration becomes more and more difficult.
  • each system such as a web (website) system, a service (service) system, and a hessian (lightweight remote tool) system, uses different protocols; when the system processes business logic, the protocol is first implemented. Adaptation, and then the business logic to achieve the conversion of the message itself, the usual message content is XML (Extensible Markup Language, Extensible Markup Language), the business logic needs to parse the content of the message before processing, and convert to POJO (Plain Ordinary Java Objects, simple Java objects) objects; then the system implements the routing function of the message by itself, and realizes the mutual routing of each system through the mesh structure.
  • XML Extensible Markup Language
  • POJO Principal Ordinary Java Objects, simple Java objects
  • the protocol is not pluggable and difficult to develop. Since the protocol adaptation between the systems needs to be processed before the processing of the service logic, the service processing efficiency is low. At the same time, the protocol is not pluggable. When a new protocol needs to be used to interact with the external system, the system needs to perform the interface. Modification and development, it is difficult;
  • the message conversion is cumbersome. Due to different message formats, each message processing needs to implement multiple message format conversions, which is cumbersome to operate. In addition, the message format is highly dependent, and the format needs to be modified when the format changes, and the steps are cumbersome;
  • the system cost is high.
  • the system implements the routing function of the message itself, which requires high coupling between the systems; because the routing is implemented through a complex mesh structure, when the routing policy changes, the phases Both the system and the interaction structure need to be modified, which is costly and is not conducive to data synchronization of the system.
  • the object of the present invention is to provide a data transmission device, a data transmission method, and a data synchronization method, which can simplify real-time sending and receiving of messages, and support protocol insertion and extraction and multiple routing strategies, thereby reducing development difficulty. Reduce system costs.
  • an embodiment of the present invention provides a data transmission device, including: a message conversion module, configured to construct a first message supported by a pre-configured transmission protocol according to the received parameter information, or to receive the first message The message is converted into a second message supported by the business logic;
  • a routing module configured to route the first message constructed by the message conversion module to the message exit to send to the peer device, or invoke the service logic to respond to the second message converted by the message conversion module.
  • an embodiment of the present invention further provides a data transmission method, including:
  • the embodiment of the present invention further provides another data transmission method, including:
  • the business logic is invoked in response to the second message based on pre-configured routing information.
  • an embodiment of the present invention further provides a data synchronization method, including:
  • the loaded synchronization data is sent to the peer device according to the pre-configured routing information to synchronize the data of the peer device.
  • the invention encapsulates and integrates functions such as protocol adaptation, message conversion, message routing and data synchronization to form a data transmission device, which can support plugging and unplugging various protocols and support various routing strategies; the data transmission device as a public
  • the component can be used as the sender to process and send the message in real time, and can be used as the receiver to receive the message in real time; simplifying the conversion and realizing of the message Time to send and receive, reduce development and reduce development difficulty;
  • it can simplify the synchronous transmission and reception of asynchronous data, reducing system cost.
  • FIG. 1 is a schematic structural diagram of an embodiment of a data transmission device according to the present invention.
  • FIG. 2 is a schematic structural diagram of an embodiment of a synchronization module according to the present invention.
  • FIG. 3 is a flow chart of a first embodiment of a data transmission method of the present invention.
  • FIG. 4 is a flow chart of a second embodiment of a data transmission method of the present invention.
  • FIG. 5 is a flow chart of an embodiment of a data synchronization method of the present invention. detailed description
  • the data transmission device includes: a message conversion module 20 and a routing module 30.
  • the data transmission device can be applied as a common component to the sender, the receiver, the client, and the server.
  • the data transmission device can be applied to a server, which is a sender of a message, and sends a corresponding message to the digital television receiving terminal through the transmission device, where the digital television receiving terminal includes It is not limited to: Set Top Box (STB), IPTV (Internet Protocol Television), TV mobile phone, digital TV integrated machine, etc., which have the function of receiving digital TV.
  • STB Set Top Box
  • IPTV Internet Protocol Television
  • TV mobile phone digital TV integrated machine, etc.
  • the data transmission device can also be applied to a digital television receiving terminal, which is a receiver of a message, receives a message sent by the front-end server through the transmission device, and invokes a corresponding service logic to respond to the message.
  • a digital television receiving terminal which is a receiver of a message
  • receives a message sent by the front-end server through the transmission device and invokes a corresponding service logic to respond to the message.
  • application of the data transmission device here is only an example, and similar analysis can be performed in other application situations, and details are not described herein.
  • the first message supported by the conference or converting the received first message into a second message supported by the business logic;
  • the parameter information includes a message body, a message entry address, and an operation code.
  • the routing module 30 is configured to route the first message constructed by the message conversion module 20 to a message exit to be sent to the peer device, or invoke the service logic to respond to the second message converted by the message conversion module 20. .
  • the data transmission device further includes: a pre-configuration module 10, an interaction module 40, and a synchronization module 50.
  • the pre-configuration module 10 is configured to pre-configure a transmission protocol and routing information.
  • the pre-configuration module 10 is mainly used to implement insertion and removal of various protocols, and implement various routing policies.
  • the message exchanged by the existing system is mainly an XML message
  • the message format processed by the business logic is a message of the POJO object. Therefore, the pre-configuration module 10 pre-configures the transmission protocol, for example, pre-configuring the XML transmission protocol or
  • the POJO transport protocol is such that the message conversion module 20 implements bidirectional conversion of XML and POJO objects according to a pre-configured protocol.
  • the protocol type here is only an example, and other situations can be similarly analyzed, for example:
  • the new protocol can be directly pre-configured, and the new protocol can be used in data transmission;
  • the pre-configuration may not be performed before the data transmission, and details are not described herein.
  • the pre-configuration module 10 implements plugging and unplugging and adaptation of protocols.
  • the pre-configuration module 10 pre-defines various routing policies to provide routing information for message transmission. Specifically, pre-configuration of various routing information and existing routing strategies are performed. The process of formulating routing information is similar and will not be described here.
  • the interaction module 40 is configured to provide an interface for externally interacting with a message, including a message interface that receives parameter information that is externally transmitted, a message entry that receives an external incoming first message, and a message exit that sends a message to the peer device. And the business interface that invokes the business logic to respond to the message.
  • the interaction module 40 provides an interface for various message interactions, which shields the processing of messages (including message conversion, message routing, protocol adaptation, etc.) within the data transmission device, and presents the information to the user only
  • the processing of the business logic that is, the user only needs to call the interface of the data transmission device to carry in the initial information, and then the data transmission device performs a series of processing and returns to the user.
  • the user first needs to invoke various interfaces of the interaction module 40 through an API (Application Programming Interface) to implement data transmission.
  • API Application Programming Interface
  • the user invokes the message interface of the interaction module 40 through an API call, as follows:
  • Body requestBody new UserRequestBody()
  • Body responseBody new UserResponseBody()
  • IMessageSender sender new MessageSender()
  • API calls when data synchronization is required are as follows:
  • Body requestBody new UserRequestBody()
  • API call is only an example, and other cases: For example: When the data transmission device is applied to the receiving end, or applied to the requested party of the synchronous data, the API call can be similarly analyzed. This will not be repeated.
  • the synchronization module 50 is configured to store the content of the first message constructed by the message conversion module 20 as synchronization data to a database, and load all synchronization data in the database; according to the pre-configured routing information, The routing module 30 sends the loaded synchronization data to the peer device to synchronize the data of the peer device.
  • the synchronization module 50 also returns a synchronization identifier to the calling party of the synchronization interface, and the synchronization interface caller considers that the data synchronization is completed after receiving the synchronization identifier, and the synchronous interface caller can also view according to the synchronization identifier.
  • This data synchronization record includes viewing the synchronization data of this synchronization from the database, and the synchronization process to the peer device.
  • the invention encapsulates and integrates functions such as protocol adaptation, message conversion, message routing and data synchronization to form a data transmission device, which can support plugging and unplugging various protocols and support various routing strategies; the data transmission device as a public
  • the component can be used as the sender to process and send the message in real time, and can be used as the receiver to receive and receive the message in real time. It simplifies the message conversion and real-time sending and receiving, reduces the development amount and reduces the development difficulty.
  • the interaction structure can be modified or added with corresponding functions, which can simplify the synchronous sending and receiving of asynchronous data and reduce the system cost.
  • the synchronization module 50 includes: a storage unit 501, a loading unit 502, and a synchronization unit 503.
  • the storage unit 501 is configured to store the content of the first message constructed by the message conversion module 20 as synchronization data to a database;
  • the transmission protocol pre-configured by the pre-configuration module 10 is an XML protocol.
  • the message conversion module 20 first constructs a request header of an XML message according to the operation code, and according to the message body introduced in the interaction module 40. a parameter, converting a POJO object of the body into an XML object, and combining the request header into an XML request message; the storage unit 501 storing the content of the XML message as synchronization data in a database;
  • the loading unit 502 is configured to load all synchronization data in the database;
  • the loading unit 502 is responsible for loading all the synchronization data in the database by loading the thread. Specifically, the loading unit may put the loaded synchronization data into the blocking data queue.
  • synchronous data can also be placed in other data queues in memory, and the characteristics of the queue can be used to store synchronized data.
  • the synchronization unit 503 is configured to send, by using the routing module 30, the synchronization data loaded by the loading unit 502 to the peer device according to the pre-configured routing information, to synchronize data of the peer device.
  • the synchronization unit 503 reads data from the blocking queue by reading the thread, and sends data through the sending thread of the sending thread pool, and the sending thread is routed according to the message entry address parameter and the pre-configured routing information.
  • the module 30 routes the message to the message exit and sends it to the peer device to synchronize the data of the peer device.
  • the data transmission device is applied to the data synchronization client, and the synchronous data is sent in an asynchronous manner, which simplifies the synchronous transmission of the asynchronous data. It can be understood that when the data transmission device is applied to the data synchronization server, the data synchronization process can be similarly analyzed, and details are not described herein.
  • the invention can simplify the synchronous sending and receiving of asynchronous data without reducing the system and the interaction structure or adding corresponding functions, thereby reducing the system cost.
  • FIG. 3 is a flowchart of a first embodiment of a data transmission method according to the present invention.
  • the embodiment shown in FIG. 3 is an embodiment of a data transmission device applied to a sender for message transmission. As shown in FIG.
  • the methods include:
  • the S101 is mainly used to implement insertion and removal of various protocols, and to implement various routing strategies.
  • the messages exchanged by the existing system are mainly XML messages, and the message format processed by the business logic is a message of a POJO object. Therefore, the transmission protocol can be pre-configured, for example, a pre-configured XML transmission protocol or a POJO transmission protocol is implemented. Bidirectional conversion of XML and POJO objects. It can be understood that the protocol type here is only an example, and other situations can be similarly analyzed, for example: When a new protocol needs to be used, the new protocol can be directly pre-configured, that is, during data transmission.
  • S101 implements the insertion and removal and adaptation of the protocol.
  • various routing policies may be pre-defined to provide routing information for message transmission, specifically, pre-configuration of various routing information and existing routing information using various routing policies. Similarly, no comments are made here.
  • the external may pass the message body, the message entry address, and the operation code as parameters through the method invoked by the API, and S102 receives the above-mentioned parameter information introduced by the user.
  • S104 Route the first message to the message exit to send to the peer device according to the parameter information and the pre-configured routing information.
  • an API call may be performed according to the message entry address parameter, and the message is sent to the message portal, and the message portal selects a corresponding message exit according to the pre-configured routing information, and forwards the message to the message exit.
  • the invention encapsulates and integrates functions such as protocol adaptation, message conversion, message routing and data synchronization to form a data transmission device, which can support plugging and unplugging various protocols and support various routing strategies; the data transmission device as a public
  • the component can be used as the sender to process and send the message in real time, and can be used as the receiver to receive and receive the message in real time. It simplifies the message conversion and real-time sending and receiving, reduces the development amount and reduces the development difficulty.
  • the interaction structure can be modified or added with corresponding functions, which can simplify the synchronous sending and receiving of asynchronous data and reduce the system cost.
  • FIG. 4 it is a flowchart of a second embodiment of a data transmission method according to the present invention.
  • the embodiment shown in FIG. 4 is an embodiment of a data transmission device applied to a receiving end for message reception and response; , the method includes:
  • S201 Receive an external first message by using a message portal.
  • the S201 receives, by using a message portal, a first message sent by the sending end, that is, an XML request message; 5202. Convert the received first message into a second message supported by the service logic.
  • the S202 separately extracts the request header and the message body part in the XML request message, and converts the XML object of the message body part into a POJO object. Making it a second message supported by the business logic, and the second message includes a message body that is a POJO object;
  • S203 The service logic is invoked to respond to the second message according to the pre-configured routing information.
  • the routing information herein is a service route that is determined according to each service logic.
  • S203 responds to the second message by calling the corresponding service logic of the service interface according to the operation code included in the request header extracted in S202 and the pre-configured service route.
  • the invention encapsulates and integrates functions such as protocol adaptation, message conversion, message routing and data synchronization to form a data transmission device, which can support plugging and unplugging various protocols and support various routing strategies; the data transmission device as a public
  • the component can be used as the sender to process and send the message in real time, and can be used as the receiver to receive and receive the message in real time. It simplifies the message conversion and real-time sending and receiving, reduces the development amount and reduces the development difficulty.
  • the interaction structure can be modified or added with corresponding functions, which can simplify the synchronous sending and receiving of asynchronous data and reduce the system cost.
  • FIG. 5 it is a flowchart of an embodiment of a data synchronization method according to the present invention.
  • the embodiment shown in FIG. 5 is an embodiment of a data transmission device applied to a data synchronization client. As shown in FIG. 5, the method includes:
  • S301 is mainly used to implement plugging and unplugging of various protocols and to implement various routing strategies.
  • the messages exchanged by the existing system are mainly XML messages, and the message format processed by the business logic is a message of a POJO object. Therefore, the transmission protocol can be pre-configured, for example, a pre-configured XML transmission protocol or a POJO transmission protocol is implemented. Bidirectional conversion of XML and POJO objects.
  • the protocol type here is only an example, and other situations can be similarly analyzed, for example:
  • the new protocol can be directly pre-configured, and the new protocol can be used in data transmission;
  • the pre-configuration may not be performed before the data transmission, and no comment is made here.
  • S301 implements the insertion and removal and adaptation of the protocol.
  • various routing policies may be pre-defined to provide routing information for message transmission, specifically, pre-configuration of various routing information and existing routing information using various routing policies. Similarly, no comments are made here. 5302, receiving externally passed parameter information;
  • the external for example: the user
  • the external can invoke the synchronization interface of the data transmission device by using the method invoked by the API, and the message body, the message entry address, and the operation code are input as parameters, and S302 receives the above-mentioned parameter passed by the user. information.
  • an external for example, a user
  • the external eg, user
  • the corresponding parameter is input.
  • the data transmission device returns the synchronization identifier to the outside (for example: the user), that is, the API interface caller, and the API interface caller receives the synchronization identifier, that is, the data synchronization is completed, and the API interface caller can also use the synchronization identifier.
  • View this data synchronization record including viewing the synchronization data of this synchronization from the database, as well as the synchronization process.
  • all the synchronization data in the database is loaded by loading the thread, and specifically, the loaded synchronization data can be put into the blocking data queue.
  • the loaded synchronization data can be put into the blocking data queue.
  • the S307 reads the data from the blocking queue by reading the thread, and then sends the data through the sending thread of the sending thread pool, and the sending thread sends the message by the routing module 30 according to the message entry address parameter and the pre-configured routing information.
  • the routing message exit is sent to the peer device to synchronize the data of the peer device.
  • the specific process may refer to the process of the data transmission device applied to the receiving end and the data synchronization client, and is not described herein.
  • the present invention through protocol adaptation, message conversion, message routing And data synchronization and other functions for package integration, forming a data transmission device, capable of supporting plugging and unplugging of various protocols and supporting various routing strategies;
  • the data transmission device as a common component can be used as a sender for real-time processing of messages and Sending, and can be used as a receiver to receive and receive messages in real time; simplifying message conversion and real-time sending and receiving, reducing development and reducing development difficulty;
  • it can be simplified without modifying the system and interaction structure or adding corresponding functions. Synchronous transmission and reception of asynchronous data reduces system cost.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Communication Control (AREA)

Abstract

Provided are a data transmission device, data transmission method and data synchronization method, wherein the data transmission device includes a message conversion module, for constructing, according to received parameter information, a first message supported by a pre-configured transmission protocol, or for converting a received first message into a second message supported by a service logic, and a routing module, for routing the first message constructed by said message conversion module to a message outlet to send it to an opposite device, or for invoking said service logic to respond to the converted second message of said message conversion module. The present invention can simplify real-time receiving/sending of a message and synchronous receiving/sending of asynchronous data, and supports protocol plug in & out and multiple routing strategies, thereby reducing the development difficulty and system cost.

Description

数据传输设备、 数据传输方法及数据同步方法  Data transmission device, data transmission method and data synchronization method
本申请要求于 2010 年 2 月 1 日提交中国专利局、 申请号为 201019164030.5、 发明名称为"数据传输设备、 方法及数据同步方法 "的中国专 利申请的优先权, 其全部内容通过引用结合在本申请中。  This application claims priority to Chinese Patent Application No. 201019164030.5, entitled "Data Transmission Equipment, Method and Data Synchronization Method", filed on February 1, 2010, the entire contents of which are incorporated herein by reference. In the application.
技术领域 Technical field
本发明涉及计算机技术领域, 尤其涉及数据传输设备、数据传输方法及数 据同步方法。 背景技术  The present invention relates to the field of computer technologies, and in particular, to a data transmission device, a data transmission method, and a data synchronization method. Background technique
分布式系统( distributed system )是建立在计算机网络上的软件系统, 具 有高度的内聚性和透明性。 随着分布式系统的广泛使用, 系统之间的交互越来 越复杂, 集成的难度也越来越大。  A distributed system is a software system built on a computer network with a high degree of cohesion and transparency. With the widespread use of distributed systems, the interaction between systems becomes more and more complex, and the integration becomes more and more difficult.
现有的分布式系统中, 各个系统如 web (网站) 系统、 service (服务) 系 统、 hessian (轻量级远程工具) 系统等, 均使用不同的协议; 系统在处理业务 逻辑时, 首先进行协议的适配, 然后由业务逻辑自己实现消息的转换, 通常的 消息内容为 XML ( Extensible Markup Language, 可扩展标记语言), 业务逻辑 在处理前需要解析消息的内容, 并转换为 POJO ( Plain Ordinary Java Objects, 简单 Java对象)对象; 然后由系统自行实现消息的路由功能, 通过网状结构 实现各系统相互的路由。  In the existing distributed system, each system, such as a web (website) system, a service (service) system, and a hessian (lightweight remote tool) system, uses different protocols; when the system processes business logic, the protocol is first implemented. Adaptation, and then the business logic to achieve the conversion of the message itself, the usual message content is XML (Extensible Markup Language, Extensible Markup Language), the business logic needs to parse the content of the message before processing, and convert to POJO (Plain Ordinary Java Objects, simple Java objects) objects; then the system implements the routing function of the message by itself, and realizes the mutual routing of each system through the mesh structure.
发明人在实施本发明的过程中发现, 现有的系统主要存在以下缺陷: The inventors found in the process of implementing the present invention that the existing system mainly has the following defects:
1、 协议不可插拔、 开发难度大。 由于各系统之间的协议适配需要在处理 业务逻辑之前进行处理, 其造成业务处理效率较低; 同时, 协议不可插拔, 当 需要使用新的协议和外部系统交互时, 系统需要对接口进行修改和开发, 其难 度大; 1. The protocol is not pluggable and difficult to develop. Since the protocol adaptation between the systems needs to be processed before the processing of the service logic, the service processing efficiency is low. At the same time, the protocol is not pluggable. When a new protocol needs to be used to interact with the external system, the system needs to perform the interface. Modification and development, it is difficult;
2、 消息转换繁瑣。 由于消息格式不同, 每次业务逻辑处理时需要实现多 种消息格式的转换, 其操作繁瑣; 另外, 消息格式依赖度高, 当格式变化的时 候还需要修改, 步骤繁瑣;  2. The message conversion is cumbersome. Due to different message formats, each message processing needs to implement multiple message format conversions, which is cumbersome to operate. In addition, the message format is highly dependent, and the format needs to be modified when the format changes, and the steps are cumbersome;
3、 系统成本高。 系统自己实现消息的路由功能, 其需要系统之间的耦合 性很高; 由于路由的实现通过复杂的网状结构, 当路由策略发生变化时, 各相 关系统及交互结构都需要修改, 其成本较高, 并且不利于系统的数据同步。 发明内容 3. The system cost is high. The system implements the routing function of the message itself, which requires high coupling between the systems; because the routing is implemented through a complex mesh structure, when the routing policy changes, the phases Both the system and the interaction structure need to be modified, which is costly and is not conducive to data synchronization of the system. Summary of the invention
针对现有技术的缺点, 本发明的目的在于, 提供数据传输设备、 数据传输 方法以及数据同步的方法, 能够简化消息的实时收发, 并支持协议插拔和多种 路由策略, 减小开发难度, 降低系统成本。  Aiming at the disadvantages of the prior art, the object of the present invention is to provide a data transmission device, a data transmission method, and a data synchronization method, which can simplify real-time sending and receiving of messages, and support protocol insertion and extraction and multiple routing strategies, thereby reducing development difficulty. Reduce system costs.
为了实现上述目的, 本发明实施例提供了一种数据传输设备, 包括: 消息转换模块, 用于根据接收的参数信息,构造预配置的传输协议所支持 的第一消息, 或将接收的第一消息转换为业务逻辑所支持的第二消息;  In order to achieve the above object, an embodiment of the present invention provides a data transmission device, including: a message conversion module, configured to construct a first message supported by a pre-configured transmission protocol according to the received parameter information, or to receive the first message The message is converted into a second message supported by the business logic;
路由模块,用于将所述消息转换模块构造的第一消息路由至消息出口以发 送至对端设备, 或调用所述业务逻辑以响应所述消息转换模块转换的第二消 息。  And a routing module, configured to route the first message constructed by the message conversion module to the message exit to send to the peer device, or invoke the service logic to respond to the second message converted by the message conversion module.
相应地, 本发明实施例还提供了一种数据传输方法, 包括:  Correspondingly, an embodiment of the present invention further provides a data transmission method, including:
根据接收的参数信息, 构造预配置的传输协议所支持的第一消息; 根据所述接收的参数信息和预配置的路由信息,将所述第一消息路由至消 息出口以发送至对端设备。  And configuring, according to the received parameter information, a first message supported by the pre-configured transport protocol; and routing the first message to the message exit to send to the peer device according to the received parameter information and the pre-configured routing information.
相应地, 本发明实施例还提供了另一种数据传输方法, 包括:  Correspondingly, the embodiment of the present invention further provides another data transmission method, including:
将接收的第一消息转换为业务逻辑所支持的第二消息;  Converting the received first message into a second message supported by the business logic;
根据预配置的路由信息, 调用所述业务逻辑以响应所述第二消息。  The business logic is invoked in response to the second message based on pre-configured routing information.
相应地, 本发明实施例还提供了一种数据同步方法, 包括:  Correspondingly, an embodiment of the present invention further provides a data synchronization method, including:
根据接收的参数信息, 构造预配置的传输协议所支持的第一消息; 将所述第一消息的内容作为同步数据存储于数据库,并加载所述数据库内 的所有同步数据;  Constructing, according to the received parameter information, a first message supported by the pre-configured transport protocol; storing the content of the first message as synchronization data in a database, and loading all the synchronization data in the database;
根据预配置的路由信息,将加载的同步数据发送至对端设备, 以同步所述 对端设备的数据。  The loaded synchronization data is sent to the peer device according to the pre-configured routing information to synchronize the data of the peer device.
本发明通过将协议适配、 消息转换、 消息路由以及数据同步等功能进行封 装整合, 形成了数据传输设备, 能够支持各种协议的插拔以及支持各种路由策 略; 该数据传输设备作为一个公共组件, 既能够作为发送方进行消息的实时处 理和发送, 又可作为接收方进行消息的实时处理接收; 简化了消息的转换和实 时收发, 减少开发量以及降低开发难度; 另外, 无需对系统及交互结构进行修 改或增设相应的功能, 即可简化异步数据的同步收发, 降低了系统成本。 附图说明 The invention encapsulates and integrates functions such as protocol adaptation, message conversion, message routing and data synchronization to form a data transmission device, which can support plugging and unplugging various protocols and support various routing strategies; the data transmission device as a public The component can be used as the sender to process and send the message in real time, and can be used as the receiver to receive the message in real time; simplifying the conversion and realizing of the message Time to send and receive, reduce development and reduce development difficulty; In addition, without the need to modify the system and interaction structure or add corresponding functions, it can simplify the synchronous transmission and reception of asynchronous data, reducing system cost. DRAWINGS
图 1为本发明的数据传输设备的实施例的结构示意图;  1 is a schematic structural diagram of an embodiment of a data transmission device according to the present invention;
图 2为本发明的同步模块的实施例的结构示意图;  2 is a schematic structural diagram of an embodiment of a synchronization module according to the present invention;
图 3为本发明的数据传输方法的第一实施例的流程图;  3 is a flow chart of a first embodiment of a data transmission method of the present invention;
图 4为本发明的数据传输方法的第二实施例的流程图;  4 is a flow chart of a second embodiment of a data transmission method of the present invention;
图 5为本发明的数据同步方法的实施例的流程图。 具体实施方式  FIG. 5 is a flow chart of an embodiment of a data synchronization method of the present invention. detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  BRIEF DESCRIPTION OF THE DRAWINGS The technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative work are within the scope of the present invention.
请参见图 1 , 为本发明的数据传输设备的实施例的结构示意图; 如图 1所 示, 所述数据传输设备包括: 消息转换模块 20和路由模块 30。  1 is a schematic structural diagram of an embodiment of a data transmission device according to the present invention. As shown in FIG. 1, the data transmission device includes: a message conversion module 20 and a routing module 30.
具体实现中,所述数据传输设备可作为公共组件,应用于发送端,接收端, 客户端和服务端。 比如: 在数字电视接收系统中, 所述数据传输设备可应用于 服务器端, 其作为消息的发送者,通过所述传输设备为数字电视接收终端发送 相应的消息, 所述数字电视接收终端包括但不限于: 机顶盒(Set Top Box, STB ), IPTV ( Internet Protocol Television, 网络电视)、 电视手机、 数字电视 一体机等具有接收数字电视功能的终端。再如: 所述数据传输设备还可应用于 数字电视接收终端, 其作为消息的接收者,通过所述传输设备接收前端服务器 发送的消息, 并调用相应的业务逻辑进行消息的响应。 可以理解的是, 此处数 据传输设备的应用仅为举例, 其他应用情况可进行类似的分析,在此不进行贅 述。 议所支持的第一消息, 或将接收的第一消息转换为业务逻辑所支持的第二消 息; In a specific implementation, the data transmission device can be applied as a common component to the sender, the receiver, the client, and the server. For example, in a digital television receiving system, the data transmission device can be applied to a server, which is a sender of a message, and sends a corresponding message to the digital television receiving terminal through the transmission device, where the digital television receiving terminal includes It is not limited to: Set Top Box (STB), IPTV (Internet Protocol Television), TV mobile phone, digital TV integrated machine, etc., which have the function of receiving digital TV. For example, the data transmission device can also be applied to a digital television receiving terminal, which is a receiver of a message, receives a message sent by the front-end server through the transmission device, and invokes a corresponding service logic to respond to the message. It can be understood that the application of the data transmission device here is only an example, and similar analysis can be performed in other application situations, and details are not described herein. The first message supported by the conference, or converting the received first message into a second message supported by the business logic;
具体实现中, 所述参数信息包括消息主体(Body )、 消息入口地址和操作 码。  In a specific implementation, the parameter information includes a message body, a message entry address, and an operation code.
所述路由模块 30, 用于将所述消息转换模块 20构造的第一消息路由至消 息出口以发送至对端设备, 或调用所述业务逻辑以响应所述消息转换模块 20 转换的第二消息。  The routing module 30 is configured to route the first message constructed by the message conversion module 20 to a message exit to be sent to the peer device, or invoke the service logic to respond to the second message converted by the message conversion module 20. .
进一步如图 1所示, 所述数据传输设备还包括: 预配置模块 10, 交互模 块 40和同步模块 50。  As further shown in FIG. 1, the data transmission device further includes: a pre-configuration module 10, an interaction module 40, and a synchronization module 50.
所述预配置模块 10, 用于预先配置传输协议和路由信息; 具体实现中, 所述预配置模块 10主要用于实现各种协议的插拔, 以及实现各种路由策略的 制定。 一般地, 现有系统交互的消息主要为 XML消息, 而业务逻辑所处理的 消息格式为 POJO对象的消息, 因此, 所述预配置模块 10会预先配置传输协 议, 比如, 预先配置 XML传输协议或 POJO传输协议, 以使所述消息转换模 块 20根据预先配置的协议, 实现 XML和 POJO对象的双向转换。可以理解的 是, 此处的协议类型仅为举例, 其他情况可进行类似分析, 比如: 当需要使用 新的协议时, 可直接进行新协议的预配置, 即可在数据传输时使用新协议; 再 比如, 当不需要某种协议时, 可在数据传输之前不进行预先配置, 在此不进行 贅述。 所述预配置模块 10实现了协议的插拔和适配。 另外, 根据实际需要, 或系统配置, 所述预配置模块 10预先制定各种路由策略, 为消息的传输提供 路由信息, 具体地,各种路由信息的预配置与现有利用各种路由策略进行路由 信息的制定过程相类似, 在此不进行贅述。  The pre-configuration module 10 is configured to pre-configure a transmission protocol and routing information. In a specific implementation, the pre-configuration module 10 is mainly used to implement insertion and removal of various protocols, and implement various routing policies. Generally, the message exchanged by the existing system is mainly an XML message, and the message format processed by the business logic is a message of the POJO object. Therefore, the pre-configuration module 10 pre-configures the transmission protocol, for example, pre-configuring the XML transmission protocol or The POJO transport protocol is such that the message conversion module 20 implements bidirectional conversion of XML and POJO objects according to a pre-configured protocol. It can be understood that the protocol type here is only an example, and other situations can be similarly analyzed, for example: When a new protocol needs to be used, the new protocol can be directly pre-configured, and the new protocol can be used in data transmission; For another example, when a certain protocol is not needed, the pre-configuration may not be performed before the data transmission, and details are not described herein. The pre-configuration module 10 implements plugging and unplugging and adaptation of protocols. In addition, according to actual needs, or system configuration, the pre-configuration module 10 pre-defines various routing policies to provide routing information for message transmission. Specifically, pre-configuration of various routing information and existing routing strategies are performed. The process of formulating routing information is similar and will not be described here.
所述交互模块 40, 用于对外部提供消息交互的接口, 包括接收外部所传 入的参数信息的消息接口,接收外部传入的第一消息的消息入口, 向对端设备 发送消息的消息出口, 以及调用业务逻辑进行消息响应的业务接口。  The interaction module 40 is configured to provide an interface for externally interacting with a message, including a message interface that receives parameter information that is externally transmitted, a message entry that receives an external incoming first message, and a message exit that sends a message to the peer device. And the business interface that invokes the business logic to respond to the message.
具体实现中, 所述交互模块 40提供了各种消息交互的接口, 其屏蔽了数 据传输设备内部对消息的处理 (包括消息转换, 消息路由以及协议适配等), 对外呈现给用户的仅为业务逻辑的处理,即用户只需调用数据传输设备的接口 进行初始信息的传入, 然后由数据传输设备进行一系列处理后, 返回给用户。 具体地, 用户在使用所述数据传输设备时, 首先需要通过 API ( Application Programming Interface,应用程序编程接口)调用所述交互模块 40的各种接口, 来实现数据的传输。 In a specific implementation, the interaction module 40 provides an interface for various message interactions, which shields the processing of messages (including message conversion, message routing, protocol adaptation, etc.) within the data transmission device, and presents the information to the user only The processing of the business logic, that is, the user only needs to call the interface of the data transmission device to carry in the initial information, and then the data transmission device performs a series of processing and returns to the user. Specifically, when the user uses the data transmission device, the user first needs to invoke various interfaces of the interaction module 40 through an API (Application Programming Interface) to implement data transmission.
具体地, 当所述数据传输设备应用于消息发送端时, 用户通过 API调用, 调用所述交互模块 40的消息接口, 具体如下:  Specifically, when the data transmission device is applied to the message sending end, the user invokes the message interface of the interaction module 40 through an API call, as follows:
//UserRequestBody和 UserResponseBody继承数据传输设备提供的 Body抽象 类  //UserRequestBody and UserResponseBody inherit the Body abstract class provided by the data transfer device.
Body requestBody = new UserRequestBody(); Body requestBody = new UserRequestBody();
Body responseBody = new UserResponseBody(); Body responseBody = new UserResponseBody();
IMessageSender sender = new MessageSender(); IMessageSender sender = new MessageSender();
//调用接口方法发送消息, 支持扩展的时候调用 sendToSystem() / / Call the interface method to send a message, support extension when calling sendToSystem ()
ReturnMessage message = sender. sendToAAA(requestBody, ReturnMessage message = sender. sendToAAA(requestBody,
responseBody,"AAA— Query— User"); 通过上述程序, 可调用所述交互模块 40的发送消息接口, 用户即可把消 息主体部分的 POJO对象、消息入口地址和操作码作为程序中的参数传入所述 数据传输设备中。  responseBody, "AAA- Query-User"); Through the above program, the sending message interface of the interaction module 40 can be invoked, and the user can pass the POJO object, the message entry address and the operation code of the message body part as parameters in the program. Into the data transmission device.
具体地, 当需要数据同步时的 API调用如下:  Specifically, the API calls when data synchronization is required are as follows:
Body requestBody = new UserRequestBody(); Body requestBody = new UserRequestBody();
IMessageSync syncer = new MessageSync(); IMessageSync syncer = new MessageSync();
String resultID = syncer. syncMessage(requestBody, "AAA— Query— User "," aaa. sync ") ; 通过上述程序, 可调用所述交互模块 40的同步接口, 用户即可把消息主 体部分的 POJO对象、消息入口地址和操作码作为参数传入所述数据传输设备 中。 String resultID = syncer. syncMessage(requestBody, "AAA_ Query_User"," aaa. sync ") ; Through the above program, the synchronization interface of the interaction module 40 can be called, and the user can put the POJO object of the message body part, The message entry address and the opcode are passed as parameters to the data transmission device Medium.
可以理解的是, 上述的 API调用仅为举例, 其他情况: 比如: 当所述数据 传输设备应用于接收端时,或应用于同步数据的被请求方时,其 API调用可类 似的分析, 在此不进行贅述。  It can be understood that the above API call is only an example, and other cases: For example: When the data transmission device is applied to the receiving end, or applied to the requested party of the synchronous data, the API call can be similarly analyzed. This will not be repeated.
所述同步模块 50, 用于将所述消息转换模块 20构造的第一消息的内容作 为同步数据存储至数据库, 并加载所述数据库内的所有同步数据; 根据预配置 的路由信息, 通过所述路由模块 30将所述加载的同步数据发送至对端设备, 以同步所述对端设备的数据。  The synchronization module 50 is configured to store the content of the first message constructed by the message conversion module 20 as synchronization data to a database, and load all synchronization data in the database; according to the pre-configured routing information, The routing module 30 sends the loaded synchronization data to the peer device to synchronize the data of the peer device.
具体实现中, 所述同步模块 50还会返回同步标识给同步接口的调用方, 该同步接口调用方接收到该同步标识即认为数据同步已完成, 另外, 同步接口 调用方还可根据同步标识查看本次数据同步记录,包括从数据库查看本次同步 的同步数据, 以及对对端设备的同步流程等。  In a specific implementation, the synchronization module 50 also returns a synchronization identifier to the calling party of the synchronization interface, and the synchronization interface caller considers that the data synchronization is completed after receiving the synchronization identifier, and the synchronous interface caller can also view according to the synchronization identifier. This data synchronization record includes viewing the synchronization data of this synchronization from the database, and the synchronization process to the peer device.
本发明通过将协议适配、 消息转换、 消息路由以及数据同步等功能进行封 装整合, 形成了数据传输设备, 能够支持各种协议的插拔以及支持各种路由策 略; 该数据传输设备作为一个公共组件, 既能够作为发送方进行消息的实时处 理和发送, 又可作为接收方进行消息的实时处理接收; 简化了消息的转换和实 时收发, 减少开发量以及降低开发难度; 另外, 无需对系统及交互结构进行修 改或增设相应的功能, 即可简化异步数据的同步收发, 降低了系统成本。  The invention encapsulates and integrates functions such as protocol adaptation, message conversion, message routing and data synchronization to form a data transmission device, which can support plugging and unplugging various protocols and support various routing strategies; the data transmission device as a public The component can be used as the sender to process and send the message in real time, and can be used as the receiver to receive and receive the message in real time. It simplifies the message conversion and real-time sending and receiving, reduces the development amount and reduces the development difficulty. The interaction structure can be modified or added with corresponding functions, which can simplify the synchronous sending and receiving of asynchronous data and reduce the system cost.
为了更清楚的说明本发明,下面将对数据传输设备中的同步模块进行详细 介绍。  In order to explain the present invention more clearly, the synchronization module in the data transmission device will be described in detail below.
请参见图 2, 为本发明的同步模块的实施例的结构示意图; 如图 2所示, 所述同步模块 50包括: 存储单元 501 , 加载单元 502和同步单元 503。  Referring to FIG. 2, it is a schematic structural diagram of an embodiment of a synchronization module according to the present invention. As shown in FIG. 2, the synchronization module 50 includes: a storage unit 501, a loading unit 502, and a synchronization unit 503.
所述存储单元 501 , 用于将所述消息转换模块 20构造的第一消息的内容 作为同步数据存储至数据库;  The storage unit 501 is configured to store the content of the first message constructed by the message conversion module 20 as synchronization data to a database;
具体实现中, 以预配置模块 10预配置的传输协议为 XML协议为例, 所 述消息转换模块 20, 首先根据操作码构造 XML消息的请求头, 并根据交互模 块 40中所传入的消息主体参数,将其主体的 POJO对象转换为 XML对象,结 合请求头构造成 XML请求消息; 所述存储单元 501将所述 XML消息的内容 作为同步数据, 存储于数据库中; 所述加载单元 502, 用于加载所述数据库内的所有同步数据; In a specific implementation, the transmission protocol pre-configured by the pre-configuration module 10 is an XML protocol. The message conversion module 20 first constructs a request header of an XML message according to the operation code, and according to the message body introduced in the interaction module 40. a parameter, converting a POJO object of the body into an XML object, and combining the request header into an XML request message; the storage unit 501 storing the content of the XML message as synchronization data in a database; The loading unit 502 is configured to load all synchronization data in the database;
具体实现中, 所述加载单元 502通过加载线程, 负责将数据库中的所有同 步数据进行加载, 具体地, 其可以将加载的同步数据放到阻塞数据队列中。 当 然,也可以将同步数据放到内存的其他数据队列中, 利用队列的特性进行同步 数据的存储。  In a specific implementation, the loading unit 502 is responsible for loading all the synchronization data in the database by loading the thread. Specifically, the loading unit may put the loaded synchronization data into the blocking data queue. Of course, synchronous data can also be placed in other data queues in memory, and the characteristics of the queue can be used to store synchronized data.
所述同步单元 503 , 用于根据预配置的路由信息, 通过所述路由模块 30 将所述加载单元 502加载的同步数据发送至对端设备,以同步所述对端设备的 数据。  The synchronization unit 503 is configured to send, by using the routing module 30, the synchronization data loaded by the loading unit 502 to the peer device according to the pre-configured routing information, to synchronize data of the peer device.
具体实现中, 所述同步单元 503通过读取线程, 从阻塞队列中读取数据, 并通过发送线程池的发送线程进行数据发送,发送线程根据消息入口地址参数 和预配置的路由信息,由路由模块 30将消息路由至消息出口发送至对端设备, 以同步对端设备的数据。  In a specific implementation, the synchronization unit 503 reads data from the blocking queue by reading the thread, and sends data through the sending thread of the sending thread pool, and the sending thread is routed according to the message entry address parameter and the pre-configured routing information. The module 30 routes the message to the message exit and sends it to the peer device to synchronize the data of the peer device.
上述过程中, 所述数据传输设备应用于数据同步客户端, 其采用异步方式 进行同步数据的发送, 简化了异步数据的同步发送。 可以理解的是, 当所述数 据传输设备应用于数据同步服务端时, 其数据同步过程可作类似分析,在此不 进行贅述。  In the above process, the data transmission device is applied to the data synchronization client, and the synchronous data is sent in an asynchronous manner, which simplifies the synchronous transmission of the asynchronous data. It can be understood that when the data transmission device is applied to the data synchronization server, the data synchronization process can be similarly analyzed, and details are not described herein.
本发明无需对系统及交互结构进行修改或增设相应的功能,即可简化异步 数据的同步收发, 降低了系统成本。  The invention can simplify the synchronous sending and receiving of asynchronous data without reducing the system and the interaction structure or adding corresponding functions, thereby reducing the system cost.
为了更清楚说明本发明, 下面将对本发明的数据传输方法进行详细介绍。 请参见图 3 , 为本发明的数据传输方法的第一实施例的流程图; 图 3所示 的实施例为数据传输设备应用于发送端进行消息发送的实施例; 如图 3所示, 所述方法包括:  In order to explain the present invention more clearly, the data transmission method of the present invention will be described in detail below. 3 is a flowchart of a first embodiment of a data transmission method according to the present invention. The embodiment shown in FIG. 3 is an embodiment of a data transmission device applied to a sender for message transmission. As shown in FIG. The methods include:
S101 , 预先配置传输协议和路由信息;  S101, pre-configuring a transmission protocol and routing information;
具体实现中, S101 主要用于实现各种协议的插拔, 以及实现各种路由策 略的制定。 一般地, 现有系统交互的消息主要为 XML消息, 而业务逻辑所处 理的消息格式为 POJO对象的消息, 因此, 可预先配置传输协议, 比如, 预先 配置 XML传输协议或 POJO传输协议, 以实现 XML和 POJO对象的双向转 换。 可以理解的是, 此处的协议类型仅为举例, 其他情况可进行类似分析, 比 如: 当需要使用新的协议时, 可直接进行新协议的预配置, 即可在数据传输时 使用新协议; 再比如, 当不需要某种协议时, 可在数据传输之前不进行预先配 置, 在此不进行赞述。 S101实现了协议的插拔和适配。 另外, 根据实际需要, 或系统配置,可预先制定各种路由策略,为消息的传输提供路由信息,具体地, 各种路由信息的预配置与现有利用各种路由策略进行路由信息的制定过程相 类似, 在此不进行赞述。 In the specific implementation, the S101 is mainly used to implement insertion and removal of various protocols, and to implement various routing strategies. Generally, the messages exchanged by the existing system are mainly XML messages, and the message format processed by the business logic is a message of a POJO object. Therefore, the transmission protocol can be pre-configured, for example, a pre-configured XML transmission protocol or a POJO transmission protocol is implemented. Bidirectional conversion of XML and POJO objects. It can be understood that the protocol type here is only an example, and other situations can be similarly analyzed, for example: When a new protocol needs to be used, the new protocol can be directly pre-configured, that is, during data transmission. Use the new protocol; for example, when a certain protocol is not needed, it can be pre-configured before data transmission, and no comment is given here. S101 implements the insertion and removal and adaptation of the protocol. In addition, according to actual needs, or system configuration, various routing policies may be pre-defined to provide routing information for message transmission, specifically, pre-configuration of various routing information and existing routing information using various routing policies. Similarly, no comments are made here.
5102, 接收外部所传入的参数信息;  5102, receiving parameter information that is externally transmitted;
具体实现中, 外部 (比如: 用户)可通过 API调用的方法, 将消息主体、 消息入口地址和操作码作为参数传入, S102 即接收用户传入的上述的参数信 息。  In the specific implementation, the external (for example, the user) may pass the message body, the message entry address, and the operation code as parameters through the method invoked by the API, and S102 receives the above-mentioned parameter information introduced by the user.
5103 , 根据接收的参数信息, 构造预配置的传输协议所支持的第一消息; 具体实现中, 根据操作码参数, 构造 XML的消息请求头, 再根据消息主 体参数, 结合消息请求头, 构造 XML的请求消息;  5103. Construct a first message supported by the pre-configured transport protocol according to the received parameter information. In the specific implementation, construct an XML message request header according to the opcode parameter, and then construct a XML according to the message body parameter and the message request header. Request message
5104,根据参数信息和预配置的路由信息,将第一消息路由至消息出口以 发送至对端设备。  S104: Route the first message to the message exit to send to the peer device according to the parameter information and the pre-configured routing information.
具体实现中,根据消息入口地址参数可进行 API调用,将消息发送至消息 入口, 消息入口根据预配置的路由信息, 选择相应的消息出口, 将消息转发至 所述消息出口。  In a specific implementation, an API call may be performed according to the message entry address parameter, and the message is sent to the message portal, and the message portal selects a corresponding message exit according to the pre-configured routing information, and forwards the message to the message exit.
本发明通过将协议适配、 消息转换、 消息路由以及数据同步等功能进行封 装整合, 形成了数据传输设备, 能够支持各种协议的插拔以及支持各种路由策 略; 该数据传输设备作为一个公共组件, 既能够作为发送方进行消息的实时处 理和发送, 又可作为接收方进行消息的实时处理接收; 简化了消息的转换和实 时收发, 减少开发量以及降低开发难度; 另外, 无需对系统及交互结构进行修 改或增设相应的功能, 即可简化异步数据的同步收发, 降低了系统成本。  The invention encapsulates and integrates functions such as protocol adaptation, message conversion, message routing and data synchronization to form a data transmission device, which can support plugging and unplugging various protocols and support various routing strategies; the data transmission device as a public The component can be used as the sender to process and send the message in real time, and can be used as the receiver to receive and receive the message in real time. It simplifies the message conversion and real-time sending and receiving, reduces the development amount and reduces the development difficulty. The interaction structure can be modified or added with corresponding functions, which can simplify the synchronous sending and receiving of asynchronous data and reduce the system cost.
请参见图 4, 为本发明的数据传输方法的第二实施例的流程图; 图 4所示 的实施例为数据传输设备应用于接收端进行消息接收和响应的实施例; 如图 4 所示, 所述方法包括:  Referring to FIG. 4, it is a flowchart of a second embodiment of a data transmission method according to the present invention. The embodiment shown in FIG. 4 is an embodiment of a data transmission device applied to a receiving end for message reception and response; , the method includes:
S201 , 通过消息入口接收外部的第一消息;  S201. Receive an external first message by using a message portal.
具体实现中, S201通过消息入口接收发送端所发送的第一消息, 即 XML 请求消息; 5202 , 将接收的第一消息转换为业务逻辑所支持的第二消息; 具体实现中, S202分别取出 XML请求消息中的请求头和消息主体部分, 将消息主体部分的 XML对象转换为 POJO对象, 使其成为业务逻辑所支持的 第二消息, 其第二消息包括的消息主体为 POJO对象; In a specific implementation, the S201 receives, by using a message portal, a first message sent by the sending end, that is, an XML request message; 5202. Convert the received first message into a second message supported by the service logic. In a specific implementation, the S202 separately extracts the request header and the message body part in the XML request message, and converts the XML object of the message body part into a POJO object. Making it a second message supported by the business logic, and the second message includes a message body that is a POJO object;
5203 , 根据预配置的路由信息, 调用所述业务逻辑以响应所述第二消息; 具体实现中,根据预配置的路由信息, 此处的路由信息为根据各业务逻辑 所制定的业务路由。 S203根据 S202中所取出的请求头中所包含的操作码, 以 及预配置的业务路由, 通过业务接口的调用相应的业务逻辑来响应第二消息。  S203: The service logic is invoked to respond to the second message according to the pre-configured routing information. In the specific implementation, according to the pre-configured routing information, the routing information herein is a service route that is determined according to each service logic. S203 responds to the second message by calling the corresponding service logic of the service interface according to the operation code included in the request header extracted in S202 and the pre-configured service route.
本发明通过将协议适配、 消息转换、 消息路由以及数据同步等功能进行封 装整合, 形成了数据传输设备, 能够支持各种协议的插拔以及支持各种路由策 略; 该数据传输设备作为一个公共组件, 既能够作为发送方进行消息的实时处 理和发送, 又可作为接收方进行消息的实时处理接收; 简化了消息的转换和实 时收发, 减少开发量以及降低开发难度; 另外, 无需对系统及交互结构进行修 改或增设相应的功能, 即可简化异步数据的同步收发, 降低了系统成本。  The invention encapsulates and integrates functions such as protocol adaptation, message conversion, message routing and data synchronization to form a data transmission device, which can support plugging and unplugging various protocols and support various routing strategies; the data transmission device as a public The component can be used as the sender to process and send the message in real time, and can be used as the receiver to receive and receive the message in real time. It simplifies the message conversion and real-time sending and receiving, reduces the development amount and reduces the development difficulty. The interaction structure can be modified or added with corresponding functions, which can simplify the synchronous sending and receiving of asynchronous data and reduce the system cost.
请参见图 5 , 为本发明的数据同步方法的实施例的流程图; 图 5所示实施 例为数据传输设备应用于数据同步客户端的实施例; 如图 5所示, 所述方法包 括:  Referring to FIG. 5, it is a flowchart of an embodiment of a data synchronization method according to the present invention. The embodiment shown in FIG. 5 is an embodiment of a data transmission device applied to a data synchronization client. As shown in FIG. 5, the method includes:
S301 , 预先配置传输协议和路由信息;  S301, pre-configuring a transmission protocol and routing information;
具体实现中, S301 主要用于实现各种协议的插拔, 以及实现各种路由策 略的制定。 一般地, 现有系统交互的消息主要为 XML消息, 而业务逻辑所处 理的消息格式为 POJO对象的消息, 因此, 可预先配置传输协议, 比如, 预先 配置 XML传输协议或 POJO传输协议, 以实现 XML和 POJO对象的双向转 换。 可以理解的是, 此处的协议类型仅为举例, 其他情况可进行类似分析, 比 如: 当需要使用新的协议时, 可直接进行新协议的预配置, 即可在数据传输时 使用新协议; 再比如, 当不需要某种协议时, 可在数据传输之前不进行预先配 置, 在此不进行赞述。 S301实现了协议的插拔和适配。 另外, 根据实际需要, 或系统配置,可预先制定各种路由策略,为消息的传输提供路由信息,具体地, 各种路由信息的预配置与现有利用各种路由策略进行路由信息的制定过程相 类似, 在此不进行赞述。 5302, 接收外部传入的参数信息; In specific implementation, S301 is mainly used to implement plugging and unplugging of various protocols and to implement various routing strategies. Generally, the messages exchanged by the existing system are mainly XML messages, and the message format processed by the business logic is a message of a POJO object. Therefore, the transmission protocol can be pre-configured, for example, a pre-configured XML transmission protocol or a POJO transmission protocol is implemented. Bidirectional conversion of XML and POJO objects. It can be understood that the protocol type here is only an example, and other situations can be similarly analyzed, for example: When a new protocol needs to be used, the new protocol can be directly pre-configured, and the new protocol can be used in data transmission; For another example, when a certain protocol is not needed, the pre-configuration may not be performed before the data transmission, and no comment is made here. S301 implements the insertion and removal and adaptation of the protocol. In addition, according to actual needs, or system configuration, various routing policies may be pre-defined to provide routing information for message transmission, specifically, pre-configuration of various routing information and existing routing information using various routing policies. Similarly, no comments are made here. 5302, receiving externally passed parameter information;
具体实现中, 外部(比如: 用户)可通过 API调用的方法, 调用数据传输 设备的同步接口, 将消息主体、 消息入口地址和操作码作为参数传入, S302 即接收用户传入的上述的参数信息。  In the specific implementation, the external (for example: the user) can invoke the synchronization interface of the data transmission device by using the method invoked by the API, and the message body, the message entry address, and the operation code are input as parameters, and S302 receives the above-mentioned parameter passed by the user. information.
5303 , 根据接收的参数, 构造预配置的传输协议所支持的第一消息; 具体实现中, 根据操作码参数, 构造 XML的消息请求头, 再根据消息主 体参数, 结合消息请求头, 构造 XML的请求消息;  5303. Construct a first message supported by the pre-configured transport protocol according to the received parameter. In the specific implementation, construct an XML message request header according to the opcode parameter, and then construct a XML according to the message body parameter and the message request header. Request message
5304, 将所述第一消息的内容作为同步数据存储于数据库;  5304. Store the content of the first message as synchronization data in a database.
5305 , 返回同步标识给 API接口调用方;  5305, returning the synchronization identifier to the API interface caller;
具体实现中, 由于外部(比如: 用户)通过 API调用的方法, 调用数据传 输设备的同步接口来实现数据的同步, 当所述外部 (比如: 用户 )通过 API 调用同步接口传入相应参数后, 所述数据传输设备即返回同步标识给外部 (比 如: 用户), 即 API接口调用方, API接口调用方接收到该同步标识即认为数 据同步已完成, 另外, API接口调用方还可根据同步标识查看本次数据同步记 录, 包括从数据库查看本次同步的同步数据, 以及同步流程等。  In a specific implementation, since an external (for example, a user) invokes a synchronous interface of the data transmission device to implement data synchronization by using an API call method, when the external (eg, user) invokes the synchronization interface through the API, the corresponding parameter is input. The data transmission device returns the synchronization identifier to the outside (for example: the user), that is, the API interface caller, and the API interface caller receives the synchronization identifier, that is, the data synchronization is completed, and the API interface caller can also use the synchronization identifier. View this data synchronization record, including viewing the synchronization data of this synchronization from the database, as well as the synchronization process.
5306, 加载所述数据库内的所有同步数据;  5306, loading all the synchronization data in the database;
具体实现中, 通过加载线程, 将数据库中的所有同步数据进行加载, 具体 地, 其可以将加载的同步数据放到阻塞数据队列中。 当然, 也可以将同步数据 放到内存的其他的数据队列中, 利用队列的特性进行同步数据的存储。  In a specific implementation, all the synchronization data in the database is loaded by loading the thread, and specifically, the loaded synchronization data can be put into the blocking data queue. Of course, it is also possible to put the synchronous data into other data queues in the memory, and use the characteristics of the queue to store the synchronized data.
5307, 根据预配置的路由信息, 将同步数据发送至对端设备, 以同步所述 对端设备的数据。  5307. Send synchronization data to the peer device according to the pre-configured routing information, to synchronize data of the peer device.
具体实现中, S307 通过读取线程, 从阻塞队列中读取数据, 再通过发送 线程池的发送线程进行数据发送,发送线程根据消息入口地址参数和预配置的 路由信息, 由路由模块 30将消息路由消息出口发送给对端设备, 以同步对端 设备的数据。  In a specific implementation, the S307 reads the data from the blocking queue by reading the thread, and then sends the data through the sending thread of the sending thread pool, and the sending thread sends the message by the routing module 30 according to the message entry address parameter and the pre-configured routing information. The routing message exit is sent to the peer device to synchronize the data of the peer device.
具体地,当数据传输设备应用于同步数据服务端进行同步数据接收并同步 时, 其具体过程可参照数据传输设备应用于接收端以及数据同步客户端的流 程, 在此不进行赞述。  Specifically, when the data transmission device is applied to the synchronous data server for synchronous data reception and synchronization, the specific process may refer to the process of the data transmission device applied to the receiving end and the data synchronization client, and is not described herein.
通过上述各实施例的描述, 本发明通过将协议适配、 消息转换、 消息路由 以及数据同步等功能进行封装整合, 形成了数据传输设备, 能够支持各种协议 的插拔以及支持各种路由策略; 该数据传输设备作为一个公共组件, 既能够作 为发送方进行消息的实时处理和发送,又可作为接收方进行消息的实时处理接 收; 简化了消息的转换和实时收发, 减少开发量以及降低开发难度; 另外, 无 需对系统及交互结构进行修改或增设相应的功能,即可简化异步数据的同步收 发, 降低了系统成本。 Through the description of the above embodiments, the present invention through protocol adaptation, message conversion, message routing And data synchronization and other functions for package integration, forming a data transmission device, capable of supporting plugging and unplugging of various protocols and supporting various routing strategies; the data transmission device as a common component can be used as a sender for real-time processing of messages and Sending, and can be used as a receiver to receive and receive messages in real time; simplifying message conversion and real-time sending and receiving, reducing development and reducing development difficulty; In addition, it can be simplified without modifying the system and interaction structure or adding corresponding functions. Synchronous transmission and reception of asynchronous data reduces system cost.
以上所揭露的仅为本发明一种较佳实施例而已,当然不能以此来限定本发 明之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流 程, 并依本发明权利要求所作的等同变化, 仍属于发明所涵盖的范围。  The above is only a preferred embodiment of the present invention, and of course, the scope of the present invention is not limited thereto, and those skilled in the art can understand all or part of the process of implementing the above embodiments, and according to the present invention. The equivalent changes required are still within the scope of the invention.

Claims

权 利 要 求 Rights request
1、 一种数据传输设备, 其特征在于, 包括:  A data transmission device, comprising:
消息转换模块, 用于根据接收的参数信息,构造预配置的传输协议所支持 的第一消息, 或将接收的第一消息转换为业务逻辑所支持的第二消息;  a message conversion module, configured to construct, according to the received parameter information, a first message supported by the pre-configured transport protocol, or convert the received first message into a second message supported by the service logic;
路由模块,用于将所述消息转换模块构造的第一消息路由至消息出口以发 送至对端设备, 或调用所述业务逻辑以响应所述消息转换模块转换的第二消 息。  And a routing module, configured to route the first message constructed by the message conversion module to the message exit to send to the peer device, or invoke the service logic to respond to the second message converted by the message conversion module.
2、 如权利要求 1所述的设备, 其特征在于, 还包括: 2. The device according to claim 1, further comprising:
预配置模块, 用于预先配置传输协议和路由信息。  Pre-configuration module for pre-configuring transport protocols and routing information.
3、 如权利要求 2所述的设备, 其特征在于, 还包括: 3. The device according to claim 2, further comprising:
交互模块, 用于对所述数据传输设备的外部提供消息交互的接口, 所述接 口包括接收所述数据传输设备外部传入的参数信息的消息接口,接收所述数据 传输设备外部传入的第一消息的消息入口, 向对端设备发送消息的消息出口, 以及调用业务逻辑进行消息响应的业务接口。  An interaction module, configured to provide an interface for message interaction to the outside of the data transmission device, where the interface includes a message interface that receives parameter information externally transmitted by the data transmission device, and receives an externally transmitted The message entry of a message, the message exit of the message sent to the peer device, and the service interface that invokes the service logic to respond to the message.
4、 如权利要求 3任一项所述的设备, 其特征在于, 还包括: 4. The device according to any one of claims 3, further comprising:
同步模块,用于将所述消息转换模块构造的第一消息的内容作为同步数据 存储至数据库,加载所述数据库内的所有同步数据;并根据预配置的路由信息, 通过所述路由模块将加载的同步数据发送至对端设备,以同步所述对端设备的 数据。  a synchronization module, configured to store the content of the first message constructed by the message conversion module as synchronization data to a database, load all synchronization data in the database; and load the data through the routing module according to the pre-configured routing information. The synchronization data is sent to the peer device to synchronize the data of the peer device.
5、 如权利要求 4所述的设备, 其特征在于, 所述同步模块包括: 存储单元,用于将所述消息转换模块构造的第一消息的内容作为同步数据 存储至数据库; The device of claim 4, wherein the synchronization module comprises: a storage unit, configured to store the content of the first message constructed by the message conversion module as synchronization data to a database;
加载单元, 用于加载所述数据库内的所有同步数据;  a loading unit, configured to load all synchronization data in the database;
同步单元, 用于根据预配置的路由信息,通过所述路由模块将所述加载单 元加载的同步数据发送至对端设备, 以同步所述对端设备的数据。 The synchronization unit is configured to send, by using the routing module, the synchronization data loaded by the loading unit to the peer device according to the pre-configured routing information, to synchronize data of the peer device.
6、 一种数据传输方法, 其特征在于: 6. A data transmission method, characterized in that:
根据接收的参数信息, 构造预配置的传输协议所支持的第一消息; 根据所述接收的参数信息和预配置的路由信息,将所述第一消息路由至消 息出口以发送至对端设备。  And configuring, according to the received parameter information, a first message supported by the pre-configured transport protocol; and routing the first message to the message exit to send to the peer device according to the received parameter information and the pre-configured routing information.
7、 如权利要求 6所述的方法, 其特征在于, 所述根据接收的参数信息, 构造预配置的传输协议所支持的第一消息之前, 还包括: The method according to claim 6, wherein the constructing the first message supported by the pre-configured transport protocol according to the received parameter information further includes:
接收传入的参数信息, 所述参数信息包括消息主体、 消息入口地址和操作 码。  The incoming parameter information is received, and the parameter information includes a message body, a message entry address, and an operation code.
8、 如权利要求 7所述的方法, 其特征在于, 所述接收传入的参数信息之 前, 还包括: The method according to claim 7, wherein the receiving the incoming parameter information further includes:
预先配置传输协议和路由信息。  Pre-configure transport protocols and routing information.
9、 一种数据传输方法, 其特征在于: 9. A data transmission method, characterized in that:
将接收的第一消息转换为业务逻辑所支持的第二消息;  Converting the received first message into a second message supported by the business logic;
根据预配置的路由信息, 调用所述业务逻辑以响应所述第二消息。  The business logic is invoked in response to the second message based on pre-configured routing information.
10、 如权利要求 9所述的方法, 其特征在于, 所述将接收的第一消息转换 为业务逻辑所支持的第二消息之前, 包括: The method according to claim 9, wherein the converting the received first message to the second message supported by the service logic comprises:
通过消息入口接收传入的第一消息。  The incoming first message is received through the message portal.
11、 一种数据同步方法, 其特征在于: 11. A data synchronization method, characterized in that:
根据接收的参数信息, 构造预配置的传输协议所支持的第一消息; 将所述第一消息的内容作为同步数据存储于数据库,并加载所述数据库内 的所有同步数据;  Constructing, according to the received parameter information, a first message supported by the pre-configured transport protocol; storing the content of the first message as synchronization data in a database, and loading all the synchronization data in the database;
根据预配置的路由信息,将加载的同步数据发送至对端设备, 以同步所述 对端设备的数据。 The loaded synchronization data is sent to the peer device according to the pre-configured routing information to synchronize the data of the peer device.
12、 如权利要求 11所述的方法, 其特征在于, 根据接收的参数信息, 构 造预配置的传输协议所支持的第一消息之前, 还包括: The method according to claim 11, wherein before the constructing the first message supported by the pre-configured transport protocol, the method further includes:
预先配置传输协议和路由信息;  Pre-configure the transport protocol and routing information;
接收传入的参数信息, 所述参数信息包括消息主体、 入口地址和操作码。  The incoming parameter information is received, and the parameter information includes a message body, an entry address, and an operation code.
PCT/CN2011/070380 2010-02-01 2011-01-19 Data transmission device, data transmission method and data synchronization method WO2011091731A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201019164030.5A CN101854401A (en) 2010-02-01 2010-02-01 Data transmission equipment and method and data synchronization method
CN201019164030.5 2010-02-01

Publications (1)

Publication Number Publication Date
WO2011091731A1 true WO2011091731A1 (en) 2011-08-04

Family

ID=42805664

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/070380 WO2011091731A1 (en) 2010-02-01 2011-01-19 Data transmission device, data transmission method and data synchronization method

Country Status (2)

Country Link
CN (1) CN101854401A (en)
WO (1) WO2011091731A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105141617A (en) * 2015-09-14 2015-12-09 上海华为技术有限公司 Deploying and adjusting method for service functions among data centers and deploying and adjusting device for service functions among data centers
TWI629911B (en) * 2017-06-15 2018-07-11 中華電信股份有限公司 Synchronous signal transmission path adaptive change system and method
CN111708568A (en) * 2020-05-06 2020-09-25 福建天泉教育科技有限公司 Component development decoupling method and terminal
CN112235398A (en) * 2020-10-12 2021-01-15 南威软件股份有限公司 Data transmission method supporting large data volume

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854401A (en) * 2010-02-01 2010-10-06 深圳市同洲电子股份有限公司 Data transmission equipment and method and data synchronization method
CN104063285B (en) * 2014-01-13 2017-06-23 惠州华阳通用电子有限公司 A kind of message broadcast communication method based between vehicle-mounted software platform process inner module
CN104615490A (en) * 2015-02-05 2015-05-13 浪潮集团有限公司 Method and device for data conversion
CN107635009A (en) * 2017-10-10 2018-01-26 山东浪潮云服务信息科技有限公司 Method of servicing, system, request of data device and the data supplying device of middleware

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1764166A (en) * 2005-11-16 2006-04-26 北京金山软件有限公司 Client system with compatible multi instantaneous communication tool and instantaneous communication method
CN1997173A (en) * 2006-12-22 2007-07-11 深圳市戴文科技有限公司 Implementation system and method for data synchronization of the mobile terminal
CN101150584A (en) * 2007-10-31 2008-03-26 中兴通讯股份有限公司 A multi-protocol conversion device and method for SMS gateway
CN101854401A (en) * 2010-02-01 2010-10-06 深圳市同洲电子股份有限公司 Data transmission equipment and method and data synchronization method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1764166A (en) * 2005-11-16 2006-04-26 北京金山软件有限公司 Client system with compatible multi instantaneous communication tool and instantaneous communication method
CN1997173A (en) * 2006-12-22 2007-07-11 深圳市戴文科技有限公司 Implementation system and method for data synchronization of the mobile terminal
CN101150584A (en) * 2007-10-31 2008-03-26 中兴通讯股份有限公司 A multi-protocol conversion device and method for SMS gateway
CN101854401A (en) * 2010-02-01 2010-10-06 深圳市同洲电子股份有限公司 Data transmission equipment and method and data synchronization method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105141617A (en) * 2015-09-14 2015-12-09 上海华为技术有限公司 Deploying and adjusting method for service functions among data centers and deploying and adjusting device for service functions among data centers
CN105141617B (en) * 2015-09-14 2018-06-15 上海华为技术有限公司 The deployment method of adjustment and device of service function body between a kind of data center
TWI629911B (en) * 2017-06-15 2018-07-11 中華電信股份有限公司 Synchronous signal transmission path adaptive change system and method
CN111708568A (en) * 2020-05-06 2020-09-25 福建天泉教育科技有限公司 Component development decoupling method and terminal
CN111708568B (en) * 2020-05-06 2023-07-07 福建天泉教育科技有限公司 Modularized development decoupling method and terminal
CN112235398A (en) * 2020-10-12 2021-01-15 南威软件股份有限公司 Data transmission method supporting large data volume

Also Published As

Publication number Publication date
CN101854401A (en) 2010-10-06

Similar Documents

Publication Publication Date Title
WO2011091731A1 (en) Data transmission device, data transmission method and data synchronization method
US10455293B2 (en) Methods and apparatus to provide messages to television users
TWI397277B (en) System and method for unified messaging service
KR20060011963A (en) Omnimodal messaging system
US8356083B2 (en) System and method for transmitting and receiving a call on a home network
US8620353B1 (en) Automatic sharing and publication of multimedia from a mobile device
WO2011150818A1 (en) Common message header bearer method and device for converting simple object access protocol application programming interface (soap api) into representional state transfer application programming interface (rest api)
WO2013097401A1 (en) Method, gateway and communication system for browser client directly communicating with back-end server
WO2017101298A1 (en) Input method and apparatus for audio and video information, network television, and user equipment
US10116988B2 (en) Signal transmission device and method for controlling same
WO2015176648A1 (en) Method and device for transmitting data in intelligent terminal to television terminal
CN102549968A (en) Apparatus and method for interfacing between a remote user interface server and a remote user interface client
EP2866385A2 (en) Error code conversion method and system, pppoe server and mobile terminal
WO2010127531A1 (en) Apparatus, web service component and method based on web service
WO2011140754A1 (en) Method and system for realizing wireless usb flash disk
WO2012088906A1 (en) Intercommunication method and system for internet of things terminals
KR20110025012A (en) Apparatus and method for maching user interface in a local network
WO2016177121A1 (en) File transmission method and device, and application server
CN102833436A (en) Method and system for achieving VOIP (Voice over Internet Phone) agency
WO2013152677A1 (en) Resource sharing method and device
WO2013110222A1 (en) Preview control method, control terminal, and smart television
CN102082973A (en) Voice message implementation method and system for network television
WO2014017455A1 (en) Communication system, method, and program
CN103442256B (en) A kind of method and system that electric program menu is realized based on HTML5
CN102857482A (en) Method and system for transmitting data on basis of multiple servers

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: 11736613

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11736613

Country of ref document: EP

Kind code of ref document: A1