Message processing method and device, electronic equipment and storage medium
Automatically assemble and process packets through preset message assembly rules, the problem of cumbersome message processing flow when users access CIPS is solved, and the efficiency and accuracy of message processing are improved.
Patent Information
- Application Number
- CN202510086091.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, the process of accessing CIPS by users is cumbersome and difficult to develop, resulting in a reduced packet processing efficiency.
Through the preset message assembly rules, the message elements obtained from the client are automatically assembled into sending messages that meet the requirements, and the target sending messages are added to the sending queue, so that CIPS can perform subsequent message service processing.
It improves the efficiency and accuracy of message processing, reduces errors and delays caused by inconsistent message formats, and enhances the consistency and standardization of message processing.
Smart Images

Figure CN119892814A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a message processing method, device, electronic device and storage medium. Background Art
[0002] The Cross-border Interbank Payment System (CIPS) is an independent payment system developed by the People's Bank of China. It provides fund clearing and settlement services for cross-border and offshore RMB businesses of domestic and foreign financial institutions. It is an important financial infrastructure in China. It aims to further integrate existing cross-border RMB payment and settlement channels and resources, meet the needs of RMB business development in major regions, and improve cross-border clearing efficiency.
[0003] In the existing technology, when users access CIPS, they usually require the R&D team to have deep professional technical skills and rich practical experience to ensure that the enterprise financial system can meet the CIPS access standards when it is developed and modified. Therefore, the process of users accessing CIPS is cumbersome, the development difficulty is relatively high, and the message processing efficiency is reduced. Summary of the invention
[0004] Based on the above problems, the present application provides a message processing method, device, electronic device and storage medium, the purpose of which is to simplify the message processing process and thus improve the message processing efficiency.
[0005] The embodiments of the present application disclose the following technical solutions:
[0006] In a first aspect, the present application provides a message processing method, comprising:
[0007] According to the message assembly rule in the preset message rule, the message elements to be processed obtained from the client are assembled and processed to obtain the target sending message; the message assembly rule is used to assemble the message elements to obtain the sending message;
[0008] The target sending message is added to the message sending queue so that the RMB cross-border payment system performs message business processing based on the target sending message.
[0009] Optionally, the method as described above further includes:
[0010] Receive the target receiving message sent by the RMB cross-border payment system and store it in the receiving queue;
[0011] According to the message assembly rule, the target received message is parsed and processed to obtain the target message element corresponding to the target received message, and the target message element is added to the to-be-received message table, so that the client obtains the target message element based on the sent received message request; the message assembly rule is used to parse the received message to obtain the message element.
[0012] Optionally, in the method described above, the method for obtaining the message assembly rule includes:
[0013] The obtained message structure document is normalized to obtain multiple message element identifiers;
[0014] Based on the preset hierarchical relationship between the message element identifiers, determining the level corresponding to each message element identifier in the multiple message element identifiers;
[0015] According to the level corresponding to each message element identifier, the multiple message element identifiers are spliced to obtain a message assembly rule.
[0016] Optionally, in the method described above, the to-be-processed message elements are obtained from the client via an HTTP message sending interface, and the target message elements are sent to the client via an HTTP message receiving interface.
[0017] Optionally, in the method described above, the preset message rules also include signing and / or signature verification rules and XSD verification rules; the signing and / or signature verification rules are used to sign the sent messages and / or verify the received messages; the XSD verification rules are used to verify the sent messages.
[0018] Optionally, the method as described above further includes:
[0019] According to the XSD validation rules in the preset message rules, the target sent message is validated and a validation result is generated;
[0020] When it is determined that the verification result is a verification failure, the verification result is returned to the client.
[0021] In a second aspect, the present application provides a message processing device, including:
[0022] A message assembly module, used to assemble the message elements to be processed obtained from the client according to the message assembly rules in the preset message rules to obtain the target sending message; the message assembly rules are used to assemble the message elements to obtain the sending message; or to parse the received message to obtain the message elements;
[0023] The sending message storage module is used to add the target sending message to the sending message queue so that the RMB cross-border payment system performs message business processing based on the target sending message and generates a target receiving message.
[0024] Optionally, the device as described above further comprises:
[0025] The sending message storage module is used to receive the target receiving message sent by the RMB cross-border payment system and store it in the receiving queue;
[0026] The message parsing module is used to parse the target received message according to the message assembly rule, obtain the target message element corresponding to the target received message, and add the target message element to the to-be-received message table, so that the client can obtain the target message element based on the sent receive message request.
[0027] In a third aspect, the present application provides an electronic device, the device comprising: a processor, and a memory communicatively connected to the processor;
[0028] Memory stores computer-executable instructions;
[0029] The processor executes the computer-executable instructions stored in the memory to implement the message processing method described in any of the above embodiments.
[0030] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the message processing method described in any of the above embodiments.
[0031] Compared with the prior art, this application has the following beneficial effects:
[0032] Through the preset message assembly rules, the system can automatically assemble the message elements obtained from the client into a sending message that meets the requirements without manual intervention, thereby improving the efficiency and accuracy of message processing. Among them, the message assembly rules ensure that all sent messages follow the same format and standard, which helps to reduce errors and delays caused by inconsistent message formats and enhances the consistency and standardization of message processing. And the target sent message is added to the message queue, so that CIPS can perform subsequent message business processing based on these messages, thereby improving the efficiency of message processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 A flowchart of an embodiment of a message processing method provided by the present application;
[0035] Figure 2 A flowchart of another embodiment of a message processing method provided by the present application;
[0036] Figure 3 A flowchart of another embodiment of a message processing method provided by the present application;
[0037] Figure 4 A schematic diagram of the structure of an embodiment of a message processing device provided by the present application;
[0038] Figure 5 A schematic structural diagram of an embodiment of an electronic device provided in the present application. DETAILED DESCRIPTION
[0039] As described above, when users currently access CIPS, they usually need a research and development team with professional technical skills and familiarity with the business to transform the user's corporate financial system after understanding the CIPS access standards, so that the corporate financial system can send messages that can be directly processed to the CIPS system, so that CIPS can perform corresponding business processing based on the messages. This leads to a complicated message processing process and reduced message processing efficiency.
[0040] After research, the inventors have proposed a message processing method, device, electronic device and storage medium to simplify the message processing process and improve the message processing efficiency.
[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] See also Figure 1 , which is a flow chart of an embodiment of a message processing method provided by the present application. Figure 1As shown, the method includes:
[0043] S101: According to the message assembly rules in the preset message rules, the elements of the message to be processed obtained from the client are assembled to obtain a target sending message.
[0044] Among them, the message assembly rule is used to assemble the message elements to obtain the sending message.
[0045] In this embodiment, the message engine obtains the message elements to be processed in JSON format from the enterprise financial system corresponding to the client through the HTTP message sending interface, and then assembles the message elements to be processed according to the preset message assembly rules to generate the target sending message.
[0046] For example, the message elements to be processed obtained may include but are not limited to the message type, the recipient identifier and the business data. Taking user A paying 100 yuan to user B as an example, the message elements to be processed obtained by the message engine from the enterprise financial system corresponding to the client of user A through the HTTP message sending interface may include: the message type is payment (PAYMENT), the recipient identifier is the identifier corresponding to user B, and the business data may include the amount (amount) of 100 and the currency (currency) of RMB. The above-mentioned message elements to be processed are assembled and processed according to the message assembly rules to obtain the target sending message, so that CIPS performs corresponding business processing according to the target sending message.
[0047] S102: Add the target sent message to the message sending queue, so that the RMB cross-border payment system performs message business processing based on the target sent message.
[0048] In this embodiment, the generated target sending message is sent to the message sending queue for storage, so that the CIPS obtains the message from the message sending queue and performs corresponding message service processing.
[0049] It is understandable that the message status of the target sent message can record whether each target sent message is sent successfully through log records, status tables, etc. If the target sent message fails to be sent, the sending failure status is returned to the client's enterprise financial system through the HTTP message sending interface.
[0050] In this embodiment, through the preset message assembly rules, the system can automatically assemble the message elements obtained from the client into a sending message that meets the requirements without manual intervention, thereby improving the efficiency and accuracy of message processing. Among them, the message assembly rules ensure that all sent messages follow the same format and standard, which helps to reduce errors and delays caused by inconsistent message formats and enhance the consistency and standardization of message processing. And the target sent message is added to the message queue, so that CIPS can perform subsequent message business processing based on these messages, thereby improving the efficiency of message processing.
[0051] Further, based on the above embodiment, the preset message rules may also include signature and / or verification rules and XSD verification rules. Among them, the signature and / or verification rules are used to sign the sent message or verify the received message by calling the signature server; the XSD verification rules are used to verify the elements of the message to be processed.
[0052] In this embodiment, the obtained message elements to be processed are subjected to XSD verification to ensure the accuracy of the structure of the target message to be sent; the verified target message to be sent is then signed to send the signed target message to the message sending queue. The received target message is subjected to signature verification to verify the validity of the signature.
[0053] Further, based on the above embodiment, after generating the target sending message and before adding the target sending message to the message sending queue, the method may further include:
[0054] According to the XSD validation rules in the preset message rules, the target sent message is validated and a validation result is generated.
[0055] When it is determined that the verification result is a verification failure, the verification result is returned to the client.
[0056] In this embodiment, according to the XSD validation rules in the preset message rules, the target sent message is validated, and the validation process may include checking whether the document structure of the generated target received message conforms to the XSD definition, whether the data types of the message elements and element attributes in the target message are correct, and whether the constraints defined in the XSD (such as uniqueness constraints, value range constraints, etc.) are met. Based on the result of the validation process, a validation result is generated. The validation result usually includes a status code indicating whether the validation is passed, and detailed information on the validation failure (such as error location, error type, etc.). The validation result is sent to the client's enterprise financial system so that the user can resend the message elements to be processed.
[0057] In this embodiment, the message engine can perform verification processing on the generated target sending document according to the preset XSD verification rules and generate corresponding verification results. When the verification fails, detailed error information can be returned to the client so that the client can perform error processing and correction to improve the accuracy of the message.
[0058] See also Figure 2 , which is a flow chart of another embodiment of a message processing method provided by the present application. After CIPS performs message service processing on the target sending message, it will generate a target receiving message to feedback the message status and service status to the client enterprise financial system. Therefore, if Figure 2 As shown, based on the above embodiment, the method further includes:
[0059] S103: Receive the target receiving message sent by the RMB cross-border payment system and store it in the receiving queue.
[0060] In this embodiment, the message engine obtains the target received message generated after the service processing from the CIPS, and stores the target received message in the message receiving queue. The target received message may include a message state and a service state.
[0061] It can be understood that if the target received message is in a message state, the target received message is stored in a message receiving queue corresponding to the message state; if the target received message is in a business state, the target received message is stored in a message receiving queue corresponding to the business state.
[0062] For example, CIPS receives a request from user A to pay user B RMB 100 and performs a series of business processing. After the processing is completed, CIPS generates a target receiving message with a business status based on the transaction result. The target receiving message usually contains information such as the transaction identifier (such as transaction ID), transaction status, transaction amount, and transaction time.
[0063] S104: according to the message assembly rule, the target receiving message is parsed and processed to obtain the target message element corresponding to the target receiving message, and the target message element is added to the to-be-received message table, so that the client obtains the target message element based on the sent receiving message request.
[0064] Among them, the message assembly rule is used to parse and process the received message to obtain the message elements.
[0065] In this embodiment, the message engine parses the received message according to the predefined message format and parsing rules to extract the target message elements. In the process of parsing the target message, the target message elements extracted by the message engine may include the transaction identifier, transaction status, transaction amount, and transaction time. It may also include an error code, error description (if the transaction fails), participant information, etc. The message engine adds the parsed target message elements to the to-be-received message table so that the client obtains the target message elements based on the received message request sent through the HTTP message receiving interface.
[0066] It is understandable that after receiving the target message element, the client enterprise financial system sends a confirmation request to the message engine to confirm that the business processing corresponding to the current target message has been completed.
[0067] In this embodiment, the target receiving message sent by the RMB cross-border payment system is received and stored in a receiving queue; then the target receiving message is parsed and processed according to the message assembly rules to obtain the target message elements corresponding to the target receiving message, and the target message elements are added to the to-be-received message table, so that the client can obtain the target message elements based on the sent receiving message request, thereby ensuring the accuracy and timeliness of the information and improving the user experience.
[0068] Further, Figure 3 A flowchart of another embodiment of a message processing method provided by the present application. Based on the above embodiment, before S101 "assembling and processing the message elements to be processed obtained from the client according to the message assembly rules in the preset message rules to obtain the target sending message", it is necessary to obtain the message assembly rules. Therefore, the method for obtaining the message assembly rules includes:
[0069] S105: normalize the acquired message structure document to obtain multiple message element identifiers.
[0070] In this embodiment, the message engine normalizes the obtained message structure document to obtain multiple message element identifiers. The message structure document is formed by the R&D personnel according to the CIPS message-related document specifications and protocol standards to understand the key information such as the structure composition, data elements, transmission rules and security requirements of the message, and organize the specific content of the message in XML format.
[0071] S106: Based on the preset hierarchical relationship between the message element identifiers, determine the level corresponding to each message element identifier in the plurality of message element identifiers.
[0072] S107: According to the level corresponding to each message element identifier, multiple message element identifiers are concatenated to obtain a message assembly rule.
[0073] In this embodiment, according to the hierarchical relationship between the preset message element identifiers, the hierarchy corresponding to each message element identifier in the multiple message element identifiers is determined. According to the order of the hierarchy corresponding to each message element identifier, these message element identifiers are spliced to obtain an xpath expression. For example, the hierarchical relationship between message element identifiers can be represented by a tree structure, in which each node represents a message element identifier, and the relationship between the parent node and the child node reflects the hierarchical relationship. Traverse this hierarchical model and assign a hierarchical number to each message element identifier. Usually, the hierarchy number of the root node is 1 (or 0, depending on the specific numbering rule), and the hierarchy number of its child node is 2, and so on. Each message element identifier and its corresponding hierarchical information are output in a list, a table or any other form suitable for displaying the hierarchical relationship to obtain a message assembly rule.
[0074] In this embodiment, the obtained message structure document is standardized to obtain multiple message element identifiers, which can ensure the consistency and accuracy of the message element identifiers, which helps to eliminate processing errors caused by inconsistent message formats and improve the standardization of message processing. Based on the hierarchical relationship between the preset message element identifiers, the level corresponding to each message element identifier in the multiple message element identifiers is determined, and the nested relationship between the various message elements can be clearly understood, which helps to quickly locate the required information when parsing the message and reduce the parsing time and complexity. Finally, according to the level of the message element identifier, splicing is performed to obtain structured message assembly rules. These rules can guide the message assembly process and ensure the correctness and integrity of the message. At the same time, the structured assembly rules also help to improve the efficiency of message assembly and reduce manual intervention and error rate.
[0075] See also Figure 4 , which is a schematic diagram of the structure of an embodiment of a message processing device provided in an embodiment of the present application. Figure 4 As shown in the solid line frame, the device 40 includes a message assembling module 41 and a sent message storage module 42.
[0076] The message assembly module 41 is used to assemble the message elements to be processed obtained from the client according to the message assembly rules in the preset message rules to obtain the target sending message; the message assembly rules are used to assemble the message elements to obtain the sending message; or to parse the received message to obtain the message elements;
[0077] The sending message storage module 42 is used to add the target sending message to the sending message queue so that the RMB cross-border payment system performs message business processing based on the target sending message and generates a target receiving message.
[0078] A message processing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0079] Further, based on the above embodiment, the device 40 may also include a sent message storage module 43 and a message parsing module 44 .
[0080] The message sending storage module 43 is used to receive the target receiving message sent by the RMB cross-border payment system and store it in the message receiving queue;
[0081] The message parsing module 44 is used to parse the target received message according to the message assembly rule, obtain the target message element corresponding to the target received message, and add the target message element to the to-be-received message table, so that the client can obtain the target message element based on the sent receive message request.
[0082] A message processing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0083] Further, based on the above embodiment, the device 40 may further include a rule acquisition module 45 .
[0084] Specifically, the rule acquisition module 45 is used to normalize the acquired message structure document to obtain multiple message element identifiers; based on the hierarchical relationship between the preset message element identifiers, determine the level corresponding to each message element identifier in the multiple message element identifiers; according to the level corresponding to each message element identifier, splice the multiple message element identifiers to obtain the message assembly rules.
[0085] A message processing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0086] Further, based on the above embodiment, the message elements to be processed are obtained from the client through the HTTP message sending interface, and the target message elements are sent to the client through the HTTP message receiving interface.
[0087] Furthermore, based on the above embodiments, the preset message rules also include signing and / or signature verification rules and XSD verification rules; the signing and / or signature verification rules are used to sign the sent messages and / or verify the received messages; the XSD verification rules are used to verify the sent messages.
[0088] Further, based on the above embodiment, the message assembly module 41 is also used to verify the target message according to the XSD verification rules in the preset message rules, and generate a verification result; when the verification result is determined to be a verification failure, the verification result is returned to the client.
[0089] A message processing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0090] See also Figure 5 , which is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device 50 may include: a processor 51 and a memory 52.
[0091] The processor 51 is in communication with the memory 52 , and the memory 52 is used to store computer-executable instructions. The processor 51 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the computer-executable instructions stored in the memory 52 .
[0092] Optionally, the memory 52 may be independent or integrated with the processor 51. Optionally, when the memory 52 is a device independent of the processor 51, the electronic device 50 may further include: a bus for connecting the above devices.
[0093] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.
[0094] An embodiment of the present application also provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement the above-mentioned method. The implementation principle and technical effect are similar and will not be repeated here.
[0095] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0096] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A message processing method, characterized in that: include: According to the message assembly rules in the preset message rules, the elements of the message to be processed obtained from the client are assembled and processed to obtain the target sending message; The message assembly rule is used to assemble the message elements to obtain a sending message; The target sending message is added to the message sending queue so that the RMB cross-border payment system performs message business processing based on the target sending message.
2. The method according to claim 1, characterized in that: The method further comprises: Receive the target receiving message sent by the RMB cross-border payment system and store it in the receiving queue; According to the message assembly rule, the target received message is parsed and processed to obtain the target message element corresponding to the target received message, and the target message element is added to the to-be-received message table, so that the client obtains the target message element based on the sent received message request; the message assembly rule is used to parse the received message to obtain the message element.
3. The method according to claim 1, characterized in that The method for obtaining the message assembly rule includes: The obtained message structure document is normalized to obtain multiple message element identifiers; Based on the preset hierarchical relationship between the message element identifiers, determining the level corresponding to each message element identifier in the multiple message element identifiers; According to the level corresponding to each message element identifier, the multiple message element identifiers are spliced to obtain a message assembly rule.
4. The method according to claim 1, characterized in that The to-be-processed message elements are obtained from the client via the HTTP message sending interface, and the target message elements are sent to the client via the HTTP message receiving interface.
5. The method according to claim 1, characterized in that: The preset message rules also include signing and / or signature verification rules and XSD verification rules; the signing and / or signature verification rules are used to sign the sent messages and / or verify the received messages; the XSD verification rules are used to verify the sent messages.
6. The method according to claim 5, characterized in that The method further comprises: According to the XSD validation rules in the preset message rules, the target sent message is validated and a validation result is generated; When it is determined that the verification result is a verification failure, the verification result is returned to the client.
7. A message processing device, characterized in that: include: A message assembly module, used to assemble the message elements to be processed obtained from the client according to the message assembly rules in the preset message rules to obtain the target sending message; the message assembly rules are used to assemble the message elements to obtain the sending message; Alternatively, it is used to parse and process the received message to obtain the message elements; The sending message storage module is used to add the target sending message to the sending message queue so that the RMB cross-border payment system performs message business processing based on the target sending message and generates a target receiving message.
8. The device according to claim 7, characterized in that The device also includes: The sending message storage module is used to receive the target receiving message sent by the RMB cross-border payment system and store it in the receiving queue; The message parsing module is used to parse the target received message according to the message assembly rule, obtain the target message element corresponding to the target received message, and add the target message element to the to-be-received message table, so that the client can obtain the target message element based on the sent receive message request.
9. An electronic device, characterized in that: The device comprises: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.