CN113225249A - Message processing method, system, device and medium - Google Patents

Message processing method, system, device and medium Download PDF

Info

Publication number
CN113225249A
CN113225249A CN202110492644.7A CN202110492644A CN113225249A CN 113225249 A CN113225249 A CN 113225249A CN 202110492644 A CN202110492644 A CN 202110492644A CN 113225249 A CN113225249 A CN 113225249A
Authority
CN
China
Prior art keywords
message
format
processing
message format
error
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.)
Pending
Application number
CN202110492644.7A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110492644.7A priority Critical patent/CN113225249A/en
Publication of CN113225249A publication Critical patent/CN113225249A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Accounting & Taxation (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present disclosure provides a message processing method, which is applied to the field of financial technology or other fields, and includes: s11, acquiring a first message with a first message format sent by a first device, wherein the first message format matches with the communication protocol of the first device; s12, converting the format of the first message to obtain a first message with a second message format, wherein the second message format matches the communication protocol of the second device; s13, processing data according to the message content of the first message with the second message format to obtain a processing result; s14, generating a second message with a second message format according to the processing result, and converting the second message with the second message format into a second message with the first message format; s15, sending a second message having the first message format to the first device. The present disclosure also provides a message processing system, an electronic device, and a computer-readable storage medium.

Description

Message processing method, system, device and medium
Technical Field
The present disclosure relates to the technical field of financial technology, and in particular, to a method, a system, a device, and a medium for processing a packet.
Background
The gateway is also called an internetwork connector and a protocol converter. The gateway realizes network interconnection above a network layer and is only used for the interconnection of two networks with different high-level protocols. The gateway can be used for interconnection of both wide area networks and local area networks. A gateway is a computer system or device that acts as a switch-operative. The gateway is a translator used between two systems that differ in communication protocol, data format or language, or even in an entirely different architecture.
At present, because of the great difference of technical architectures between the financial system and the external enterprises, the standards of network interfaces of the two parties are usually not consistent, and the interface fields, the data formats and the protocol types are different. And the demand of external enterprises on financial services has the characteristic of individuation, and under the condition that the services at the bottom layer of a bank are centralized and single, a large amount of development cost and a long development period are needed for each butt joint.
Disclosure of Invention
Technical problem to be solved
In view of the above problems, the present disclosure provides a method, a system, a device, and a medium for processing a packet, which are used to at least partially solve the technical problems of long development period, high development cost, poor compatibility, and the like of the conventional packet processing method.
(II) technical scheme
One aspect of the present disclosure provides a method for processing a packet, including: s11, acquiring a first message with a first message format sent by a first device, wherein the first message format matches with the communication protocol of the first device; s12, converting the format of the first message to obtain a first message with a second message format, wherein the second message format matches the communication protocol of the second device; s13, processing data according to the message content of the first message with the second message format to obtain a processing result; s14, generating a second message with a second message format according to the processing result, and converting the second message with the second message format into a second message with the first message format; s15, sending a second message having the first message format to the first device.
Further, S13 further includes: checking the message content of the first message with the second message format, and if the checking is passed, performing data processing according to the message content of the first message with the second message format to obtain a processing result; and if the verification fails, processing the message through the error processing script, and returning a second error message with the first message format.
Further, the processing by the error handling script and returning the second error message having the first message format includes: processing the message through the error processing script to generate a second error message with a second message format; converting the second error message with the second message format into a second error message with the first message format; and sending a second error message in the first message format to the first equipment.
Further, the acquiring of the first message with the first message format sent by the first device in S11 includes: performing message header check on the first message with the first message format, and if the check is passed, performing data processing according to the message header content of the first message with the first message format to obtain a message header processing result; and if the verification fails, processing the message through the error processing script, and returning a first error message with a first message format.
Further, processing by the error handling script and returning the first error message having the first message format includes: processing the message through an error processing script to generate a first error message with a second message format; converting the first error message with the second message format into a first error message with the first message format; and sending a first error message in a first message format to the first equipment.
Further, in S13, performing data processing according to the message content of the first message having the second message format, and obtaining a processing result includes: and calling the bottom-layer service to perform data processing by using the content processing script to obtain a processing result.
Another aspect of the present disclosure provides a method for processing a packet, including: s21, obtaining local data, and generating a third message with a second message format when the sending condition is met, wherein the second message format matches the communication protocol of the second device; s22, converting the third message with the second message format into a third message with a first message format, wherein the first message format matches the communication protocol of the first device; s23, sending a third message having the first message format to the first device.
Further, the S23 sending the third message having the first message format to the first device includes: judging whether a third message with the first message format is successfully received by the first equipment or not, if so, processing through a post-processing script and recording; and if not, processing through the error processing script and retransmitting.
Further, S21 includes: and processing the acquired local data through the preprocessing script, judging whether the transmission condition is met or not through the condition processing script, and generating a third message with a second message format if the transmission condition is judged to be met.
Further, S23 includes: and acquiring the content and the address of the first message format of the first equipment, and sending a third message with the first message format to the first equipment.
In another aspect, the present disclosure provides a method for processing a packet, including: s31, sending a first message with a first message format, wherein the first message format matches with the communication protocol of the first equipment; s32, acquiring a second message with the first message format sent by the second equipment; the first message with the first message format is subjected to format conversion through second equipment to obtain the first message with a second message format, and the second message format is matched with a communication protocol of the second equipment; the first message in the second message format is subjected to data processing through second equipment to generate a second message in the second message format; and the second message in the second message format is subjected to format conversion through the second equipment to obtain the second message in the first message format.
Further, S32 further includes: acquiring a second error message in the first message format; and the second error message in the first message format is obtained when the message content of the first message in the second message format is not checked and passed through by the second equipment.
In another aspect, the present disclosure provides a message processing system, including: the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first message with a first message format, which is sent by first equipment, and the first message format is matched with a communication protocol of the first equipment; the format conversion module is used for carrying out format conversion on the first message to obtain a first message with a second message format, and the second message format is matched with the communication protocol of the second equipment; the data processing module is used for processing data according to the message content of the first message with the second message format to obtain a processing result; the generating module is used for generating a second message with a second message format according to the processing result and converting the second message with the second message format into a second message with the first message format; and the sending module is used for sending a second message with the first message format to the first equipment.
Further, still include: the verification module is used for verifying the message content of the first message with the second message format, and if the verification is passed, data processing is carried out according to the message content of the first message with the second message format to obtain a processing result; and if the verification fails, processing the message through the error processing script, and returning a second error message with the first message format.
In another aspect, the present disclosure provides a message processing system, including: the acquisition module is used for acquiring the local data and generating a third message with a second message format when the transmission condition is met, wherein the second message format is matched with the communication protocol of the second equipment; the format conversion module is used for converting a third message with a second message format into a third message with a first message format, and the first message format is matched with the communication protocol of the first equipment; and the sending module is used for sending a third message with the first message format to the first equipment.
Yet another aspect of the present disclosure provides an electronic device, including: a processor; a memory storing a computer executable program which, when executed by the processor, causes the processor to perform the message processing method as described above.
A further aspect of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements a message processing method as described above.
(III) advantageous effects
According to the message processing method, the message processing system, the message processing equipment and the message processing medium, the first message with the second message format is obtained by converting the format of the first message in the gateway, the standardized input/output interface function is provided, the multi-channel access of a system platform is met, and the system docking efficiency between a bank and an enterprise is improved; and the sending process of the message is managed and completed through the script in a centralized way, and the forwarding function of the gateway and the error processing in the interactive process of the gateway and the service are completed on the basis of message conversion.
Drawings
FIG. 1 schematically illustrates an exemplary system architecture diagram for a message distribution method according to an embodiment of the disclosure;
FIG. 2 schematically illustrates a flow chart of a message processing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of a message processing method according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a structural diagram of a message processing system according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a business flow diagram of a primary service side in a message processing system according to the present disclosure;
FIG. 6 schematically illustrates a business flow diagram for a sub-server in a message processing system according to the present disclosure;
FIG. 7 is a schematic diagram illustrating another message processing system according to an embodiment of the present disclosure;
FIG. 8 is a schematic flow chart illustrating the operation of a host client in a message processing system according to the present disclosure;
FIG. 9 schematically illustrates a business flow diagram for a sub-client in a message processing system according to the present disclosure;
figure 10 schematically illustrates a schematic diagram of a complete gateway architecture according to an embodiment of the disclosure;
FIG. 11 schematically illustrates a flow diagram of a message processing method according to another embodiment of the present disclosure;
FIG. 12 schematically illustrates a block diagram for a message processing system apparatus according to an embodiment of the present disclosure;
FIG. 13 schematically illustrates a block diagram for a message processing system apparatus according to another embodiment of the present disclosure;
FIG. 14 schematically shows a block diagram of a computer system according to an embodiment of the disclosure.
Detailed Description
For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The embodiment of the disclosure provides a message processing method, a message processing device and a message processing medium, and provides a gateway message conversion method aiming at the problem that the existing financial system and an external enterprise are usually inconsistent in the standards of network interfaces of both parties due to great difference of technical architectures.
Fig. 1 schematically illustrates an exemplary system architecture 100 for a message processing method according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a web browser application, a search-type application, an instant messaging tool, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the message processing provided by the embodiments of the present disclosure may be generally performed by the server 105. Accordingly, the system for message processing provided by the embodiments of the present disclosure may be generally disposed in the server 105. The message processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the system for message processing provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically shows a flow chart of a message processing method according to an embodiment of the present disclosure.
S11, obtain a first packet with a first packet format sent by the first device, where the first packet format matches the communication protocol of the first device.
In step S11, the financial system gateway first obtains a first message sent by the external enterprise, where the first message corresponds to a first message format used by the external enterprise system, and the message format is used to describe a format of a message structure, such as: JSON, XML and I separation mode; the first message format matches a communication protocol of the first device, and the specific message transmission protocol is as follows: socket, http/https, web service, mq, and the like; the encoding format of the message is also included, such as: GBK, UTF-8.
S12, converting the format of the first message to obtain a first message with a second message format, wherein the second message format matches the communication protocol of the second device.
In step S12, the gateway converts the format of the first packet, for example, the bank interface standard is an XML packet format, the docking enterprise interface standard is a JSON format, that is, the first packet format is a JSON format, and the second packet format is an XML format, and after acquiring the packet in the JSON format, the financial system gateway converts the packet into the XML packet format, so that the local system identifies and processes the packet. Here, only the message format is converted, the actual content of the message is not changed, and after the conversion, the first message is the first message, but only the first message format is converted into the second message format. It should be noted that the use of ordinal numbers such as "first," "second," "third," etc., in the specification and claims does not by themselves connote any ordering of such elements, but are used merely to clearly distinguish one element having a certain name from another element having a same name.
And S13, processing data according to the message content of the first message with the second message format to obtain a processing result.
And after the message is converted into the second message format, the second message format can be identified by the local system, and the message content is processed, for example, if the message content is transfer, a transfer interface is called through the message content to perform transfer processing.
S14, generating a second message with a second message format according to the processing result, and converting the second message with the second message format into a second message with the first message format.
After the message content is processed, a message with a returned result is generated according to the processing result, at this time, the system directly generates a second message format supported by the local system, and an external enterprise only supports the first message format and cannot identify and process the message with the second message format.
S15, sending a second message having the first message format to the first device.
And sending the message of the processing result to the external equipment in a first message format, wherein the content of the second message is a message returned by a result generated aiming at the processing result, the content is still the content of the second message, and only the second message format is converted into the first message format.
The method provided by the disclosure realizes the support of multiple interface modes and multiple interface data formats of the gateway platform, improves the development and maintenance efficiency of the system, and also accelerates the system docking efficiency between banks and enterprises.
On the basis of the above embodiment, S13 further includes: checking the message content of the first message with the second message format, and if the checking is passed, performing data processing according to the message content of the first message with the second message format to obtain a processing result; and if the verification fails, processing the message through the error processing script, and returning a second error message with the first message format.
After format conversion and before data processing are carried out on the first message, checking the content of the first message, wherein the checking in the step can be checking rules of the message, for example, the field length of a transfer account number cannot exceed 15 bits, and if the field length exceeds 15 bits, an error processing script is called; at this time, a report sending template is called, and the following is written in a message returned by the transaction: transferring results: the account transfer is failed, the account number is too long, and the transaction result is as follows: "fail".
On the basis of the above embodiment, processing by the error processing script and returning the second error message having the first message format includes: processing the message through the error processing script to generate a second error message with a second message format; converting the second error message with the second message format into a second error message with the first message format; and sending a second error message in the first message format to the first equipment.
Here, the error message generated by checking the message content is in the second message format, and before being sent to the external system, the second message format needs to be converted into the error message in the first message format, so that the external enterprise can identify the content of the error message.
On the basis of the foregoing embodiment, the obtaining of the first message with the first message format sent by the first device in S11 includes: performing message header check on the first message with the first message format, and if the check is passed, performing data processing according to the message header content of the first message with the first message format to obtain a message header processing result; and if the verification fails, processing the message through the error processing script, and returning a first error message with a first message format.
After the first message is obtained, the method also comprises the steps of carrying out content verification of message additional information on a message header of the first message, for example, verifying whether a transaction code has an error or not, if the transaction code passes the verification, carrying out message header processing, and sending the message to a corresponding interface according to the transaction code to carry out next service logic processing; if the verification fails, calling corresponding logic executed by the error processing script according to the current error, firstly judging that the verification fails by the gateway platform, further judging specific reasons of the error, such as system abnormality and the like, by the error processing script, and returning the result of the system abnormality to an external system in a message form.
On the basis of the above embodiment, processing by the error processing script and returning the first error message having the first message format includes: processing the message through an error processing script to generate a first error message with a second message format; converting the first error message with the second message format into a first error message with the first message format; and sending a first error message in a first message format to the first equipment.
Here, the error message generated by performing the error processing script processing on the message content is in the second message format, and before being sent to the external system, the second message format needs to be converted into the error message in the first message format, so that the external enterprise identifies the content of the error message.
On the basis of the foregoing embodiment, in S13, performing data processing according to the message content of the first message having the second message format, and obtaining a processing result includes: and calling the bottom-layer service to perform data processing by using the content processing script to obtain a processing result.
The data processing of the message content is to call the bottom layer service according to the incoming message parameters to obtain a processing result and then call the message sending template to feed back the result to the external system. For example, if the message content is transfer, a transfer interface is called through the message content, underlying transfer service data is called, and transfer processing is performed.
The gateway platform is used as a server side in the method to perform data interaction with an external system, and functions such as bottom service calling, business logic processing and the like are completed; meanwhile, the gateway platform can also be used as a client to directly finish the process of message sending and finish corresponding service processing.
Fig. 3 schematically shows a flow chart of a message processing method according to another embodiment of the present disclosure.
S21, obtaining the local data, when the sending condition is satisfied, generating a third message with a second message format, the second message format matching the communication protocol of the second device.
The condition script defines a condition for calling the interface trigger, and when the condition is met, the gateway platform directly generates a third message, for example, the bank interface standard is an XML message format, and the docking enterprise interface standard is a JSON format, that is, the third message is an XML message format.
S22, converting the third message with the second message format into a third message with a first message format, where the first message format matches the communication protocol of the first device.
And the gateway converts the third message in the XML message format into the third message in the JSON message format so that the external system can identify and process the message. The message format conversion here includes the format of the message structure, such as: JSON, XML and I separation mode; the first message format matches a communication protocol of the first device, and the specific message transmission protocol is as follows: socket, http/https, web service, mq, and the like; the encoding format of the message is also included, such as: GBK, UTF-8.
S23, sending a third message having the first message format to the first device.
And sending the message of the processing result to the external equipment in a first message format, wherein the content of the third message is the third service message directly generated by the gateway platform, the content is still the content of the third message, and only the second message format is converted into the first message format.
On the basis of the foregoing embodiment, the sending, by the S23, the third message having the first message format to the first device includes: judging whether a third message with the first message format is successfully received by the first equipment or not, if so, processing through a post-processing script and recording; and if not, processing through the error processing script and retransmitting.
And after the third message is sent to the external system, call-back of the external system is also obtained, whether the call is successful or not is judged, and if the call is successful, a post-processing script is called, for example, a call success record is written into a log. If not, an error handling script is invoked, e.g., to reassemble the message before transmission.
On the basis of the above embodiment, S21 includes: and processing the acquired local data through the preprocessing script, judging whether the transmission condition is met or not through the condition processing script, and generating a third message with a second message format if the transmission condition is judged to be met.
The pre-processing script reads data of the bottom layer service, when the data meets a certain condition, for example, when a customer repays, a bank pushes a message to an external system, the pre-processing script reads the data of a credit system, when the data meets the condition that the customer is overdue, a third message with a second message format is generated, and after format conversion is carried out, the third message is sent to the external system.
The method completes the customization of the flow through script centralized management, and completes the forwarding function of the gateway and the error processing in the interactive process of the gateway and the service on the basis of message conversion. As a server, the script completes gateway routing, incoming message parameter verification, bottom service calling and service logic processing functions; as a client, the script performs pre-call condition control, pre-call service processing, and post-call error processing.
Fig. 4 schematically shows a structural diagram of a message processing system according to an embodiment of the present disclosure.
The message processing system, namely the gateway platform, when serving as a server to perform data interaction with an external system, includes a main service end 401, sub-service ends 402, 403, 404, and the like, where the main service end 401 is mainly used to obtain a first message with a first message format sent by a first device, and is also used to perform message header check on the first message with the first message format, and if the check passes, perform data processing according to the message header content of the first message with the first message format to obtain a message header processing result; and if the verification fails, processing the message through the error processing script, and returning a first error message with a first message format. The sub-servers 402, 403, and 404 are mainly used for performing format conversion on the first message to obtain a first message with a second message format; performing data processing according to the message content of the first message with the second message format to obtain a processing result, generating a second message with the second message format according to the processing result, and converting the second message with the second message format into the second message with the first message format; and sent to the first device.
Fig. 5 schematically shows a service flow diagram of a primary service side in a message processing system according to the present disclosure. Step 411, the remote client firstly sends a message to the main service end 401; step 412, after receiving the message, the main service end 401 determines the gateway service; step 413, determining whether the gateway service has an error; if yes, go to step 414, call error handling script for self-checking, and write log record; step 417, reading a report sending template and feeding back a message to a remote client; if the gateway service is normal, step 415 is performed, and the service logic processing is entered, and the message is sent to the corresponding sub-server 402 or 403 or 404, and so on.
The main service end 401 mainly completes message reception and describes server information (port number, communication mode, encoding format, message format), where the port number is used to define a port for receiving a message; the communication mode is used to define a specific message transmission protocol, such as: socket, http/https, web service, mq, and the like; the encoding format is used to describe the encoding format of the message, such as: GBK, UTF-8; the message format is used to describe the format of the message structure, such as: JSON, XML, | separation. A template and a script can be deployed at the main service end 401, wherein the template is used for completing message conversion, converting a context field into a message field, and generating a report sending template (callback), and the context field is defined in the script; the script can be forwarded to the sub-server according to the transaction code in the message, and can also feed back the service calling and sending template with errors through the error processing script.
Fig. 6 schematically shows a business flow diagram of a sub-server in a message processing system according to the present disclosure. Step 421, the sub-server 402 receives the message sent by the main-service 401; step 422, converting the field format according to the receiving and reporting mapping relation; step 423, checking the rules of the incoming message; if the verification fails, go to step 424, invoke the error handling script; step 428, invoking a report sending template, and feeding back a message to the remote client; if the verification is passed, step 425 is entered to perform service logic processing; 426, 427, the processing script calls the bottom layer service according to the reported parameters; step 428, after the service is processed, the report template is called to perform result feedback on the remote client.
The sub-service terminals 402, 403, and 404 respectively define the service logic to be implemented by the interface, perform rule transformation on the message received from the main service terminal 401, and call the bottom-layer service by using a script to complete the processing of the service logic. The method is composed of a message template and a script. The message template comprises a message sending template, a message entering rule and a message mapping relation. The message sending template and the father server convert the context field in the script into a message field to generate a message to be sent; the rule of the incoming report defines the format check of the incoming report field, including the length of the field and whether the entry is necessary to be input; the message mapping relationship defines a conversion rule of the message forwarded by the main service end 401, and converts the field format of the message into a required format. For example, the bank interface standard is an XML message format, the docking enterprise interface standard is a JSON format, a message template defined by the main service end 401 is consistent with the interface standard of the docking enterprise, the main service end 401 forwards the message template to the sub-client, the message mapping relation configured in the message template of the sub-server is converted, the real service processing logic is at the sub-server, the bottom layer service is called according to the incoming message parameter, and the sending template is called after the service processing to perform result feedback on the remote client.
It should be noted that the sending templates in the main service end 401 and the sub-service ends 402, 403, and 404 are different, and for the same message, the sending template of the main service end 401 is assembled with a general communication module, and the sending template of the sub-service end is assembled with a communication module corresponding to a certain transaction. It will be appreciated that two service interfaces are provided for the bank, one for the transfer transaction interface (transaction code 01) and one for the transfer transaction inquiry interface (transaction code 02) identified from the transaction code field in the universal communications module. There is then an account number in the following service communication module. After receiving the message sent by the client of the partner, the main service end 401 forwards the message to the corresponding sub-service end according to the transaction code 01, after the sub-service end completes the logic processing, the sub-service end calls the report template and returns the fields of 'account amount of the current transfer', 'transfer result', 'target account' and the like to the main service end 401, and then the main service end 401 calls the report template to assemble, and the public communication module adds the fields of 'signature', 'transaction result' and the like. In addition, the main service end 401 determines whether the service error is a check on the header packet, for example, a transaction code error; the rule check of the incoming message in the sub-server is to check the incoming message of specific transaction, such as transfer transaction, account length not meeting the specification, and the like. The error handling script is the logic executed according to the current error, and what is done is defined in the script, and may be to call some underlying service or to query some field of the database.
Specifically, for example, the bank has two interfaces, one transfer transaction interface (code 01) and one transfer transaction inquiry interface (code 02). For example, a remote client sends a series of messages, and the message content is a transaction code: 01, account number: a, amount: 1 yuan, target account number: C. the main service end 401 firstly judges whether the current gateway service is normal, if not, calls an error processing script for self-checking, writes a log record, then reads a report sending template, returns the report to the client, and sends a transaction result: the system is abnormal. If the transaction code is normal, the business logic processing is carried out, the transaction code is distributed to the sub-server 1 according to the transaction code 01, and the sub-server 1 is a transfer interface. The sub-client 1 obtains a required field format according to the receiving and reporting mapping relation, and performs rules verification on the reported message, for example, the field length of the account cannot exceed 15 bits, and if the field length exceeds 15 bits, an error processing script is called; at this time, calling a reporting template, returning in a communication module of the transaction, and transferring a result: the transaction results of transfer failure and account number overlong are as follows: "fail".
Fig. 7 schematically shows a structural diagram of another message processing system according to an embodiment of the present disclosure.
Meanwhile, the gateway platform also serves as a client to directly complete the process of message sending, and comprises a main client 501, sub-clients 502, 503 and 504 and the like, wherein the sub-clients 502, 503 and 504 are respectively used for obtaining local data, and when the sending condition is met, a third message with a second message format is generated; and converting the third message with the second message format into the third message with the first message format. The primary client 501 is configured to send a third packet with the first packet format to the first device.
FIG. 8 is a schematic flow chart illustrating the operation of the host client in the message processing system according to the present disclosure. Step 511, after the business logic processing of the sub-client 502 is completed, sending the message to the main client 501; in step 512, the host client 501 reads the configuration information of the remote server and sends the message to the corresponding remote server.
The main client 501 is mainly used to send a message to a remote server, where the definition content is similar to that of a parent server, including (port number, communication mode, encoding format, and message format) and is not described herein again, and unlike the main server 401, the main client 501 only defines the server information and the message format, and does not forward the message, and can be understood as a unified exit of the sub-clients 502, 503, and 504.
Fig. 9 schematically illustrates a business flow diagram of a sub-client in a message processing system according to the present disclosure. When the message processing system needs to send a message to the remote client, step 521, the sub-client 502 calls a pre-processing script to read bottom-layer service data; step 522, when the corresponding condition is satisfied, calling the corresponding sub-client interface; 523 and 524, the sub-client 502 calls the message sending template assembly message to send to the remote server through the target message format of the port ip address configured by the main client; step 525, the remote server receives the message; step 526, judging whether the calling is successful; if the operation is successful, entering a step 527, calling a post-processing script, and performing bottom-layer service processing; if not, then step 528 is entered, where an error handling script is invoked, which may be reassembled for transmission.
The sub-clients 502, 503, and 504 are mainly used to describe service logic before and after sending a message, and include a message template and a script, which are the same as the sub-clients. The message template includes a message sending template and a message receiving mapping relationship (when the server receives the result message in reverse transmission), and the function of the message template is the same as that of the host client 501. The scripts are divided into conditional scripts, pre-processing scripts, post-processing scripts and error processing scripts. The condition script defines the condition for calling the interface trigger; the pre-processing script defines the service logic executed before calling the interface; the post-processing script defines the service logic executed after calling the interface; the error processing script defines the service logic executed after receiving the error reporting information of the server.
Specifically, for example, a bank pushes the overdue payment information of the client to the partner. When the client repays, the bank sends a message to the cooperation platform, the sub-client is called, the pre-processing script reads data of the credit system, and when the condition processing script meets the condition that the client is overdue, the report template assembly message is called and sent to the cooperation party through a port ip address target message format configured by the parent client. And after the callback of the partner is received, judging whether the calling is successful, if so, calling a post-processing script, and writing the calling success record into a log. If not, an error handling script is invoked, such as reassembly for transmission.
Fig. 10 schematically illustrates a schematic diagram of a complete gateway architecture according to an embodiment of the disclosure.
The gateway message conversion platform 601 includes a main service module 401, sub-service modules 402, 403, and 404, a main client module 501, sub-client modules 502, 503, and 504, and further includes a parameter configuration module 602. The gateway platform supports parameterization configuration of each module, a parameter file can be derived after the configuration of the client and the server is completed by using a visual development tool on the gateway platform, and the modification of the main (sub) client or the main (sub) server can be completed by modifying parameters, wherein the main (sub) client can complete hot deployment, the parameters are read and then the parameters are immediately effective, and the main (sub) server can take effect only by being released again.
Fig. 11 schematically shows a flow chart of a message processing method according to another embodiment of the present disclosure.
S31, sending a first message with a first message format, wherein the first message format matches with the communication protocol of the first equipment;
the external system sends a first message to the local gateway platform, the message corresponding to a first message format used by the external enterprise system.
S32, acquiring a second message with the first message format sent by the second equipment; the first message with the first message format is subjected to format conversion through second equipment to obtain the first message with a second message format, and the second message format is matched with a communication protocol of the second equipment; the first message in the second message format is subjected to data processing through second equipment to generate a second message in the second message format; and the second message in the second message format is subjected to format conversion through the second equipment to obtain the second message in the first message format.
And the gateway platform sends a second message to the external system according to the first message, and the external system receives the second message. The gateway platform firstly performs format conversion according to the first message in the first message format to obtain the first message in the second message format, so that the local system can identify and process the message. After the format conversion, performing data processing on the first message in the second message format to generate a second message in the second message format; and then format conversion is carried out to obtain a second message in the first message format, and the second message is sent to an external system. The method improves the internal and external butt joint efficiency of the enterprise and improves the stability of the system.
On the basis of the above embodiment, S32 further includes: acquiring a second error message in the first message format; and the second error message in the first message format is obtained when the message content of the first message in the second message format is not checked and passed through by the second equipment.
After format conversion is carried out on the first message and before data processing is carried out on the first message, verification is carried out on the content of the first message, the verification can be carried out on the rule of the message entering the report, for example, the field length of a transfer account number cannot exceed 15 bits, if the field length exceeds 15 bits, an error processing script is called, a second error message in the format of the first message is returned, and the external system receives the error message.
Another embodiment of the present disclosure provides a block diagram for a message processing system apparatus, referring to fig. 12, a message processing system 810 includes:
an obtaining module 811, configured to obtain a first message with a first message format sent by a first device, where the first message format matches a communication protocol of the first device;
a format conversion module 812, configured to perform format conversion on the first packet to obtain a first packet with a second packet format, where the second packet format matches a communication protocol of the second device;
the data processing module 813 is configured to perform data processing according to the message content of the first message in the second message format to obtain a processing result;
a generating module 814, configured to generate a second message with a second message format according to the processing result, and convert the second message with the second message format into a second message with the first message format;
a sending module 815, configured to send a second message with the first message format to the first device.
On the basis of the above embodiment, the method further includes: the checking module 816 is configured to perform message content checking on the first message with the second message format, and if the checking passes, perform data processing according to the message content of the first message with the second message format to obtain a processing result; and if the verification fails, processing the message through the error processing script, and returning a second error message with the first message format.
Another embodiment of the present disclosure provides a block diagram for a message processing system apparatus, referring to fig. 13, a message processing system 820 includes:
an obtaining module 821, configured to obtain local data, and when a sending condition is met, generate a third message having a second message format, where the second message format matches a communication protocol of a second device;
a format conversion module 822, configured to convert the third packet with the second packet format into a third packet with a first packet format, where the first packet format matches a communication protocol of the first device;
a sending module 823, configured to send the third packet with the first packet format to the first device.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the obtaining module 801, the format conversion module 802, the data processing module 803, the generating module 804, the sending module 805, and the checking module 806 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. At least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to the embodiment of the present disclosure, at least one of the obtaining module 801, the format conversion module 802, the data processing module 803, the generating module 804, the sending module 805, and the checking module 806 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or implemented by a suitable combination of any several of them. Alternatively, at least one of the obtaining module 801, the format conversion module 802, the data processing module 803, the generating module 804, the sending module 805 and the checking module 806 may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
Fig. 14 schematically shows a block diagram of an electronic device according to another embodiment of the present disclosure.
As shown in fig. 14, the electronic device 900 includes a processor 910, a computer-readable storage medium 920. The electronic device 900 may perform a method according to an embodiment of the disclosure.
In particular, processor 910 may include, for example, a general purpose microprocessor, an instruction set processor and/or related chip set and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), and/or the like. The processor 910 may also include onboard memory for caching purposes. The processor 910 may be a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
Computer-readable storage medium 920 may be, for example, any medium that can contain, store, communicate, propagate, or transport the instructions. For example, a readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the readable storage medium include: magnetic storage devices, such as magnetic tape or Hard Disk Drives (HDDs); optical storage devices, such as compact disks (CD-ROMs); a memory, such as a Random Access Memory (RAM) or a flash memory; and/or wired/wireless communication links.
The computer-readable storage medium 920 may include a computer program 921, which computer program 921 may include code/computer-executable instructions that, when executed by the processor 910, cause the processor 910 to perform the method flows and any variations thereof according to embodiments of the present disclosure.
The computer program 921 may be configured with, for example, computer program code comprising computer program modules. For example, in an example embodiment, code in computer program 921 may include one or more program modules, including 921A, modules 921B, … …, for example. It should be noted that the division manner and the number of the modules are not fixed, and those skilled in the art may use suitable program modules or program module combinations according to actual situations, so that the processor 910 may execute the method flow according to the embodiment of the present disclosure and any variation thereof when the program modules are executed by the processor 910.
The present disclosure also provides a computer-readable storage medium, which may be included in the device/system described in the above embodiments, or may exist separately without being assembled into the device/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
While the disclosure has been shown and described with reference to certain exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the disclosure as defined by the appended claims and their equivalents. Accordingly, the scope of the present disclosure should not be limited to the above-described embodiments, but should be defined not only by the appended claims, but also by equivalents thereof.
The above-mentioned embodiments are intended to illustrate the objects, aspects and advantages of the present disclosure in further detail, and it should be understood that the above-mentioned embodiments are only illustrative of the present disclosure and are not intended to limit the present disclosure, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (17)

