Distributed system cross-node transaction parameter version consistency processing method and device

By monitoring and synchronizing parameter changes, it ensures that each node in the distributed system uses consistent parameter versions, solves the problem of transaction failure caused by inconsistent parameter versions, improves the transaction success rate, and optimizes system performance and performance through dynamic cleaning and marking mechanisms. Historical data management.

CN113741942BInactive Publication Date: 2024-10-11BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111098664.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-18
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In a distributed system, due to different processing times, the parameter versions used by each node are inconsistent, resulting in inconsistent or failed transaction processing results. Especially during asynchronous processing, inconsistent parameter versions lead to transaction failures, and existing methods such as direct transmission of parameters Or there are performance bottlenecks and historical data cleaning problems in global parameter version number updates.

Method used

By monitoring parameter changes in the distributed system, updating the effective and invalid times of parameters, and synchronizing this information to relevant systems in real time, ensuring that consistent parameter versions are used during transactions, using dynamic parameter aspects and timestamp management to realize parameter versions consistency.

Benefits of technology

It ensures the consistency of parameter versions of cross-node transactions in the distributed system, improves the transaction success rate, avoids transaction failures caused by inconsistent parameter versions, and optimizes system performance and historical data management through dynamic cleaning and marking mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113741942B_ABST
    Figure CN113741942B_ABST
Patent Text Reader

Abstract

The present invention discloses a distributed system cross-node transaction parameter version consistency processing method and device, which relates to the technical field of distributed systems, wherein the method comprises: monitoring the parameter change of each system in the distributed system; when monitoring the parameter change of a system in the distributed system, updating the effective time and expiration time pre-configured for the parameter; synchronizing the parameter change of the current system and the updated effective time and expiration time to other related systems in the distributed system; the parameter change and the updated effective time and expiration time are used to complete the distributed system cross-node transaction together with the transaction initiation time. The present invention can ensure the consistency of the distributed system cross-node transaction parameter version, thereby ensuring the success rate of the transaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of distributed systems, and in particular to a method and device for processing version consistency of cross-node transaction parameters in a distributed system. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] In a distributed system, a transaction is usually processed through multiple processing nodes, and each node needs to use corresponding parameters when processing. Since there is a certain time difference in the processing time of each node, especially when the transaction involves asynchronous processing, if there is a parameter change during this time difference, different nodes will use different parameter versions when processing the same transaction, resulting in inconsistent transaction processing results, and even causing the synchronous transaction to the customer to be returned, but the transaction failed due to inconsistent parameter versions used during the asynchronous processing process. Summary of the invention

[0004] An embodiment of the present invention provides a distributed system cross-node transaction parameter version consistency processing method, which is used to ensure the consistency of the distributed system cross-node transaction parameter version. The method includes:

[0005] Monitor parameter changes of each system in the distributed system;

[0006] When a parameter of a system in the distributed system is monitored to be changed, updating the effective time and the invalid time pre-configured for the parameter;

[0007] The parameter changes of the current system and its updated effective and expiration times are synchronized to other related systems in the distributed system; the parameter changes and its updated effective and expiration times are used together with the transaction initiation time to complete the distributed system cross-node transaction.

[0008] The embodiment of the present invention further provides a distributed system cross-node transaction parameter version consistency processing device, which is used to ensure the consistency of the distributed system cross-node transaction parameter version. The device includes:

[0009] A monitoring unit, used to monitor parameter changes of each system in the distributed system;

[0010] An updating unit, configured to update a pre-configured effective time and an expiration time for a parameter when a parameter of a system in the distributed system is monitored to change;

[0011] The processing unit is used to synchronize the parameter changes of the current system and the updated effective time and expiration time to other related systems in the distributed system; the parameter changes and the updated effective time and expiration time are used together with the transaction initiation time to complete the distributed system cross-node transaction.

[0012] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned distributed system cross-node transaction parameter version consistency processing method when executing the computer program.

[0013] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program for executing the above-mentioned distributed system cross-node transaction parameter version consistency processing method.

