Transaction message processing method, device and equipment, and storage medium

By setting the same identifier code for related transaction messages in the financial transaction system and performing hash calculations, the problem of disordered transaction message order under multi-node processing is solved, and the sequentiality and efficient processing of transaction messages are realized.

CN116708584BActive Publication Date: 2026-01-23BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310610530.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2026-01-23
Estimated Expiration
2043-05-26

AI Technical Summary

Technical Problem

In financial transaction systems, when multiple service nodes process transaction messages in parallel, there is a problem of disordered order, especially when the processing speeds of different nodes are inconsistent. This can cause transaction messages to be sent to the receiver in an out-of-order manner, affecting the transaction results.

Method used

By setting the same identifier code for related transaction messages and performing a hash operation on the identifier code, the target service node is determined based on the hash operation result. Related transaction messages are then mapped to the same service node for processing and sent to the recipient after pre-processing.

Benefits of technology

This ensures that related transaction messages are sent to the recipient in sequence, solving the problem of disordered transaction message order and achieving both high efficiency and sequentiality in parallel processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116708584B_ABST
    Figure CN116708584B_ABST
Patent Text Reader

Abstract

The application provides a transaction message processing method, device and equipment and a storage medium, which can be used in the field of distribution. The method comprises the following steps: generating an identification code according to a received target transaction message; the identification codes of transaction messages with an association relationship are the same; performing a hash operation on the identification code; determining a target service node corresponding to the target transaction message according to the hash operation result, and sending the target transaction message to the target service node, so that the target service node performs a preset processing on the target transaction message, and sends the target transaction message after the preset processing to a receiver. The method of the application sets the same identification code for the transaction messages with the association relationship and then performs a hash operation on the identification code. Since the hash operation results corresponding to different identification codes are different, the transaction messages with the association relationship are mapped to the same service node, and the transaction messages with the association relationship are ensured to be sent to the receiver in sequence.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of distribution, and in particular to a transaction message processing method and device, equipment and storage medium. BACKGROUND

[0002] In a financial transaction system, in order to improve the performance of the system, multiple node application services are usually deployed.

[0003] In a financial transaction, some transaction requests have certain requirements for the orderliness in the message transmission process. If multiple transaction messages sent in a short time and having a correlation are allocated to different service nodes, and the processing speeds of different service nodes are different, the transaction messages may be sent to the receiver in a wrong order, thereby affecting the transaction. For example, transaction message 1 is generated first, and transaction message 2 is generated later, and transaction message 1 and transaction message 2 have a correlation. If transaction message 1 is allocated to service node A, and transaction message 2 is allocated to service node B, the processing speed of service node A is slower, and the processing speed of service node B is faster, transaction message 2 will be processed before transaction message 1, thereby causing an order error.

[0004] How to ensure the correctness of message transmission on the basis of parallel processing of multiple service nodes is a problem to be solved. SUMMARY

[0005] The present application provides a transaction message processing method, device, equipment and storage medium to solve the problem of order error when multiple service nodes perform parallel processing on transaction messages.

[0006] In a first aspect, the present application provides a transaction message processing method, which is applied to a transaction system, and the transaction system includes multiple service nodes. The method comprises the following steps:

[0007] generating an identification code according to a received target transaction message; wherein the identification codes of transaction messages having a correlation relationship are the same;

[0008] performing a hash operation on the identification code to obtain a hash operation result;

[0009] determining a target service node corresponding to the target transaction message according to the hash operation result, and sending the target transaction message to the target service node, so that the target service node performs a preset processing on the target transaction message, and sends the target transaction message after the preset processing to a receiver; the receiver is used for processing the transaction message.

[0010] In a second aspect, the present application provides a transaction message processing device, which comprises the following steps:

[0011] generating an identification code according to the received target transaction message; wherein the identification codes corresponding to the transaction messages having the association relationship are the same;

[0012] processing the identification code by a hash operation to obtain a hash operation result;

[0013] determining the target service node corresponding to the target transaction message according to the hash operation result, and sending the target transaction message to the target service node, so that the target service node performs a preset processing on the target transaction message, and sends the target transaction message after the preset processing to a receiver; the receiver is configured to process the transaction message.

[0014] In a third aspect, the present application provides an electronic device, comprising a processor and a memory connected with the processor in communication;

[0015] The memory stores computer execution instructions;

