CN112383533A - Message format conversion method and device - Google Patents

Message format conversion method and device Download PDF

Info

Publication number
CN112383533A
CN112383533A CN202011247175.4A CN202011247175A CN112383533A CN 112383533 A CN112383533 A CN 112383533A CN 202011247175 A CN202011247175 A CN 202011247175A CN 112383533 A CN112383533 A CN 112383533A
Authority
CN
China
Prior art keywords
message
item
format
target
packet
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202011247175.4A
Other languages
Chinese (zh)
Other versions
CN112383533B (en
Inventor
应俊
孙莹
孙月竹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202011247175.4A priority Critical patent/CN112383533B/en
Publication of CN112383533A publication Critical patent/CN112383533A/en
Application granted granted Critical
Publication of CN112383533B publication Critical patent/CN112383533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)
  • Communication Control (AREA)

Abstract

The invention provides a message format conversion method and a device, which can be applied to a gateway, and the method comprises the following steps: when a service message sent by a source message system is received, determining each message item of the service message based on the message format of the service message; analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item, and sequentially storing the message information of each message item to a pre-established context; determining a target message format corresponding to a target application system; packaging the message information stored in the context according to the target message format to obtain a target application message corresponding to the target message format; and sending the target application message to the target application system. By applying the message format conversion method provided by the invention, the format conversion of the message among different systems is carried out through the gateway, so that each system can be free from paying attention to the format conversion of the message, the complexity of the system is reduced, and the efficiency of the message format conversion is improved.

Description