[0014] In an embodiment of the present invention, a distributed system cross-node transaction parameter version consistency processing solution is provided, by: monitoring the parameter changes of each system in the distributed system; when monitoring a parameter change of a system in the distributed system, updating the effective time and expiration time pre-configured for the parameter; synchronizing the parameter changes of the current system and its updated effective time and expiration time to other related systems in the distributed system; the parameter changes and its updated effective time and expiration time are used together with the transaction initiation time to complete the distributed system cross-node transaction, which can ensure the consistency of the distributed system cross-node transaction parameter versions, thereby ensuring the success rate of the transaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0016] Figure 1 It is a flow chart of a method for processing consistency of transaction parameter versions across nodes in a distributed system according to an embodiment of the present invention;

[0017] Figure 2 A schematic diagram of the principle of processing consistency of transaction parameter versions across nodes in a distributed system according to an embodiment of the present invention;

[0018] Figure 3 A schematic diagram of the architecture involved in the process of processing the consistency of transaction parameter versions across nodes in a distributed system according to an embodiment of the present invention;

[0019] Figure 4A schematic diagram of dynamically obtaining parameter sections during cross-node transactions in a distributed system according to an embodiment of the present invention;

[0020] Figure 5 It is a structural diagram of a distributed system cross-node transaction parameter version consistency processing device in an embodiment of the present invention. DETAILED DESCRIPTION

[0021] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0022] In distributed systems, especially distributed financial systems, in order to improve customer service experience, some transaction processing steps are made into synchronous calls and returned, and other steps are made into asynchronous calls. After the synchronous processing is successful, the transaction success is returned to the customer. At this time, there is a certain time difference between the synchronous processing steps and the asynchronous processing steps. If the parameters change during the period, the asynchronous processing will fail because the parameter version used is inconsistent with the synchronous processing. However, since the transaction to the customer has been successfully returned, it is difficult to roll back or withdraw the transaction. Even if it is manually withdrawn, it will seriously affect the customer experience. In this way, the transaction is in a dilemma.

[0023] If there are many asynchronously called transactions and the parameters are unclear, it is not feasible to use snapshots to record and transmit all parameters at the transaction time.

[0024] The technical problem to be solved by the present invention is: in a distributed system, when a transaction is processed by multiple nodes, due to different processing times, there will be a problem of inconsistent parameter versions used by various processes in the system.

[0025] The existing methods are:

[0026] 1. The first node in transaction processing obtains all parameter data required for the transaction and transmits it to subsequent nodes as transaction input information. Subsequent transactions directly obtain the required parameters from the input information. This solution increases the transmission of transaction information, and in many cases the first processing node cannot accurately know which parameters are required by the subsequent processing nodes, making this solution completely unfeasible.

[0027] 2. Add a system global parameter version number. Update the global parameter version number each time the parameter changes. Use the version number to access each time the parameter is obtained.

[0028] In the first solution, the first processing node cannot accurately know which parameters are required by the subsequent processing nodes, making the existing solution completely infeasible.

[0029] In the second solution, each time the parameters are updated, it is necessary to ensure that the global parameter version number is updated in the same transaction as the parameter record. If the parameters are updated frequently, the global parameter version number will become a hot resource, which may easily lead to performance bottlenecks. At the same time, the version number is not convenient for historical data cleanup, which will cause the parameter table to become larger and larger.

[0030] In view of the above technical problems, an embodiment of the present invention proposes a distributed system cross-node transaction parameter version consistency processing solution, which is introduced in detail below.

[0031] Figure 1 FIG. 1 is a flow chart of a method for processing consistency of transaction parameter versions across nodes in a distributed system according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0032] Step 101: Monitor the parameter changes of each system in the distributed system;

[0033] Step 102: When a parameter of a system in the distributed system is monitored to be changed, updating the effective time and the invalid time pre-configured for the parameter;

[0034] Step 103: Synchronize the parameter changes of the current system and the updated effective and expiration times to other related systems in the distributed system; the parameter changes and the updated effective and expiration times are used together with the transaction initiation time to complete the distributed system cross-node transaction.

[0035] The distributed system cross-node transaction parameter version consistency processing method provided by the embodiment of the present invention can ensure the consistency of the distributed system cross-node transaction parameter version, thereby ensuring the success rate of the transaction. Figures 2 to 4 Each step involved in this method is introduced in detail.

