Multi-party real-time account checking method and system based on message queue
By adopting a delay queue and a multi-party reconciliation mechanism based on message queues in the order processing of multi-party systems, the performance bottlenecks and data consistency problems of order processing and reconciliation in the existing technology are solved, and efficient and stable multi-party real-time reconciliation and order status management are achieved.
Patent Information
- Application Number
- CN202411774586.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art has problems such as performance bottlenecks, risk of data inconsistency, inefficient reconciliation, increased operating costs, decreased user experience and difficulty in error handling in order processing and reconciliation of multi-party systems interaction.
Using message queue-based technology, the order processing is handled through delayed queues to ensure that all transaction orders arrive at the final state, and combined with a multi-party reconciliation mechanism to ensure the consistency and accuracy of transaction data.
Real-time reconciliation of multiple parties has been realized, reconciliation efficiency has been improved, and the financial reconciliation needs have been solved, ensuring real-time viewing of order status has been achieved, reducing operating costs, and improving system performance and user experience.
Smart Images

Figure CN119809747A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for multi-party real-time reconciliation based on a message queue. Background Art
[0002] With the rapid development of e-commerce and online transactions, order processing has become a core function of many enterprises and systems, and the interaction between systems has become more frequent and complex. In the system that generates transactions, since orders interact with multiple parties, reconciliation becomes more complicated, so the management and tracking of order status is particularly important. The order status not only reflects the current processing progress of the order, but also serves as an important bridge for communication between enterprises and users. In order to ensure the accuracy and efficiency of order processing, order status reconciliation has become an indispensable part.
[0003] Traditional order status reconciliation methods mainly rely on manual operations and data reports. However, with the growth of transaction volume and the increase in order complexity, this method can no longer meet the needs of modern enterprises. First, manual reconciliation is susceptible to human errors, resulting in inaccurate data. Second, traditional data reports can usually only be viewed and analyzed after the fact, and cannot reflect changes in order status in real time.
[0004] In order to solve these problems, some technical solutions have begun to emerge. For example, some systems use automated reconciliation tools to automatically check the order status through preset rules and algorithms. These tools have improved the accuracy and efficiency of reconciliation to a certain extent, but there are still some limitations. For example, there is a patent for reconciliation based on message queues similar to the present invention, CN112734544A "A distributed real-time reconciliation method based on message queues". This special train mainly uses distributed real-time reconciliation based on messages, and the business system actively broadcasts the business details to the MQ message queue to complete the real-time reconciliation. Automated reconciliation tools can usually only handle specific order types or statuses, and may not be able to accurately identify complex order status changes. For a large number of order processing and reconciliation systems with multiple parties involved, they may face performance bottlenecks, data inconsistency risks, low reconciliation efficiency, increased operating costs, reduced user experience, and difficulty in error handling. These problems may have a negative impact on the stability and reliability of the system, reducing user satisfaction and enterprise operating efficiency. Summary of the invention
[0005] In order to solve the deficiencies of the prior art, the present invention realizes the need for multi-party reconciliation, can well locate the source of problems for orders interacting with multiple systems, realizes the need for real-time reconciliation, can compare bills in real time, improves reconciliation efficiency, and also solves the need for multi-party reconciliation when the finance department reconciles accounts, as well as the need to view the order status in real time. The message queue is used to solve the orderliness of the order, and the delay queue is used to solve the incompleteness of the order synchronization to each system status. Combining multi-party reconciliation and delay sequence processing technology, an efficient, stable and reliable order processing and reconciliation system can be constructed. In this system, after an order or transaction is generated, it will be placed in a delay queue and wait for the appropriate time to be processed. At the same time, the multi-party reconciliation mechanism can ensure the consistency and accuracy of transaction data. This combination can not only improve the performance and stability of the system, but also reduce operating costs and improve user experience.
[0006] To achieve the above objectives, the technical solutions adopted by the present invention include:
[0007] A multi-party real-time reconciliation method based on a message queue, characterized in that it includes:
[0008] S1. Order generation and detection: the business system generates orders, and the order center detects new orders in the business system in real time;
[0009] S2. Order delay processing: the delay queue cluster receives orders from the order center;
[0010] S3. Order status reconciliation: the first reconciliation service center obtains the order from the delay queue for processing;
[0011] S4. Order status confirmation and result storage. The Nth (N is greater than or equal to 2) reconciliation service center processes the orders in the general queue until all systems query the order status and store the reconciliation results in the data center.
[0012] Furthermore, the S1 order center detects new orders in the business system in real time, including that when a new order is detected, the order center pushes the order information to the delay queue;
[0013] The S2 delay queue cluster receives orders from the order center, including using a delay queue to ensure that all transaction orders reach a final state.
[0014] Furthermore, the S3 reconciliation service center obtains orders from the delay queue for processing, including calling order query interfaces provided by the business system and the acquirer system to confirm the status of orders in different systems.
[0015] Furthermore, S3 also includes that no matter whether the order exists and / or the order status query is confirmed, all non-bank system reconciliation service centers put the order into the next processing queue.
[0016] Furthermore, the S4 Nth (N is greater than or equal to 2) reconciliation service center processes the orders in the general queue until all systems query the order status, and also includes that if all systems feedback a confirmed order status, all reconciliation service centers store the reconciliation results in the data center; if any system feedbacks that the order status is uncertain or does not exist, the order will be put back in the delayed queue and wait for processing again.
[0017] Furthermore, if any of the systems report that the order status is uncertain or does not exist, the order will be put back into the delay queue and wait for processing again. If the order status cannot be determined after the number of retries exceeds the set number, the reconciliation result will be stored in the data center for manual processing.
[0018] The present invention also provides a multi-party real-time reconciliation system based on a message queue, characterized in that any method of claims 1-6 is adopted, including:
[0019] An order generation and detection module, used to detect new orders and push the new orders into the delay queue;
[0020] The order delay processing module is used to receive pending orders and ensure that all pending orders reach the final state;
[0021] The order status reconciliation module is used to query the order status and process the order to enter the order service center in the next system;
[0022] The order status confirmation and result storage module is used to determine whether the order is returned to the delay queue based on the order status, and store the query status in the data center.
[0023] The present invention also provides a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
[0024] The present invention also provides an electronic device, characterized in that it includes a processor and a memory;
[0025] The memory is used to store computer programs;
[0026] The processor is configured to execute the method according to any one of claims 1 to 6 by calling a stored computer program.
[0027] The present invention also relates to a computer program product, comprising a computer program and / or instructions, characterized in that the computer program and / or instructions implement the steps of the above method when executed by a processor.
[0028] The beneficial effects of the present invention are as follows: for orders involving multiple system interactions, the source of problems can be well located, the need for real-time reconciliation is met, the bills can be compared in real time, the efficiency of reconciliation is improved, and the need for multi-party reconciliation in finance and the need to view the order status in real time are solved. The message queue is used to solve the orderliness of the order, and the delay queue is used to solve the incompleteness of the order status synchronized to each system. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 The present invention is a flowchart of a multi-party real-time reconciliation method implemented based on a message queue.
[0030] Figure 2 The figure is a schematic diagram of the structure of a multi-party real-time reconciliation system implemented based on a message queue in the present invention.
[0031] Figure 3 The figure is a schematic diagram of the multi-party real-time reconciliation process implemented by the present invention based on the message queue. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0033] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0034] The first aspect of the present invention relates to a multi-party real-time reconciliation method based on a message queue. Figure 1 As shown, including:
[0035] S1. Order generation and detection: the business system generates orders, and the order center detects new orders in the business system in real time;
[0036] Specifically, the order center mainly detects whether a new order has been generated in the system. Once a new order is found, the order will be placed in the delay queue.
[0037] S2. Order delay processing: the delay queue cluster receives orders from the order center;
[0038] Specifically, the main function of delayed processing is to receive orders generated by the order center. The reason for using a delayed queue is that a certain amount of time will be generated in the order transaction process. Considering the possibility of timeout, a delayed queue is used to ensure that all transactions have been executed to the final state.
[0039] S3. Order status reconciliation: the first reconciliation service center obtains the order from the delay queue for processing;
[0040] Specifically, the reconciliation service center mainly extracts orders from the queue to confirm the order status. The business system and the acquiring institution system provide an order query interface to call and confirm the order status. The status query settings are separated, and the business system and the bank system provide query interfaces for payment status and refund status respectively to prevent confusion.
[0041] S4. Order status confirmation and result storage. The Nth (N is greater than or equal to 2) reconciliation service center processes the orders in the general queue until all systems query the order status and store the reconciliation results in the data center.
[0042] Specifically, each business system corresponds to a reconciliation service center. For example, in the hospital HIS system, during the order processing of multi-terminal business systems, there are interactive comparisons of orders pushed by the hospital's self-service machines, registration systems, and Internet hospital systems. At least three business systems are processed in a fixed order, that is, all orders are consumed in sequence, and when retries occur, two identical orders can be guaranteed to be executed in sequence. When processing orders at the order service center, it is necessary to ensure that all orders have reached the final state (including paid, refunded, timed out, and payment failed) to avoid changing to a refund state when processing orders. Finally, the data after execution and status confirmation is stored in the storage center to save the reconciliation results.
[0043] Another aspect of the present invention also relates to a multi-party real-time reconciliation system based on a message queue, characterized in that any method of claims 1-6 is adopted, and its structure is as follows Figure 2 As shown, including:
[0044] An order generation and detection module, used to detect new orders and push the new orders into the delay queue;
[0045] The order delay processing module is used to receive pending orders and ensure that all pending orders reach the final state;
[0046] The order status reconciliation module is used to query the order status and process the order to enter the order service center in the next system;
[0047] The order status confirmation and result storage module is used to determine whether the order is returned to the delay queue based on the order status, and store the query status in the data center.
[0048] By using this system, the above-mentioned operation processing method can be executed and the corresponding technical effects can be achieved.
[0049] The specific implementation steps of the above method are as follows Figure 3 As shown, step 1: after the business system generates an order, the order center performs real-time detection on the order. If it is found that the account in the business system has changed, it is considered that a new transaction has occurred, and the new transaction information is actively pushed to the delay queue.
[0050] Step 2: The reconciliation service center receives the order message from the delayed queue, queries the status of the order in system A, and confirms the order status in system A, regardless of whether the order exists or not and whether the order status query is successful. Once the execution is completed, the order is directly placed in the next normal queue for processing.
[0051] Step 3: Same as step 2, it also consumes orders in the message queue and queries the order information in system B. After the query is completed, regardless of the order status or whether the order exists, it is placed in the next ordinary queue for processing.
[0052] Step 4: Similar to steps 2 and 3, the reconciliation service center receives the consumption order and queries the status information in the bank institution. After completion, it confirms whether all systems have queried the order status. If all statuses are confirmed, the order reconciliation results are placed in the data storage center. If the order status is uncertain or the order does not exist, the order information is thrown back into the delay queue for execution again. If the number of retries exceeds 5 times (which can be set according to actual conditions) and still cannot be determined, the order reconciliation results are placed in the data storage center for manual confirmation.
[0053] The entire process ensures the integrity and accuracy of the order from generation to status confirmation. Through the collaborative work of the delay queue and the reconciliation service center, real-time reconciliation and final confirmation of the order status are achieved. At the same time, by setting up retry and manual processing mechanisms, abnormal situations where the order status is uncertain or cannot be queried are dealt with.
[0054] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the method in the above embodiment, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps in the method in the above embodiment are implemented.
[0055] An embodiment of the present invention also provides an electronic device for executing the above method. As an implementation device of the method, the electronic device has at least a processor and a memory, and in particular, the memory stores data and related computer programs required for executing the method, such as a multi-party real-time reconciliation computer program based on a message queue, etc., and the processor calls the data and program in the memory to execute all the steps of the implementation method and obtains the corresponding technical effect.
[0056] Preferably, the electronic device may include a bus architecture, the bus may include any number of interconnected buses and bridges, and the bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same component, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor when performing operations.
[0057] In addition, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operation control) used may include a microprocessor or other processor device and / or a logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices, which may store the above-mentioned related data information, and may also store a program for executing related information, and the processor may execute the program stored in the memory to realize information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it may be a key or a touch input device; the power supply is used to provide power to the electronic device; the display is used to display display objects such as images and text, for example, it may be an LCD display. The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal. Based on different communication technologies, multiple communication modules may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to a speaker and a microphone via an audio processor to provide an audio output via the speaker and receive an audio input from the microphone, thereby realizing a common telecommunication function. The audio processor may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to a central processor, so that recording can be performed on the machine through the microphone, and the sound stored on the machine can be played through the speaker.
[0058] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0059] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.
[0060] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0061] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in a box or multiple boxes. Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0062] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention 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 by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A multi-party real-time reconciliation method based on a message queue, characterized in that: include: S1. Order generation and detection: the business system generates orders, and the order center detects new orders in the business system in real time; S2. Order delay processing: the delay queue cluster receives orders from the order center; S3. Order status reconciliation: the first reconciliation service center obtains the order from the delay queue for processing; S4. Order status confirmation and result storage. The Nth (N is greater than or equal to 2) reconciliation service center processes the orders in the general queue until all systems query the order status and store the reconciliation results in the data center.
2. The method according to claim 1, characterized in that The S1 order center detects new orders in the business system in real time. Including, when a new order is detected, the order center pushes the order information to the delay queue; The S2 delay queue cluster receives orders from the order center, including using a delay queue to ensure that all transaction orders reach a final state.
3. The method according to claim 3, characterized in that The S3 reconciliation service center obtains the order from the delay queue for processing, including calling the order query interface provided by the business system and the acquiring institution system to confirm the status of the order in different systems.
4. The method according to claim 4, characterized in that The S3 also includes that no matter whether the order exists and / or whether the order status query is confirmed, all non-bank system reconciliation service centers put the order into the next processing queue.
5. The method according to claim 1, characterized in that The S4 Nth (N is greater than or equal to 2) reconciliation service center processes the orders in the general queue until all systems query the order status, and also includes that if all systems feedback a confirmed order status, all reconciliation service centers store the reconciliation results in the data center; if any system feedbacks that the order status is uncertain or does not exist, the order will be put back into the delayed queue and wait for processing again.
6. The method according to claim 5, characterized in that If any of the systems report that the order status is uncertain or does not exist, the order will be put back into the delay queue and wait for processing again. If the order status cannot be determined after the number of retries exceeds the set number, the reconciliation result will be stored in the data center for manual processing.
7. A multi-party real-time reconciliation system based on a message queue, characterized in that: The method of any one of claims 1 to 6, comprising: An order generation and detection module, used to detect new orders and push the new orders into the delay queue; The order delay processing module is used to receive pending orders and ensure that all pending orders reach the final state; The order status reconciliation module is used to query the order status and process the order to enter the order service center in the next system; The order status confirmation and result storage module is used to determine whether the order is returned to the delay queue based on the order status, and store the query status in the data center.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 6 by calling a stored computer program.
10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.