CN113765722A - Configurable multi-protocol message processing method and device and electronic equipment - Google Patents
Configurable multi-protocol message processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN113765722A CN113765722A CN202111094285.6A CN202111094285A CN113765722A CN 113765722 A CN113765722 A CN 113765722A CN 202111094285 A CN202111094285 A CN 202111094285A CN 113765722 A CN113765722 A CN 113765722A
- Authority
- CN
- China
- Prior art keywords
- message
- transaction
- configuration
- information
- parameter information
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/30—Profiles
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a configurable multi-protocol message processing method, a configurable multi-protocol message processing device and electronic equipment, wherein the configurable multi-protocol message processing method comprises the following steps: responding to a target instruction, and acquiring first parameter information related to the target instruction; performing packaging or unpacking based on a preset configuration table and first parameter information; the configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to the exogenous system; the interface transaction configuration information includes at least one domain name. Therefore, the processing of the messages of various protocols is realized only by the mode of configuration files, and the flexibility of message processing is improved.
Description
Technical Field
The present invention relates to the field of packet processing, and in particular, to a configurable multi-protocol packet conversion method, apparatus, and electronic device.
Background
In online transactions, a system interacts with multiple systems, often using different messaging protocols between different systems, and even the same system may use different protocols for different transaction types, such as: ISO8583 message, XML message, fixed length message, JSON message, etc. For the system, different message formats need to be analyzed and processed, and different message protocols often have very different processing, and in the prior art, a hard coding mode is usually adopted, for example, conversion of every two message formats, a converted code logic is compiled in advance, and the code logic is directly used for realizing the conversion of the two message formats. However, this method has a large amount of work, and when a new message format is present, the message format cannot be converted, so that the flexibility is poor.
Disclosure of Invention
In view of this, the embodiment of the present invention discloses a configurable multi-protocol message processing method, apparatus and electronic device, which can implement processing of messages of different protocols through a configurable configuration file, and can add configuration information of message formats by setting configuration file information, and a new message format appears in time.
The embodiment of the invention discloses a configurable multi-protocol message processing method, which comprises the following steps:
responding to a target instruction, and acquiring first parameter information related to the target instruction;
performing packaging or unpacking based on a preset configuration table and the first parameter information;
the preset configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to an exogenous system; the interface transaction configuration information comprises at least one domain name; .
Optionally, when the target instruction is a message sent by a foreign system, the packaging or unpacking based on a preset configuration table and the first parameter information includes:
determining a first message format matched with the first parameter information based on a preset configuration table;
determining first message parameter information matched with the first message format based on a preset configuration table; the first message parameter information is basic information of a message related to the first message format;
analyzing the message based on the parameter information of the first message format to obtain a first transaction code;
determining first interface message configuration information matched with the first transaction code, the message format and the transaction direction of the first message based on a preset configuration table; the interface transaction configuration information comprises at least one domain name;
determining domain configuration information matched with the first interface message configuration information based on a preset configuration table;
and unpacking the message according to the domain configuration information.
Optionally, the analyzing the message based on the parameter information of the first message format to obtain the first transaction code of the message includes:
extracting a message header in the message based on first message parameter information;
and analyzing the message header to obtain a first transaction code of the message.
Optionally, when the target instruction is a transmission packet, the performing packet packing or unpacking based on a preset configuration table and the first parameter information includes:
determining a second message format matched with the first parameter information based on a preset configuration table;
determining second message parameter information matched with the second message format based on a preset configuration table; the second message parameter information is basic information of a message related to the second message format;
acquiring a second transaction code, and generating a message header based on the parameter information of the second message format and the second transaction code;
determining interface message configuration information matched with the second transaction code, the second message format and the transaction direction based on a preset configuration table; the interface transaction configuration information comprises at least one domain name;
determining domain configuration information matched with the second interface message configuration information based on a preset configuration table
And grouping the body information based on the domain configuration information matched with the second interface message configuration information.
Optionally, the method further includes:
setting configuration information of a target message format;
the configuration information of the target message format includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a target message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains;
the target message format is a message format not contained in the configuration file.
The embodiment of the invention discloses a configurable multi-protocol message processing device, which comprises:
an acquisition unit configured to acquire, in response to a target instruction, first parameter information related to the target instruction,
the message processing unit is used for performing packaging or unpacking based on a preset configuration table and the first parameter information;
the configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to the exogenous system; the interface transaction configuration information comprises at least one domain name; the first parameter is related to an exogenous system.
Optionally, when the target instruction is a message sent by a receiving external system, the message processing unit includes:
the first determining subunit is configured to determine, based on a preset configuration table, a first packet format of a first packet matched with the first parameter information;
the second determining subunit is configured to determine, based on a preset configuration table, first packet parameter information matched with the first packet format; the first message parameter information is basic information of a message related to the first message format;
the analysis unit is used for analyzing the message based on the parameter information of the first message format to obtain a first transaction code;
the third determining subunit is configured to determine, based on a preset configuration table, first interface message configuration information that matches the first transaction code, the message format of the first message, and the transaction direction; the interface transaction configuration information comprises at least one domain name;
a fourth determining subunit, configured to determine, based on a preset configuration table, domain configuration information that matches the first interface packet configuration information;
and the unpacking subunit is used for unpacking the message according to the domain configuration information.
Optionally, when the target instruction is a send message, the message processing unit includes:
a fifth determining subunit, configured to determine, based on a preset configuration table, a second packet format matched with the first parameter information;
a sixth determining subunit, configured to determine, based on a preset configuration table, second packet parameter information matched with the second packet format; the second message parameter information is basic information of a message related to the second message format;
a message header generating subunit, configured to acquire a second transaction code, and generate a message header based on the parameter information of the second message format and the second transaction code;
a seventh determining subunit, configured to determine, based on a preset configuration table, interface message configuration information that matches the second transaction code, the second message format, and the transaction direction; the interface transaction configuration information comprises at least one domain name;
an eighth determining subunit, configured to determine, based on a preset configuration table, domain configuration information matched with the second interface packet configuration information
And the group packaging subunit is used for packaging the group body information based on the domain configuration information matched with the second interface message configuration information.
Optionally, the method further includes:
the setting subunit is used for setting the configuration information of the target message format;
the configuration information of the target message format includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a target message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains;
the target message format is a message format not contained in the configuration file.
The embodiment of the invention discloses an electronic device, which comprises:
a memory and a processor;
the memory is used for storing programs, and the processor is used for executing the configurable multi-protocol message processing method when the programs are executed.
The embodiment of the invention discloses a configurable multi-protocol message processing method, a configurable multi-protocol message processing device and electronic equipment, wherein the method comprises the following steps: responding to a target instruction, and acquiring first parameter information related to the target instruction; performing packaging or unpacking based on a preset configuration table and the first parameter information; the configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to an exogenous system; the interface transaction configuration information includes at least one domain name. Therefore, the processing of the messages of various protocols is realized only by the mode of configuration files, and the flexibility of message processing 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 schematic flowchart illustrating a configurable multi-protocol message conversion method according to embodiment 1 of the present invention;
fig. 2 is a schematic flowchart illustrating a configurable multi-protocol message conversion method according to embodiment 2 of the present invention;
fig. 3 is a schematic flowchart illustrating a configurable multi-protocol message conversion method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a configurable multi-protocol message processing apparatus according to an embodiment of the present invention;
fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of 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.
Example 1:
referring to fig. 1, a schematic flowchart of a configurable multi-protocol packet conversion method provided in an embodiment of the present invention is shown, where in this embodiment, the method includes:
s101: acquiring first parameter information under the condition of receiving a message sent by an external source system; the first parameter information is related to the exogenous system;
in this embodiment, the external source system is a system for communicating with the system, and may be, for example, a message processing system of any financial institution.
Wherein the first parameter obtained is related to the exogenous system, for example comprising: name of the foreign system, communication type, etc.
S102: determining a first message format matched with the first parameter information based on a preset configuration table;
in this embodiment, the configuration table is preconfigured with relevant information of some messages of different protocols, for example, the configuration table includes an external connection system table, and the external connection system table includes a corresponding relationship between a parameter of an external source system and a message format. Or the external connection table comprises the corresponding relation between the first parameter information and the message format.
When the first parameter information is acquired, that is, the parameter information of the external source system is acquired, a message format matched with the first parameter information can be determined based on the first parameter information.
S103: determining first message parameter information matched with the first message format based on a preset configuration table; the second message parameter information is the basic information of the message related to the first message format;
in this embodiment, a message control table is preconfigured in the configuration table, and the message control table includes an association relationship between a message format and a message parameter.
The message parameter includes various information, and preferably, the message parameter may include: the message format, the header length, whether the message length includes the header length, the system format type, the number of domains, and the like.
It should be understood that each message format corresponds to a unique message parameter. That is, each message format corresponds to a unique message format, a header length, whether the message length includes information such as the header length, a system format type, and the number of domains.
In this embodiment, based on a message control table in a preset configuration table, message parameter information that matches the first message format may be determined, which is expressed as the first message parameter information in this embodiment.
S104: analyzing the first message based on the parameter information of the first message format to obtain a first transaction code of the first message;
specifically, the process of parsing the first packet includes:
extracting a message header in the first message based on first message parameter information;
and analyzing the message header to obtain a first transaction code of the first message.
For example, the following steps are carried out: the packet header can be extracted from the first packet according to the packet header length and whether the packet header length is included in the packet header length, and the transaction code can be analyzed from the packet header based on information such as the format type of the system.
S105: determining first interface message configuration information matched with the first transaction code, the first message format and the transaction direction based on a preset configuration table; the interface transaction configuration information comprises at least one domain name;
in this embodiment, the transaction direction indicates that the transaction is a request instruction or a return instruction.
The configuration table is preset with a transaction message configuration table, and the transaction message configuration table comprises: the relationship between the transaction code, the message format, the transaction direction and the interface message configuration information.
It should be noted that the transaction code, the message format, the transaction direction and the interface message configuration information have a unique corresponding relationship.
S106: determining domain configuration information matched with the first interface message configuration information based on a preset configuration table;
in this embodiment, the configuration table includes a domain configuration table, and the domain configuration table includes configuration information of domains corresponding to the domain names.
Wherein, the configuration information of the domain at least comprises: domain length (maximum length), type of domain, class fixed/variable length of domain, subdomain, etc.
S107: and unpacking the message according to the domain configuration information matched with the first interface message configuration information.
In this embodiment, as can be seen from the above description, in step S104, the header of the first packet is analyzed, and then in step S107, the packet body of the packet needs to be analyzed. The message body of the message is analyzed based on the configuration information of at least one domain corresponding to the first message, and a middle message is obtained.
Further, the method also comprises the following steps:
setting configuration information of a target message format, wherein the configuration information of the target message format comprises: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a target message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains.
In the embodiment, when a first message sent by an external source system is received, first parameter information is obtained; the first parameter domain is related to the foreign system; determining a first message format of a first message matched with the first parameter information based on a preset configuration table; determining first message parameter information matched with the first message format based on a preset configuration table; the second message parameter information is the basic information of the message related to the first message format; analyzing the first message based on the parameter information of the first message format to obtain a transaction code of the first message; determining interface message configuration information matched with the transaction code, the message format of the first message and the transaction direction based on a preset configuration table; the interface transaction configuration information comprises at least one domain name; determining domain configuration information matched with the interface message configuration information based on a preset configuration table; and according to the domain configuration information, the first message is reported. Therefore, unpacking operation of messages with different protocols is achieved through the configuration table, and configuration information can be configured, so that unpacking of the messages with the new message format can be achieved through a mode of modifying the configuration file under the condition that the new message format occurs, and flexibility of message processing is improved.
Referring to fig. 2, a schematic flow chart of a configurable multi-protocol packet conversion method provided in embodiment 2 of the present invention is shown, where in this embodiment, the method includes:
s201: when an instruction of sending a message to an external source system is received, first parameter information is obtained; the first parameter information is related to the downstream system;
in this embodiment, when a message instruction needs to be sent to the external source system, first parameter information related to the external source system may be acquired.
Wherein the first parameter obtained is related to the exogenous system, for example comprising: name of the foreign system, communication type, etc.
S202: determining a second message format matched with the first parameter information based on a preset configuration table;
in this embodiment, the configuration table is preconfigured with relevant information of some messages of different protocols, for example, the configuration table includes an external connection system table, and the external connection system table includes a corresponding relationship between a parameter of an external source system and a message format. Or the external connection table comprises the corresponding relation between the first parameter information and the message format.
When the first parameter information is acquired, that is, the parameter information of the external source system is acquired, a packet format matched with the first parameter information may be determined based on the first parameter information, which is expressed as a second packet format in this embodiment.
S203: determining second message parameter information matched with the second message format based on a preset configuration table; the second message parameter information is basic information of a message related to the second message format;
in this embodiment, a message control table is preconfigured in the configuration table, and the message control table includes an association relationship between a message format and a message parameter.
The message parameter includes various information, and preferably, the message parameter may include: the message format, the header length, whether the message length includes the header length, the system format type, the number of domains, and the like.
It should be understood that each message format corresponds to a unique message parameter. That is, each message format corresponds to a unique message format, a header length, whether the message length includes information such as the header length, a system format type, and the number of domains.
In this embodiment, based on a message control table in a preset configuration table, message parameter information matched with the second message format may be determined, which is expressed as the second message parameter information in this embodiment.
S204: acquiring a second transaction code, and generating a message header based on the parameter information of the second message format and the second transaction code;
for example, the following steps are carried out: the message header can be generated according to the length of the packet header and whether the length of the message contains the length of the packet header, the format type of an external source system and the like.
S205: determining second interface message configuration information matched with the second transaction code, the second message format and the transaction direction based on a preset configuration table; the interface transaction configuration information comprises at least one domain name;
in this embodiment, the transaction direction indicates that the transaction is a request instruction or a return instruction.
The configuration table is preset with a transaction message configuration table, and the transaction message configuration table comprises: the relationship between the transaction code, the message format, the transaction direction and the interface message configuration information.
It should be noted that the transaction code, the message format, the transaction direction and the interface message configuration information have a unique corresponding relationship.
S206: determining domain configuration information matched with the second interface message configuration information based on a preset configuration table;
s207: grouping the body information based on the domain configuration information matched with the second interface message configuration information;
in this embodiment, the configuration table includes a domain configuration table, and the domain configuration table includes configuration information of domains corresponding to the domain names.
Wherein, the configuration information of the domain at least comprises: domain length (maximum length), type of domain, class fixed/variable length of domain, subdomain, etc.
In this embodiment, the purpose of grouping packets of different protocol messages is achieved through the configuration table, and the configuration information is configurable, so that when a new message format occurs, unpacking of a message of the new message format can be achieved by modifying the configuration file, thereby improving the flexibility of message processing.
Referring to fig. 3, a schematic flowchart of a configurable multi-protocol packet conversion method provided in an embodiment of the present invention is shown, where the method in this embodiment includes:
s301: responding to a target instruction, and acquiring first parameter information related to the target instruction;
s302: performing packaging or unpacking based on a preset configuration table and the first parameter information;
the configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to the exogenous system; the interface transaction configuration information includes at least one domain name.
In this embodiment, the target instruction includes a message receiving instruction and a message sending instruction, and the following operation processes are included for different target instructions:
the first implementation mode comprises the following steps: aiming at a message receiving instruction:
acquiring first parameter information under the condition of receiving a message sent by an external source system; the first parameter is related to the exogenous system;
determining a first message format of a first message matched with the first parameter information based on a preset configuration table;
determining first message parameter information matched with the first message format based on a preset configuration table; the second message parameter information is the basic information of the message related to the first message format;
analyzing the first message based on the parameter information of the first message format to obtain a transaction code of the first message;
determining interface message configuration information matched with the transaction code, the message format of the first message and the transaction direction based on a preset configuration table; the interface transaction configuration information comprises at least one domain name;
determining domain configuration information matched with the interface message configuration information based on a preset configuration table;
and unpacking the message according to the domain configuration information matched with the first interface message configuration information.
A specific implementation manner of the first implementation manner is described in detail in the first implementation manner, and is not described in detail in this embodiment.
The second embodiment: aiming at a message sending instruction:
when an instruction of sending a message to an external source system is received, first parameter information is obtained; the first parameter information is related to the downstream system;
determining a second message format matched with the first parameter information based on a preset configuration table;
determining second message parameter information matched with the second message format based on a preset configuration table; the second message parameter information is basic information of a message related to the second message format;
acquiring a second transaction code, and generating a message header based on the parameter information of the second message format and the second transaction code;
determining interface message configuration information matched with the second transaction code, the second message format and the transaction direction based on a preset configuration table; the interface transaction configuration information comprises at least one domain name;
grouping body information based on the domain configuration information.
The specific implementation manner of the second embodiment is described in detail in the second embodiment, and is not described in detail in this embodiment.
Further, in order to ensure that packet packing or unpacking operation of the packet can be realized after a new packet format appears, the method further includes:
setting configuration information of a target message format;
the configuration information of the target message format includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a target message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains;
the target message format is a message format not contained in the configuration file.
The embodiment of the invention discloses a configurable multi-protocol message processing method, a configurable multi-protocol message processing device and electronic equipment, wherein the method comprises the following steps: responding to a target instruction, and acquiring first parameter information related to the target instruction; performing packaging or unpacking based on a preset configuration table and the first parameter information; the configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to the exogenous system; the interface transaction configuration information includes at least one domain name. Therefore, the processing of the messages of various protocols is realized only by the mode of configuration files, and the flexibility of message processing is improved.
Example 4:
referring to fig. 4, a schematic structural diagram of a configurable multi-protocol packet processing apparatus according to an embodiment of the present invention is shown, where the apparatus includes:
an obtaining unit 401, in response to a target instruction, obtains first parameter information related to the target instruction, and
a packet processing unit 402, configured to perform packet packing or unpacking based on a preset configuration table and the first parameter information;
the preset configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to the exogenous system; the interface transaction configuration information includes at least one domain name.
Optionally, when the target instruction is a message receiving instruction, the message processing unit includes:
the first determining subunit is configured to determine, based on a preset configuration table, a first packet format of a first packet matched with the first parameter information;
the second determining subunit is configured to determine, based on a preset configuration table, first packet parameter information matched with the first packet format; the first message parameter information is basic information of a message related to the first message format;
the analysis unit is used for analyzing the message based on the parameter information of the first message format to obtain a first transaction code;
the third determining subunit is configured to determine, based on a preset configuration table, first interface message configuration information that matches the first transaction code, the message format of the first message, and the transaction direction; the interface transaction configuration information comprises at least one domain name;
a fourth determining subunit, configured to determine, based on a preset configuration table, domain configuration information that matches the first interface packet configuration information;
and the unpacking subunit is used for unpacking the message according to the domain configuration information.
Optionally, when the target instruction is a message sending instruction, the message processing unit includes:
a fifth determining subunit, configured to determine, based on a preset configuration table, a second packet format matched with the first parameter information;
a sixth determining subunit, configured to determine, based on a preset configuration table, second packet parameter information matched with the second packet format; the second message parameter information is basic information of a message related to the second message format;
a message header generating subunit, configured to acquire a second transaction code, and generate a message header based on the parameter information of the second message format and the second transaction code;
a seventh determining subunit, configured to determine, based on a preset configuration table, interface message configuration information that matches the second transaction code, the second message format, and the transaction direction; the interface transaction configuration information comprises at least one domain name;
an eighth determining subunit, configured to determine, based on a preset configuration table, domain configuration information that matches the second interface packet configuration information;
and the group packaging subunit is used for packaging the group body information based on the domain configuration information matched with the second interface message configuration information.
Optionally, the method further includes:
the setting subunit is used for setting the configuration information of the target message format;
the configuration information of the target message format includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a target message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains;
the target message format is a message format not contained in the configuration file.
The device of the embodiment is used for responding to a target instruction and acquiring first parameter information related to the target instruction; performing packaging or unpacking based on a preset configuration table and the first parameter information; the configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to the exogenous system; the interface transaction configuration information includes at least one domain name. Therefore, the processing of the messages of various protocols is realized only by the mode of configuration files, and the flexibility of message processing is improved.
Example 5:
referring to fig. 5, a schematic structural diagram of an electronic device disclosed in an embodiment of the present invention is shown, and in this embodiment, the electronic device includes:
a memory and a processor;
the memory is used for storing programs, and the processor is used for executing the configurable multi-protocol message processing method described in the above embodiments 1-3 when executing the programs.
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.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A configurable multi-protocol message processing method is characterized by comprising the following steps:
responding to a target instruction, and acquiring first parameter information related to the target instruction;
performing packaging or unpacking based on a preset configuration table and the first parameter information;
the preset configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to an exogenous system; the interface transaction configuration information includes at least one domain name.
2. The method according to claim 1, wherein when the target instruction is a packet received from an external system, the performing packet packing or unpacking based on a preset configuration table and the first parameter information includes:
determining a first message format matched with the first parameter information based on a preset configuration table;
determining first message parameter information matched with the first message format based on a preset configuration table; the first message parameter information is basic information of a message related to the first message format;
analyzing the message based on the parameter information of the first message format to obtain a first transaction code;
determining first interface message configuration information matched with the first transaction code, the message format and the transaction direction of the first message based on a preset configuration table; the interface transaction configuration information comprises at least one domain name;
determining domain configuration information matched with the first interface message configuration information based on a preset configuration table;
and unpacking the message according to the domain configuration information matched with the first interface message configuration information.
3. The method of claim 2, wherein parsing the message based on the parameter information of the first message format to obtain the first transaction code of the message comprises:
extracting a message header in the message based on first message parameter information;
and analyzing the message header to obtain a first transaction code of the message.
4. The method according to claim 1, wherein when the target instruction is a transmission packet, the performing packet packing or unpacking based on a preset configuration table and the first parameter information includes:
determining a second message format matched with the first parameter information based on a preset configuration table;
determining second message parameter information matched with the second message format based on a preset configuration table; the second message parameter information is basic information of a message related to the second message format;
acquiring a second transaction code, and generating a message header based on the parameter information of the second message format and the second transaction code;
determining interface message configuration information matched with the second transaction code, the second message format and the transaction direction based on a preset configuration table; the interface transaction configuration information comprises at least one domain name;
determining domain configuration information matched with the second interface message configuration information based on a preset configuration table
And grouping the body information based on the domain configuration information matched with the second interface message configuration information.
5. The method of claim 1, further comprising:
setting configuration information of a target message format;
the configuration information of the target message format includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a target message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains;
the target message format is a message format not contained in the configuration file.
6. A configurable multi-protocol message processing apparatus, comprising:
an acquisition unit configured to acquire, in response to a target instruction, first parameter information related to the target instruction,
the message processing unit is used for performing packaging or unpacking based on a preset configuration table and the first parameter information;
the configuration table includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains; the first parameter information is related to an exogenous system; the interface transaction configuration information includes at least one domain name.
7. The apparatus according to claim 6, wherein, in the case that the target instruction is to receive a message sent by an external source system, the message processing unit comprises:
the first determining subunit is configured to determine, based on a preset configuration table, a first packet format of a first packet matched with the first parameter information;
the second determining subunit is configured to determine, based on a preset configuration table, first packet parameter information matched with the first packet format; the first message parameter information is basic information of a message related to the first message format;
the analysis unit is used for analyzing the message based on the parameter information of the first message format to obtain a first transaction code;
the third determining subunit is configured to determine, based on a preset configuration table, first interface message configuration information that matches the first transaction code, the message format of the first message, and the transaction direction; the interface transaction configuration information comprises at least one domain name;
a fourth determining subunit, configured to determine, based on a preset configuration table, domain configuration information that matches the first interface packet configuration information;
and the unpacking subunit is used for unpacking the message according to the domain configuration information.
8. The apparatus of claim 6, wherein, in the case that the target command is a send message, the message processing unit comprises:
a fifth determining subunit, configured to determine, based on a preset configuration table, a second packet format matched with the first parameter information;
a sixth determining subunit, configured to determine, based on a preset configuration table, second packet parameter information matched with the second packet format; the second message parameter information is basic information of a message related to the second message format;
a message header generating subunit, configured to acquire a second transaction code, and generate a message header based on the parameter information of the second message format and the second transaction code;
a seventh determining subunit, configured to determine, based on a preset configuration table, interface message configuration information that matches the second transaction code, the second message format, and the transaction direction; the interface transaction configuration information comprises at least one domain name;
an eighth determining subunit, configured to determine, based on a preset configuration table, domain configuration information that matches the second interface packet configuration information;
and the group packaging subunit is used for packaging the group body information based on the domain configuration information matched with the second interface message configuration information.
9. The apparatus of claim 6, further comprising:
the setting subunit is used for setting the configuration information of the target message format;
the configuration information of the target message format includes: the system comprises an external system table, a message control table, a transaction message configuration table and a domain configuration table; the external connection system table comprises a corresponding relation between a target message format and first parameter information, and the message control table comprises a corresponding relation between a message format and message parameter information; the transaction message configuration table comprises the relationship between transaction codes, message formats, transaction directions and interface message configuration information; the domain configuration table includes: configuration information of different domains;
the target message format is a message format not contained in the configuration file.
10. An electronic device, comprising:
a memory and a processor;
the memory is used for storing a program, and the processor is used for executing the configurable multi-protocol message processing method of any one of the preceding claims 1-5 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111094285.6A CN113765722B (en) | 2021-09-17 | 2021-09-17 | Configurable multi-protocol message processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111094285.6A CN113765722B (en) | 2021-09-17 | 2021-09-17 | Configurable multi-protocol message processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113765722A true CN113765722A (en) | 2021-12-07 |
CN113765722B CN113765722B (en) | 2023-01-20 |
Family
ID=78796276
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111094285.6A Active CN113765722B (en) | 2021-09-17 | 2021-09-17 | Configurable multi-protocol message processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113765722B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115174375A (en) * | 2022-07-08 | 2022-10-11 | 中国银行股份有限公司 | Message unpacking method, device, equipment and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103428080A (en) * | 2012-05-17 | 2013-12-04 | 中国银联股份有限公司 | Data unpacking and data packing method |
CN110264648A (en) * | 2019-05-10 | 2019-09-20 | 杭州米雅信息科技有限公司 | Data processing method and device, automatic teller machine and data processing system |
CN110287247A (en) * | 2019-05-22 | 2019-09-27 | 平安银行股份有限公司 | Date storage method, device, equipment and storage medium based on Unionpay's system |
CN112383533A (en) * | 2020-11-10 | 2021-02-19 | 中国农业银行股份有限公司 | Message format conversion method and device |
-
2021
- 2021-09-17 CN CN202111094285.6A patent/CN113765722B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103428080A (en) * | 2012-05-17 | 2013-12-04 | 中国银联股份有限公司 | Data unpacking and data packing method |
CN110264648A (en) * | 2019-05-10 | 2019-09-20 | 杭州米雅信息科技有限公司 | Data processing method and device, automatic teller machine and data processing system |
CN110287247A (en) * | 2019-05-22 | 2019-09-27 | 平安银行股份有限公司 | Date storage method, device, equipment and storage medium based on Unionpay's system |
CN112383533A (en) * | 2020-11-10 | 2021-02-19 | 中国农业银行股份有限公司 | Message format conversion method and device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115174375A (en) * | 2022-07-08 | 2022-10-11 | 中国银行股份有限公司 | Message unpacking method, device, equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN113765722B (en) | 2023-01-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108076017B (en) | Protocol analysis method and device for data packet | |
CN113360301B (en) | Message transmission system and method | |
CN113765722B (en) | Configurable multi-protocol message processing method and device and electronic equipment | |
CN114025015A (en) | Message transmission method and device | |
CN115208951B (en) | Request processing method, request processing device, electronic equipment and computer readable storage medium | |
CN111246406A (en) | Short message sending method, system, storage medium and terminal equipment | |
CN113867732A (en) | Message information processing method, system and storage medium | |
CN110647490A (en) | Data transmission method, device, equipment and computer storage medium | |
CN113973111B (en) | Data forwarding method, device, gateway equipment and computer readable storage medium | |
CN111131323A (en) | Message transmission method and related device | |
CN114815782A (en) | Remote diagnosis method, apparatus, device and medium | |
CN105068926A (en) | Program test method and device thereof | |
US20140136620A1 (en) | Protocol conversion apparatus and method | |
CN112910838B (en) | Composite protocol analysis method, device, equipment, system and storage medium | |
CN110445658B (en) | Message processing method and system | |
CN104734939A (en) | Session keep-alive method and device | |
CN108306865B (en) | Modbus packet-sticking processing method and device based on Netty framework | |
CN114244758B (en) | Network diagnosis method, storage medium, electronic equipment and system of android platform | |
CN111107080B (en) | Error information pushing method, device and equipment and readable storage medium | |
CN111162879A (en) | Data transmission method and device, electronic equipment and storage medium | |
CN113204492A (en) | Android application testing method and device | |
CN113138861A (en) | Message processing method, system and storage medium based on equipment service system | |
CN110943895A (en) | Network shutdown and Linux system-based network data processing method and device | |
CN104468128B (en) | Type of network interface extensively adapter system for Embedded Network Processor | |
CN110661681B (en) | Buried point design method and device |
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 |