1. A message processing method is characterized by comprising the following steps:
s11, acquiring a first message with a first message format sent by a first device, wherein the first message format matches with a communication protocol of the first device;
s12, converting the format of the first message to obtain a first message with a second message format, wherein the second message format matches the communication protocol of the second device;
s13, processing data according to the message content of the first message with the second message format to obtain a processing result;
s14, generating a second message with a second message format according to the processing result, and converting the second message with the second message format into a second message with a first message format;
s15, sending the second message with the first message format to the first device.
2. The message processing method according to claim 1, wherein the S13 further includes:
checking the message content of the first message with the second message format, and if the checking is passed, performing data processing according to the message content of the first message with the second message format to obtain a processing result;
and if the verification fails, processing the message through the error processing script, and returning a second error message with the first message format.
3. The message processing method of claim 2, wherein the processing by the error handling script and returning the second error message having the first message format comprises:
processing the message through the error processing script to generate a second error message with a second message format;
converting the second error message with the second message format into a second error message with the first message format;
and sending a second error message in the first message format to the first equipment.
4. The message processing method according to claim 1, wherein the obtaining of the first message with the first message format sent by the first device in S11 includes:
performing message header verification on the first message with the first message format, and if the verification is passed, performing data processing according to the message header content of the first message with the first message format to obtain a message header processing result;
and if the verification fails, processing the message through the error processing script, and returning a first error message with a first message format.
5. The message processing method of claim 4, wherein the processing via the error handling script and returning the first error message having the first message format comprises:
processing the message through an error processing script to generate a first error message with a second message format;
converting the first error message with the second message format into a first error message with a first message format;
and sending a first error message in the first message format to the first equipment.
6. The message processing method according to claim 1, wherein the performing data processing according to the message content of the first message with the second message format in S13 to obtain a processing result includes:
and calling the bottom-layer service to perform data processing by using the content processing script to obtain a processing result.
7. A message processing method is characterized by comprising the following steps:
s21, obtaining local data, and generating a third message with a second message format when the sending condition is met, wherein the second message format matches the communication protocol of the second device;
s22, converting the third packet with the second packet format into a third packet with a first packet format, where the first packet format matches a communication protocol of the first device;
s23, sending the third packet with the first packet format to the first device.
8. The message processing method of claim 7, wherein the S23 sending the third message having the first message format to the first device includes:
judging whether the third message with the first message format is successfully received by the first equipment or not, if so, processing through a post-processing script and recording; and if not, processing through the error processing script and retransmitting.
9. The message processing method according to claim 8, wherein the S21 includes:
the acquired local data is processed through a pre-processing script, the condition meeting the sending condition is judged through a condition processing script, and if the condition meeting the sending condition is judged, a third message with a second message format is generated.
10. The message processing method according to claim 7, wherein the S23 includes:
and acquiring the content and the address of the first message format of the first equipment, and sending the third message with the first message format to the first equipment.
11. A message processing method is characterized by comprising the following steps:
s31, sending a first message with a first message format, wherein the first message format matches with the communication protocol of the first device;
s32, acquiring a second message with the first message format sent by the second equipment; the first message with the first message format is subjected to format conversion through the second equipment to obtain a first message with a second message format, and the second message format is matched with a communication protocol of the second equipment; the first message in the second message format is subjected to data processing through the second equipment to generate a second message in the second message format; and the second message in the second message format is subjected to format conversion through the second equipment to obtain the second message in the first message format.
12. The message processing method according to claim 11, wherein the S32 further includes:
acquiring a second error message in the first message format; and the second error message in the first message format is obtained when the second device fails to check the message content of the first message in the second message format.
13. A message processing system, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first message with a first message format, which is sent by first equipment, and the first message format is matched with a communication protocol of the first equipment;
the format conversion module is used for carrying out format conversion on the first message to obtain a first message with a second message format, and the second message format is matched with a communication protocol of second equipment;
the data processing module is used for processing data according to the message content of the first message with the second message format to obtain a processing result;
the generating module is used for generating a second message with a second message format according to the processing result and converting the second message with the second message format into a second message with a first message format;
a sending module, configured to send the second packet with the first packet format to the first device.
14. The message processing system of claim 13, further comprising:
the verification module is used for verifying the message content of the first message with the second message format, and if the verification is passed, data processing is carried out according to the message content of the first message with the second message format to obtain a processing result; and if the verification fails, processing the message through the error processing script, and returning a second error message with the first message format.
15. A message processing system, comprising:
the acquisition module is used for acquiring local data and generating a third message with a second message format when the transmission condition is met, wherein the second message format is matched with the communication protocol of the second equipment;
the format conversion module is used for converting the third message with the second message format into a third message with a first message format, and the first message format is matched with a communication protocol of the first equipment;
a sending module, configured to send the third packet with the first packet format to the first device.
16. An electronic device, comprising:
a processor;
a memory storing a computer executable program which, when executed by the processor, causes the processor to perform a message processing method according to any one of claims 1 to 6 or claims 7 to 10 or claims 11 to 12.
17. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a message processing method according to any one of claims 1 to 6 or claims 7 to 10 or claims 11 to 12.
CN202110492644.7A 2021-05-06 2021-05-06 Message processing method, system, device and medium Pending CN113225249A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110492644.7A CN113225249A (en) 2021-05-06 2021-05-06 Message processing method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110492644.7A CN113225249A (en) 2021-05-06 2021-05-06 Message processing method, system, device and medium