[0016] The processor executes the computer execution instructions stored in the memory to realize the method of the first aspect.

[0017] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer execution instructions, and when the processor executes the computer execution instructions, the method of the first aspect is realized.

[0018] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which is executed by the processor to realize the method of the first aspect.

[0019] The transaction message processing method, device, equipment and storage medium provided by the present application generate an identification code according to the received target transaction message; wherein the identification codes corresponding to the transaction messages having the association relationship are the same; the identification code is processed by a hash operation to obtain a hash operation result; the target service node corresponding to the target transaction message is determined according to the hash operation result, and the target transaction message is sent to the target service node, so that the target service node performs a preset processing on the target transaction message, and sends the target transaction message after the preset processing to a receiver; the receiver is configured to process the transaction message, by setting the same identification code for the transaction messages having the association relationship, and then processing the identification code by a hash operation, since the hash operation results corresponding to different identification codes are different, the transaction messages having the association relationship are mapped to the same service node, and it is ensured that the transaction messages having the association relationship are sent to the receiver in order. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate embodiments consistent with the application and, together with the description, further serve to explain the principles of the application.

[0021] Figure 1 An application scenario diagram of a transaction message processing method provided by an embodiment of the application is shown in FIG. 1.

[0022] Figure 2 A flowchart of a transaction message processing method provided by an embodiment of the application is shown in FIG. 2.

[0023] Figure 3 A flowchart of another transaction message processing method provided by an embodiment of the application is shown in FIG. 3.

[0024] Figure 4 A diagram for determining a target service node according to a second value provided by an embodiment of the application is shown in FIG. 4.

[0025] Figure 5 A structural diagram of a transaction message processing device provided by an embodiment of the application is shown in FIG. 5.

[0026] Figure 6 A hardware structural diagram of an electronic device provided by an embodiment of the application is shown in FIG. 6.

[0027] The specific embodiments have been shown and described in the foregoing drawings and specification, it is to be understood that the application is not limited to the embodiments disclosed, but instead can be practiced with the scope of the claims. It is intended that modifications and variations shall be considered as within the scope of the application based on the overall disclosure. DETAILED DESCRIPTION

[0028] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements in the several figures. The following detailed description describes embodiments that are provided by way of example in order to provide a thorough understanding of the application. It does not represent the only embodiments in which the application can be practiced. It can be understood that other embodiments can be practiced, which lie within the scope of the application as detailed in the following claims.

[0029] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards, and provide corresponding operation portal for user to choose authorization or refusal.

[0030] It should be noted that the transaction message processing method and device of the present application can be used in the distributed field, and can also be used in any field other than the distributed field. The application field of the transaction message processing method and device of the present application is not limited.

[0031] The specific application scenario of the present application is a transaction system, especially a financial transaction system. Generally, the financial transaction system has high performance requirements and needs to process the generated transaction messages in a timely manner. Therefore, a multi-node application service is deployed in the financial transaction system. Figure 1 The application scenario diagram of the transaction message processing method provided by the embodiment of the present application is shown in Figure 1 The transaction system includes N service nodes, and the transaction messages can be distributed to the service nodes based on a gateway (such as a routing module) in the transaction system. When distributing, the routing module considers mechanisms such as load balancing and flow control for regular transaction messages, so that the number of transaction messages processed by each service node is as close as possible.

[0032] However, there are some special scenarios when multiple transaction messages have requirements for the order of transmission. If the same service node cannot be used to process these transaction messages, the order of the transaction messages sent to the receiver may be disordered. For example, when user A submits a transaction of 100,000 financial products, if user A cancels the order within a short period of time, it indicates that the two transaction messages have an association relationship. When the two transaction messages are processed by different service nodes, because some service nodes process fast and some service nodes process slow, the order of the transaction messages sent to the receiver may be disordered, that is, the transaction message corresponding to the cancellation is transmitted to the receiver earlier than the transaction message corresponding to the order, thereby affecting the transaction effect.

[0033] Based on the above problems, the present application sets the same identification code for the transaction messages having an association relationship, and then performs a hash operation through the routing module. Through the hash operation, the hash operation results corresponding to different identification codes are different, and the hash operation results corresponding to the same identification code are the same. Therefore, the transaction messages having an association relationship can be distributed to the same service node for processing, so as to ensure the order of message processing and transmission.

