CN114745449A - Message processing method and device, storage medium and electronic equipment - Google Patents

Message processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114745449A
CN114745449A CN202210385557.6A CN202210385557A CN114745449A CN 114745449 A CN114745449 A CN 114745449A CN 202210385557 A CN202210385557 A CN 202210385557A CN 114745449 A CN114745449 A CN 114745449A
Authority
CN
China
Prior art keywords
format
message
attribute value
host
transaction request
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
CN202210385557.6A
Other languages
Chinese (zh)
Other versions
CN114745449B (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.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210385557.6A priority Critical patent/CN114745449B/en
Publication of CN114745449A publication Critical patent/CN114745449A/en
Application granted granted Critical
Publication of CN114745449B publication Critical patent/CN114745449B/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/22Parsing or analysis of headers

Landscapes

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

Abstract

The invention provides a message processing method and device, a storage medium and electronic equipment, which can be applied to the financial field or other fields, wherein the method comprises the following steps: when a transaction request of an external system is received, acquiring a transaction request message in the transaction request; determining the message format of the transaction request message; carrying out format conversion on the transaction request message in the message format to obtain a target transaction request message in a host format, wherein the host format is one of a dynamic host format and a static host format; generating a transaction response message in the host format based on the target transaction request message; carrying out format conversion on the transaction response message in the host format to obtain a target transaction response message in the message format; and sending the target transaction response message to the external system. By applying the message processing method provided by the embodiment of the invention, the host can receive messages in different types of message formats.

Description

Message processing method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for processing a packet, a storage medium, and an electronic device.
Background
At present, in order to meet the increasing business requirements, the number of various application systems is increasing, and in the process of performing various business processes, a host computer that needs to process business data is usually connected with various systems, however, the host computer processing message interface definition format is not a standardized format that is commonly used in the industry, the extensibility is poor, the format is single, if the format defined in the interface of the host computer changes, all systems that call the host computer interface need to be matched and modified, and the maintenance difficulty is large.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a message processing method, which can enable a host to receive messages in different types of message formats.
The invention also provides a message processing device, which is used for ensuring the realization and the application of the method in practice.
A message processing method comprises the following steps:
when a transaction request of an external system is received, acquiring a transaction request message in the transaction request;
determining the message format of the transaction request message;
carrying out format conversion on the transaction request message in the message format to obtain a target transaction request message in a host format, wherein the host format is one of a dynamic host format and a static host format;
generating a transaction response message in the host format based on the target transaction request message;
carrying out format conversion on the transaction response message in the host format to obtain a target transaction response message in the message format;
and sending the target transaction response message to the external system.
Optionally, the above method, performing format conversion on the transaction request packet in the packet format to obtain a target transaction request packet in a host format, includes:
obtaining the attribute value of the message format of the transaction request message,
determining an output format attribute value corresponding to the attribute value of the message format, and analyzing the transaction request message according to the attribute value of the message format to obtain transaction request message data;
and processing the transaction request message data according to the output attribute value to obtain a target transaction message in a host format corresponding to the output format attribute value.
Optionally, the method for determining the attribute value of the output packet format corresponding to the attribute value of the packet format includes:
taking the attribute value of the message format as an input format attribute value, and acquiring a preset configuration file;
and determining an output format attribute value corresponding to the input format attribute value in the configuration file.
Optionally, in the method, when the output packet format attribute value is a dynamic host format attribute value, the processing the transaction request packet data according to the output format attribute value to obtain a target transaction packet in a host format corresponding to the output format attribute value includes:
formatting each data field in the transaction request message data to obtain each host standardized data;
and splicing the standardized data of the hosts by using a preset separator to obtain a target transaction message in a dynamic host format.
Optionally, in the method, when the output packet format attribute value is a static host format attribute value, the processing the transaction request packet data according to the output format attribute value to obtain a target transaction packet in a host format corresponding to the output format attribute value includes:
obtaining initial output message data;
matching the first field identification of each data field in the transaction request message data with each second field identification of the initial output message data to determine each first target field identification, wherein the first target field identification is the first field identification successfully matched with one second field identification in the initial output message data;
and putting the field data to which each first target field identifier belongs into the position corresponding to the second field identifier successfully matched with the first target field identifier in the initial output message data to obtain the target transaction message in the static host format.
Optionally, the above method, where the format conversion is performed on the transaction response packet in the host format to obtain the target transaction response packet in the packet format, includes:
analyzing the transaction response message according to the attribute value of the host format to obtain transaction response message data;
and processing the transaction response message data according to the attribute value of the message format to obtain a target transaction message in the message format.
A message processing apparatus comprising:
the receiving unit is used for acquiring a transaction request message in a transaction request when the transaction request of an external system is received;
the determining unit is used for determining the message format of the transaction request message;
the first format conversion unit is used for carrying out format conversion on the transaction request message in the message format to obtain a target transaction request message in a host format, wherein the host format is one of a dynamic host format and a static host format;
the generating unit is used for generating a transaction response message in the host format based on the target transaction request message;
the second format conversion unit is used for carrying out format conversion on the transaction response message in the host format to obtain a target transaction response message in the message format;
and the sending unit is used for sending the target transaction response message to the external system.
The above apparatus, optionally, the first format conversion unit includes:
an obtaining subunit, configured to obtain an attribute value of a message format of the transaction request message,
a determining subunit, configured to determine an output format attribute value corresponding to the attribute value of the message format, and analyze the transaction request message according to the attribute value of the message format to obtain transaction request message data;
and the processing subunit is used for processing the transaction request message data according to the output attribute value to obtain a target transaction message in a host format corresponding to the output format attribute value.
A storage medium, which includes a storage instruction, and when the instruction runs, controls a device on which the storage medium is located to execute the message processing method as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the message processing method as described above.
Compared with the prior art, the invention has the following advantages:
the invention provides a message processing method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when a transaction request of an external system is received, acquiring a transaction request message in the transaction request; determining the message format of the transaction request message; carrying out format conversion on the transaction request message in the message format to obtain a target transaction request message in a host format, wherein the host format is one of a dynamic host format and a static host format; generating a transaction response message in the host format based on the target transaction request message; carrying out format conversion on the transaction response message in the host format to obtain a target transaction response message in the message format; and sending the target transaction response message to the external system. The host can receive messages in various formats, the expansibility of a host interface and the independence between systems can be improved, each calling party system only needs to pay attention to fields related to the host interface, extra processing is not needed for the fields not related to the host interface, and linkage change caused by the fact that the fields are newly added to the host interface in the traditional mode is avoided.
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 of a message processing method according to the present invention;
FIG. 2 is a flow chart illustrating a process for obtaining a target transaction request message in a host format according to the present invention;
fig. 3 is a flowchart of a process of determining an output packet format attribute value corresponding to an attribute value of a packet format according to the present invention;
fig. 4 is a schematic structural diagram of a message processing apparatus according to the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention;
fig. 6 is a flowchart of a message processing procedure 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.
In this application, 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.
An embodiment of the present invention provides a method for processing a message, where the method may be applied to an electronic device, and the electronic device may be a host, a server, a notebook computer, a desktop computer, an all-in-one computer, or a portable terminal, and a flowchart of the method is shown in fig. 1, and specifically includes:
s101: when a transaction request of an external system is received, a transaction request message in the transaction request is obtained.
In this embodiment, the external system may be an external transaction system, for example, a transaction system in a bank.
Optionally, the transaction request may be analyzed to obtain transaction request messages in the transaction request, and the number of the transaction request messages may be one or more.
S102: and determining the message format of the transaction request message.
The message format of the transaction request message in this embodiment may be various types of formats adapted to the external transaction system, for example, a Json format or an XML format.
S103: and carrying out format conversion on the transaction request message in the message format to obtain a target transaction request message in a host format.
In this embodiment, the host format may be a format adapted to the host side, and for example, may be at least one of a dynamic host format and a static host format.
Optionally, a format conversion mode corresponding to the message format may be determined, and the format conversion is performed on the transaction request message according to the format conversion mode corresponding to the message format, so as to obtain a target transaction request message in the host format.
Optionally, format conversion may be performed on the received transaction request message through a preset format conversion component, so as to obtain a host format target transaction request message.
S104: and generating a transaction response message in the host format based on the target transaction request message.
In this embodiment, after obtaining the target transaction request message in the host format, the electronic device may execute the transaction operation corresponding to the target transaction response message, and generate the transaction response message in the host format according to an operation result obtained by executing the transaction operation.
S105: and carrying out format conversion on the transaction response message in the host format to obtain a target transaction response message in the message format.
In this embodiment, the message format of the target transaction response message may be consistent with the message format of the transaction request message, that is, the transaction response message may be a message in a Json format or an XML format, and format conversion may be performed on the transaction response message in a format conversion manner corresponding to the host format, so as to obtain the target transaction response message in the message format.
Optionally, format conversion may be performed on the transaction response message through the format conversion component, so as to obtain a host format target transaction response message.
S106: and sending the target transaction response message to the external system.
In this embodiment, the target transaction response message is sent to the external system, and the external system may display transaction response information, such as an operation result, included in the target transaction response message in a preset transaction screen.
By applying the method provided by the embodiment of the invention, the host can receive messages in various formats and convert the received messages into the messages in the host format, the expansibility of a host interface and the independence among systems can be improved, each calling party system only needs to pay attention to the fields related by the own party in the interface, the fields not related need not to be additionally processed, and the linkage change caused by the addition of the fields in the interface in the traditional mode is avoided.
In an embodiment provided by the present invention, based on the foregoing implementation process, optionally, the format conversion is performed on the transaction request packet in the packet format to obtain a target transaction request packet in a host format, as shown in fig. 2, including:
s201: and acquiring the attribute value of the message format of the transaction request message.
In this embodiment, the attribute value of the packet format may be an attribute parameter that characterizes the packet format.
S202: and determining an output format attribute value corresponding to the attribute value of the message format, and analyzing the transaction request message according to the attribute value of the message format to obtain transaction request message data.
In this embodiment, the output format attribute value corresponding to the attribute value of the packet format may be determined according to a preset configuration file, and the output format attribute value may include at least one of a dynamic host format attribute value and a static host format attribute value.
S203: and processing the transaction request message data according to the output attribute value to obtain a target transaction message in a host format corresponding to the output format attribute value.
In this embodiment, the processing mode of the transaction request message data may be determined according to the output attribute value, so that the transaction request message data is processed according to the processing mode to obtain the target transaction message in the host format.
In an embodiment provided by the present invention, based on the foregoing implementation process, optionally, the determining an attribute value of an output packet format corresponding to the attribute value of the packet format, as shown in fig. 3, includes:
s301: and taking the attribute value of the message format as an input format attribute value, and acquiring a preset configuration file.
In this embodiment, the configuration file may record a corresponding relationship between each input format attribute value and the input format attribute value.
S302: and determining an output format attribute value corresponding to the input format attribute value in the configuration file.
In this embodiment, the configuration file may be traversed according to the input format attribute value, and the output format attribute value corresponding to the input format attribute value may be determined in the configuration file.
In an embodiment provided by the present invention, based on the foregoing implementation process, optionally, when the output packet format attribute value is a dynamic host format attribute value, the processing, according to the output format attribute value, the transaction request packet data to obtain a target transaction packet in a host format corresponding to the output format attribute value includes:
formatting each data field in the transaction request message data to obtain each host standardized data;
and splicing the standardized data of the hosts by using a preset separator to obtain a target transaction message in a dynamic host format.
In this embodiment, the normalized data may include at least one of numeric data and variable data; the numeric data may include field identifications, attributes, and values; the variant data may include field identifications, attributes, old values, and new values.
In an embodiment provided by the present invention, based on the foregoing implementation process, optionally, when the output packet format attribute value is a static host format attribute value, processing the transaction request packet data according to the output format attribute value to obtain a target transaction packet in a host format corresponding to the output format attribute value includes:
obtaining initial output message data;
matching the first field identification of each data field in the transaction request message data with each second field identification of the initial output message data to determine each first target field identification, wherein the first target field identification is the first field identification successfully matched with one second field identification in the initial output message data;
and putting the field data to which each first target field identifier belongs into the position corresponding to the second field identifier successfully matched with the first target field identifier in the initial output message data to obtain the target transaction message in the static host format.
In this embodiment, an operation of initializing output message data may be performed to obtain initial output message data, and in one implementation, a preset message template may be obtained, and the operation of initializing output message data may be performed based on the message template.
Optionally, when the first field identifier is consistent with any one of the second field identifiers, it is determined that the first field identifier is successfully matched with the second field identifier.
In an embodiment of the present invention, based on the foregoing implementation process, optionally, the performing format conversion on the transaction response packet in the host format to obtain the target transaction response packet in the packet format includes:
analyzing the transaction response message according to the attribute value of the host format to obtain transaction response message data;
and processing the transaction response message data according to the attribute value of the message format to obtain a target transaction message in the message format.
In the embodiment of the invention, the analysis mode of the transaction response message is determined according to the attribute value of the host format, the transaction response message is analyzed based on the analysis mode of the transaction response message to obtain the data of the transaction response message, and the data of each transaction response message is packaged based on the processing mode of the attribute value of the message format to obtain the target transaction message of the message format.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides a message processing apparatus, which is used for specifically implementing the method in fig. 1, where the message processing apparatus provided in the embodiment of the present invention may be applied to an electronic device, and a schematic structural diagram of the message processing apparatus is shown in fig. 4, and specifically includes:
a receiving unit 401, configured to obtain a transaction request message in a transaction request when receiving the transaction request of an external system;
a determining unit 402, configured to determine a message format of the transaction request message;
a first format conversion unit 403, configured to perform format conversion on the transaction request packet in the packet format to obtain a target transaction request packet in a host format, where the host format is one of a dynamic host format and a static host format;
a generating unit 404, configured to generate a transaction response message in the host format based on the target transaction request message;
a second format conversion unit 405, configured to perform format conversion on the transaction response packet in the host format, to obtain a target transaction response packet in the packet format;
a sending unit 406, configured to send the target transaction response message to the external system.
In an embodiment provided by the present invention, based on the above scheme, optionally, the first format conversion unit includes:
an obtaining subunit, configured to obtain an attribute value of a message format of the transaction request message,
a determining subunit, configured to determine an output format attribute value corresponding to the attribute value of the message format, and analyze the transaction request message according to the attribute value of the message format to obtain transaction request message data;
and the processing subunit is used for processing the transaction request message data according to the output attribute value to obtain a target transaction message in a host format corresponding to the output format attribute value.
In an embodiment provided by the present invention, based on the above scheme, optionally, the determining subunit is configured to:
taking the attribute value of the message format as an input format attribute value, and acquiring a preset configuration file;
and determining an output format attribute value corresponding to the input format attribute value in the configuration file.
In an embodiment provided by the present invention, based on the above scheme, optionally, under the condition that the output packet format attribute value is a dynamic host format attribute value, the processing subunit is configured to:
formatting each data field in the transaction request message data to obtain each host standardized data;
and splicing the standardized data of the hosts by using a preset separator to obtain a target transaction message in a dynamic host format.
In an embodiment provided by the present invention, based on the above scheme, optionally, under the condition that the output packet format attribute value is a static host format attribute value, the processing subunit is configured to:
obtaining initial output message data;
matching the first field identification of each data field in the transaction request message data with each second field identification of the initial output message data to determine each first target field identification, wherein the first target field identification is the first field identification successfully matched with one second field identification in the initial output message data;
and putting the field data to which each first target field identifier belongs into the position corresponding to the second field identifier successfully matched with the first target field identifier in the initial output message data to obtain the target transaction message in the static host format.
In an embodiment provided by the present invention, based on the above scheme, optionally, the second format conversion unit includes:
the analysis subunit is used for analyzing the transaction response message according to the attribute value of the host format to obtain transaction response message data;
and the execution subunit is used for processing the transaction response message data according to the attribute value of the message format to obtain a target transaction message in the message format.
The specific principle and the execution process of each unit and each module in the message processing apparatus disclosed in the embodiment of the present invention are the same as those of the message processing method disclosed in the embodiment of the present invention, and reference may be made to corresponding parts in the message processing 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 device where the storage medium is located is controlled to execute the message processing method.
An embodiment of the present invention further provides an electronic device, a schematic structural diagram of which is shown in fig. 5, and the electronic device specifically includes a memory 501 and one or more instructions 502, where the one or more instructions 502 are stored in the memory 501, and are configured to be executed by one or more processors 503 to perform the following operations for the one or more instructions 502:
when a transaction request of an external system is received, acquiring a transaction request message in the transaction request;
determining the message format of the transaction request message;
carrying out format conversion on the transaction request message in the message format to obtain a target transaction request message in a host format, wherein the host format is one of a dynamic host format and a static host format;
generating a transaction response message in the host format based on the target transaction request message;
carrying out format conversion on the transaction response message in the host format to obtain a target transaction response message in the message format;
and sending the target transaction response message to the external system.
The inventor researches and discovers that at present, most of services provided under a mainframe are realized through a static data interface when the services are called by other modules or external systems. The interface leads each field in the interface to be assigned when data is uploaded each time, even if the transaction only modifies one field value; in addition, if a field is added in the interface subsequently, all modules calling the interface and external systems need to be modified in a matching way, and the exception of data exception occurs in the program once the modification is missed.
Based on the method, the dynamic input message is realized by converting the input Json or XML dynamic message into a standardized static or dynamic output; and converting the static or dynamic data structure returned by the mainframe into a Json or XML format and returning the Json or XML format to the external call.
Specifically, some attribute parameters may be set by the host, including: converting the direction parameters, the input format attribute parameters, the output format attribute parameters and the data standardized by the host; the conversion direction parameters comprise parameters for converting Json or XML into a host format and parameters for converting the host format into Json or XML; the input format attribute parameters comprise Json format attribute parameters, XML format attribute parameters, host static format attribute parameters and host dynamic format attribute parameters; the output format parameters comprise Json format attribute parameters, XML format attribute parameters, host static format attribute parameters and host dynamic format attribute parameters; the data standardized by the host computer comprises value type data and variation type data; the value type data is field id, attribute and value; the variable data is field id, attribute, old value, new value.
The Json or XML message can be converted into a host format, and the input message data is analyzed according to the input format attribute value; and determining the host format to be converted according to the output format attribute value.
If the message is converted into the static format, firstly initializing output message data; then, transmitting data according to whether the field id in the analyzed input message data is matched with the field name of the output message format; if the field names are the same, the value entered by the field is put into the position corresponding to the field in the output message.
If the data fields in the input message are converted into the dynamic format, the data fields in the input message are formatted into the data standardized by the host computer one by one, and then the data are spliced together through separators and output.
And converting the host format into a Json or XML message, analyzing the input message data according to the input format attribute value, and formatting the analyzed input data into a Json or XML output according to the output attribute value.
The invention is also provided with a parameter module used for pre-configuring the attribute parameters and the functional parameters needed to be used in the analysis process.
Referring to fig. 6, the external system may generate a transaction message in a Json format or an XML format, that is, a transaction request message, including a transaction request including the transaction message, and after receiving the request message, the host system requests to parse the message, converts the transaction message from Json or XML to a host format depending on attribute parameters through a preset component, and then processes the format-converted transaction message to generate a return message, that is, a transaction response message; the request converts the return message from a host format to a Json format or an XML format, the return message is converted from the host format to the Json format or the XML format through the components depending on the attribute parameters, and then the return message after format conversion is sent to an external system.
In the embodiment, Json or XML sent by an external system can be analyzed into a data format which can be identified by a host, and the conversion is completely realized through a parameterized form, so that the defect that an interface needs to prepare an analysis program in the past is overcome. And then packaging the data format returned by the host computer into Json or XML format for output.
In the embodiment of the invention, the Json message and the XML message are analyzed at the host end, and the development independence between the systems is realized. I.e. the external system does not wait for the interface format determination of the host before it is developed. Due to the dynamic design of the uploading content, each calling party only needs to pay attention to the fields related by the calling party in the interface, extra processing is not needed for the fields not related, and linkage change caused by the fact that the fields are newly added to the interface in the traditional mode is avoided. And due to dynamic design of the uploading content, the transaction picture design of each system only needs to be drawn according to respective service characteristics, and the integrity of the interface field is not considered.
It should be noted that the message processing method and apparatus, the storage medium, and the electronic device provided by the present invention can be used in the fields of artificial intelligence, block chaining, distributed, cloud computing, big data, internet of things, mobile internet, network security, chip, virtual reality, augmented reality, holography, quantum computing, quantum communication, quantum measurement, digital twinning, and finance. The foregoing is merely an example, and does not limit the application fields of the message processing method and apparatus, the storage medium, and the electronic device provided in the present invention.
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 software products, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include 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 processing method provided by the present invention, and a specific example is applied in this document 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 processing method is characterized by comprising the following steps:
when a transaction request of an external system is received, acquiring a transaction request message in the transaction request;
determining the message format of the transaction request message;
carrying out format conversion on the transaction request message in the message format to obtain a target transaction request message in a host format, wherein the host format is one of a dynamic host format and a static host format;
generating a transaction response message in the host format based on the target transaction request message;
carrying out format conversion on the transaction response message in the host format to obtain a target transaction response message in the message format;
and sending the target transaction response message to the external system.
2. The method according to claim 1, wherein the converting the format of the transaction request message in the message format to obtain the target transaction request message in the host format comprises:
obtaining the attribute value of the message format of the transaction request message,
determining an output format attribute value corresponding to the attribute value of the message format, and analyzing the transaction request message according to the attribute value of the message format to obtain transaction request message data;
and processing the transaction request message data according to the output attribute value to obtain a target transaction message in a host format corresponding to the output format attribute value.
3. The method of claim 2, wherein determining the output packet format attribute value corresponding to the packet format attribute value comprises:
taking the attribute value of the message format as an input format attribute value, and acquiring a preset configuration file;
and determining an output format attribute value corresponding to the input format attribute value in the configuration file.
4. The method according to claim 2 or 3, wherein, in a case that the output packet format attribute value is a dynamic host format attribute value, the processing the transaction request packet data according to the output format attribute value to obtain a target transaction packet in a host format corresponding to the output format attribute value includes:
formatting each data field in the transaction request message data to obtain each host standardized data;
and splicing the standardized data of the hosts by using a preset separator to obtain a target transaction message in a dynamic host format.
5. The method according to claim 2 or 3, wherein, in a case that the output packet format attribute value is a static host format attribute value, the processing the transaction request packet data according to the output format attribute value to obtain a target transaction packet in a host format corresponding to the output format attribute value includes:
obtaining initial output message data;
matching a first field identifier of each data field in the transaction request message data with each second field identifier of the initial output message data to determine each first target field identifier, wherein the first target field identifier is a first field identifier successfully matched with one second field identifier in the initial output message data;
and putting the field data to which each first target field identifier belongs into the position corresponding to the second field identifier successfully matched with the first target field identifier in the initial output message data to obtain the target transaction message in the static host format.
6. The method according to claim 1, wherein the converting the format of the transaction response message in the host format to obtain the target transaction response message in the message format comprises:
analyzing the transaction response message according to the attribute value of the host format to obtain transaction response message data;
and processing the transaction response message data according to the attribute value of the message format to obtain a target transaction message in the message format.
7. A message processing apparatus, comprising:
the receiving unit is used for acquiring a transaction request message in a transaction request when the transaction request of an external system is received;
the determining unit is used for determining the message format of the transaction request message;
the first format conversion unit is used for carrying out format conversion on the transaction request message in the message format to obtain a target transaction request message in a host format, wherein the host format is one of a dynamic host format and a static host format;
the generating unit is used for generating a transaction response message in the host format based on the target transaction request message;
the second format conversion unit is used for carrying out format conversion on the transaction response message in the host format to obtain a target transaction response message in the message format;
and the sending unit is used for sending the target transaction response message to the external system.
8. The apparatus of claim 7, wherein the first format conversion unit comprises:
an obtaining subunit, configured to obtain an attribute value of a message format of the transaction request message,
a determining subunit, configured to determine an output format attribute value corresponding to the attribute value of the message format, and analyze the transaction request message according to the attribute value of the message format to obtain transaction request message data;
and the processing subunit is used for processing the transaction request message data according to the output attribute value to obtain a target transaction message in a host format corresponding to the output format attribute value.
9. A storage medium, characterized in that the storage medium comprises a storage instruction, wherein when the instruction runs, a device on which the storage medium is located is controlled to execute the message processing method according to any one of claims 1 to 6.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the message processing method of any one of claims 1-6.
CN202210385557.6A 2022-04-13 2022-04-13 Message processing method and device, storage medium and electronic equipment Active CN114745449B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210385557.6A CN114745449B (en) 2022-04-13 2022-04-13 Message processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210385557.6A CN114745449B (en) 2022-04-13 2022-04-13 Message processing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114745449A true CN114745449A (en) 2022-07-12
CN114745449B CN114745449B (en) 2024-01-30

Family

ID=82282548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210385557.6A Active CN114745449B (en) 2022-04-13 2022-04-13 Message processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114745449B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115643314A (en) * 2022-10-21 2023-01-24 中电金信软件有限公司 System alternation information confirmation method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109344183A (en) * 2018-01-30 2019-02-15 深圳壹账通智能科技有限公司 Data interactive method, device, computer equipment and storage medium
CN109617647A (en) * 2018-10-22 2019-04-12 中国平安财产保险股份有限公司 Message forwarding method, device, computer equipment and computer readable storage medium
CN112383533A (en) * 2020-11-10 2021-02-19 中国农业银行股份有限公司 Message format conversion method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109344183A (en) * 2018-01-30 2019-02-15 深圳壹账通智能科技有限公司 Data interactive method, device, computer equipment and storage medium
CN109617647A (en) * 2018-10-22 2019-04-12 中国平安财产保险股份有限公司 Message forwarding method, device, computer equipment and computer readable storage medium
CN112383533A (en) * 2020-11-10 2021-02-19 中国农业银行股份有限公司 Message format conversion method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115643314A (en) * 2022-10-21 2023-01-24 中电金信软件有限公司 System alternation information confirmation method and system
CN115643314B (en) * 2022-10-21 2024-02-23 中电金信软件有限公司 System alternating information confirmation method and system

Also Published As

Publication number Publication date
CN114745449B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN111083225A (en) Data processing method and device in Internet of things platform and Internet of things platform
CN114564203A (en) Service operation method and device, electronic equipment and readable medium
CN112346794A (en) Interface calling method, device, equipment and medium
CN114745449B (en) Message processing method and device, storage medium and electronic equipment
CN114513552B (en) Data processing method, device, equipment and storage medium
CN111324467B (en) Business service calling method, device, equipment and storage medium
CN111241180A (en) Information processing method, device, equipment and storage medium
CN113780969B (en) Customs declaration method and system
CN113011848A (en) Method, device, equipment and storage medium for accessing approval service
CN112416739B (en) Test method and device and electronic equipment
CN112181393A (en) Front-end and back-end code generation method and device, computer equipment and storage medium
CN111966653A (en) Data processing method, device, server and storage medium for micro-service call link
CN111506305A (en) Tool kit generation method and device, computer equipment and readable storage medium
CN115934537A (en) Interface test tool generation method, device, equipment, medium and product
CN112379967B (en) Simulator detection method, device, equipment and medium
CN114219643A (en) Transaction calling method, device, equipment and storage medium
CN114285774A (en) Flow recording method and device, electronic equipment and storage medium
CN109543398B (en) Application program account migration method and device and electronic equipment
CN114238065A (en) Test processing method, device, equipment and readable storage medium
CN112860538A (en) Method and device for performing interface regression test based on online log
CN114449052B (en) Data compression method and device, electronic equipment and storage medium
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
TWI802223B (en) Micro-service application platform system, method of micro-service application and computer program product thereof
CN114202046B (en) Method, device, equipment and medium for generating two-dimension code based on SAP system
CN114996135A (en) Interface testing method, device, equipment and storage medium based on bypass drainage

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