[0036] 1. First, we introduce the pre-configuration step, i.e., the storage design of parameters.

[0037] Add (pre-configured) control of effective time and expiration time in the parameter table; the expiration time is the time point when the current parameter is updated, invalidated, deleted, etc.

[0038] 2. Next, for ease of understanding, the above steps 101 and 102 are introduced together.

[0039] In the above step 101, the parameter changes of each system in the distributed system can be monitored in real time.

[0040] In one embodiment, in the above step 102, when a parameter of a system in the distributed system is monitored to be changed, updating the effective time and the invalid time pre-configured for the parameter may include:

[0041] When a new parameter is detected, the effective timestamp field of the new parameter is configured as the current system timestamp.

[0042] In one embodiment, in the above step 102, when a parameter of a system in the distributed system is monitored to be changed, updating the effective time and the invalid time pre-configured for the parameter may include:

[0043] When monitoring detects that a parameter is being modified, the expiration timestamp field of the parameter record whose modification is effective is changed to the current system timestamp; at the same time, a new parameter record is added according to the parameter whose modification is effective, and the effective timestamp field of the newly added parameter record is configured to be the current system timestamp, and the expiration timestamp is empty.

[0044] In one embodiment, in the above step 102, when a parameter of a system in the distributed system is monitored to be changed, updating the effective time and the invalid time pre-configured for the parameter may include:

[0045] When it is detected that a parameter is to be deleted, the expiration timestamp field of the parameter record to be deleted is changed to the current system timestamp.

[0046] In specific implementation, when a parameter is changed, if it is a new addition, the effective timestamp field of the new record is the current system timestamp; if it is a modification, first change the invalid timestamp field of the currently effective parameter record to the current system timestamp, and add a new parameter record at the same time, the effective timestamp field is the current system timestamp, and the invalid timestamp is empty; if it is a deletion, change the invalid timestamp field of the record to be deleted to the current system timestamp (such as Figure 3 parameters shown).

[0047] 3. Next, the above step 103 is introduced.