Publications (1)

Publication Number Publication Date
CN113225249A true CN113225249A (en) 2021-08-06

Family

ID=77091348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110492644.7A Pending CN113225249A (en) 2021-05-06 2021-05-06 Message processing method, system, device and medium

Country Status (1)

Country Link
CN (1) CN113225249A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110264648A (en) * 2019-05-10 2019-09-20 杭州米雅信息科技有限公司 Data processing method and device, automatic teller machine and data processing system
CN110445860A (en) * 2019-08-06 2019-11-12 深圳市金证科技股份有限公司 A kind of file transmitting method, device, terminal device and storage medium
CN111740967A (en) * 2020-06-12 2020-10-02 北京思特奇信息技术股份有限公司 Method, system and electronic equipment for message conversion and transmission

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110264648A (en) * 2019-05-10 2019-09-20 杭州米雅信息科技有限公司 Data processing method and device, automatic teller machine and data processing system
CN110445860A (en) * 2019-08-06 2019-11-12 深圳市金证科技股份有限公司 A kind of file transmitting method, device, terminal device and storage medium
CN111740967A (en) * 2020-06-12 2020-10-02 北京思特奇信息技术股份有限公司 Method, system and electronic equipment for message conversion and transmission

Similar Documents

Publication Publication Date Title
US7216142B2 (en) Network application program interface facilitating communication in a distributed network environment
US8094797B2 (en) Service provisioning and activation engines for system
CN112788074B (en) Data transmitting method, processing method, receiving method, apparatus thereof, and storage medium
CN101729491B (en) Method, device and system for enhancing application reliability of script-based business
CN107135188B (en) Method, device and system for realizing services of financial information exchange (FIX) protocol
CN112288577B (en) Transaction processing method, device, electronic equipment and medium for distributed service
CN113673978B (en) Transaction method, system, computer device and storage medium based on SWIFT system
US8566646B2 (en) Selective logging based on set parameter
CN114979295B (en) Gateway management method and device
US10404826B2 (en) Content based routing architecture system and method
CN112866268B (en) Message processing method and system
CN113225249A (en) Message processing method, system, device and medium
CN109005163B (en) HTTP dynamic request service calling method
CN104427003B (en) Transmission device, transfer approach and relay system
CN112819605A (en) Method and device for testing fund settlement service and computer readable medium
CN113067885B (en) Application system, request processing method, electronic device and storage medium
CN114995813B (en) Exchange API module and related exchange application platform
CN111159103B (en) Enterprise service bus system
US11943322B2 (en) Interceptor hub for service-consuming applications
CN108768925B (en) Intelligent communication system and processing method thereof
JP5079427B2 (en) Service provisioning and activation engine for systems
CN116012158A (en) Service processing method, device, equipment and storage medium
CN116707988A (en) Authentication method, device, computer equipment and medium based on unified gateway system
CN117725609A (en) User authorization information storage method, device, electronic equipment and storage medium
CN113989046A (en) Transaction processing method, apparatus, electronic device, storage medium, and program product

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210806