[0034] The transaction message processing method provided by the present application aims to solve the above technical problems of the prior art.

[0035] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in detail in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0036] Figure 2 A flowchart of a transaction message processing method provided by an embodiment of the present application is shown in the figure. The method is applied to a transaction system, which comprises a plurality of service nodes. The method comprises:

[0037] Step S201: generating an identification code according to a received target transaction message.

[0038] The identification codes of the transaction messages having an association relationship are the same. When two transaction messages correspond to the same service, it indicates that there is an association relationship.

[0039] When a transaction message is generated due to the triggering of a sender, an identification code can be generated for the transaction message. For example, the sender can be a user. When the user submits a transaction request for a product, a transaction message is triggered.

[0040] Specifically, for any target transaction message, an identification code corresponding to the target transaction message can be set. When there is another transaction message having an association relationship with the target transaction message, the identification code of the target transaction message is the same as the identification code of the transaction message having the association relationship. The association relationship indicates that the two transaction messages correspond to the same service. For example, when a user A places an order and cancels the order, the services correspond to the order placement and the order cancellation are the same. When the user A places an order, a transaction message 1 is generated, and the identification code of the transaction message 1 is identification code 1. When the user A cancels the order, a transaction message 2 is generated, and the identification code of the transaction message 2 is also identification code 1.

[0041] Step S202: performing a hash operation on the identification code to obtain a hash operation result.

[0042] When the identification code corresponding to the transaction message is generated, a hash operation can be performed on the identification code. For example, the MD5 (Message-Digest Algorithm, password hash function) can be used to calculate the identification code, and a 128-bit binary data can be obtained. Then, a binary conversion is performed to obtain a string containing 32 characters.

[0043] The processing process of the hash operation on the identification code can be performed by a routing module. When the identification codes are the same, the corresponding hash operation results are the same. When the identification codes are different, the corresponding hash operation results are different, so that the target service node can be determined based on the hash operation result.

[0044] Step S203: determining a target service node corresponding to the target transaction message according to the hash operation result, and sending the target transaction message to the target service node, so that the target service node performs a preset processing on the target transaction message, and sends the target transaction message after the preset processing to a receiver. The receiver is used to process the transaction message.

[0045] When the hash operation result is obtained, the target service node can be determined based on the hash operation result, and the target transaction message with the same identification code can be distributed to the same service node, and the target transaction message with different identification codes can be distributed to different service nodes.

[0046] After receiving the target transaction message, the service node can perform preset processing on the target transaction message according to a specific scene, and after the preset processing, the transaction message after the preset processing can be sent to the receiver, so that the receiver can continue to process the target transaction message.

[0047] When placing an order, the sender can be a user, the receiver can be a transaction center, and the routing module can generate an identification code for the target transaction message and determine a target service node according to the identification code. The target service node performs preset processing, which can be checking the amount of the account. If the checking is successful, the target transaction message can be sent to the transaction center. When the transaction center receives the order placing request, it can be processed. For example, when processing, the transaction center can process in batches. For example, if the transaction amount is 1 million, the transaction amount can be divided into 300,000, 300,000 and 400,000 for processing. When each processing is completed, the processing result can be transmitted to the sender.

[0048] In the process of returning the processing result, the identification code of the transaction message corresponding to each processing result is the same as the identification code of the transaction message generated when placing an order. In the process of returning the processing result, the transaction center is the sender, and the user is the receiver. The routing module can send the transaction message corresponding to each processing result to the same service node, and the preset processing performed by the service node can update the state of the transaction and send the transaction message to the receiver.

[0049] The transaction message processing method, device, equipment and storage medium provided by the application generate an identification code according to the received target transaction message. The identification codes of the transaction messages with an association relationship are the same. The identification code is subjected to a hash operation to obtain a hash operation result. The target service node corresponding to the target transaction message is determined according to the hash operation result, and the target transaction message is sent to the target service node, so that the target service node performs preset processing on the target transaction message, and sends the target transaction message after the preset processing to the receiver. The receiver is used to process the transaction message. Since the hash operation results corresponding to different identification codes are different, the same identification code is set for the transaction messages with an association relationship, and the identification code is subjected to a hash operation, so that the transaction messages with an association relationship are mapped to the same service node, and the transaction messages with an association relationship are ensured to be sent to the receiver in order.

