Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
See also Fig. 1, be the structural representation of the embodiment of data transmission set of the present invention; As shown in Figure 1, described data transmission set comprises: message conversion module 20 and routing module 30.
In the specific implementation, described data transmission set can be used as common component, is applied to transmitting terminal, receiving terminal, client and service end.Such as: in digital TV receiving system, described data transmission set can be applicable to server end, it is as the sender of message, by described transmission equipment is that receiving terminal for digital television sends corresponding message, described receiving terminal for digital television includes but not limited to: set-top box (Set Top Box, STB), IPTV (Internet Protocol Television, Web TV), Digital Video Broadcasting Handheld, digital TV integrated machine etc. have the terminal of receiving digital television function.For another example: described data transmission set also can be applicable to receiving terminal for digital television, and it by the message of described transmission equipment receiving front-end server transmission, and calls the response that correspondent service logic is carried out message as the recipient of message.Be understandable that only for giving an example, other applicable cases can similarly be analyzed, and do not give unnecessary details at this in the application of data transmission set herein.
See also Fig. 1 again:
Described message conversion module 20 is used for constructing first message that pre-configured host-host protocol is supported according to the parameter information that receives, and first message conversion that maybe will receive is second message that service logic is supported;
In the specific implementation, described parameter information comprises source body (Body), message entry address and command code.
Described routing module 30 is used for first message with described message conversion module 20 structures and routes to the message outlet being sent to opposite equip., or calls described service logic to respond second message of described message conversion module 20 conversions.
Further as shown in Figure 1, described data transmission set also comprises: pre-configured module 10, interactive module 40 and synchronization module 50.
Described pre-configured module 10 is used for pre-configured host-host protocol and routing iinformation; In the specific implementation, described pre-configured module 10 is mainly used in the plug that realizes variety of protocol, and the formulation that realizes various routing policies.Usually, the existing system interactive messages is mainly XML message, and the handled message format of service logic is the message of POJO object, therefore, the pre-configured host-host protocol of described pre-configured module 10 meetings, such as, pre-configured XML host-host protocol or POJO host-host protocol, so that described message conversion module 20 according to pre-configured agreement, realizes the bi-directional conversion of XML and POJO object.Be understandable that only for giving an example, other situations can be carried out similar analysis to protocol type herein, such as: when needs use new agreement, the pre-configured of New Deal can be directly carried out, New Deal can be when transfer of data, used; For another example, when not needing certain agreement, can before transfer of data, not carry out pre-configuredly, do not give unnecessary details at this.Described pre-configured module 10 has realized the plug of agreement and adaptive.In addition, according to actual needs, or system configuration, described pre-configured module 10 pre-establishes various routing policies, for the transmission of message provides routing iinformation, particularly, the pre-configured and existing formulation process that utilizes various routing policies to carry out routing iinformation of various routing iinformations is similar, does not give unnecessary details at this.
Described interactive module 40, be used for the outside mutual interface that gives information, comprise the message interface that receives the outside parameter information that is imported into, receive the message inlet of outside first message of importing into, send the message outlet of message to opposite equip., and call the business interface that service logic is carried out message response.
In the specific implementation, described interactive module 40 provides the interface of various interacting messages, it has shielded data transmission set inside the processing of message (has been comprised message conversion, message route and protocol adaptation etc.), that externally presents to the user only is the processing of service logic, be that the interface that the user only need call data transmission set carries out importing into of initial information, carry out a series of processing by data transmission set then after, return to the user.Particularly, the user at first needs to call by API (ApplicationProgramming Interface, application programming interface) various interface of described interactive module 40 when using described data transmission set, realize the transmission of data.
Particularly, when described data transmission set was applied to message sending end, the user calls the message interface of described interactive module 40 by API Calls, and was specific as follows:
//UserRequestBody and UserResponseBody inherit the Body abstract class that data transmission set provides
Body?requestBody=new?UserRequestBody();
Body?responseBody=new?UserResponseBody();
IMessageSender?sender=new?MessageSender();
// calling interface method sends message, calls sendToSystem () when supporting expansion
ReturnMessage?message=sender.sendToAAA(requestBody,
responseBody,″AAA_Query_User″);
By said procedure, can call the transmission message interface of described interactive module 40, the user can be imported POJO object, message entry address and the command code of source body part in the described data transmission set into as the parameter in the program.
Particularly, the API Calls when needing data sync is as follows:
Body?requestBody=new?UserRequestBody();
IMessageSync?syncer=new?MessageSync();
String?resultID=syncer.syncMessage(requestBody,″AAA_Query_User″,″aaa.sync″);
By said procedure, can call the sync cap of described interactive module 40, the user can be imported POJO object, message entry address and the command code of source body part in the described data transmission set into as parameter.
Be understandable that above-mentioned API Calls is only for for example, other situations: such as: when described data transmission set is applied to receiving terminal, or when being applied to the Requested Party of synchrodata, its API Calls can similarly be analyzed, and does not give unnecessary details at this.
Described synchronization module 50 is used for the content of first message of described message conversion module 20 structures is stored to database as synchrodata, and loads all synchrodatas in the described database; According to pre-configured routing iinformation, by described routing module 30 synchrodata of described loading is sent to opposite equip., with the data of synchronous described opposite equip..
In the specific implementation, described synchronization module 50 also can return the called side that sync id is given sync cap, this sync cap called side receives this sync id and thinks that promptly data sync finishes, in addition, the sync cap called side also can be checked this data sync record according to sync id, comprise from database and check this subsynchronous synchrodata, and to the synchronous flow process of opposite equip. etc.
The present invention has formed data transmission set by functions such as protocol adaptation, message conversion, message route and data sync are encapsulated integration, can support the plug of variety of protocol and support various routing policies; This data transmission set can either carry out the real-time processing and the transmission of message as transmit leg as a common component, can be used as the real-time processing reception that the recipient carries out message again; Simplified the conversion and the real-time tranception of message, reduced the exploitation amount and reduce development difficulty; In addition, need not system and interactive structure are made amendment or set up function corresponding, can simplify the synchronous transmitting-receiving of asynchronous data, reduced system cost.
For clearer explanation the present invention, will the synchronization module in the data transmission set be described in detail below.
See also Fig. 2, be the structural representation of the embodiment of synchronization module of the present invention; As shown in Figure 2, described synchronization module 50 comprises: memory cell 501, loading unit 502 and lock unit 503.
Described memory cell 501 is used for the content of first message of described message conversion module 20 structures is stored to database as synchrodata;
In the specific implementation, with pre-configured module 10 pre-configured host-host protocols is that the XML agreement is an example, described message conversion module 20, at first construct the request header of XML message according to command code, and according to the source body parameter of being imported in the interactive module 40, the POJO object of its main body is converted to the XML object, is configured to the XML request message in conjunction with request header; Described memory cell 501 as synchrodata, is stored in the content of described XML message in the database;
Described loading unit 502 is used to load all synchrodatas in the described database;
In the specific implementation, described loading unit 502 is responsible for all synchrodatas in the database are loaded by loading thread, and particularly, it can be put into the synchrodata that loads in the blocking data formation.Certainly, also synchrodata can be put in other data queues of internal memory, utilize the characteristic of formation to carry out the storage of synchrodata.
Described lock unit 503 is used for according to pre-configured routing iinformation, by described routing module 30 synchrodata that described loading unit 502 loads is sent to opposite equip., with the data of synchronous described opposite equip..
In the specific implementation, described lock unit 503 is by reading thread, reading of data from block formation, and carry out data by the transmission thread that sends thread pool and send, send thread according to message entry address parameter and pre-configured routing iinformation, forward the message to the message outlet by routing module 30 and be sent to opposite equip., with the data of synchronous opposite equip..
In the said process, described data transmission set is applied to the data sync client end, and it adopts asynchronous system to carry out the transmission of synchrodata, has simplified the synchronized transmission of asynchronous data.Be understandable that when described data transmission set was applied to the data synchronization service end, its data synchronization process can be made similar analysis, does not give unnecessary details at this.
The present invention need not system and interactive structure are made amendment or set up function corresponding, can simplify the synchronous transmitting-receiving of asynchronous data, has reduced system cost.
In order more to clearly demonstrate the present invention, will describe in detail to data transmission method of the present invention below.
See also Fig. 3, be the flow chart of first embodiment of data transmission method of the present invention; Embodiment shown in Figure 3 carries out the embodiment that message sends for data transmission set is applied to transmitting terminal; As shown in Figure 3, described method comprises:
S101, pre-configured host-host protocol and routing iinformation;
In the specific implementation, S101 is mainly used in the plug that realizes variety of protocol, and the formulation that realizes various routing policies.Usually, the existing system interactive messages is mainly XML message, and the handled message format of service logic is the message of POJO object, therefore, can pre-configured host-host protocol, such as, pre-configured XML host-host protocol or POJO host-host protocol are to realize the bi-directional conversion of XML and POJO object.Be understandable that only for giving an example, other situations can be carried out similar analysis to protocol type herein, such as: when needs use new agreement, the pre-configured of New Deal can be directly carried out, New Deal can be when transfer of data, used; For another example, when not needing certain agreement, can before transfer of data, not carry out pre-configuredly, do not give unnecessary details at this.S101 has realized the plug of agreement and adaptive.In addition, according to actual needs, or system configuration, can pre-establish various routing policies, for the transmission of message provides routing iinformation, particularly, pre-configured and the existing formulation process that utilizes various routing policies to carry out routing iinformation of various routing iinformations is similar, does not give unnecessary details at this.
S102 receives the outside parameter information that is imported into;
In the specific implementation, outside (such as: the user) can source body, message entry address and command code be imported into as parameter by the method for API Calls, S102 promptly receives the above-mentioned parameter information that the user is imported into.
S103 according to the parameter information that receives, constructs first message that pre-configured host-host protocol is supported;
In the specific implementation, according to the command code parameter, the message request head of structure XML, again according to the source body parameter, in conjunction with the message request head, the request message of structure XML;
S104 according to parameter information and pre-configured routing iinformation, routes to the message outlet to be sent to opposite equip. with first message.
In the specific implementation, can carry out API Calls according to message entry address parameter, message is sent to the message inlet, message enters the mouth according to pre-configured routing iinformation, selects corresponding message outlet, and forwards to described message is exported.
The present invention has formed data transmission set by functions such as protocol adaptation, message conversion, message route and data sync are encapsulated integration, can support the plug of variety of protocol and support various routing policies; This data transmission set can either carry out the real-time processing and the transmission of message as transmit leg as a common component, can be used as the real-time processing reception that the recipient carries out message again; Simplified the conversion and the real-time tranception of message, reduced the exploitation amount and reduce development difficulty; In addition, need not system and interactive structure are made amendment or set up function corresponding, can simplify the synchronous transmitting-receiving of asynchronous data, reduced system cost.
See also Fig. 4, be the flow chart of second embodiment of data transmission method of the present invention; Embodiment shown in Figure 4 is applied to the embodiment that receiving terminal carries out message sink and response for data transmission set; As shown in Figure 4, described method comprises:
S201 receives the first outside message by the message inlet;
In the specific implementation, S201 is by message inlet first message that receiving end/sending end sent, i.e. XML request message;
S202 is second message that service logic is supported with first message conversion that receives;
In the specific implementation, S202 takes out request header and the source body part in the XML request message respectively, the XML object of source body part is converted to the POJO object, makes it become second message that service logic is supported, the source body that its second message comprises is the POJO object;
S203 according to pre-configured routing iinformation, calls described service logic to respond described second message;
In the specific implementation, according to pre-configured routing iinformation, the professional route of routing iinformation herein for formulating according to each service logic.S203 is according to the command code that is comprised in the request header that is taken out among the S202, and pre-configured professional route, and the correspondent service logic of calling by business interface responds second message.
The present invention has formed data transmission set by functions such as protocol adaptation, message conversion, message route and data sync are encapsulated integration, can support the plug of variety of protocol and support various routing policies; This data transmission set can either carry out the real-time processing and the transmission of message as transmit leg as a common component, can be used as the real-time processing reception that the recipient carries out message again; Simplified the conversion and the real-time tranception of message, reduced the exploitation amount and reduce development difficulty; In addition, need not system and interactive structure are made amendment or set up function corresponding, can simplify the synchronous transmitting-receiving of asynchronous data, reduced system cost.
See also Fig. 5, be the flow chart of the embodiment of method of data synchronization of the present invention; The embodiment that is applied to the data sync client end for data transmission set embodiment illustrated in fig. 5; As shown in Figure 5, described method comprises:
S301, pre-configured host-host protocol and routing iinformation;
In the specific implementation, S301 is mainly used in the plug that realizes variety of protocol, and the formulation that realizes various routing policies.Usually, the existing system interactive messages is mainly XML message, and the handled message format of service logic is the message of POJO object, therefore, can pre-configured host-host protocol, such as, pre-configured XML host-host protocol or POJO host-host protocol are to realize the bi-directional conversion of XML and POJO object.Be understandable that only for giving an example, other situations can be carried out similar analysis to protocol type herein, such as: when needs use new agreement, the pre-configured of New Deal can be directly carried out, New Deal can be when transfer of data, used; For another example, when not needing certain agreement, can before transfer of data, not carry out pre-configuredly, do not give unnecessary details at this.S301 has realized the plug of agreement and adaptive.In addition, according to actual needs, or system configuration, can pre-establish various routing policies, for the transmission of message provides routing iinformation, particularly, pre-configured and the existing formulation process that utilizes various routing policies to carry out routing iinformation of various routing iinformations is similar, does not give unnecessary details at this.
S302 receives the outside parameter information that imports into;
In the specific implementation, outside (such as: the user) can call the sync cap of data transmission set by the method for API Calls, source body, message entry address and command code are imported into as parameter, S302 promptly receives the above-mentioned parameter information that the user is imported into.
S303 according to the parameter that receives, constructs first message that pre-configured host-host protocol is supported;
In the specific implementation, according to the command code parameter, the message request head of structure XML, again according to the source body parameter, in conjunction with the message request head, the request message of structure XML;
S304 is stored in database with the content of described first message as synchrodata;
S305 returns sync id and gives the api interface called side;
In the specific implementation, because outside (such as: the user) method by API Calls, the sync cap of calling data transmission set realizes data synchronization, when described outside (such as: the user) import relevant parameter into by the API Calls sync cap after, described data transmission set promptly return sync id give outside (such as: the user), it is the api interface called side, the api interface called side receives this sync id and thinks that promptly data sync finishes, in addition, the api interface called side also can be checked this data sync record according to sync id, comprise from database and check the synchrodata that this is subsynchronous, and synchronous flow process etc.
S306 loads all synchrodatas in the described database;
In the specific implementation, by loading thread, all synchrodatas in the database are loaded, particularly, it can be put into the synchrodata that loads in the blocking data formation.Certainly, also synchrodata can be put in other the data queue of internal memory, utilize the characteristic of formation to carry out the storage of synchrodata.
S307, the routing iinformation according to pre-configured is sent to opposite equip. with synchrodata, with the data of synchronous described opposite equip..
In the specific implementation, S307 is by reading thread, reading of data from block formation, carrying out data by the transmission thread that sends thread pool again sends, send thread according to message entry address parameter and pre-configured routing iinformation, by routing module 30 outlet of message route messages is sent to opposite equip., with the data of synchronous opposite equip..
Particularly, when data transmission set is applied to that the sync data service end carries out that synchrodata receives and synchronously the time, but its detailed process comparable data transmission equipment is applied to the flow process of receiving terminal and data sync client end, does not give unnecessary details at this.
By the description of the various embodiments described above, the present invention has formed data transmission set by functions such as protocol adaptation, message conversion, message route and data sync are encapsulated integration, can support the plug of variety of protocol and support various routing policies; This data transmission set can either carry out the real-time processing and the transmission of message as transmit leg as a common component, can be used as the real-time processing reception that the recipient carries out message again; Simplified the conversion and the real-time tranception of message, reduced the exploitation amount and reduce development difficulty; In addition, need not system and interactive structure are made amendment or set up function corresponding, can simplify the synchronous transmitting-receiving of asynchronous data, reduced system cost.
Above disclosed only is a kind of preferred embodiment of the present invention, certainly can not limit the present invention's interest field with this, one of ordinary skill in the art will appreciate that all or part of flow process that realizes the foregoing description, and, still belong to the scope that invention is contained according to the equivalent variations that claim of the present invention is done.