[0048] In the above step 103, the current system (such as Figure 2 The parameter changes of the parameter system in the distributed system and the time when the parameters are updated and when they take effect and when they are invalid are synchronized to other related systems in the distributed system (there are also systems involved in the parameter changes, such as Figure 2 In system 1, system 2 and system 3), that is, each system that needs asynchronous call, synchronizes all parameters in real time, that is, Figure 2 As shown, from the parameter issuing system (the system that monitors the parameter changes), all the parameters required by this system are synchronized in real time (such as Figure 3 Parameter synchronization as shown). In this way, when initiating a distributed system cross-node transaction, the parameters are read according to the transaction initiation time, parameter changes, and the effective and invalid time after the update (such as Figure 3Parameter reading as shown: Read the parameters according to the transaction initiation timestamp of the sent transaction as the parameter section position and the parameter validity time and expiration time), ensuring the consistency of transaction parameters across nodes in the distributed system, thereby ensuring the transaction success rate, that is, Figure 4 As shown, when initiating cross-node transactions in a distributed system, it is an implementation plan for dynamically obtaining parameter slices: the parameters are synchronized using the transaction initiation time slice method. For asynchronously called transactions, no matter at what time point, they are piloted to obtain the parameters that need to be obtained through the transaction initiation time point and the current parameters, thereby achieving a flexible time slice method among all parameters based on the transaction initiation time point.

[0049] in addition, Figure 3 The system shown in: A distributed business system using parameters (geographically dispersed), asynchronous calls between systems may occur.

[0050] Fourth, the further preferred steps of the embodiment of the present invention are introduced, namely, Figure 3 The steps for parameter cleaning are shown.

[0051] 1. First, let’s introduce the dynamic cleaning of parameters.

[0052] In one embodiment, the above-mentioned distributed system cross-node transaction parameter version consistency processing method may also include:

[0053] Detect the earliest transaction time among all transactions that require parameters in the distributed system;

[0054] Expired parameter clearing processing is performed on the parameters that are invalid before the earliest transaction time.

[0055] In specific implementation, dynamic cleaning of parameters: Considering that transaction parameters are updated very frequently, and asynchronous processing may take a long time due to network reasons, in order to store all parameters in use in memory, expired and useless parameters are cleaned up. (Mainly considering parameters with low usage frequency and high update frequency) For parameters with low overall update frequency, only expired parameters are cleaned up.

[0056] Specifically, for example, the earliest transaction time among all transactions that require parameters is calculated, and the parameters that expire before this time (except for the parameters needed at this time point) can be used for expired parameter cleanup. For example, if the earliest time point is 10:00, and there is a parameter before 10:00, and 7:00 is the latest valid parameter (expiration time is after 10:00), then the parameter at 7:00 needs to be retained, and the earlier parameters can be cleaned up.

[0057] 2. Next, we will introduce parameter tag cleaning.

[0058] In one embodiment, the above-mentioned distributed system cross-node transaction parameter version consistency processing method may also include:

[0059] Clean up the parameters according to the parameter cleanup identifier pre-configured for the parameters.

[0060] In specific implementation, parameter marks are cleaned up. For all scenarios where asynchronous calls may use parameters, the transaction initiation time point (time point mark, i.e. parameter cleanup mark) is recorded; when cleaning up useless parameters, parameters at unmarked time points can be cleaned up, and parameter cleanup marks (such as Figure 3 The settings of the time stamps shown in the table can be found in Table 1 below.

[0061]

[0062] Table 1

[0063] Specifically, for example, all time point marks (parameter cleanup marks) are calculated for high-frequency parameters (too much data), and parameters other than the most recent parameters used at the time point when the transaction was initiated can be cleaned up.

[0064] In summary, the distributed system cross-node transaction parameter version consistency processing method provided by the embodiment of the present invention can ensure that the parameter versions used by each node processing a transaction in the distributed system are consistent, while not introducing new hot resource bottlenecks and facilitating historical data cleaning.

[0065] The embodiment of the present invention also provides a distributed system cross-node transaction parameter version consistency processing device, as described in the following embodiment. Since the principle of solving the problem by the device is similar to the distributed system cross-node transaction parameter version consistency processing method, the implementation of the device can refer to the implementation of the distributed system cross-node transaction parameter version consistency processing method, and the repeated parts will not be repeated.

[0066] Figure 5 FIG. 1 is a schematic diagram of a distributed system cross-node transaction parameter version consistency processing device according to an embodiment of the present invention. Figure 5 As shown, the device comprises:

[0067] Monitoring unit 01, used to monitor parameter changes of each system in the distributed system;

[0068] The updating unit 02 is used to update the effective time and the invalid time pre-configured for the parameter when a parameter of a system in the distributed system is monitored to change;

[0069] Processing unit 03 is used to synchronize the parameter changes of the current system and the updated effective time and expiration time to other related systems in the distributed system; the parameter changes and the updated effective time and expiration time are used together with the transaction initiation time to complete the distributed system cross-node transaction.

[0070] In one embodiment, the updating unit is specifically configured to:

[0071] When a new parameter is detected, the effective timestamp field of the new parameter is configured as the current system timestamp.

[0072] In one embodiment, the updating unit is specifically configured to:

[0073] When monitoring detects that a parameter is being modified, the expiration timestamp field of the parameter record whose modification is effective is changed to the current system timestamp; at the same time, a new parameter record is added according to the parameter whose modification is effective, and the effective timestamp field of the newly added parameter record is configured to be the current system timestamp, and the expiration timestamp is empty.

[0074] In one embodiment, the updating unit is specifically configured to:

[0075] When it is detected that a parameter is to be deleted, the expiration timestamp field of the parameter record to be deleted is changed to the current system timestamp.

[0076] In one embodiment, the above-mentioned distributed system cross-node transaction parameter version consistency processing device may also include:

[0077] A detection unit, used to detect the earliest transaction time among all transactions requiring parameters in the distributed system;

[0078] The first parameter clearing unit is used to perform expired parameter clearing processing on parameters that are invalid before the earliest transaction time.

[0079] In one embodiment, the above-mentioned distributed system cross-node transaction parameter version consistency processing device may also include:

[0080] The second parameter cleaning unit is used to clean up the parameters according to the parameter cleaning identifier pre-configured for the parameters.

[0081] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned distributed system cross-node transaction parameter version consistency processing method when executing the computer program.

[0082] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program for executing the above-mentioned distributed system cross-node transaction parameter version consistency processing method.

[0083] In an embodiment of the present invention, by: monitoring parameter changes of each system in the distributed system; when monitoring changes in parameters of a system in the distributed system, updating the effective time and expiration time pre-configured for the parameters; synchronizing the parameter changes of the current system and the updated effective time and expiration time to other related systems in the distributed system; the parameter changes and the updated effective time and expiration time are used together with the transaction initiation time to complete the cross-node transaction of the distributed system, which can ensure the consistency of the parameter versions of the cross-node transaction of the distributed system, thereby ensuring the success rate of the transaction.

[0084] 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.

[0085] 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 device that provides the functions specified in a block or multiple blocks.

[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0087] 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 in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0088] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A distributed system cross-node transaction parameter version consistency processing method, characterized in that: include: Monitor the parameter changes of each system in the distributed system; When a parameter of a system in the distributed system is monitored to be changed, updating the effective time and the invalid time pre-configured for the parameter; Synchronize the parameter changes of the current system and the updated effective and expiration times to other related systems in the distributed system; the parameter changes and the updated effective and expiration times are used together with the transaction initiation time to complete the distributed system cross-node transaction; When a parameter change of a system in a distributed system is monitored, the effective time and expiration time pre-configured for the parameter are updated, including: when it is monitored that a new parameter is added, the effective timestamp field of the new parameter is configured to the current system timestamp; when it is monitored that a parameter is modified, the expiration timestamp field of the parameter record whose modification is effective is changed to the current system timestamp; at the same time, a new parameter record is added according to the parameter whose modification is effective, and the effective timestamp field of the new parameter record is configured to be the current system timestamp, and the expiration timestamp is empty; when it is monitored that a parameter is deleted, the expiration timestamp field of the parameter record to be deleted is changed to the current system timestamp.

2. The distributed system cross-node transaction parameter version consistency processing method according to claim 1, characterized in that: Also includes: Detect the earliest transaction time among all transactions that require parameters in the distributed system; Expired parameter clearing processing is performed on the parameters that are invalid before the earliest transaction time.

3. The distributed system cross-node transaction parameter version consistency processing method according to claim 1, characterized in that: Also includes: Clean up the parameters according to the parameter cleanup identifier pre-configured for the parameters.

4. A distributed system cross-node transaction parameter version consistency processing device, characterized in that: include: A monitoring unit, used to monitor parameter changes of each system in the distributed system; An updating unit, configured to update a pre-configured effective time and an expiration time for a parameter when a parameter of a system in the distributed system is monitored to change; A processing unit, used to synchronize the parameter changes of the current system and the updated effective time and expiration time to other related systems in the distributed system; the parameter changes and the updated effective time and expiration time are used to complete the distributed system cross-node transaction together with the transaction initiation time; The updating unit is specifically used to: when monitoring that a new parameter is added, configure the effective timestamp field of the new parameter to the current system timestamp; when monitoring that a parameter is modified, change the invalid timestamp field of the parameter record whose modification is effective to the current system timestamp; at the same time, add a new parameter record according to the modified effective parameter, configure the effective timestamp field of the new parameter record to the current system timestamp, and the invalid timestamp to be empty; When it is detected that a parameter is to be deleted, the expiration timestamp field of the parameter record to be deleted is changed to the current system timestamp.

5. The distributed system cross-node transaction parameter version consistency processing device according to claim 4, characterized in that: Also includes: A detection unit, used to detect the earliest transaction time among all transactions requiring parameters in the distributed system; The first parameter clearing unit is used to perform expired parameter clearing processing on parameters that are invalid before the earliest transaction time.

6. The distributed system cross-node transaction parameter version consistency processing device according to claim 4, characterized in that: Also includes: The second parameter cleaning unit is used to clean up the parameters according to the parameter cleaning identifier pre-configured for the parameters.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 3.