[0050] Figure 3 Another flowchart of a transaction message processing method provided by an embodiment of the present application is shown in FIG. 3, which includes the following steps. Figure 3

[0051] In step S301, an identification code is generated according to the received target transaction message; the identification codes corresponding to the transaction messages having an association relationship are the same.

[0052] In step S302, a hash operation is performed on the identification code to obtain a hash operation result.

[0053] The steps S301 and S302 can refer to the steps S201 and S202 in the embodiment shown in FIG. 2, respectively, which will not be described here. Figure 2

[0054] The hash operation result is a string containing M characters.

[0055] In step S303, N characters are taken from the string, and a first value is determined according to the ASCII values corresponding to the N characters; the first value is the sum of the ASCII values corresponding to the N characters.

[0056] After the string is obtained, the string can be processed and calculated, so that the target transaction messages can be divided as evenly as possible to different service nodes based on the calculation result.

[0057] The N characters can be taken from the string, and the ASCII values corresponding to the N characters are summed to obtain the first value. When the N characters are taken, the N characters can be taken from a fixed position, or the N characters can be randomly taken.

[0058] For example, for an identification code 2021062700000001, after the hash operation, the corresponding hash operation result is 106875bb0efc1e6256151a688261633e, the first four characters (1068) and the last four characters (633e) are taken from the string, and the ASCII values of the eight characters are added to obtain an integer 464 (the first value), and then the target service node can be determined based on the first value.

[0059] In step S304, the target service node corresponding to the target transaction message is determined according to the first value.

[0060] Through the above operations, different first values can be obtained for different hash operation results, and then different target transaction messages can be evenly distributed to different target service nodes.

[0061] ​​By selecting N-bit characters from the string and obtaining the ASCII value corresponding to the N-bit characters, the string can be converted into a numerical value, so as to facilitate the determination of the target service node through calculation.

[0062] Optionally, the target service node corresponding to the target transaction message is determined according to the first numerical value, and the method comprises the following steps of:

[0063] A second numerical value is determined according to the first numerical value and the number of service nodes; the second numerical value is the result of the modulo operation of the first numerical value on the number of service nodes; the target service node corresponding to the target transaction message is determined according to the second numerical value; wherein different target service nodes correspond to different second numerical values.

[0064] In order to allocate transaction messages to each service node, the modulo operation of the first numerical value on the number of service nodes can be calculated, that is, the remainder of the division of the two is obtained, that is, the second numerical value. When the number of service nodes is L, the result of the modulo operation can be any numerical value between 0 and L-1, and then the target service node can be determined according to the second numerical value.

[0065] Figure 4 A schematic diagram for determining the target service node according to the second numerical value is provided for the embodiment of the application, and an example is shown in Figure 4 When the second numerical value is 0, the target transaction message is allocated to the service node 1; when the second numerical value is 1, the target transaction message is allocated to the service node 2; and when the second numerical value is L-1, the target transaction message is allocated to the service node L.

[0066] As can be seen, when the second numerical value is different, the corresponding different target service nodes are different.

[0067] When the service nodes are expanded or contracted, the number of service nodes can be directly modified, and the flexibility is high.

[0068] By calculating the result of the modulo operation of the first numerical value on the number of service nodes, different transaction messages can be sent to different service nodes, and the transaction messages can be as evenly distributed as possible on all service nodes.

[0069] In step S305, the target transaction message is sent to the target service node, so that the target service node performs a preset processing on the target transaction message, and sends the target transaction message after the preset processing to a receiving party; the receiving party is used to process the transaction message.

[0070] When the target service node is determined, the target transaction message can be sent to the target service node.

[0071] Optionally, the target transaction message is sent to the target service node, comprising:

[0072] A communication mode between the target service node and the routing module is determined, and the target transaction message is sent to the target service node according to the communication mode.

[0073] In the process of sending the target transaction message, the communication mode between the routing module and each service node can be a synchronous communication mode or an asynchronous communication mode, and the transmission mode of the target transaction message is different in the two communication modes.

[0074] Therefore, the communication mode between the routing module and the target service node can be determined, and the target transaction message is sent to the target service node according to the communication mode.

[0075] By determining the communication mode, the mode of sending the target transaction message to the target service node is determined based on different communication modes, thereby improving the success rate of the target service node receiving the target transaction message.

[0076] Optionally, the target transaction message is sent to the target service node according to the communication mode, comprising:

[0077] When the communication mode is a synchronous communication mode, the communication address information of the target service node is obtained, and the target transaction message is sent to the target service node according to the communication address information.

[0078] When the communication mode is an asynchronous communication mode, a message queue corresponding to the target service node is determined, and the target transaction message is sent to the message queue, so that the target service node obtains the target transaction message from the message queue; the target service node and the message queue correspond to each other.

[0079] The communication mode between the routing module and the service node can be a synchronous communication mode or an asynchronous communication mode. When it is a synchronous communication mode, the identity between the two needs to be verified, so the IP address and port number of the target service node are directly obtained, and then the target transaction message is sent based on the communication address information.

[0080] For example, when the second value is 0, the target transaction message is mapped to the IP address and port of the service node 1; when the second value is 1, the target transaction message is mapped to the IP address and port of the service node 2, and so on.

[0081] For the asynchronous communication mode, the identity between the two does not need to be verified, so the target transaction message can be transmitted based on the message queue. When the number of service nodes is L, the number of message queues is also L, and one service node corresponds to one message queue.

[0082] For example, when the second value is 0, the target transaction message is mapped to the message queue queue_0, and the service node 1 takes the target transaction message from the queue; when the second value is 1, the target transaction message is mapped to the message queue queue_1, and the service node 2 takes the target transaction message from the queue, and so on.

[0083] The process of generating the identification code according to the received target transaction message is described in detail below.

[0084] Optionally, when an order transaction is performed, the generating of the identification code according to the received target transaction message comprises:

[0085] When the target transaction message is a placing request for a target service, the identification code is generated in a sequence self-increment manner or a universally unique identifier manner, and the identification code is stored.

[0086] When the target transaction message is a cancel request corresponding to the placing request, the identification code corresponding to the target transaction message is determined as a preset identification code; the preset identification code is the identification code of the corresponding placing request.

[0087] When the services corresponding to two target transaction messages are the same, it indicates that there is a correlation relationship between the two. Specifically, when an order transaction is performed, when there is a transaction message corresponding to a placing request, an identification code, for example, identification code 1, can be generated. Specifically, a numerical identification code can be generated in a sequence self-increment manner; a string type identification code can also be generated in a universally unique identifier (UUID) manner. When a cancel request corresponding to the placing request exists subsequently, the identification code of the target transaction message corresponding to the cancel request is also identification code 1.

[0088] In addition, in the placing process, the service node can send the target transaction message to the receiving party, and when the receiving party generates a processing result corresponding to the placing request, the identification code of the transaction message corresponding to the processing result is also identification code 1.

[0089] Optionally, when a quotation transaction is performed, the generating of the identification code according to the received target transaction message comprises:

[0090] When the target transaction message is a quotation request for a target product, the identification code is generated in a sequence self-increment manner or a universally unique identifier manner, and the identification code is stored.

[0091] When the target transaction message is a quotation reply corresponding to the quotation request, the identification code corresponding to the target transaction message is determined as a preset identification code; the preset identification code is the identification code of the corresponding quotation request.

[0092] For the quotation transaction scenario, when the quotation transaction is initiated in the foreign exchange transaction center, for example, when the user initiates an inquiry for a target product, the transaction center can send multiple quotation replies within 1 second, and the later quotation will cover the previous quotation, so the order of the quotation reply is very important. The target transaction message corresponding to the multiple quotation replies and the target transaction message corresponding to the inquiry request have an association relationship.

[0093] Based on the above scenario, for the target transaction message corresponding to the inquiry request, an identification code can be generated in a sequence-incremental manner or a universally unique identifier manner and stored, such as identification code 2. When the transaction center generates a transaction message corresponding to the quotation reply of the inquiry request, the identification code corresponding to the transaction message can be determined as identification code 2.

[0094] Through the method of the present application, the identification codes of the transaction messages with an association relationship are set to be the same, then the hash operation results of the two transaction messages with the same identification code are the same after the hash operation, then the corresponding transaction messages can be distributed to the same service node for processing, so that the order of message transmission can be guaranteed, and the transaction messages without an association relationship will also be distributed to different service nodes for processing, and the efficiency of parallel processing is realized.