Message format conversion method and device
Technical Field
The present invention relates to the field of packet processing technologies, and in particular, to a method and an apparatus for converting a packet format.
Background
With the development of computer technology, in order to meet the increasing business requirements, the number of various application systems is also increasing, and in the process of processing various businesses, multiple application systems are usually required to be docked and data shared, data exchange between application systems is often based on messages, the messages define the content and format of data exchange between application systems, and data exchange is performed through the messages, so that the application systems can coordinate to work, and corresponding businesses can be completed.
In the prior art, because the formats of the data exchange messages provided by different application systems are different, when an application system receiving a message receives messages sent by different application systems, the application system receiving the message generally needs to perform corresponding format conversion on the received messages with different formats respectively to obtain the messages with an applicable format, however, the message processing logic of the application system receiving the message is complex, so that the complexity of the system is high, and the maintenance difficulty is large.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a message format conversion method, which can simplify the message processing logic of the application system and reduce the complexity of the application system.
The invention also provides a message format conversion device, which is used for ensuring the realization and the application of the method in practice.
A message format conversion method is applied to a gateway, and comprises the following steps:
when a preset service message sent by a source message system is received, acquiring the message format of the service message;
determining each message item of the service message based on the message format;
analyzing each message item according to an analysis mode corresponding to each message item to obtain message information of each message item, and sequentially storing the message information of each message item to a pre-established context;
determining a target message format corresponding to a preset target application system, wherein the target application system is an application system for processing a service corresponding to the service message;
packaging the message information stored in the context according to the target message format to obtain a target application message corresponding to the target message format;
and sending the target application message to the target application system.
Optionally, the method for acquiring the message format of the service message includes:
acquiring a message format definition file of the source message system according to the system identifier of the source message system;
and reading the message format definition file to obtain the message format of the service message.
Optionally, the analyzing the message items according to the analysis mode corresponding to each message item to obtain the message information of each message item includes:
determining the message item type of each message item;
determining an analysis mode corresponding to each message item based on each message item type;
and analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item.
Optionally, the method for packaging the message information stored in the context according to the target message format to obtain the target application message corresponding to the target message format includes:
determining each target message item format defined by the target message format;
sequentially acquiring message information corresponding to each target message item format in the context, and encapsulating the message information corresponding to the target message item format stored in the context into corresponding target message items based on each target message item format;
and forming a target application message by each target message item.
Optionally, the above method, where the step of sequentially storing the message information of each message item to a pre-established context includes:
determining a cache level corresponding to each message information in the context;
and storing each message information to a cache level corresponding to the message information in the context.
A message format conversion device is applied to a gateway, and the device comprises:
the receiving unit is used for acquiring the message format of a service message when the service message sent by a preset source message system is received;
a first determining unit, configured to determine, based on the packet format, each packet item of the service packet;
the analysis unit is used for analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item, and sequentially storing the message information of each message item to a pre-established context;
a second determining unit, configured to determine a target packet format corresponding to a preset target application system, where the target application system is an application system that processes a service corresponding to the service packet;
a packaging unit, configured to package the message information stored in the context according to the target message format, so as to obtain a target application message corresponding to the target message format;
and the sending unit is used for sending the target application message to the target application system.
The above apparatus, optionally, the receiving unit that obtains the message format of the service message is configured to:
acquiring a message format definition file of the source message system according to the system identifier of the source message system;
and reading the message format definition file to obtain the message format of the service message.
Optionally, in the apparatus, the parsing unit is configured to parse each packet item according to a parsing manner corresponding to each packet item to obtain packet information of each packet item, and is configured to:
determining the message item type of each message item;
determining an analysis mode corresponding to each message item based on each message item type;
and analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item.
The above apparatus, optionally, the group packaging unit is configured to:
determining each target message item format defined by the target message format;
sequentially acquiring message information corresponding to each target message item format in the context, and forming corresponding target message items by the acquired message information based on the target message item format;
and packaging each target message item to obtain a target application message.
Optionally, the apparatus described above, where the message information of each message item is sequentially stored in an analysis unit of a pre-established context, is configured to:
determining a cache level corresponding to each message information in the context;
and storing each message information to a cache level corresponding to the message information in the context.
Compared with the prior art, the invention has the following advantages:
the invention provides a message format conversion method and a device, which can be applied to a gateway, and the method comprises the following steps: when a preset service message sent by a source message system is received, acquiring the message format of the service message; determining each message item of the service message based on the message format; analyzing each message item according to an analysis mode corresponding to each message item to obtain message information of each message item, and sequentially storing the message information of each message item to a pre-established context; determining a target message format corresponding to a preset target application system, wherein the target application system is an application system for processing a service corresponding to the service message; packaging the message information stored in the context according to the target message format to obtain a target application message corresponding to the target message format; and sending the target application message to the target application system. By applying the message format conversion method provided by the invention, the format conversion of the message among different systems is carried out through the gateway, so that each system can be free from paying attention to the format conversion of the message, the complexity of the system is reduced, and the efficiency of the message format conversion is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for converting a message format according to the present invention;
fig. 2 is a flowchart of another method of a message format conversion method according to the present invention;
fig. 3 is a flowchart of another method of a message format conversion method according to the present invention;
FIG. 4 is an exemplary diagram of an embodiment of the present invention;
fig. 5 is a schematic diagram of a process of message format conversion according to the present invention;
FIG. 6 is an exemplary diagram of a message item type provided by the present invention;
fig. 7 is a schematic structural diagram of a message format conversion device according to the present invention;
fig. 8 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
An embodiment of the present invention provides a method for converting a message format, where the method may be applied to multiple system platforms, an execution subject of the method may be a processor of an electronic device, and the electronic device may be a gateway, and a flowchart of the method is shown in fig. 1, and specifically includes:
s101: when a preset service message sent by a source message system is received, the message format of the service message is obtained.
In the method provided by the embodiment of the present invention, the source message system may be a service system of the transmitted message, and in a case where any one service system transmits a service message, the service system of the transmitted message may be used as the source message system, and the source message system has a message format of the service message corresponding thereto.
The type of the message format may be one of XML, JSON, fixed-length string, indefinite-length string, separator, key-value pair, 8583, IMIX, FIN, and the like.
Specifically, the message format may represent the composition definition of the message.
S102: and determining each message item of the service message based on the message format.
In the method provided by the embodiment of the present invention, the message item type of the message item may be a field type, a loop type, a branch type, and a sub-message type.
Wherein each service message is composed of one or more types of message items.
Specifically, the message item composition of the service message may be determined based on the message format of the service message.
S103: and analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item, and sequentially storing the message information of each message item to a pre-established context.
In the method provided by the embodiment of the present invention, the context may be a message information cache having a plurality of cache levels for storing message information.
When each message item is analyzed to obtain the message information of the message item, the message information can be stored in the context.
Specifically, the parsing of the message item may refer to splitting the message item, and the parsing manners corresponding to different types of message items are different, that is, the splitting manners may be different, that is, each type of message item has its corresponding parsing manner.
S104: and determining a target message format corresponding to a preset target application system, wherein the target application system is an application system for processing a service corresponding to the service message.
In the method provided by the embodiment of the present invention, the target message format may be a message format matched with a data interface of the target application system.
The type of the target message format may also be one of XML, JSON, fixed-length string, indefinite-length string, separator, key-value pair, 8583, IMIX, FIN, and the like.
Optionally, the type of the target packet format is different from the type of the packet format of the service packet, for example, the packet format type of the service packet may be XML, and the target packet format may be JSON.
S105: and packaging the message information stored in the context according to the target message format to obtain a target application message corresponding to the target message format.
In the method provided by the embodiment of the invention, the target message format can represent the target message item composition of the target application message.
The message information can be sequentially acquired in the context, the acquired messages are assembled in the assembling mode corresponding to each target message item in sequence to obtain each target message item, and the target application message is composed of each target message item.
S106: and sending the target application message to the target application system.
In the method provided by the embodiment of the present invention, the target application packet is sent to the target application system, so that the target application system performs corresponding service processing based on the target application packet.
The embodiment of the invention provides a message format conversion method, which can be applied to a gateway and comprises the following steps: when a preset service message sent by a source message system is received, acquiring the message format of the service message; determining each message item of the service message based on the message format; analyzing each message item according to an analysis mode corresponding to each message item to obtain message information of each message item, and sequentially storing the message information of each message item to a pre-established context; determining a target message format corresponding to a preset target application system, wherein the target application system is an application system for processing a service corresponding to the service message; packaging the message information stored in the context according to the target message format to obtain a target application message corresponding to the target message format; and sending the target application message to the target application system. By applying the message format conversion method provided by the embodiment of the invention, the format conversion of the message between different systems is carried out through the gateway, so that each system can be free from paying attention to the format conversion of the message, the complexity of the system is reduced, and the efficiency of the message format conversion is improved.
Based on the above implementation process, the method provided in the embodiment of the present invention specifically obtains the message format of the service message, including:
acquiring a message format definition file of the source message system according to the system identifier of the source message system;
and reading the message format definition file to obtain the message format of the service message.
In the method provided by the embodiment of the invention, the message format definition file of each system can be stored in advance.
Specifically, the corresponding relationship between the message format definition file and the system identifier may be recorded in a preset configuration file, and the configuration file may be queried based on the system identifier of the source system, so as to obtain the message format definition file of the source message system.
Wherein, the message format definition file records the message format of the service message of the source system.
Based on the foregoing implementation process, the method provided in the embodiment of the present invention specifically analyzes each packet item according to an analysis mode corresponding to each packet item, and obtains packet information of each packet item, as shown in fig. 2, and specifically includes:
s201: and determining the message item type of each message item.
In the method provided by the embodiment of the present invention, for a message item and a target message item, the message item types may include a field type, a loop type, a branch type, and a sub-message type.
The field type packet item may be a basic unit content defining a packet, and may include a field name, a field value, and a path of a packet structure, where the field type packet item is generally defined as follows:
< field name ═ field specific name ═ type ═ field type ═ value ═ field value ═ path ═ field URL path "/>, and
optionally, the message item of the loop type may be in a format with repeated text fields, and may include a loop name, loop times, a field, and the like, where the message item of the loop type is generally defined as follows:
< loop name ═ loop field concrete name ═ loop number ">, and
< field/>
< circulation >
Optionally, the message item of the branch type may define a brushing condition of the message field, specifically including a branch name, a judgment condition, a field, and the like, and the message item of the branch type is generally defined as follows:
< Branch name ═ Branch specific name ">
< conditional branch determination condition ═ determination condition of branch ">
< field/>
< conditional branch/>)
< Branch >)
Optionally, a segment of independent packet format may be defined for the packet item of the sub-packet type, and the segment may include a sub-packet name, a field, a loop, a branch, and the like, where the packet item of the sub-packet type is generally defined as follows:
sub-message name ═ sub-message specific name >
< field/>
< cycles/>
< Branch/>)
</sub message >
Optionally, each packet item and the packet item type of each packet item may be determined based on the packet format of the service packet.
S202: and determining the analysis mode corresponding to the message item based on each message item type.
Each message item type has a corresponding analysis mode.
S203: and analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item.
In the method provided by the embodiment of the present invention, the message information may include a message item type, a value type description, a storage structure, and the like.
Based on the above implementation process, the method provided in the embodiment of the present invention specifically packages the packet information stored in the context according to the target packet format to obtain the target application packet corresponding to the target packet format, as shown in fig. 3, specifically includes:
s301: and determining each target message item format defined by the target message format.
In the method provided by the embodiment of the present invention, the target packet item format may include a packet item type of the target packet item, and the target packet item format is used to represent a composition of a target packet item corresponding to the target packet item format.
S302: and sequentially acquiring message information corresponding to each target message item format in the context, and encapsulating the message information corresponding to the target message item format stored in the context into corresponding target message items based on each target message item format.
In the method provided by the embodiment of the present invention, the context is stored in a Key-Value pair (Key-Value) form, where a Key of a Key-Value pair is a name of a message item type of each message item, and values of the Key-Value pair have different Value types for different types of message format definitions, see table 1, which is a message information storage example table in the context provided by the embodiment of the present invention, and specifically includes:
Figure BDA0002770399750000091
TABLE 1
Specifically, in the context, the message information corresponding to each target message item is obtained, and the message information is assembled according to the assembling mode corresponding to each target message item, so as to obtain the target message item.
S303: and forming a target application message by each target message item.
In the method provided by the embodiment of the invention, the target application message composed of each target message item is obtained after each target message item is obtained.
Based on the above implementation process, the method provided in the embodiment of the present invention specifically stores the packet information of each packet item in sequence to a pre-established context, including:
determining a cache level corresponding to each message information in the context;
and storing each message information to a cache level corresponding to the message information in the context.
In the method provided by the embodiment of the present invention, the context is provided with multiple cache levels, and the storage level corresponding to the message information in the context can be determined according to the item splitting sequence of the message item corresponding to each message information, and the message information is stored to the corresponding cache level.
Referring to fig. 4, an exemplary diagram of an implementation scenario provided by the present invention includes a source messaging system 401, a gateway 402, and a target application system 403.
The source message system 401 may send a service request to the gateway 402, and after receiving the service request, the gateway 402 obtains a service message included in the service request, and executes a message conversion process, which is shown in fig. 5 and specifically includes:
reading a message format definition file of a source application system by a message conversion engine according to a line, obtaining a message format definition of each message item of a service message, and obtaining the format definition of each message item when the message format definition of each message item is obtained; determining the message item type of the message item based on the message format definition, and executing unpacking operation corresponding to the message item type:
if the type of the message item is a field type, the value of the message field is obtained from the message of the source application system according to the definition of the message field.
If the message item type is a cycle type, continuously reading the cycle sub-message according to the cycle times.
If the message item type is a branch type, executing the branch sub-message meeting the condition according to the branch condition.
If the message item type is the sub-message type, continuing to read the message format definition file to obtain the next message format definition so as to determine the message item type of the message item of each sub-level of the message item.
And (4) putting the acquired message field and the value of the corresponding message field into a context, ending the message unpacking process of the source application system, and entering the packaging process of the target application system.
Reading a message format definition file of a source application system by a message conversion engine according to a line, obtaining a message format definition of each target message item of a target application message, and obtaining the format definition of each target message item when the message format definition of each target message item is obtained; determining the message item type of the target message item based on the message format definition, and executing a packet packaging operation corresponding to the message item type of the target message item, wherein the packet packaging process is similar to the unpacking process, and the difference is that the value of the message field of the message packet is obtained from the context.
Specifically, after the packaging process is finished, a target application message corresponding to the target message format is obtained; and sending the target application message to the target application system.
Wherein, for each type of message item, it may contain one or more sub-level message items, see fig. 6, which is an exemplary diagram of a message item type provided by the present invention.
The message item type of the message item can comprise a field type, a cycle type, a branch type and a sub-message type, the message definition of each type of message item can also comprise message items of sub-message types from 0 to a sub-level, and the whole message definition is completed through a cycle nesting mode.
Specifically, using an XML type message as an example, the message format definition model is used for description, and the XML message is exemplified as follows:
Figure BDA0002770399750000111
correspondingly, the message format is defined as follows:
Figure BDA0002770399750000112
optionally, the message format definition may be recorded in a message format definition file.
If the XML message is stored in the context, the context structure may be:
{user={Name=”Zhang san”,Item=[{Account=0001,Active=true},{Active=true}]}}
by applying the message format conversion method provided by the embodiment of the invention, the format conversion of the message between different systems is carried out through the gateway, namely, based on the definition of the message format, the conversion of any message format into another message format can be realized, so that each system can not need to pay attention to the format conversion of the message, the complexity of the system is reduced, the universality is high, the message unpacking and the message packing in a message conversion engine of the gateway are processed in the context, and the context is realized by adopting a cache structure, so the performance has high efficiency.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides a message format conversion apparatus, which is used for implementing the method in fig. 1 specifically, and the message format conversion apparatus provided in the embodiment of the present invention may be applied to a computer terminal or various mobile devices, and a schematic structural diagram of the apparatus is shown in fig. 7, and specifically includes:
a receiving unit 501, configured to obtain a message format of a service message when receiving the service message sent by a preset source message system;
a first determining unit 502, configured to determine, based on the packet format, each packet item of the service packet;
an analyzing unit 503, configured to analyze each message item according to an analyzing mode corresponding to each message item, obtain message information of each message item, and store the message information of each message item in sequence to a pre-established context;
a second determining unit 504, configured to determine a target packet format corresponding to a preset target application system, where the target application system is an application system that processes a service corresponding to the service packet;
a packaging unit 505, configured to package, according to the target packet format, packet information stored in the context, so as to obtain a target application packet corresponding to the target packet format;
a sending unit 506, configured to send the target application packet to the target application system.
In an embodiment provided by the present invention, based on the above apparatus, specifically, the receiving unit 501 for obtaining a message format of the service packet is configured to:
acquiring a message format definition file of the source message system according to the system identifier of the source message system;
and reading the message format definition file to obtain the message format of the service message.
In an embodiment of the present invention, based on the above apparatus, specifically, the parsing unit 503, configured to parse each packet item according to a parsing manner corresponding to each packet item to obtain packet information of each packet item, is configured to:
determining the message item type of each message item;
determining an analysis mode corresponding to each message item based on each message item type;
and analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item.
In an embodiment provided by the present invention, based on the above apparatus, specifically, the group packaging unit 505 is configured to:
determining each target message item format defined by the target message format;
sequentially acquiring message information corresponding to each target message item format in the context, and forming corresponding target message items by the acquired message information based on the target message item format;
and packaging each target message item to obtain a target application message.
In an embodiment of the present invention, based on the above apparatus, specifically, the parsing unit 503 that sequentially stores the message information of each message item in a pre-established context is configured to:
determining a cache level corresponding to each message information in the context;
and storing each message information to a cache level corresponding to the message information in the context.
The specific principle and the execution process of each unit and each module in the message format conversion device disclosed in the embodiment of the present invention are the same as those of the message format conversion method disclosed in the embodiment of the present invention, and reference may be made to the corresponding parts in the message format conversion method provided in the embodiment of the present invention, which are not described herein again.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the equipment where the storage medium is located is controlled to execute the message format conversion method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 8, which specifically includes a memory 601 and one or more instructions 602, where the one or more instructions 602 are stored in the memory 601 and configured to be executed by one or more processors 603 to perform the following operations on the one or more instructions 602:
when a preset service message sent by a source message system is received, acquiring the message format of the service message;
determining each message item of the service message based on the message format;
analyzing each message item according to an analysis mode corresponding to each message item to obtain message information of each message item, and sequentially storing the message information of each message item to a pre-established context;
determining a target message format corresponding to a preset target application system, wherein the target application system is an application system for processing a service corresponding to the service message;
packaging the message information stored in the context according to the target message format to obtain a target application message corresponding to the target message format;
and sending the target application message to the target application system.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The above detailed description is provided for a message format conversion method provided by the present invention, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A message format conversion method is applied to a gateway, and the method comprises the following steps:
when a preset service message sent by a source message system is received, acquiring the message format of the service message;
determining each message item of the service message based on the message format;
analyzing each message item according to an analysis mode corresponding to each message item to obtain message information of each message item, and sequentially storing the message information of each message item to a pre-established context;
determining a target message format corresponding to a preset target application system, wherein the target application system is an application system for processing a service corresponding to the service message;
packaging the message information stored in the context according to the target message format to obtain a target application message corresponding to the target message format;
and sending the target application message to the target application system.
2. The method according to claim 1, wherein the obtaining the message format of the service message comprises:
acquiring a message format definition file of the source message system according to the system identifier of the source message system;
and reading the message format definition file to obtain the message format of the service message.
3. The method according to claim 1, wherein the parsing each message item according to the parsing manner corresponding to each message item to obtain the message information of each message item comprises:
determining the message item type of each message item;
determining an analysis mode corresponding to each message item based on each message item type;
and analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item.
4. The method according to claim 1, wherein packaging the packet information stored in the context according to the target packet format to obtain a target application packet corresponding to the target packet format, includes:
determining each target message item format defined by the target message format;
sequentially acquiring message information corresponding to each target message item format in the context, and encapsulating the message information corresponding to the target message item format stored in the context into corresponding target message items based on each target message item format;
and forming a target application message by each target message item.
5. The method of claim 1, wherein the storing the message information of each message item in sequence to a pre-established context comprises:
determining a cache level corresponding to each message information in the context;
and storing each message information to a cache level corresponding to the message information in the context.
6. A message format conversion apparatus, applied to a gateway, the apparatus comprising:
the receiving unit is used for acquiring the message format of a service message when the service message sent by a preset source message system is received;
a first determining unit, configured to determine, based on the packet format, each packet item of the service packet;
the analysis unit is used for analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item, and sequentially storing the message information of each message item to a pre-established context;
a second determining unit, configured to determine a target packet format corresponding to a preset target application system, where the target application system is an application system that processes a service corresponding to the service packet;
a packaging unit, configured to package the message information stored in the context according to the target message format, so as to obtain a target application message corresponding to the target message format;
and the sending unit is used for sending the target application message to the target application system.
7. The apparatus according to claim 6, wherein the receiving unit that obtains the packet format of the service packet is configured to:
acquiring a message format definition file of the source message system according to the system identifier of the source message system;
and reading the message format definition file to obtain the message format of the service message.
8. The apparatus according to claim 6, wherein the parsing unit that parses each of the packet items according to the parsing manner corresponding to each of the packet items to obtain the packet information of each of the packet items is configured to:
determining the message item type of each message item;
determining an analysis mode corresponding to each message item based on each message item type;
and analyzing each message item according to the analysis mode corresponding to each message item to obtain the message information of each message item.
9. The apparatus of claim 6, wherein the group packing unit is configured to:
determining each target message item format defined by the target message format;
sequentially acquiring message information corresponding to each target message item format in the context, and forming corresponding target message items by the acquired message information based on the target message item format;
and packaging each target message item to obtain a target application message.
10. The apparatus according to claim 6, wherein the parsing unit for sequentially storing the packet information of each packet item into a pre-established context is configured to:
determining a cache level corresponding to each message information in the context;
and storing each message information to a cache level corresponding to the message information in the context.
CN202011247175.4A 2020-11-10 2020-11-10 Message format conversion method and device Active CN112383533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011247175.4A CN112383533B (en) 2020-11-10 2020-11-10 Message format conversion method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011247175.4A CN112383533B (en) 2020-11-10 2020-11-10 Message format conversion method and device

