Distributed business data management system and method
Through global lock management and real-time consistency verification mechanism, the balance problem between data consistency and performance in distributed transaction processing in telecommunications billing systems is solved, efficient data verification and consistency management are achieved, and the reliability and robustness of the system are ensured.
Patent Information
- Application Number
- CN202510083970.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-01-17
AI Technical Summary
In telecommunications billing systems, existing technologies find it difficult to strike a balance between ensuring data consistency and performance. Especially in compute-intensive scenarios, the data verification difficulties and performance loss problems caused by distributed transaction processing have not been effectively resolved.
A global lock management module is used to perform mutual exclusive locking on business data, and real-time consistency verification is performed through data version and global lock version. Combined with automatic and manual repair mechanisms, data consistency among multiple centers is ensured.
It improves the real-time and efficiency of data verification, reduces the impact of abnormal transactions on business continuity, ensures the final consistency of data, and enhances the reliability and robustness of the system.
Smart Images

Figure CN119996149B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of distributed data processing, in particular to a distributed business data management system and method. BACKGROUND
[0002] As a core business support platform of an operator, a telecom billing system must ensure its all-weather uninterrupted business processing capability. Any system failure or disaster event may lead to billing data loss or service interruption, and further affect the operator's revenue and customer satisfaction. Therefore, in order to ensure business continuity, it is crucial to establish an effective disaster recovery system, which can quickly restore business operation when a disaster occurs. At the data level, disaster recovery needs to synchronize data between data centers in different geographical locations and properly handle distributed transaction problems. Distributed transaction and data consistency are key prerequisites to ensure the accuracy of multi-data center business processing results. Although existing strong consistency distributed transaction solutions (such as the RAFT (Raft Consensus Algorithm) protocol) can solve the problem of distributed transaction, they usually bring about a large performance loss, which is not suitable for telecom billing systems in computationally intensive scenarios. If a strong consistency distributed transaction protocol is not selected, but instead, eventual consistency is pursued, although it can reduce the impact on performance during transaction processing, it introduces new challenges of data consistency and transaction compensation. In the daily operation of a telecom billing system, changes to user information, account details and other data need to be checked between multiple centers, which puts higher requirements on timeliness and data access. Although stream data processing frameworks such as Flink and Spark can be used for data consistency checking, they have high demands on hardware resources and are difficult to provide effective transaction compensation mechanisms for specific billing business scenarios. In summary, when designing a disaster recovery solution for a telecom billing system, the relationship between the consistency and performance of distributed transactions needs to be balanced, and a method that can meet the requirements of data consistency and adapt to high computational load needs to be explored. In the face of this complex situation, different technologies and strategies may need to be applied comprehensively to find the most suitable solution for a telecom billing system.
[0003] At present, no effective solution has been proposed to solve the above problems. SUMMARY
[0004] Embodiments of the present application provide a distributed business data management system and method to at least solve the technical problem of difficulty in verification due to large amounts of business data that need to be synchronized in a distributed business data processing scenario.
[0005] According to one aspect of an embodiment of the present application, a distributed business data management system is provided, comprising: a management center and multiple business centers, the management center comprising: a global lock management module and a verification module, each business center comprising: at least one business application and a business database, wherein a first business application in a first business center is configured to, when processing a target transaction, mutually exclusive lock first business data corresponding to the target transaction through the global lock management module, and submit the target business data to a first business database in the first business center after the target transaction is processed, wherein the target business data comprises: second business data obtained by processing the first business data, a data version corresponding to the second business data, and a global lock version used, the first business center being any business center among the multiple business centers, and the first business application being any business application in the first business center; the first business database being configured to synchronize the target business data to second business databases in respective second business centers through message middleware, wherein the second business centers are business centers other than the first business center among the multiple business centers; and the verification module being configured to respond to a synchronization data stream in the message middleware and, upon completion of data synchronization, perform a consistency verification on the target business data in each second business database and the target business data in the first business database based on the data version and the global lock version.
[0006] Optionally, the verification module is used to perform mutual exclusive locking on the target business data in the second business database through the global lock management module when the target business data in any second business database and the target business data in the first business database fail to pass the consistency verification; periodically perform consistency verification on the target business data in the second business database and the target business data in the first business database within a preset time period; if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency verification after the preset time period, perform data repair on the target business data in the second business database; after the data repair is completed, release the mutual exclusive lock on the target business data in the second business database.
[0007] Optionally, the first business application is used to send a global lock acquisition request to the global lock management module when processing the target transaction; the global lock management module is used to detect the locking status of the first business data; when the first business data has been locked, it feeds back data locking prompt information to the first business application; when the first business data is not locked, it allocates a global lock to the first business application; the first business application is used to record the global lock version of the global lock allocated by the global lock management module, and mutually exclusively lock the first business data based on the global lock, wherein, in the mutually exclusive locked state, other business applications except the first business application cannot access the first business data.
[0008] Optionally, the first business application is used to process the first business data based on the target transaction to obtain the second business data, and record the data version corresponding to the second business data; submit the second business data, data version and global lock version as target business data to the first business database; release the global lock and release the mutual exclusion lock on the second business data.
[0009] Optionally, the verification module is used to monitor the status of the synchronization data flow in the message middleware; when the message middleware synchronizes the target business data to any second business database, the data version and global lock version of the target business data in the second business database are compared with the target business data in the first business database; when the data version and the global lock version are consistent, it is determined that the target business data in the second business database and the target business data in the first business database have passed the consistency check; when the data version and / or the global lock version are inconsistent, it is determined that the target business data in the second business database and the target business data in the first business database have not passed the consistency check.
[0010] Optionally, the verification module is used to notify the first business database to re-synchronize the target business data to the second business database through the target channel if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency verification after a preset period of time, and after the re-synchronization is completed, to re-check the consistency of the target business data in the second business database and the target business data in the first business database, wherein the target channel includes at least one of the following: message middleware, a preset data transmission channel; if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency verification, a manual repair prompt message is sent to the target object; the second business database is used to store the manually repaired target business data.
[0011] Optionally, the global lock management module allocates different global lock versions to different transactions; and each business application obtains a different data version of the data business after processing each transaction.
[0012] According to another aspect of an embodiment of the present application, a distributed business data management method is also provided, including: when processing a target transaction, requesting the global lock management module of the management center to perform a mutual exclusive lock on the first business data corresponding to the target transaction; after the target transaction is processed, the second business data obtained by processing the first business data, the data version corresponding to the second business data, and the global lock version used are stored as target business data in the first business database of the first business center; the target business data is synchronized to the second business database in the second business center through the message middleware, wherein the management center also includes a verification module, which is used to respond to the synchronization data stream in the message middleware. At the end of data synchronization, the target business data in the second business database and the target business data in the first business database are checked for consistency based on the data version and the global lock version.
[0013] According to another aspect of an embodiment of the present application, a distributed business data management method is also provided, including: in response to a global lock acquisition request sent by the first business center when processing a target transaction, calling the global lock management module to perform a mutual exclusive lock on the first business data corresponding to the target transaction, wherein the first business center is used to process the first business data according to the target transaction, and synchronize the obtained second business data, the data version corresponding to the second business data, and the used global lock version as the target business data to the second business center through the message middleware; monitoring the status of the synchronization data flow in the message middleware, and when the message middleware synchronizes the target business data to the second business center, performing consistency verification on the target business data in the second business center and the target business data in the first business center based on the data version and the global lock version.
[0014] Optionally, when the target business data in the second business center and the target business data in the first business center fail to pass the consistency check, the target business data in the second business center are mutually exclusive locked by the global lock management module; the target business data in the second business center and the target business data in the first business center are periodically checked for consistency within a preset time period; if after the preset time period, the target business data in the second business center and the target business data in the first business center still fail to pass the consistency check, data repair is performed on the target business data in the second business center; after the data repair is completed, the mutual exclusive lock on the target business data in the second business center is released.
[0015] According to another aspect of an embodiment of the present application, a computer program product is further provided, the computer program product comprising: a computer program, wherein when the computer program is executed by a processor, the above-mentioned distributed business data management method is implemented.
[0016] According to another aspect of an embodiment of the present application, an electronic device is further provided, which includes: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned distributed business data management method through the computer program.
[0017] In an embodiment of the present application, when processing a target transaction, the global lock management module performs mutual exclusive locking on specific business data to ensure that only one business application can modify the data at the same time, thereby avoiding data inconsistency problems caused by concurrent operations; real-time consistency verification is performed using data version and global lock version information. This mechanism enables the verification module to quickly and accurately determine the consistency of data between multiple business centers after data synchronization is completed. Compared with the audit of each data item, the comparison of version numbers greatly reduces the consumption of computing resources and improves the real-time and efficiency of the audit; when the data version or the global lock version is inconsistent, that is, the data consistency check fails, the system can automatically lock the problem data to prevent the abnormal data from being further used, and at the same time try to automatically repair the data consistency problem. If the automatic repair cannot solve the problem, the system will notify manual intervention to restore data consistency through resynchronization or manual repair. This mechanism reduces the impact of abnormal transactions on business continuity, ensures the ultimate consistency of data, and is a reflection of system reliability and robustness, thereby solving the technical problem of verification difficulties caused by the large amount of business data to be synchronized in distributed business data processing scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 is a schematic structural diagram of an optional distributed business data management system according to an embodiment of the present application;
[0020] Figure 2 This is a flow chart of an optional distributed business data management method according to an embodiment of the present application;
[0021] Figure 3 This is a flow chart of an optional distributed business data management method according to an embodiment of the present application;
[0022] Figure 4 It is a schematic structural diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0024] It should be noted that the terms "first", "second", etc. in the specification, claims, and drawings of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0025] Example 1
[0026] According to an embodiment of the present application, a distributed business data management system is provided, such as Figure 1 As shown, the distributed business data management system includes at least: a management center 11 and multiple business centers 1 (2 ~ m), the management center includes: a global lock management module 111 and a verification module 112, each business center includes: at least one business application 1 (2 ~ m) 1 and a business database 1 (2 ~ m) 2, wherein,
[0027] The first business application in the first business center, when processing a target transaction, performs a mutual exclusive lock on the first business data corresponding to the target transaction through the global lock management module 111, and after completing the target transaction, submits the target business data to the first business database in the first business center, where the target business data includes: second business data obtained by processing the first business data, a data version corresponding to the second business data, and a used global lock version. The first business center is any business center among the multiple business centers, and the first business application is any business application in the first business center.
[0028] The first business database is used to synchronize target business data to the second business databases in each second business center through the message middleware, wherein the second business center is a business center other than the first business center in the multiple business centers;
[0029] The verification module 112 is used to respond to the synchronization data flow in the message middleware, and when data synchronization is completed, perform consistency verification on the target business data in each second business database and the target business data in the first business database based on the data version and the global lock version.
[0030] The following describes the functions of each module of the distributed business data management system in conjunction with the specific implementation process.
[0031] When processing a target transaction, the first business application in the first business center performs a mutual exclusive lock on the first business data corresponding to the target transaction through the global lock management module, and submits the target business data to the first business database in the first business center after the target transaction is processed. The target business data includes: second business data obtained by processing the first business data, a data version corresponding to the second business data, and a global lock version used. The first business center is any business center among the multiple business centers, and the first business application is any business application in the first business center.
[0032] The first business application processes the first business data according to the target transaction to obtain the second business data, and records the data version corresponding to the second business data; submits the second business data, the data version and the global lock version as the target business data to the first business database; releases the global lock and removes the mutual exclusion lock on the second business data.
[0033] For example: When the business application of the first business center needs to process a target transaction, such as a user recharge operation, it first sends a lock request to the global lock management module, requesting a mutual exclusive lock on the first business data related to the transaction (such as user account information). After receiving the request, the global lock management module will check the current status of the business data. If the data is not locked, a global lock will be assigned to the first business application, and the new global lock version will be recorded. If the data has been locked, feedback will be given to the first business application to inform it that it needs to wait for the lock to be released. After the first business application successfully obtains the global lock, it begins to process the first business data. During this period, other business applications will not be able to modify the same business data to ensure data consistency.
[0034] Under the protection of the mutual exclusion lock, the first business application executes the target transaction, such as modifying the user account balance, and generates new business data, namely the second business data. After processing the target transaction, the first business application will generate a new data version identifier to indicate that the data has been updated and is different from the previous version. The first business application packages the second business data, the data version of the data, and the global lock version used when processing the transaction, and submits them as the target business data to the business database of the first business center.
[0035] After submitting data to the first business database, the first business application sends a lock release request to the global lock management module to release the mutual exclusive lock on the first business data, allowing other business applications to request and obtain locks when needed.
[0036] The first business database synchronizes the target business data to the second business databases in each second business center through the message middleware, wherein the second business center is other business centers among the multiple business centers except the first business center.
[0037] Among them, the message middleware can be Apache Kafka, ActiveMQ, RocketMQ, RabbitMQ, etc.
[0038] It should be noted that the global lock versions of the global locks allocated by the global lock management module to different transactions are all different; and the data versions of the data services obtained by each business application after processing each transaction are all different.
[0039] The verification module responds to the synchronous data flow in the message middleware, and when data synchronization is completed, performs consistency verification on the target business data in each second business database and the target business data in the first business database based on the data version and the global lock version.
[0040] As an optional implementation method, the implementation process of the verification module can take the following steps:
[0041] The verification module monitors the status of the synchronization data flow in the message middleware; when the message middleware synchronizes the target business data to any second business database, it compares the data version and global lock version of the target business data in the second business database with the target business data in the first business database; when the data version and the global lock version are consistent, it is determined that the target business data in the second business database and the target business data in the first business database have passed the consistency check; when the data version and / or the global lock version are inconsistent, it is determined that the target business data in the second business database and the target business data in the first business database have not passed the consistency check.
[0042] When the target business data in any second business database and the target business data in the first business database fail to pass the consistency check, the verification module uses the global lock management module to mutually lock the target business data in the second business database; since the database itself has an automatic recovery mechanism, a period of time is reserved for it to recover automatically. If it cannot recover automatically, intervention will be made. Therefore, the target business data in the second business database and the target business data in the first business database are periodically checked for consistency within a preset time period; if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency check after the preset time period, data repair is performed on the target business data in the second business database; after the data repair is completed, the mutual exclusive lock on the target business data in the second business database is released.
[0043] After a preset period of time, if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency check, the verification module notifies the first business database to re-synchronize the target business data to the second business database through the target channel, and after the re-synchronization is completed, the target business data in the second business database and the target business data in the first business database are again checked for consistency, wherein the target channel includes at least one of the following: message middleware, a preset data transmission channel; if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency check, a manual repair prompt message is sent to the target object; the second business database is used to store the manually repaired target business data.
[0044] In an embodiment of the present application, when processing a target transaction, the global lock management module performs mutual exclusive locking on specific business data to ensure that only one business application can modify the data at the same time, thereby avoiding data inconsistency problems caused by concurrent operations; real-time consistency verification is performed using data version and global lock version information. This mechanism enables the verification module to quickly and accurately determine the consistency of data between multiple business centers after data synchronization is completed. Compared with the audit of each data item, the comparison of version numbers greatly reduces the consumption of computing resources and improves the real-time and efficiency of the audit; when the data version or the global lock version is inconsistent, that is, the data consistency check fails, the system can automatically lock the problem data to prevent the abnormal data from being further used, and at the same time try to automatically repair the data consistency problem. If the automatic repair cannot solve the problem, the system will notify manual intervention to restore data consistency through resynchronization or manual repair. This mechanism reduces the impact of abnormal transactions on business continuity, ensures the ultimate consistency of data, and is a reflection of system reliability and robustness, thereby solving the technical problem of verification difficulties caused by the large amount of business data to be synchronized in distributed business data processing scenarios.
[0045] Embodiment 2
[0046] According to the embodiments of the present application, a distributed business data management method applied to the distributed business data management system in Embodiment 1 is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0047] Figure 2 is a flowchart of a distributed business data management method according to the embodiments of the present application, as shown in Figure 2 , the method comprises the following steps:
[0048] Step S202, when processing a target transaction, requesting the global lock management module of the management center to mutually lock the first business data corresponding to the target transaction;
[0049] Step S204, after the target transaction is processed, storing the second business data obtained by processing the first business data, the data version corresponding to the second business data, and the global lock version used as the target business data to the first business database of the first business center;
[0050] Step S206, synchronizing the target business data to the second business database in the second business center through the message middleware, wherein the management center further comprises a verification module, the verification module is used to respond to the synchronization data stream in the message middleware, and when the data synchronization is completed, the consistency verification is performed on the target business data in the second business database and the target business data in the first business database according to the data version and the global lock version.
[0051] The steps of the distributed business data management method will be described in detail below in combination with the specific implementation process.
[0052] The first business application in the first business center requests the global lock management module of the management center to mutually lock the first business data corresponding to the target transaction when processing the target transaction.
[0053] For example, when a user initiates a business operation such as recharging or payment in the first business center, the target transaction is started to be processed.
[0054] After receiving the request, the global lock management module checks the locking state of the corresponding first business data. If the data is not locked, a new global lock is allocated and the version number of the global lock is recorded.
[0055] After obtaining the lock, the first business application processes the target transaction.
[0056] After the target transaction is processed, the second business data obtained by processing the first business data, the data version corresponding to the second business data, and the used global lock version are stored as target business data in the first business database of the first business center.
[0057] After this step is completed, the business application releases the global lock and releases the mutually exclusive lock status of the business data.
[0058] The first business database synchronizes the target business data to the second business database in the second business center through the message middleware. The management center also includes a verification module, which is used to respond to the synchronization data stream in the message middleware. At the end of data synchronization, the target business data in the second business database and the target business data in the first business database are checked for consistency based on the data version and the global lock version.
[0059] It should be noted that the various implementation steps in the distributed business data management method in the embodiment of the present application correspond one-to-one to the various implementation steps of the distributed business data management system in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be elaborated on here.
[0060] Example 3
[0061] According to an embodiment of the present application, a distributed business data management method is provided for use in the distributed business data management system in Example 1. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0062] Figure 3 FIG. 1 is a flow chart of a distributed business data management method provided in accordance with an embodiment of the present application, such as Figure 3 As shown, the method includes the following steps:
[0063] Step S302: In response to a global lock acquisition request sent by the first business center when processing a target transaction, the global lock management module is called to perform a mutual exclusive lock on the first business data corresponding to the target transaction. The first business center processes the first business data according to the target transaction and synchronizes the obtained second business data, the data version corresponding to the second business data, and the used global lock version as the target business data to the second business center via the message middleware.
[0064] Step S304: monitor the status of the synchronization data flow in the message middleware, and when the message middleware synchronizes the target business data to the second business center, perform consistency check on the target business data in the second business center and the target business data in the first business center based on the data version and the global lock version.
[0065] The following describes the steps of the distributed business data management method in conjunction with a specific implementation process.
[0066] In response to the global lock acquisition request sent by the first business center when processing the target transaction, the global lock management module is called to perform mutual exclusion locking on the first business data corresponding to the target transaction, wherein the first business center is used to process the first business data according to the target transaction, and synchronize the obtained second business data, the data version corresponding to the second business data, and the used global lock version as the target business data to the second business center through the message middleware.
[0067] It can be understood as follows: when the first business center is processing the target transaction, its business application sends a global lock acquisition request to the management center. The global lock management module of the management center receives the request, and the global lock management module detects the locking status of the first business data. If the data is not locked, a global lock is allocated to the first business application, and the global lock version of the lock is recorded. The global lock management module performs a mutually exclusive locking operation to ensure that when the first business application is processing the target transaction, the first business data will not be modified by other applications at the same time, thereby ensuring the atomicity and consistency of data modification.
[0068] Monitor the status of the synchronization data flow in the message middleware, and when the message middleware synchronizes the target business data to the second business center, perform consistency check on the target business data in the second business center and the target business data in the first business center based on the data version and global lock version.
[0069] It can be understood as follows: the verification module of the management center continuously monitors the synchronization data flow status in the message middleware to ensure the integrity of the data synchronization process. When the first business center synchronizes the target business data (including the second business data, data version, and global lock version) to the second business center through the message middleware, the verification module responds to this synchronization process. After the data synchronization is completed, the verification module immediately performs a consistency check on the target business data in the second business database of the second business center and the target business data in the first business database of the first business center based on the data version and global lock version information.
[0070] When the target business data in the second business center and the target business data in the first business center fail to pass the consistency check, the target business data in the second business center are mutually exclusive locked by the global lock management module; the target business data in the second business center and the target business data in the first business center are periodically checked for consistency within a preset time period; if the target business data in the second business center and the target business data in the first business center still fail to pass the consistency check after the preset time period, data repair is performed on the target business data in the second business center; after the data repair is completed, the mutual exclusive lock on the target business data in the second business center is released.
[0071] If the consistency check passes, data synchronization is successful and the data in the first and second business centers are consistent. If the consistency check fails, it means there are differences in the data version or global lock version, which may indicate data inconsistency. In this case, the verification module will initiate an exception handling process, including but not limited to locking relevant data, periodic re-verification, data repair attempts, and notifying manual intervention when necessary to ensure that the data is ultimately consistent.
[0072] It should be noted that the various implementation steps in the distributed business data management method in the embodiment of the present application correspond one-to-one to the various implementation steps of the distributed business data management system in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be elaborated on here.
[0073] Example 4
[0074] According to an embodiment of the present application, a computer program product is also provided, which includes a computer program, wherein when the computer program is executed by a processor, it implements the distributed business data management method in Example 2 or Example 3.
[0075] According to an embodiment of the present application, a non-volatile storage medium is also provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the distributed business data management method in Example 2 or Example 3 by running the computer program.
[0076] According to an embodiment of the present application, a processor is further provided, which is used to run a computer program, wherein the distributed business data management method in Example 2 or Example 3 is executed when the computer program is running.
[0077] According to an embodiment of the present application, an electronic device is also provided, which includes: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the distributed business data management method in Example 2 or Example 3 through the computer program.
[0078] Specifically, when the computer program is running, the following steps are executed:
[0079] As an optional implementation, the electronic device may be in the form of a mobile terminal, a computer terminal or a similar computing device. Figure 4 FIG1 shows a hardware structure block diagram of an electronic device for implementing a distributed service data management method. Figure 4 As shown, the electronic device 40 may include one or more (402a, 402b, ..., 402n are shown in the figure) processors 402 (the processor 402 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 404 for storing data, and a transmission device 406 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 4 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 4 More or fewer components than shown, or with Figure 4 Different configurations shown.
[0080] It should be noted that the one or more processors 402 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single, independent processing module, or may be incorporated in whole or in part into any of the other components of the electronic device 40. As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0081] The memory 404 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the distributed business data management method in the embodiment of the present application. The processor 402 executes various functional applications and data processing by running the software programs and modules stored in the memory 404, that is, implementing the vulnerability detection method of the above-mentioned application. The memory 404 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 404 may further include a memory remotely located relative to the processor 402, and these remote memories may be connected to the electronic device 40 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0082] Transmission device 406 is used to receive or send data via a network. Specific examples of the aforementioned network may include a wireless network provided by the communications provider of electronic device 40. In one embodiment, transmission device 406 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 406 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0083] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 40 .
[0084] The serial numbers of the above embodiments are for description only and do not represent the advantages or disadvantages of the embodiments.
[0085] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0086] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0087] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.
[0088] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0089] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.
[0090] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A distributed business data management system, characterized in that: include: A management center and multiple business centers, the management center includes: a global lock management module and a verification module, each of the business centers includes: at least one business application and a business database, wherein, The first business application in the first business center is configured to, when processing a target transaction, perform a mutually exclusive lock on first business data corresponding to the target transaction through the global lock management module, and submit the target business data to the first business database in the first business center after processing the target transaction is completed, wherein the target business data includes: second business data obtained by processing the first business data, a data version corresponding to the second business data, and a used global lock version. The first business center is any business center among the multiple business centers, and the first business application is any business application in the first business center. The first business database is used to synchronize the target business data to the second business databases in each second business center through the message middleware, wherein the second business center is a business center other than the first business center in the multiple business centers; The verification module is used to respond to the synchronous data flow in the message middleware, and when the data synchronization is completed, perform consistency verification on the target business data in each second business database and the target business data in the first business database based on the data version and the global lock version.
2. The system according to claim 1, wherein: The verification module is used to, when the target business data in any second business database and the target business data in the first business database fail to pass the consistency verification, perform mutual exclusive locking on the target business data in the second business database through the global lock management module; periodically perform consistency verification on the target business data in the second business database and the target business data in the first business database within a preset time period; if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency verification after the preset time period, perform data repair on the target business data in the second business database; after the data repair is completed, release the mutual exclusive lock on the target business data in the second business database.
3. The system according to claim 1, wherein: The first business application is configured to send a global lock acquisition request to the global lock management module when processing the target transaction; The global lock management module is configured to detect the locking status of the first business data; if the first business data is locked, provide data locking prompt information to the first business application; if the first business data is not locked, allocate a global lock to the first business application; The first business application is used to record the global lock version of the global lock allocated by the global lock management module, and to perform mutual exclusion locking on the first business data based on the global lock, wherein, in the mutual exclusion locking state, other business applications except the first business application cannot access the first business data.
4. The system according to claim 3, characterized in that The first business application is used to process the first business data according to the target transaction to obtain the second business data and record the data version corresponding to the second business data; submit the second business data, the data version and the global lock version as the target business data to the first business database; release the global lock and release the mutual exclusion lock on the second business data.
5. The system according to claim 1, wherein: The verification module is used to monitor the status of the synchronization data flow in the message middleware; when the message middleware synchronizes the target business data to any second business database, compares the data version and global lock version of the target business data in the second business database with the target business data in the first business database; when the data version and the global lock version are consistent, determines that the target business data in the second business database and the target business data in the first business database have passed the consistency verification; when the data version and / or the global lock version are inconsistent, determines that the target business data in the second business database and the target business data in the first business database have not passed the consistency verification.
6. The system according to claim 2, wherein: The verification module is configured to, if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency check after the preset time period has elapsed, notify the first business database to re-synchronize the target business data to the second business database through the target channel, and after the re-synchronization is completed, re-check the consistency of the target business data in the second business database and the target business data in the first business database, wherein the target channel includes at least one of the following: the message middleware, a preset data transmission channel; if the target business data in the second business database and the target business data in the first business database still fail to pass the consistency check, send a manual repair prompt message to the target object; The second service database is used to store the manually repaired target service data.
7. The system according to any one of claims 1 to 6, characterized in that The global lock versions of the global locks allocated by the global lock management module to different transactions are all different; The data versions of the data services obtained by each business application after processing each transaction are different.
8. A distributed business data management method, characterized in that: include: When processing a target transaction, requesting the global lock management module of the management center to perform a mutual exclusive lock on the first business data corresponding to the target transaction; After the target transaction is processed, the second business data obtained by processing the first business data, the data version corresponding to the second business data, and the used global lock version are stored as target business data in the first business database of the first business center; The target business data is synchronized to the second business database in the second business center through the message middleware, wherein the management center also includes a verification module, which is used to respond to the synchronization data stream in the message middleware. When the data synchronization is completed, the target business data in the second business database and the target business data in the first business database are checked for consistency based on the data version and the global lock version.
9. A distributed business data management method, characterized in that: include: In response to a global lock acquisition request sent by the first business center when processing a target transaction, calling a global lock management module to perform a mutual exclusive lock on the first business data corresponding to the target transaction, wherein the first business center is used to process the first business data according to the target transaction, and synchronize the obtained second business data, the data version corresponding to the second business data, and the used global lock version as the target business data to the second business center via the message middleware; Monitor the status of the synchronization data flow in the message middleware, and when the message middleware synchronizes the target business data to the second business center, perform consistency check on the target business data in the second business center and the target business data in the first business center based on the data version and the global lock version.
10. The method according to claim 9, characterized in that The method further comprises: If the target business data in the second business center and the target business data in the first business center fail to pass the consistency check, performing a mutual exclusive lock on the target business data in the second business center through the global lock management module; Periodically performing consistency checks on the target service data in the second service center and the target service data in the first service center within a preset time period; If the target service data in the second service center and the target service data in the first service center still fail the consistency check after the preset time period, repairing the target service data in the second service center; After the data repair is completed, the mutual exclusive lock on the target business data in the second business center is released.
11. A computer program product, characterized in that include: A computer program, wherein when the computer program is executed by a processor, it implements the distributed business data management method according to any one of claims 8 to 10.
12. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the distributed business data management method according to any one of claims 8 to 10 through the computer program.
Citation Information
Patent Citations
Method, device and system for processing distributed transactions in SQL (Structured Query Language) database
CN114328613A
Lock checking method in distributed transactional memory state locking process
CN115357399A