[0095] Figure 5 A structure schematic diagram of a transaction message processing device 50 provided for an embodiment of the present application, the device 50 is applied to a transaction system, the transaction system includes multiple service nodes; the device 50 includes:

[0096] A generation module 501 is configured to generate an identification code according to a received target transaction message; wherein the identification codes of the transaction messages with an association relationship are the same; when two transaction messages correspond to the same service, it indicates that there is an association relationship;

[0097] A processing module 502 is configured to perform a hash operation on the identification code to obtain a hash operation result;

[0098] A determination module 503 is configured to determine a target service node corresponding to the target transaction message according to the hash operation result, and send the target transaction message to the target service node, so that the target service node performs a preset processing on the target transaction message, and sends the target transaction message after the preset processing to a receiver; the receiver is configured to process the transaction message.

[0099] Optionally, the hash operation result is a string containing M characters; when determining the target service node corresponding to the target transaction message according to the hash operation result, the determination module 503 is specifically configured to:

[0100] Taking N-bit characters from the string, determining a first numerical value according to an ASCII value corresponding to the N-bit characters; the first numerical value is a summation result of the ASCII value corresponding to the N-bit characters;

[0101] Determining a target service node corresponding to the target transaction message according to the first numerical value.

[0102] Optionally, the determining module 503 is specifically used for:

[0103] Determining a second numerical value according to the first numerical value and a service node quantity; the second numerical value is a result of a modulo operation of the first numerical value on the service node quantity;

[0104] Determining a target service node corresponding to the target transaction message according to the second numerical value; when the second numerical values are different, different target service nodes correspond to the second numerical values.

[0105] Optionally, when an order transaction is performed, the generating module 501 is specifically used for:

[0106] When the target transaction message is a placing request for a target service, generating an identification code in a sequence self-increment manner or a universally unique identifier manner, and storing the identification code;

[0107] When the target transaction message is a canceling request corresponding to the placing request, determining an identification code corresponding to the target transaction message as a preset identification code; the preset identification code is an identification code of the placing request.

[0108] Optionally, when a quotation transaction is performed, the generating module 501 is specifically used for:

[0109] When the target transaction message is an inquiry request for a target product, generating an identification code in a sequence self-increment manner or a universally unique identifier manner, and storing the identification code;

[0110] When the target transaction message is a quotation reply corresponding to the inquiry request, determining an identification code corresponding to the target transaction message as a preset identification code; the preset identification code is an identification code of the inquiry request.

[0111] Optionally, the determining module 503 is specifically used for:

[0112] Determining a communication mode between the target service node;

[0113] Sending the target transaction message to the target service node according to the communication mode.

[0114] Optionally, the determining module 503 is configured to:

[0115] when the communication mode is a synchronous communication mode, obtaining communication address information of the target service node, and sending the target transaction message to the target service node according to the communication address information;

[0116] when the communication mode is an asynchronous communication mode, determining a message queue corresponding to the target service node, and sending the target transaction message to the transaction queue, so that the target service node obtains the target transaction message from the message queue; the target service node and the message queue correspond to each other.

[0117] The transaction message processing device provided by the embodiment of the application can implement the transaction message processing method of the embodiments shown in Figure 2 and Figure 3 The implementation principle and technical effects are similar, and will not be described here.

[0118] Figure 6 A hardware structure schematic diagram of an electronic device is provided for the embodiment of the application. As shown in Figure 6 The electronic device provided by the embodiment includes at least one processor 601 and a memory 602. The processor 601 and the memory 602 are connected through a bus 603.

[0119] In the specific implementation process, the at least one processor 601 executes the computer execution instructions stored in the memory 602, so that the at least one processor 601 executes the method in the above method embodiment.

[0120] The specific implementation process of the processor 601 can be referred to the above method embodiment, and the implementation principle and technical effects are similar, which will not be described here.

[0121] In the above Figure 6In the illustrated embodiment, it is to be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.

[0122] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, such as at least one disk memory.

[0123] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0124] The embodiment of the application further provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions. When the processor executes the computer execution instructions, the method of the above method embodiment is realized.

[0125] The above computer readable storage medium, the above readable storage medium can be realized by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0126] An example readable storage medium is coupled to the processor such that the processor can read information from the readable storage medium and can write information to the readable storage medium. Of course, the readable storage medium can be a part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can exist as discrete components in the device.