Publications (2)

Publication Number Publication Date
CN112383533A true CN112383533A (en) 2021-02-19
CN112383533B CN112383533B (en) 2023-07-28

Family

ID=74579716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011247175.4A Active CN112383533B (en) 2020-11-10 2020-11-10 Message format conversion method and device

Country Status (1)

Country Link
CN (1) CN112383533B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113542374A (en) * 2021-06-30 2021-10-22 北京宇信科技集团股份有限公司 Message processing method and system
CN113709177A (en) * 2021-09-06 2021-11-26 中国银行股份有限公司 Method for processing message and external call gateway
CN113726781A (en) * 2021-08-31 2021-11-30 平安养老保险股份有限公司 Message information processing method and device, computer equipment and storage medium
CN113765722A (en) * 2021-09-17 2021-12-07 中国银行股份有限公司 Configurable multi-protocol message processing method and device and electronic equipment
CN113783860A (en) * 2021-09-01 2021-12-10 建信金融科技有限责任公司 Message processing method, device and equipment based on visual configuration
CN114025015A (en) * 2021-11-29 2022-02-08 中电金信软件有限公司 Message transmission method and device
CN114745449A (en) * 2022-04-13 2022-07-12 中国银行股份有限公司 Message processing method and device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070061489A1 (en) * 2001-05-02 2007-03-15 Uzi Lev-Ami Method and apparatus for two phase structured message to tagged message translation
CN102546442A (en) * 2012-03-09 2012-07-04 北京神州数码思特奇信息技术股份有限公司 Communication protocol conversion technology
CN108881172A (en) * 2018-05-22 2018-11-23 阿里巴巴集团控股有限公司 The analysis method and device of message
CN111061481A (en) * 2019-12-17 2020-04-24 神州数码融信软件有限公司 Data format conversion method and device
CN111104106A (en) * 2019-12-31 2020-05-05 中电长城(长沙)信息技术有限公司 Visual development method, system and medium for integrating business process and communication message
CN111447257A (en) * 2020-03-09 2020-07-24 中国建设银行股份有限公司 Message conversion method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070061489A1 (en) * 2001-05-02 2007-03-15 Uzi Lev-Ami Method and apparatus for two phase structured message to tagged message translation
CN102546442A (en) * 2012-03-09 2012-07-04 北京神州数码思特奇信息技术股份有限公司 Communication protocol conversion technology
CN108881172A (en) * 2018-05-22 2018-11-23 阿里巴巴集团控股有限公司 The analysis method and device of message
CN111061481A (en) * 2019-12-17 2020-04-24 神州数码融信软件有限公司 Data format conversion method and device
CN111104106A (en) * 2019-12-31 2020-05-05 中电长城(长沙)信息技术有限公司 Visual development method, system and medium for integrating business process and communication message
CN111447257A (en) * 2020-03-09 2020-07-24 中国建设银行股份有限公司 Message conversion method and device

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113542374A (en) * 2021-06-30 2021-10-22 北京宇信科技集团股份有限公司 Message processing method and system
CN113542374B (en) * 2021-06-30 2022-04-12 北京宇信科技集团股份有限公司 Message processing method and system
CN113726781A (en) * 2021-08-31 2021-11-30 平安养老保险股份有限公司 Message information processing method and device, computer equipment and storage medium
CN113726781B (en) * 2021-08-31 2023-05-16 平安养老保险股份有限公司 Message information processing method, device, computer equipment and storage medium
CN113783860A (en) * 2021-09-01 2021-12-10 建信金融科技有限责任公司 Message processing method, device and equipment based on visual configuration
CN113783860B (en) * 2021-09-01 2023-11-28 建信金融科技有限责任公司 Message processing method, device, equipment and storage medium based on visual configuration
CN113709177B (en) * 2021-09-06 2022-10-18 中国银行股份有限公司 Method for processing message and external call gateway
CN113709177A (en) * 2021-09-06 2021-11-26 中国银行股份有限公司 Method for processing message and external call gateway
CN113765722A (en) * 2021-09-17 2021-12-07 中国银行股份有限公司 Configurable multi-protocol message processing method and device and electronic equipment
CN113765722B (en) * 2021-09-17 2023-01-20 中国银行股份有限公司 Configurable multi-protocol message processing method and device and electronic equipment
CN114025015A (en) * 2021-11-29 2022-02-08 中电金信软件有限公司 Message transmission method and device
CN114745449A (en) * 2022-04-13 2022-07-12 中国银行股份有限公司 Message processing method and device, storage medium and electronic equipment
CN114745449B (en) * 2022-04-13 2024-01-30 中国银行股份有限公司 Message processing method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN112383533B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
CN112383533A (en) Message format conversion method and device
US11226795B2 (en) Efficient state machines for real-time dataflow programming
US9122510B2 (en) Querying and managing computing resources in a networked computing environment
CN107463434B (en) Distributed task processing method and device
CN110781180B (en) Data screening method and data screening device
CN109783562B (en) Service processing method and device
CN109254854A (en) Asynchronous invoking method, computer installation and storage medium
CN113839977A (en) Message pushing method and device, computer equipment and storage medium
US11294740B2 (en) Event to serverless function workflow instance mapping mechanism
CN111553652B (en) Service processing method and device
US20190095257A1 (en) Fault tolerant adapter system to consume database as a service
CN113596078A (en) Service problem positioning method and device
CN112417016B (en) Data exchange method, system, equipment and storage medium
CN107040613A (en) A kind of message transmitting method and system
CN113010542A (en) Service data processing method and device, computer equipment and storage medium
CN111966653A (en) Data processing method, device, server and storage medium for micro-service call link
CN112016285B (en) Logistics information processing method and processing system
US20230122597A1 (en) Real time method and system for analyzing data streams
CN110555042B (en) Method, device and system for retrieving data in real time
US20140324554A1 (en) Analysis and annotation of interactions obtained from network traffic
CN114338494B (en) Service dependency topological relation obtaining method and device, storage medium and electronic equipment
CN117827631A (en) Data processing method and device
CN115643320A (en) Data processing method, system, storage medium and processor
CN117880008A (en) Gateway-based service request processing method, device, equipment and storage medium
CN117435618A (en) Data query method, data query system, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant