Data processing method, system and device, storage medium and program product
By pairing and data synchronization between the slices of the database and automatically forwarding requests when an exception occurs, combined with the idea of two-stage confirmation, the requirements for data consistency and timeliness of large-scale business systems are solved, and efficient dual-active deployment and resource reuse are achieved.
Patent Information
- Application Number
- CN202411674481.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-21
AI Technical Summary
The existing database dual-activity solution is difficult to meet the requirements of data real-time and consistency of large-user scale and large-traffic business systems, and the slice library architecture lacks a high-availability solution.
By pairing multiple slices between libraries, data synchronization is achieved. When a library encounters a database exception, the request is automatically forwarded to the paired library through pre-active routing to ensure business continuity, and data synchronization is performed using the idea of two-stage confirmation.
It realizes database resource reuse, saves resources, reduces costs, ensures data consistency and timeliness, fills the blind spots of main and backup switching scenarios, and adapts to scenarios where database architecture number adjustment is performed.
Smart Images

Figure CN119669352A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a data processing method, system, device, storage medium and program product. Background Art
[0002] Currently, databases of important systems often use a master-slave architecture. When the master database fails, the slave database is switched to continue providing services. Traditional database master-slave switching solutions have the following main problems: (1) master-slave data is inconsistent; (2) the switching speed between databases is slow; and (3) there are blind spots in the switching scenarios between databases.
[0003] Database active-active is a common solution to improve database availability and system disaster recovery capabilities. There are two main types of active-active solutions. The first type is to make certain optimizations based on the traditional active-standby solution. The second type is to build a second database as an active-active standby database and use the API module to write to both databases to achieve active-active. The problem with this solution is that it requires building a dedicated active-active standby database, which has a relatively high resource cost, a fixed mode, and does not solve the problem of data consistency between the two databases.
[0004] For important business systems with large user scale and high traffic, the current active-active solutions are difficult to meet the requirements for real-time and consistency of business data. In addition, in order to disperse risks, such systems often adopt a slicing and database-sharing architecture. Currently, no database high-availability solution for the slicing and database-sharing architecture has been found. Summary of the invention
[0005] The main purpose of this application is to provide a data processing method, system, device, storage medium and program product, aiming to solve the technical problem of how to ensure high availability and data consistency of master-slave switching, and at the same time achieve efficient active-active deployment under the slicing and database architecture.
[0006] To achieve the above object, the present application proposes a data processing method, which is applied to the first sub-database of the database, and comprises:
[0007] Online calling the second sub-database of the database, and sending a data synchronization request to the second sub-database, so that the second sub-database obtains synchronized data based on the data synchronization request;
[0008] When an abnormal situation of the database is detected, the service request is forwarded to the second sub-database by applying the front-end active-active routing strategy, and the second sub-database uses the synchronous data to perform service processing based on the service request.
[0009] In one embodiment, the step of online calling the second sub-database of the database and sending a data synchronization request to the second sub-database so that the second sub-database obtains synchronized data based on the data synchronization request includes:
[0010] Receive the data synchronization processing result returned by the second sub-database, and perform second-stage data processing based on the data synchronization processing result to obtain a second-stage processing result, wherein the data synchronization processing result is obtained by the second sub-database based on the data synchronization request;
[0011] The two-stage processing result is sent to the second sub-database, and the second sub-database obtains the synchronization data based on the two-stage processing result.
[0012] In one embodiment, the second-stage processing result includes supplementary data and a data confirmation request, and the step of performing second-stage data processing based on the data synchronization processing result to obtain the second-stage processing result includes:
[0013] When the data synchronization processing result is that the current database status information is in a fault state, obtaining the supplementary data;
[0014] When the data synchronization processing result is that the current database status information is in a normal state, the synchronization data is confirmed and a data confirmation request is generated.
[0015] In one embodiment, the step of sending the second-stage processing result to the second sub-database, and having the second sub-database complete data synchronization processing based on the second-stage processing result includes:
[0016] Asynchronously pushing the supplementary data to the second sub-database, so that the second sub-database writes the supplementary data into a normal business state to obtain synchronous data; or
[0017] The data confirmation request is sent to the second sub-database, so that the second sub-database can convert the data in the pending confirmation state into positive data based on the data confirmation request to obtain synchronized data.
[0018] In one embodiment, the step of performing two-stage data processing based on the data synchronization processing result to obtain the two-stage processing result further includes:
[0019] When the data synchronization processing result is that the current database status information is in an unknown state, asynchronously sending a data confirmation request to the second sub-database, so that the second sub-database rolls back the data to be confirmed based on the data confirmation request to obtain synchronized data; or
[0020] Asynchronously send a supplementary push request to the second sub-database, so that the second sub-database can receive and process the supplementary push data based on the supplementary push request, complete the storage of the data in the pending state, and obtain synchronous data.
[0021] In addition, to achieve the above purpose, the present application also proposes a data processing method, which is applied to the second sub-database of the database, and the method includes:
[0022] Receiving a data synchronization request sent by the first sub-database of the database, and obtaining synchronization data based on the data synchronization request;
[0023] The service request forwarded by the first sub-database is received, and based on the service request, the synchronization data is used to perform service processing.
[0024] In one embodiment, the step of obtaining synchronization data based on the data synchronization request includes:
[0025] Based on the data synchronization request, transmit the data synchronization processing result to the first sub-database, so that the first sub-database performs two-stage processing on the data synchronization processing result to obtain the two-stage processing result;
[0026] Receive the second-stage processing result sent by the first sub-database, and obtain synchronization data based on the second-stage processing result.
[0027] In one embodiment, the step of transmitting the data synchronization return result to the first sub-database based on the data synchronization request includes:
[0028] Check the current database status information;
[0029] Based on the current database status information and the data synchronization request, a corresponding data transmission strategy is executed.
[0030] In one embodiment, the step of executing a corresponding data transmission strategy based on the current database state information and the data synchronization request includes:
[0031] If the current database status information is a fault state, based on the data synchronization request, returning the fault state as a data synchronization processing result to the first sub-database;
[0032] If the current database status information is in a normal state, then based on the data synchronization request, the to-be-confirmed state data is written, and the normal state is returned to the first sub-database as a data synchronization processing result.
[0033] In one embodiment, the two-stage processing result includes supplementary push data and a data confirmation request, and the step of obtaining synchronization data based on the two-stage processing result includes:
[0034] Writing the supplementary data into a normal service state to obtain synchronized data; or
[0035] The data in the to-be-confirmed state is converted to positive based on the data confirmation request to obtain synchronized data.
[0036] In one embodiment, the step of completing the data synchronization process based on the second-stage processing results further includes:
[0037] Receive a data confirmation request sent asynchronously by the first sub-database, and roll back the data in the to-be-confirmed state based on the data confirmation request to obtain synchronized data; or
[0038] Receive the supplementary push request sent asynchronously by the first sub-database, and perform supplementary push data reception processing based on the supplementary push request, complete the storage of the data in the to-be-determined state, and obtain synchronous data.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a data processing system, the system comprising a database, the database further comprising a first sub-database and a second sub-database;
[0040] The first sub-library includes:
[0041] A sending module, used for online calling the second sub-library of the database, and sending a data synchronization request to the second sub-library, so that the second sub-library obtains synchronized data based on the data synchronization request;
[0042] A forwarding module, configured to forward the service request to the second sub-database by applying a front-end active-active routing strategy when an abnormal situation of the database is detected, and the second sub-database uses the synchronized data to perform service processing based on the service request;
[0043] The second sub-library includes:
[0044] A receiving module, used for receiving a data synchronization request sent by the first sub-database of the database, and obtaining synchronization data based on the data synchronization request;
[0045] The processing module is used to receive the service request forwarded by the first sub-database, and perform service processing based on the service request using the synchronization data.
[0046] In addition, to achieve the above objectives, the present application also proposes a data processing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data processing method described above.
[0047] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data processing method described above are implemented.
[0048] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the data processing method described above are implemented.
[0049] The embodiment of the present application provides a data processing method, system, device, storage medium and program product, the method includes the first sub-library of the database online calling the second sub-library, and sending a data synchronization request to the second sub-library to obtain synchronized data; when an abnormal situation of the database is detected, the business request is forwarded to the second sub-library by applying the front-end active-active routing strategy, and the second sub-library performs business processing based on the business request. This solution realizes database resource reuse by pairing the slice sub-libraries in pairs, effectively saving resources and reducing costs; the idea of two-stage confirmation is used to synchronize data between active-active paired sub-libraries, solve the problem of data accuracy, and achieve quasi-real-time level of timeliness and data consistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0052] Figure 1 A flowchart of the first embodiment of the data processing method of the present application is provided;
[0053] Figure 2 A flowchart of the second embodiment of the data processing method of this application is provided;
[0054] Figure 3 A flowchart of the third embodiment of the data processing method of this application is provided;
[0055] Figure 4 A flowchart of the fourth embodiment of the data processing method of the present application is provided;
[0056] Figure 5 A brief flowchart of the data processing method provided in Embodiment 1 and Embodiment 3 of the present application;
[0057] Figure 6 A schematic diagram of the system architecture provided for Embodiment 1 and Embodiment 3 of the present application;
[0058] Figure 7 A schematic diagram of a dual-active routing process provided in Embodiment 1 and Embodiment 3 of the present application;
[0059] Figure 8 This is a schematic diagram of the module structure of the data processing system according to an embodiment of the present application;
[0060] Fig. 9 Schematic diagram of the device structure of the hardware operating environment involved in the data processing method in the embodiment of the present application.
[0061] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0062] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0063] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0064] The main solution of the embodiment of the present application is: the first sub-library of the database calls the second sub-library online, and sends a data synchronization request to the second sub-library, so that the second sub-library returns the data synchronization processing result to the first sub-library based on the data synchronization request; the first sub-library receives the data synchronization processing result returned by the second sub-library, and performs two-stage data processing based on the data synchronization processing result to obtain the two-stage processing result; the two-stage processing result is sent to the second sub-library, and the second sub-library completes the data synchronization processing based on the two-stage processing result.
[0065] For database applications, due to the unreliability of the underlying database infrastructure, database failures and other failures may occur at any time, causing application system paralysis, business continuity interruption, and immeasurable business losses.
[0066] At present, databases of important systems often adopt a master-slave architecture. When the main database fails, the system switches to the slave database to continue to provide services instead of the main database. The traditional database master-slave switching solution has the following main problems: (1) The master-slave data is inconsistent. Under some abnormal circumstances, the master and slave of the database itself will have a relatively large delay, resulting in obvious inconsistency between the master and slave data. Once an automatic switch occurs, the wrong data may be used. (2) The switching speed is slow. At present, the automatic switching of common database systems takes tens of seconds or minutes. If manual processing is required, it may even take half an hour or more. For important systems with large access volume, this time is unacceptable. (3) There is a blind spot in the switching scenario. The master-slave switch may only be triggered when the database fails seriously and the system determines that the main database is unavailable. However, in some scenarios, the database itself is not faulty, but it may be that a certain application instance accesses the database abnormally, such as the number of connections is full. In this scenario, the master-slave switch will not be triggered, but the instance can no longer obtain the database connection.
[0067] Database active-active is a common solution to improve database availability and system disaster recovery capabilities. There are two main types of active-active solutions. The first type is to make certain optimizations based on the traditional active-active solution. For example, by parsing the log of the primary database and synchronizing data to the standby database, it can ensure that the database of the disaster recovery center is always active to improve the data consistency of the active-standby switch. This type of solution essentially relies on the active-standby switch and cannot completely avoid the problems of the above-mentioned active-standby switch solution. The second type is to build a second database as an active-active standby database. For example, build a first database and a second database, and use the API module to write to the two databases to achieve active-active. The problem with this solution is that it builds a dedicated active-active standby database, which has a relatively high resource cost, a fixed mode, and does not solve the problem of data consistency between the two databases.
[0068] For important business systems with large user scale and high traffic, the current active-active solutions are difficult to meet the requirements for real-time and consistency of business data. In addition, in order to disperse risks, such systems often adopt a slicing and database-sharing architecture. Currently, no database high-availability solution for the slicing and database-sharing architecture has been found.
[0069] The present application provides a solution, the core idea of which is to pair multiple slice sub-libraries in pairs, synchronize data between paired sub-libraries, and when a sub-library encounters a database exception, the request is automatically forwarded to the paired sub-library through the front-end active-active routing to ensure business continuity. This solution pairs slice sub-libraries in pairs to form active-active units. There is no need to deploy a dedicated active-active database, and the existing database is used to achieve resource reuse, which can effectively save resources and reduce system costs. The active-active pairing relationship is flexible and configurable to adapt to the scenario of adjusting the number of database architectures. The idea of two-stage confirmation is used to synchronize data between active-active paired sub-libraries, which can solve the problem of data accuracy well, and can achieve quasi-real-time timeliness and final consistency of data. Customized database detection mechanism and active-active routing strategy. Fill the blind spot of the main-standby switching scenario, and support scenarios where the database cannot be accessed due to the application itself. It can achieve automatic switching to the active-active paired sub-library within a preset time, significantly improving the switching speed.
[0070] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes a personal computer as an example to illustrate this embodiment and the following embodiments.
[0071] Based on this, the present application embodiment provides a data processing method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the data processing method of the present application.
[0072] In this embodiment, the data processing method includes steps S10 to S20:
[0073] Step S10, calling the second sub-database online, and sending a data synchronization request to the second sub-database to obtain synchronized data;
[0074] It should be noted that this solution is to pair multiple slice sub-libraries of the database in pairs and synchronize data between the paired sub-libraries. Therefore, in this embodiment, the first sub-library of the database is taken as an example.
[0075] It is understandable that since the basic premise of database active-active is that each sub-database must contain the data of the paired sub-database at the same time, performing step S10 first can avoid data inconsistency and effectively improve system stability and data synchronization efficiency.
[0076] Specifically, first, the system will actively initiate an online call operation to establish a connection between the first sub-database and the second sub-database. This process involves the use of network communication protocols, such as TCP / IP, to ensure that the first sub-database can communicate with the second sub-database securely and efficiently.
[0077] Once the first sub-library successfully establishes a connection with the second sub-library, the first sub-library will construct a data synchronization request and send it to the second sub-library. The data synchronization request includes but is not limited to the specific information of the data to be synchronized, such as the identifier and version number of the data. After receiving the data synchronization request sent by the first sub-library, the second sub-library will perform corresponding processing based on the information in the request and send the response back to the first sub-library through the established link.
[0078] Through the above steps, by flexibly pairing the slice sub-libraries in pairs, database resource reuse can be achieved, resources can be effectively saved, and by calling the second sub-library online through the first sub-library and sending a data synchronization request, the consistency, real-time, integrity and reliability of data between different sub-libraries can be ensured.
[0079] Based on the above, the step of "online calling the second sub-database of the database and sending a data synchronization request to the second sub-database" also includes steps S11 to S12:
[0080] Step S11, receiving the data synchronization processing result returned by the second sub-database, and performing two-stage data processing based on the data synchronization processing result to obtain a two-stage processing result, wherein the data synchronization processing result is obtained by the second sub-database based on the data synchronization request;
[0081] It should be noted that the data synchronization processing result returned by the second sub-database is not limited to synchronization data, current database status information, and status data to be confirmed, etc. Among them, the current database status information includes whether the second sub-database is in a faulty state or a normal state.
[0082] The results of the second-stage processing include but are not limited to requests for confirmation of supplementary data.
[0083] It is worth noting that in the first stage, the first data synchronization is achieved through online connection between sub-databases, and data accuracy is prioritized. Step S20 is executed to perform the second-stage processing asynchronously to ultimately ensure data consistency.
[0084] In a feasible embodiment, step S11 may include steps A1 to A2:
[0085] Step A1, when the data synchronization processing result is that the current database status information is in a fault state, obtaining supplementary data;
[0086] Specifically, the first sub-database receives the data synchronization processing result returned by the second sub-database, which contains the current database status information. If it is detected that the second sub-database is in a faulty state, in this case, the faulty state of the second sub-database cannot affect the business submission of the first sub-database. That is, the business of the first sub-database is successful, but no data is written to the second sub-database. Therefore, in the two-stage processing process, the first sub-database generates supplementary data based on the data synchronization processing result returned by the second sub-database, so as to perform subsequent data supplementary processing.
[0087] Step A2: when the data synchronization processing result is that the current database status information is in a normal state, confirm the synchronization data and generate a data confirmation request.
[0088] Specifically, the first sub-database receives the data synchronization processing result returned by the second sub-database, which includes the current database status information. If the second sub-database is detected to be in a normal state, it means that the data synchronization between the online calls to the sub-databases in the first stage is successful. In this case, the business executed by the first sub-database is successful, the synchronized data is confirmed, and a data confirmation request is generated to facilitate the subsequent normalization of the data to be confirmed.
[0089] Through the above steps, the data synchronization problem of the second sub-database in the fault state and the normal state is handled respectively, ensuring the consistency of data and the stability of the system.
[0090] Step S12, sending the two-stage processing result to the second sub-library, and the second sub-library obtains the synchronization data based on the two-stage processing result.
[0091] It should be noted that the second-stage processing results include but are not limited to the supplementary data and data synchronization request generated in step S20. The supplementary data includes data items, data versions, data verification information, and data metadata information, etc. The data synchronization request includes request identifier, request type, request parameters, and request timestamp, etc.
[0092] In a feasible embodiment, step S12 further includes steps B1 to B2:
[0093] Step B1, asynchronously push the supplementary data to the second sub-database, so that the second sub-database writes the supplementary data into a normal business state to obtain synchronous data;
[0094] Specifically, when the first sub-database identifies that the current database status information is in a fault state and generates supplementary push data, the supplementary push data that needs to be synchronized is re-pushed to the second sub-database in an asynchronous manner through the established link. Asynchronous supplementary push means that the data push operation will not block the current business process, but will be completed step by step in the background. This ensures that the main business process can still run normally even during the recovery of the second sub-database.
[0095] When the current state of the second sub-database is restored to normal, the supplementary data can be received immediately, and the supplementary data can be processed in the second sub-database and written into the normal business state.
[0096] Step B2: Send a data confirmation request to the second sub-database, so that the second sub-database can convert the data in the pending confirmation state into positive data based on the data confirmation request to obtain synchronized data.
[0097] Specifically, when the first sub-library recognizes that the current database status information is normal and generates a data confirmation request, it sends the data confirmation request to the second sub-library asynchronously and in quasi-real time, so that after the second sub-library receives the data confirmation request, it checks the data in the pending confirmation state and changes the data from the "pending confirmation state" to the "official state" to ensure that the data is officially effective in the system. This process supports retries.
[0098] Step S20, when an abnormal situation of the database is detected, the service request is forwarded to the second sub-database by applying the front-end active-active routing strategy, and the second sub-database uses the synchronous data to perform service processing based on the service request.
[0099] It should be noted that the front-end active-active routing strategy is a network architecture design that aims to improve system availability and reliability, especially in data centers or large network environments. This strategy achieves high availability by deploying two or more active nodes in multiple geographical locations to ensure that the system can still operate normally even if a node fails.
[0100] Specifically, this embodiment detects whether the database is abnormal through a customized database detection mechanism. First, the database detection mechanism can be configured as a database detection interval. According to the business continuity guarantee requirements, the database detection interval can be freely configured, such as 1-3S detection once, to ensure that the abnormality can be identified in the first time.
[0101] Secondly, it has a mechanism to prevent misjudgment. An occasional database detection failure may be a short-term system jitter and cannot be directly identified as a database abnormality. This embodiment supports configuring a number of consecutive detection failures (for example, 5 consecutive times) before the database is considered to be faulty.
[0102] Finally, the database detection results are saved through application cache. The database detection results are cached as the database available status in the application instance to ensure that the subsequent application front-end active-active strategy can obtain the database status from the memory at any time.
[0103] By determining the database status through custom database detection, you can identify scenarios where the database cannot be accessed due to application problems, fill the blind spots in active-standby switching scenarios, and enrich the usage scenarios of database active-active.
[0104] If the database is detected to be abnormal, the system will redirect the business request originally sent to the first sub-database to the second sub-database. After receiving the business request, the second sub-database performs business processing based on the synchronized data. This includes operations such as reading data, updating data, and executing transactions.
[0105] Database anomalies are discovered through custom database detection. When an abnormality occurs in the database, the request of the first sub-database is forwarded to the second sub-database by applying the front-end active-active routing strategy, so that the second sub-database takes over the service of the first sub-database.
[0106] Through the above-mentioned embodiment method, the first data synchronization is achieved through online sub-database, and data accuracy is prioritized; through asynchronous second data confirmation, data consistency is finally guaranteed. This solution is suitable for most important business systems that have high requirements for data accuracy. When an abnormality occurs in the first sub-database and triggers the active-active switch to the second sub-database, it can be guaranteed that the data provided by the second sub-database to the outside is the latest and accurate, and no erroneous business results will be caused by the active-active switch. Database resource reuse is achieved, resources are effectively saved, costs are reduced, and the problem of data accuracy is effectively solved, achieving quasi-real-time timeliness and data consistency.
[0107] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , step S11 also includes steps C1 to C2:
[0108] Step C1, when the data synchronization processing result is that the current database status information is in an unknown state, asynchronously sending a data confirmation request to the second sub-database, so that the second sub-database rolls back the data to be confirmed based on the data confirmation request to obtain synchronized data; or
[0109] Step C2, asynchronously sending a supplementary push request to the second sub-database, so that the second sub-database performs supplementary push data receiving and processing based on the supplementary push request to obtain synchronous data.
[0110] Specifically, when it is identified that the first stage of calling the sub-database to achieve data synchronization fails. This situation is an abnormal scenario, which is often caused by abnormal reasons such as network communication. It is uncertain whether the second sub-database has written the data to be confirmed, that is, the current database status information is unknown. For this situation, this embodiment adopts two solutions:
[0111] The first is that if the business has extremely high requirements for data accuracy, the first sub-database can be treated as a business failure, and then the first sub-database sends a data confirmation request to the second sub-database in an asynchronous manner, requesting confirmation of the received data. After receiving the data confirmation request, the second sub-database will completely roll back the supplementary data and restore it to the state before synchronization.
[0112] The second is that the first sub-database returns to the asynchronous push route. Without affecting the successful submission of the business of the first sub-database, the first sub-database then sends a push request to the second sub-database in an asynchronous manner, requesting to push the data again. After receiving the push request, the second sub-database processes the push data, such as writing it into the normal business state.
[0113] Through the above-mentioned embodiment method, the situation where the state of the second sub-database is unknown can be effectively dealt with, ensuring that the data synchronization process in the distributed database system is both reliable and efficient.
[0114] Based on this, the present application embodiment provides a data processing method, referring to Figure 3 , Figure 3 This is a flowchart of the third embodiment of the data processing method of the present application.
[0115] In this embodiment, the data processing method includes steps S30 to S40:
[0116] Step S30, receiving a data synchronization request sent by the first sub-database of the database, and obtaining synchronization data based on the data synchronization request;
[0117] It should be noted that this solution is to pair multiple slice sub-libraries of the database in pairs and synchronize data between the paired sub-libraries. Therefore, in this embodiment, the paired slice sub-library of the first sub-library, that is, the second sub-library, is used as an example.
[0118] In a feasible embodiment method, step S30 further includes steps S31-S32:
[0119] Step S31: based on the data synchronization request, transmitting the data synchronization processing result to the first sub-database, so that the first sub-database performs two-stage processing on the data synchronization processing result to obtain the two-stage processing result;
[0120] Specifically, the system initiates an online call operation to establish a connection between the first sub-database and the second sub-database. When the second sub-database receives the data synchronization request sent by the first sub-database through the connection, the second sub-database checks the status information of the database.
[0121] The current status information of the database is checked in the second sub-database. If it is found that the database is in a faulty state, for example, the database service is not started, the disk space is insufficient, etc., the "faulty state" is directly returned to the first sub-database, so that the first sub-database can obtain the supplementary data according to the "faulty state" and send the supplementary data to the second sub-database asynchronously. If it is found that the database is in a normal state, the data synchronization request continues to be processed. The second sub-database writes the received data to a temporary table or area in a "pending confirmation state". At the same time, the second sub-database returns the "normal state" as the data synchronization processing result to the first sub-database, so that the first sub-database can return the data synchronization request to the second sub-database based on the data synchronization processing result. It should also be noted that the pending confirmation state is an intermediate state. The data result is unknown and cannot be provided to users as correct business data. The significance of this state is to ensure the absolute accuracy of the data and avoid using old versions of data.
[0122] Step S32, receiving the second-stage processing result sent by the first sub-database, and obtaining synchronization data based on the second-stage processing result.
[0123] It should be noted that the second-stage processing result is the result of the data synchronization processing received by the first sub-database and returned by the second sub-database, and the result obtained after the second-stage processing, including but not limited to supplementary data and data confirmation requests.
[0124] Specifically, when the second sub-database receives the supplementary data sent by the first sub-database for the fault information according to the current database status information, it checks its own database status again to confirm that it has returned to normal. The second sub-database writes the supplementary data directly into the data table in the normal state without going through the "pending confirmation state".
[0125] Alternatively, when the second sub-database receives the data confirmation request sent by the first sub-database based on the current database status information being normal information, a series of verification operations are performed on the data to be confirmed to ensure the integrity and consistency of the data. After the verification passes, the second sub-database executes the transaction commit and formally writes the data to be confirmed into the target table.
[0126] Through the above steps, it can be ensured that in a distributed database system, even if some components fail, data synchronization problems can be effectively managed and handled to ensure data consistency and system stability.
[0127] Step S40: receiving the service request forwarded by the first sub-database, and performing service processing based on the service request using the synchronization data.
[0128] Similarly, when it is detected that the database is in an abnormal situation, the service request sent by the first sub-database by applying the front-end active-active routing strategy is received, and based on the service request, the synchronization data obtained through the above steps is used to perform subsequent service processing.
[0129] Through the above-mentioned embodiment method, the second sub-library receives the data synchronization request sent by the first sub-library of the database, and obtains the synchronization data based on the data synchronization request; receives the business request forwarded by the first sub-library, and uses the synchronization data to perform business processing based on the business request. By pairing the slice sub-libraries in pairs, database resource reuse is achieved, resources are effectively saved, and costs are reduced; the idea of two-stage confirmation is adopted to synchronize data between active-active paired sub-libraries, solve the problem of data accuracy, and achieve quasi-real-time timeliness and data consistency.
[0130] Based on the third embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the third embodiment can be referred to the above description, and will not be described in detail later. Figure 4 , step S32 also includes steps D1 to D2:
[0131] Step D1, receiving a data confirmation request sent asynchronously by the first sub-database, and rolling back the data in the to-be-confirmed state based on the data confirmation request to obtain synchronized data; or
[0132] Step D2, receiving the supplementary push request sent asynchronously by the first sub-database, and performing supplementary push data receiving and processing based on the supplementary push request, completing the storage of the data in the to-be-determined state, and obtaining synchronous data.
[0133] Specifically, if the first sub-database fails to call the second sub-database for data synchronization in the first phase, this situation is an abnormal scenario. It is uncertain whether there is any data to be confirmed written in the second sub-database, that is, the current database status information is unknown. For this situation, this embodiment adopts two solutions:
[0134] The first is that the second sub-database receives the data confirmation request sent by the first sub-database and checks the data in the pending confirmation state to ensure that the data has been correctly written into the database. If data inconsistency or error is detected, the second sub-database will completely roll back the data and restore it to the state before synchronization.
[0135] The second is that the second sub-database receives the push request sent by the first sub-database, processes the push data based on the request, and writes it into the normal business state. If the data writing fails, the second sub-database can retry until the data is successfully written or the maximum number of retries is reached.
[0136] Through the above-mentioned embodiment method, the situation where the state of the second sub-database is unknown can be effectively dealt with, ensuring that the data synchronization process in the distributed database system is both reliable and efficient.
[0137] For example, to help understand the implementation process of the data processing method obtained by combining the first embodiment and the third embodiment, please refer to Figure 5 , Figure 5 A brief flowchart of a database processing method is provided, specifically:
[0138] It should be noted that the basic premise of database active-active is that each sub-database must contain the data of the paired sub-database at the same time. In a distributed system architecture, data synchronization cannot guarantee real-time, accuracy, and absolute consistency at the same time. This embodiment adopts the idea of two-stage confirmation, and achieves the real-time and accuracy of data synchronization by introducing state data to be confirmed, and then supplemented by subsequent secondary confirmation to achieve the final consistency of data.
[0139] First, during business processing, the first sub-database calls the second sub-database online to send a data synchronization request. After receiving the request, the second sub-database first checks the current database status information of the second sub-database. If the database fails, the failure status is directly returned to the first sub-database; if the database is normal, the data in the pending confirmation status is written to the second sub-database.
[0140] Then, the first sub-database receives the data synchronization processing result returned by the second sub-database and performs the second-stage processing. If the data synchronization processing result is a failure of the second sub-database. In this case, the failure of the second sub-database cannot affect the business submission of the first sub-database. That is, the business of the first sub-database is successful, but no data is written to the second sub-database, and the second stage needs to perform data re-push processing. By asynchronously and quasi-real-time re-push of the business data to the second sub-database, the re-push supports retries. When the second sub-database is restored, it can receive the re-push request as soon as possible and write normal status data in the database.
[0141] If the result of data synchronization processing is that the second sub-database is normal, it means that the business of the first sub-database is successful. In the second stage, the data confirmation request is sent to the second sub-database asynchronously and in quasi-real time. The second sub-database will make the data to be confirmed normal. This process supports retries.
[0142] If the result of data synchronization processing is that the second sub-database is uncertain whether the data to be confirmed has been written. For this situation, this solution supports two different processing methods. Solution 1: If the business has extremely high requirements for data accuracy, the first sub-database can be treated as a business failure, and then the data confirmation request is sent to the second sub-database asynchronously and in real time to completely roll back the business. Solution 2: Return to the asynchronous re-push route. It does not affect the successful submission of the business of the first sub-database, and then sends the re-push request to the second sub-database asynchronously and in real time. The second sub-database receives and processes the re-push data to ensure that the data is stored normally. This process supports retries.
[0143] When the preset detection mechanism detects that the database is abnormal, the request of the first sub-database is forwarded to the second sub-database by applying the front-end active-active routing strategy, thereby achieving the purpose of the second sub-database taking over the service of the first sub-database.
[0144] In summary, the first data synchronization during online connection gives priority to ensuring data accuracy; the asynchronous second data confirmation ultimately ensures data consistency. This solution is applicable to most important business systems that require high data accuracy. When an exception occurs in the first sub-database, triggering the active-active switch to the second sub-database, it can ensure that the data provided by the second sub-database is the latest and most accurate, and no erroneous business results will be caused by the active-active switch.
[0145] For example, to help understand the implementation process of the data processing method obtained by combining the first embodiment and the third embodiment, please refer to Figure 6 , Figure 6 A system architecture diagram of a database processing method is provided, specifically:
[0146] The core idea of this embodiment is to pair multiple slice sub-databases in pairs and synchronize data between the paired sub-databases. When a sub-database encounters a database exception, the request is automatically forwarded to the paired sub-database through the front-end active-active routing to ensure business continuity.
[0147] For a system with a sliced sub-library architecture, it naturally includes multiple sub-libraries, such as the fourth sub-library, the eighth sub-library, and so on. Under normal circumstances, these sub-libraries are completely isolated from each other, and if one sub-library fails, all customers of this sub-library will be affected. Considering that the probability of two sub-libraries failing at the same time is greatly reduced, in order to improve the overall availability of the system, the present invention pairs all sub-libraries in pairs, and each sub-library must select another sub-library as its paired sub-library, and the two paired sub-libraries form an active-active unit. The data between the sub-libraries in the active-active unit are synchronized with each other. When any sub-library fails, it can be replaced by another sub-library.
[0148] To further reduce the probability of two shards failing at the same time, when selecting paired shards, try to choose shards whose primary and active nodes are in different availability zones (AZs). Since there is a certain distance between AZs and the hardware, network, power and other infrastructure are isolated, the possibility of simultaneous failures is extremely low.
[0149] In scenarios such as system reconstruction or major upgrades, the number of database architectures is not static, and you may face the need to expand the full database or reduce the sub-library. In order to more flexibly support scenarios where sub-libraries change, the sub-library pairing relationship of the present invention is configurable at any time. For example, the first sub-library is originally paired with the second sub-library, and it can be modified at any time to pair the first sub-library with the third sub-library; for example, if the system is expanded from the fourth sub-library to the sixth sub-library, a new pairing relationship can be added, and the fifth sub-library can be paired with the sixth sub-library.
[0150] Technically, the sub-library pairing relationship is configured in a unified parameter center, and each application instance periodically refreshes it to the instance cache. When modification is required, it only needs to be modified in the parameter center and it will automatically take effect.
[0151] In this embodiment, the slice sub-databases are paired in pairs to form active-active units. There is no need to deploy a dedicated active-active database, and the existing database is used to achieve resource reuse, which can effectively save resources and reduce system costs.
[0152] For example, to help understand the implementation process of the data processing method obtained by combining the first embodiment and the third embodiment, please refer to Figure 7 , Figure 7 A schematic diagram of a dual-active routing process is provided, specifically,
[0153] In order to realize automatic switching to the active-active paired second sub-database when the first sub-database fails, the method of this embodiment adds a pre-active-active routing strategy at the application layer, and supports flexible configurations such as active-active anti-duplicate, active-active master switch, and active-active switch in functional dimensions.
[0154] like Figure 7As shown in the figure, adding an active-active flag packet to the active-active forwarding request message can prevent repeated forwarding. The database status obtained through custom database detection is the most important indicator for determining whether active-active is required. In addition, an active-active switch is set to determine whether the function supports active-active. When the switch is turned on, it can switch automatically without any sense by default.
[0155] When the first sub-database fails, this set of front-end routing strategies can automatically forward the traffic of the first sub-database to the second sub-database of the active-active backup database, thus ensuring business continuity.
[0156] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0157] This application also provides a data processing system, please refer to Figure 8 , the data processing system includes a database, and the database includes a first sub-database and a second sub-database;
[0158] The first sub-library includes:
[0159] The sending module 10 is used to call the second sub-database of the database online and send a data synchronization request to the second sub-database, so that the second sub-database obtains synchronized data based on the data synchronization request;
[0160] The forwarding module 20 is used to forward the service request to the second sub-database by applying the front-end active-active routing strategy when an abnormal situation of the database is detected, and the second sub-database uses the synchronous data to perform service processing based on the service request;
[0161] The second sub-library includes:
[0162] The receiving module 30 is used to receive a data synchronization request sent by the first sub-database of the database, and obtain synchronization data based on the data synchronization request;
[0163] The processing module 40 is used to receive the service request forwarded by the first sub-database, and perform service processing based on the service request using the synchronization data.
[0164] The data processing system provided by the present application adopts the data processing method in the above embodiment, which can solve the technical problem of how to ensure high availability and data consistency of the master-slave switching, and realize efficient active-active deployment under the slice and database architecture. Compared with the prior art, the beneficial effects of the data processing system provided by the present application are the same as the beneficial effects of the data processing method provided by the above embodiment, and other technical features in the data processing system are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0165] The present application provides a data processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data processing method in the above-mentioned embodiment 1.
[0166] Reference below Fig. 9 , which shows a schematic diagram of the structure of a data processing device suitable for implementing an embodiment of the present application. The data processing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The data processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0167] like Fig. 9 As shown, the data processing device may include a processing system 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage system 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data processing device are also stored. The processing system 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input system 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output system 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage system 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication system 1009. Communication system 1009 can allow data processing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a data processing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0168] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication system, or installed from a storage system 1003, or installed from a ROM 1002. When the computer program is executed by the processing system 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0169] The data processing device provided by the present application adopts the data processing method in the above embodiment, which can solve the technical problem of how to ensure high availability and data consistency of the master-slave switching, and realize efficient active-active deployment under the slice and database architecture. Compared with the prior art, the beneficial effects of the data processing device provided by the present application are the same as the beneficial effects of the data processing method provided by the above embodiment, and the other technical features in the data processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0170] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0171] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0172] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the data processing method in the above-mentioned embodiment.
[0173] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0174] The computer-readable storage medium may be included in a data processing device, or may exist independently without being incorporated into a data processing device.
[0175] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the data processing device, the data processing device is enabled to: the first sub-library of the database calls the second sub-library of the database online, and sends a data synchronization request to the second sub-library, so that the second sub-library returns the data synchronization processing result to the first sub-library based on the data synchronization request; the first sub-library performs two-stage data processing based on the data synchronization processing result to obtain the two-stage processing result; the two-stage processing result is sent to the second sub-library, and the second sub-library completes the data synchronization processing based on the two-stage processing result.
[0176] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0177] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0178] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0179] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned data processing method, and can solve the technical problems of data processing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the data processing method provided in the above-mentioned embodiment, and will not be repeated here.
[0180] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned data processing method when executed by a processor.
[0181] The computer program product provided by this application can solve the technical problem of how to ensure high availability and data consistency of active-standby switching, and realize efficient active-active deployment under the slice and database architecture. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as those of the data processing method provided by the above embodiment, and will not be repeated here.
[0182] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A data processing method, characterized in that: The method is applied to a first sub-database of a database, and the method comprises: Online calling the second sub-database of the database, and sending a data synchronization request to the second sub-database, so that the second sub-database obtains synchronized data based on the data synchronization request; When an abnormal situation of the database is detected, the service request is forwarded to the second sub-database by applying the front-end active-active routing strategy, and the second sub-database uses the synchronous data to perform service processing based on the service request.
2. The method according to claim 1, characterized in that The step of online calling the second sub-database of the database and sending a data synchronization request to the second sub-database so that the second sub-database obtains synchronized data based on the data synchronization request includes: Receive the data synchronization processing result returned by the second sub-database, and perform second-stage data processing based on the data synchronization processing result to obtain a second-stage processing result, wherein the data synchronization processing result is obtained by the second sub-database based on the data synchronization request; The two-stage processing result is sent to the second sub-database, and the second sub-database obtains the synchronization data based on the two-stage processing result.
3. The method according to claim 2, characterized in that The second-stage processing result includes supplementary data and a data confirmation request, and the step of performing second-stage data processing based on the data synchronization processing result to obtain the second-stage processing result includes: When the data synchronization processing result is that the current database status information is in a fault state, obtaining the supplementary data; When the data synchronization processing result is that the current database status information is in a normal state, the synchronization data is confirmed and a data confirmation request is generated.
4. The method according to claim 2, characterized in that The step of sending the second-stage processing result to the second sub-database, and having the second sub-database complete data synchronization processing based on the second-stage processing result includes: Asynchronously pushing the supplementary data to the second sub-database, so that the second sub-database writes the supplementary data into a normal business state to obtain synchronous data; or The data confirmation request is sent to the second sub-database, so that the second sub-database can convert the data in the pending confirmation state into positive data based on the data confirmation request to obtain synchronized data.
5. The method according to claim 2, characterized in that The step of sending the second-stage processing result to the second sub-database, and obtaining the synchronization data based on the second-stage processing result by the second sub-database, further includes: When the data synchronization processing result is that the current database status information is in an unknown state, asynchronously sending a data confirmation request to the second sub-database, so that the second sub-database rolls back the data to be confirmed based on the data confirmation request to obtain synchronized data; or Asynchronously send a supplementary push request to the second sub-database, so that the second sub-database can receive and process the supplementary push data based on the supplementary push request, complete the storage of the data in the pending state, and obtain synchronous data.
6. A data processing method, characterized in that: The method is applied to the second sub-database of the database, and the method comprises: Receiving a data synchronization request sent by the first sub-database of the database, and obtaining synchronization data based on the data synchronization request; The service request forwarded by the first sub-database is received, and based on the service request, the synchronization data is used to perform service processing.
7. The method according to claim 6, characterized in that The step of obtaining synchronization data based on the data synchronization request includes: Based on the data synchronization request, transmit the data synchronization processing result to the first sub-database, so that the first sub-database performs two-stage processing on the data synchronization processing result to obtain the two-stage processing result; The second-stage processing result sent by the first sub-database is received, and synchronization data is obtained based on the second-stage processing result.
8. The method according to claim 7, characterized in that The step of transmitting the data synchronization return result to the first sub-database based on the data synchronization request includes: Check the current database status information; Based on the current database status information and the data synchronization request, a corresponding data transmission strategy is executed.
9. The method according to claim 8, characterized in that The step of executing a corresponding data transmission strategy based on the current database state information and the data synchronization request includes: If the current database status information is a fault state, based on the data synchronization request, returning the fault state as a data synchronization processing result to the first sub-database; If the current database status information is in a normal state, then based on the data synchronization request, the to-be-confirmed state data is written, and the normal state is returned to the first sub-database as a data synchronization processing result.
10. The method according to claim 7, characterized in that The second-stage processing result includes supplementary push data and a data confirmation request. The step of obtaining synchronization data based on the second-stage processing result includes: Writing the supplementary data into a normal service state to obtain synchronized data; or The data in the to-be-confirmed state is converted to positive based on the data confirmation request to obtain synchronized data.
11. The method according to claim 7, characterized in that The step of obtaining synchronization data based on the second-stage processing results further includes: Receive a data confirmation request sent asynchronously by the first sub-database, and roll back the data in the to-be-confirmed state based on the data confirmation request to obtain synchronized data; or Receive the supplementary push request sent asynchronously by the first sub-database, and perform supplementary push data reception processing based on the supplementary push request, complete the storage of the data in the to-be-determined state, and obtain synchronous data.
12. A data processing system, characterized in that: The system includes a database, and the database includes a first sub-database and a second sub-database; The first sub-library includes: A sending module, used for online calling the second sub-library of the database, and sending a data synchronization request to the second sub-library, so that the second sub-library obtains synchronized data based on the data synchronization request; A forwarding module, configured to forward the service request to the second sub-database by applying a front-end active-active routing strategy when an abnormal situation of the database is detected, and the second sub-database uses the synchronized data to perform service processing based on the service request; The second sub-library includes: A receiving module, used for receiving a data synchronization request sent by the first sub-database of the database, and obtaining synchronization data based on the data synchronization request; The processing module is used to receive the service request forwarded by the first sub-database, and perform service processing based on the service request using the synchronization data.
13. A data processing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data processing method according to any one of claims 1 to 5 or claims 6 to 11.
14. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 5 or claims 6 to 11 are implemented.
15. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 5 or claims 6 to 11 are implemented.