[0127] The application also provides a program product, which includes executable instructions stored in a readable storage medium. At least one processor of an electronic device can read the executable instructions from the readable storage medium, and the at least one processor executes the executable instructions to enable the transaction message processing apparatus to implement the transaction message processing method provided in the various embodiments.

[0128] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by relevant hardware of program instructions. The foregoing program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the foregoing storage medium includes various media capable of storing program codes, such as ROM, RAM, magnetic disk or optical disk.

[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing transaction messages, characterized in that, The method is applied to a trading system, which includes multiple service nodes; the method includes: An identifier code is generated based on the received target transaction message; among them, transaction messages with related relationships have the same identifier code; Perform a hash operation on the identifier code to obtain the hash result; The target service node corresponding to the target transaction message is determined based on the hash operation result, and the target transaction message is sent to the target service node so that the target service node performs preset processing on the target transaction message and sends the preset processed target transaction message to the receiver; the receiver is used to process the transaction message. The hash operation result is a string containing M characters; determining the target service node corresponding to the target transaction message based on the hash operation result includes: Take N characters from the string, and determine a first value based on the ASCII values ​​corresponding to the N characters; the first value is the sum of the ASCII values ​​corresponding to the N characters. The target service node corresponding to the target transaction message is determined based on the first value.

2. The method according to claim 1, characterized in that, Determining the target service node corresponding to the target transaction message based on the first value includes: The second value is determined based on the first value and the number of service nodes; the second value is the result of modulo operation of the first value and the number of service nodes. The target service node corresponding to the target transaction message is determined based on the second value; wherein, different target service nodes correspond to different values.

3. The method according to claim 1, characterized in that, When an order transaction is performed, the step of generating an identifier code based on the received target transaction message includes: When the target transaction message is an order request for the target business, an identifier code is generated using a sequence auto-incrementing method or a universally unique identifier method, and the identifier code is stored. When the target transaction message is a cancellation request corresponding to the order placement request, the identifier code corresponding to the target transaction message is determined as a preset identifier code; the preset identifier code is the identifier code of the corresponding order placement request.

4. The method according to claim 1, characterized in that, When conducting a quotation transaction, the step of generating an identifier code based on the received target transaction message includes: When the target transaction message is a price inquiry request for the target product, an identifier code is generated using a sequence auto-incrementing method or a universally unique identifier, and the identifier code is stored. When the target transaction message is a quote response corresponding to the inquiry request, the identifier code corresponding to the target transaction message is determined as a preset identifier code; the preset identifier code is the identifier code of the corresponding inquiry request.

5. The method according to any one of claims 1-4, characterized in that, Sending the target transaction message to the target service node includes: Determine the communication method with the target service node; The target transaction message is sent to the target service node according to the communication method described.

6. The method according to claim 5, characterized in that, Sending the target transaction message to the target service node according to the communication method includes: When the communication method is synchronous communication, the communication address information of the target service node is obtained, and the target transaction message is sent to the target service node according to the communication address information; When the communication method is asynchronous, a message queue corresponding to the target service node is determined, and the target transaction message is sent to the transaction queue so that the target service node can obtain the target transaction message from the message queue; the target service node corresponds one-to-one with the message queue.

7. A transaction message processing apparatus, characterized in that, The device is applied to a trading system, which includes multiple service nodes; including: The generation module is used to generate an identifier code based on the received target transaction message; among them, transaction messages with related relationships have the same identifier code; The processing module is used to perform a hash operation on the identifier code to obtain the hash operation result; The determining module is used to determine the target service node corresponding to the target transaction message based on the hash operation result, and send the target transaction message to the target service node so that the target service node performs preset processing on the target transaction message and sends the preset processed target transaction message to the receiver; the receiver is used to process the transaction message; The hash operation result is a string containing M characters; when determining the target service node corresponding to the target transaction message based on the hash operation result, the determining module is specifically used for: Take N characters from the string, and determine a first value based on the ASCII values ​​corresponding to the N characters; the first value is the sum of the ASCII values ​​corresponding to the N characters. The target service node corresponding to the target transaction message is determined based on the first value.

8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Decentralized trading system for fair ordering and matching of trades received at multiple network nodes and matched by multiple network nodes within decentralized trading system

    US20190005566A1

  • Data transmission method and apparatus

    WO2022052882A1