The application is submission on October 14th, 2013 Patent Office of the People's Republic of China, application No. is 201310478640.9, denominations of invention
For a kind of divisional application of the Chinese patent application of " method and apparatus for realizing message transmission between heterogeneous system ".
Specific embodiment
With internet, the fast development of e-commerce industry, generally require to carry out between IT system large-scale asynchronous
Data exchange.The exchange of asynchronous data is carried out often through the mode of message.However, between different enterprises, different IT systems
Between, often use different message-oriented middlewares.Cause these message to have differences in terms of grammer, semanteme, leads to its nothing
Method is effectively interacted between enterprise, between IT system.
The main idea of the present application lies in that directly realizing that the message of two levels of syntax and semantics turns between interaction both sides
It changes, and by cancelling intermediates message, improves efficiency, improving performance.
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with the application specific embodiment and
Technical scheme is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the application one
Section Example, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall in the protection scope of this application.
The system architecture of the ESB of the prior art is schematically shown below with reference to Fig. 1, Fig. 1.
As shown in Figure 1, ESB 150 and B2B gateway, enterprises service composer 130, service routing catalogue 160, enterprises service
Catalogue 190 together, constitutes the base for being used for SOA (service-oriented architecture, Services Oriented Achitecture)
Infrastructure component.The infrastructure component form enterprises service requester 120 and enterprises service provider 180 it
Between and the intermediary between enterprise external service requester 110 and enterprise external service provider 170.In brief, 150 ESB
It is exactly the intermediary of a service, forms service user -> ESB service broker -> ISP biological chain.
The basic function of ESB 150 is data transmission, messaging protocol conversion (or message transmission), three big core function of routing
Energy.When carrying out the integration of heterogeneous system, these functions often are provided by ESB 150 as needed.It can integrate in ESB 150
The function of conventional message middleware.
The principle of middleware Technology and message-oriented middleware technology is briefly described below.
With reference to Fig. 2, Fig. 2 schematically shows the schematic diagrams of the middleware of the prior art.
IT system A, IT system B and middleware 240 are shown in Fig. 2.By taking system A as an example, as shown in Fig. 2, middleware 240
On operating system 220-a and hardware 230-a, using 210-a under.
In Fig. 2, system A's is communicated with the application 210-b of system B by middleware 240 using 210-a.It is intermediate
Part 240 just looks like to be using 210-a and using the bus between 210-b.Pass through centre using 210-a and using 210-b
240 shared resource of part.
Fig. 3 schematically shows the schematic diagram of the message-oriented middleware of the prior art.
As shown in figure 3, using 210-a and application 210-b by using the API (Application of message-oriented middleware 310
Programming Interface, Application Programming Interface) send message communicated.
Message is routed to using 210-b by message-oriented middleware 310, and such message can be present in entirely different calculating
On machine, message-oriented middleware 310 is responsible for processing network communication.If network connection is unavailable, message-oriented middleware 310, which can store, to disappear
Breath when connection is made available by, then is forwarded messages to using 210-b.
When sending its message using 210-a, execution state can be even not at using 210-b.Message-oriented middleware 310
This message will be retained, until starting to execute and try to retrieve message using 210-b.
The advantages of message-oriented middleware, is to provide synchronous and asynchronous connection between clients and servers, and
Can message be transmitted or be stored at any time forwarding.In addition, message-oriented middleware will not occupy a large amount of network
Bandwidth, can track affairs, and by by the recovery of system when realizing network failure in affairs storage to disk.Among message
Part is applicable to carry out the distributed environment of reliable data transmission between multiple processes.
Specifically, ESB provides a kind of unified message representation as intermediary, according to " called side-intermediary-quilt
The process of called side " carries out message conversion, makes it possible types of applications Collaboration in network." called side-intermediary-quilt
The message conversion of called side " can also be subdivided into the conversion of the message " from called side to intermediary " and " from intermediary to called side "
Message conversion.Specifically, called side (for example, as shown in figure 3, applying 210-a in system A) needs first to convert the message to
Intermediates message, that is, with the message that unified message representation indicates, then can just be sent out.Called side is (for example, such as
Shown in Fig. 3,210-b is applied in system B) after receiving the message, it needs message being converted to called side from intermediates message
Then the message representation of itself could be further processed the message.
Therefore, traditional ESB is needed to be implemented " from called side to intermediary " and the message of " from intermediary to called side " is converted,
This objectively causes unnecessary efficiency expense.
In addition, ESB is only only completed the message conversion of syntactic level, and it cannot achieve the message conversion of semantic level.
Fig. 4 schematically shows be used to realize message transmission between heterogeneous system according to the application one embodiment
Method 400 flow chart.Method 400 may include step 410-440.
In step 410, the message from source system is obtained.
When system A is source system, system B is purpose system.Conversely, when system B is source system, for the purpose of system A
System.
According to one embodiment of the application, the message from source system can be subscribed to according to theme and/or type.It needs
The message subject of subscription can be configured according to practical business.
According to another embodiment of the application, the message from source system can not be obtained by way of subscription, and
It is that message actively can be sent to purpose system from source system.
According to the further embodiment of the application, publish/subscribe mode can be based on, by existing message-oriented middleware or
The message-oriented middleware integrated in ESB subscribes to the message from source system.
In publish/subscribe mode, without traditional client and server, and information is only carried out in network
The application (publisher) of publication and the application (referred to as subscriber) for receiving specified subject information.The information of interaction is known as between them
Message.Publisher gives out information to message-oriented middleware, and subscriber then subscribes to message to message-oriented middleware, indicates to which in system
A little message are interested.
It is, for example, possible to use the subscription clients of the message-oriented middleware of system A to subscribe to the message from system A, use
The subscription client of the message-oriented middleware of system B subscribes to the message from system B.
According to the further embodiment of the application, the message integrated in existing message-oriented middleware or ESB can not be utilized
Middleware subscribes to the message from source system, but subscribed to using the special subscription client in system A or system B come
From the message of source system.
According to one embodiment of the application, message subscribing person (system A or system B) can be carried out by subscribing to instruction
It subscribes to, is unsubscribed by unsubscribing instruction.
At step 420, the message syntax that the syntax conversion of message can be identified for purpose system.
Message is made of message header and message body.Message header includes the identification information of message, such as type of message, theme, is disappeared
The sender of breath and priority etc..Message body then contains the actual transmissions data of message, such as business datum etc..
Syntax conversion, that is, message format conversion of message.
Message format used by different IT systems is different.According to the application, the message format of system A is the first format,
The message format of system B is the second format.The message of the message queue of the first format of system A can be converted into the second format
Message, be sent to the message queue of the second format of B system.Conversely, can be by the message queue of the second format of system B
Message is converted to the message of the first format, is sent to the message queue of the first format of A system.
Message format refers to the form of expression of data.For example, message format used by system A is XML (Extensible
Markup Language, extensible markup language), message format used by system B is Json (JavaScript Object
Notation, JavaScript object representation).Therefore, it is necessary to carry out syntax conversion, that is, XML and Json is carried out two-way turn
It changes.
When carrying out the conversion of message format, unserializing-serializing operation of corresponding agreement is carried out.
Serializing mechanism refers to the data coding mode that data are used in network transmission.For example, the message sequence of system A
Change mechanism is Hessain, and the message sequence mechanism of system B is Json.
When two processes are when carrying out telecommunication, various types of data can be sent each other.Either which kind of type
Data, can all be transmitted on network in the form of binary sequence.Sender needs this object to be converted to byte sequence,
It could be transmitted on network, recipient then needs byte sequence to revert to object again.Byte sequence is reverted to the mistake of object
Journey is known as the unserializing of object.The process that object is converted to byte sequence is called the serializing of object.
When needing the message transmission from system A to system B, serializing be can be by disappearing used by system A
It ceases serializing mechanism and the message sequence of the first format used by system A is turned to and (be converted to) byte sequence, then antitone sequence
Change, which can be, to be deserialized as and (reverting to) system B for byte sequence by message sequence mechanism used by system B and adopted
The message of second format.
Conversely, serializing can be to be used by system A when needing the message transmission from system B to system A
Message sequence mechanism the message of the second format used by system B is converted into byte sequence, then unserializing can be with
It is the message that byte sequence is reverted to the first format used by system A by message sequence mechanism used by system B.
According to the application, it is only necessary to mutually be turned between the message format of source system and the message format of purpose system
It changes, without mutually being converted and being incited somebody to action the message format of source system and unified message format (that is, intermediates message)
The message format of purpose system is mutually converted with unified message format (that is, intermediates message), is disappeared to eliminate intermediary
Breath, improves transfer efficiency.
In step 430, the business datum that message is included by the message syntax that can be identified according to the purpose system is converted
The business datum needed at purpose system.
Step 430 is exactly to convert from semantically to the message from source system.Therefore, the application is not only able to from language
Message conversion is carried out in method level, additionally it is possible to message conversion is carried out from semantic level.
According to one embodiment of the application, system A can be shopping website, and system B can be paying website.
Message data from system A includes shopping website User ID, and the data that system B needs are payment account ID.
Therefore, it when message is transmitted to system B from system A, needs shopping website User ID being converted into payment account ID.
For example, shopping website User ID can be converted by the SOA interface that business side can be called to provide, the SOA interface
Payment account ID.
In step 440, the message comprising the business datum after conversion is sent to purpose system.
It, can be by among the message that is integrated in existing message-oriented middleware or ESB according to one embodiment of the application
Message comprising the business datum after conversion is sent to purpose system by part.
As described above, publisher gives out information to message-oriented middleware, subscriber then subscribes to message to message-oriented middleware, indicates
It is interested in which message in system.And message-oriented middleware then guarantees in time, reliably to transmit the message that publisher issues
To it is all to interested message subscribing person.
It is, for example, possible to use the transmission clients of the message-oriented middleware of system A will include the business datum after conversion
Message is sent to system A, uses transmission client the disappearing the business datum after including conversion of the message-oriented middleware of system B
Breath is sent to system B.
According to the further embodiment of the application, the message integrated in existing message-oriented middleware or ESB can not be utilized
Middleware subscribes to the message from source system, but will include using the special transmission client in system A or system B
The message of business datum after conversion is sent to purpose system.
According to one embodiment of the application, a message from source system may be converted into multiple correspondences and disappear
Breath, is then transmitted to purpose system.
It, can be by the uninterested message screening of purpose system in order to improve performance according to one embodiment of the application
Fall.
According to one embodiment of the application, system A is source system, and system B is purpose system.System A can be shopping
Website, system B can be paying website.In this case, system B is only concerned the payment message from system A, without concern for
Delivery message from system A.
According to the application, filter condition can be previously set, the message from system A is carried out according to the strobe utility
Filtering, to leave behind the interested message of those systems B.
According to one embodiment of the application, can be filtered according to the type of message.For example, system can will be come from
The delivery message screening of A falls.
According to another embodiment of the application, can be filtered according to the content of message.For example, due to " cashing on delivery "
The payment behavior of transaction is to be carried out face to face by user when receiving, without being propped up on the net by B system (paying website)
It pays, therefore B system (paying website) may not be needed to receive " cashing on delivery " transaction message from A system (shopping website).
In this case, so that it may the filter condition transaction message that " will cash on delivery " be set and filtered out.
Fig. 5 is schematically shown according to the application one embodiment for realizing message transmission between heterogeneous system
Device 500 structural block diagram.
Device 500 may include: to obtain module 510, for obtaining the message from source system;Syntax conversion module 520,
Message syntax for that can identify the syntax conversion of message for purpose system;Business datum conversion module 530 is used for basis
The business datum that message is included by the message syntax that purpose system can identify is converted into the business datum of purpose system needs;With
And sending module 540, the message comprising the business datum after conversion is sent to purpose system.
According to one embodiment of the application, syntax conversion module 520 further comprises: serialization module, for passing through
The message sequence of the grammer of source system is turned to byte sequence by message sequence mechanism used by the system of source;And unserializing
Module, for the byte sequence to be deserialized as goal systems by message sequence mechanism used by goal systems
The message of grammer.
According to one embodiment of the application, obtaining module 510 may further include subscribing module, for according to theme
Subscribe to the message from the source system.
According to one embodiment of the application, device 500 may further include filtering module, be used for purpose system not
Interested message screening falls.
According to one embodiment of the application, filtering module may further include filter submodule, for according to message
Type and/or content message is filtered.
According to one embodiment of the application, the message from source system corresponds to a plurality of business comprising after conversion
The message of data.
Physically, device 500 can both be located in the system of source, can also be located in purpose system, can also be neither
Also it is not located in purpose system in the system of source, but is located on third party system.
In short, the application realizes the asynchronous message intercommunication of system A and system B by a kind of new method.According to this Shen
Please, the message of system A can be carried out to the conversion of syntax and semantics, be sent to system by the asynchronous message of theme ordering system A
The message queue of B.Conversely, the asynchronous message of system B can be converted to the message of system A, it is sent to the message team of system A
Column.In such manner, it is possible to realize the mutual consumption of both sides' message.
Compared with prior art, the application is not only able to achieve the message conversion of syntactic level, is also able to achieve semantic level
Conversion.In addition, the application eliminates intermediates message from the angle of efficiency, the message of interaction both sides be can be realized directly
Conversion, the promotion of performance is obtained with this.
It should be noted that the application is not limited to although the application is illustrated by taking Asynchronous message transfer as an example above
This, but it is readily applicable to synchronization message transmitting.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art
For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal
Replacement, improvement etc., should be included within the scope of the claims of this application.