Data processing method, device, backup database and business system

By receiving data processing requests in the standby database and sending data processing requests and synchronization requests to the main database, the problem of low data processing efficiency in the dual-active network architecture is solved, and data synchronization updates across the availability zone are realized, and data transmission delays are reduced.

CN114661743BActive Publication Date: 2025-05-16ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210314943.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-05-16
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

In a dual active network architecture, data update, synchronization and feedback need to be processed multiple times across the availability zone, resulting in a large delay in data transmission, thereby reducing data processing efficiency.

Method used

By receiving data processing requests when the standby database and the business system are in the same Availability Zone, the standby database receives data processing requests and data synchronization requests to the primary database. The primary database and the standby database are located in different Availability Zones, thereby adding data processing requests to the data synchronization link. Data synchronization updates are required to be performed across the Availability Zone once.

Benefits of technology

The data transmission delay is reduced, the data processing efficiency is improved, and the number of network requests across the Availability Zone is reduced by adding data processing requests to the data synchronization link.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661743B_ABST
    Figure CN114661743B_ABST
Patent Text Reader

Abstract

The present application provides a data processing method, device, standby database and business system, the method comprising: the standby database receives a data processing request sent by a business system, the standby database and the business system are in the same availability zone; the standby database sends the data processing request to the main database, and receives a data synchronization request corresponding to the data processing request sent by the main database, the standby database and the main database are in different availability zones; the standby database updates the data according to the data synchronization request, and sends a data processing end message to the business system. The efficiency of data processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a data processing method, device, backup database and business system. Background Art

[0002] In the active-active network architecture of the cloud network's business data, both copies can provide read and write services to the outside world. When processing business, the data of the primary copy must be updated first, and then the data of the secondary copy must be updated synchronously. Finally, the update results are fed back to the business system through the primary copy.

[0003] At present, the two replicas in the active-active network architecture are set in different availability zones, and each availability zone can be set up with a corresponding business system. Since the data transmission delay in the availability zone is small, the data processing in the same availability zone (such as data update and addition in the database) is more efficient. However, when the business system receiving the business is located in a different availability zone from the primary replica, the data update, synchronization and feedback need to be processed across availability zones multiple times, resulting in a large data transmission delay, which in turn leads to low data processing efficiency. Summary of the invention

[0004] The present application provides a data processing method, device, backup database and business system, which are used to solve the technical problem of low efficiency of data processing in the prior art.

[0005] In a first aspect, the present application provides a data processing method, the method comprising:

[0006] The standby database receives a data processing request sent by the business system, and the standby database and the business system are in the same availability zone;

[0007] The standby database sends the data processing request to the primary database, and receives a data synchronization request corresponding to the data processing request sent by the primary database, wherein the standby database and the primary database are in different availability zones;

[0008] The standby database updates the data according to the data synchronization request, and sends a data processing completion message to the business system.

[0009] In a possible implementation manner, the standby database sends the data processing request to the primary database, including:

[0010] The standby database obtains a request type of the data processing request, where the request type is a read operation type or a write operation type;

[0011] The standby database sends a data processing request to the primary database according to the request type.

[0012] In a possible implementation, sending a data processing request to the primary database according to the request type includes:

[0013] When the request type is a read operation type, the standby database sends data corresponding to the data processing request to the business system;

[0014] When the request type is a write operation type, the standby database sends the data processing request to the primary database.

[0015] In a possible implementation, the data processing priority of the primary database is greater than the data processing priority of the standby database.

[0016] In a possible implementation manner, before the standby database sends the data processing request to the primary database, the method further includes:

[0017] The standby database adds a request identifier to the data processing request.

[0018] In a second aspect, the present application provides another data processing method, the method comprising:

[0019] The business system receives a data processing request;

[0020] The business system obtains a first availability zone where the primary database is located and a second availability zone where the standby database is located, where the first availability zone is different from the second availability zone;

[0021] The business system sends the data processing request according to the first availability zone and the second availability zone, and receives the data processing request end message.

[0022] In a possible implementation manner, the business system sends the data processing request according to the first availability zone and the second availability zone, including:

[0023] Obtain the third available zone where the business system is located;

[0024] If the first availability zone is the same as the third availability zone, the business system sends the data processing request to the primary database;

[0025] If the second availability zone is the same as the third availability zone, the business system sends the data processing request to the standby database.

[0026] In a possible implementation manner, receiving the data processing request end message includes:

[0027] If the first available zone is the same as the third available zone, the business system receives the data processing request end message sent by the primary database;

[0028] If the second availability zone is the same as the third availability zone, the business system receives the data processing request end message sent by the standby database.

[0029] In a third aspect, the present application provides a data processing device, including a receiving module, a sending module and an updating module, wherein:

[0030] The receiving module is used to receive a data processing request sent by a business system, and the standby database and the business system are in the same availability zone;

[0031] The sending module is used to send the data processing request to the primary database, and receive a data synchronization request corresponding to the data processing request sent by the primary database, and the standby database and the primary database are in different availability zones;

[0032] The updating module is used to update the data according to the data synchronization request and send a data processing completion message to the business system.

[0033] In a possible implementation manner, the sending module is specifically configured to:

[0034] Obtaining a request type of the data processing request, where the request type is a read operation type or a write operation type;

[0035] According to the request type, a data processing request is sent to the primary database.

[0036] In a possible implementation manner, the sending module is specifically configured to:

[0037] When the request type is a read operation type, sending data corresponding to the data processing request to the business system;

[0038] When the request type is a write operation type, the data processing request is sent to the primary database.

[0039] In a possible implementation, the data processing priority of the primary database is greater than the data processing priority of the standby database.

[0040] In a possible implementation manner, the sending module is further used for:

[0041] A request identifier is added to the data processing request.

[0042] In a fourth aspect, the present application provides another data processing device, including a receiving module, an acquiring module and a sending module, wherein:

[0043] The receiving module is used to receive a data processing request;

[0044] The acquisition module is used to acquire a first availability zone where the primary database is located and a second availability zone where the standby database is located, wherein the first availability zone is different from the second availability zone;

[0045] The sending module is used to send the data processing request according to the first available zone and the second available zone, and receive the data processing request end message.

[0046] In a possible implementation manner, the sending module is specifically configured to:

[0047] Obtain the third available zone where the business system is located;

[0048] If the first availability zone is the same as the third availability zone, the business system sends the data processing request to the primary database;

[0049] If the second availability zone is the same as the third availability zone, the business system sends the data processing request to the standby database.

[0050] In a possible implementation manner, the sending module is specifically configured to:

[0051] If the first available zone is the same as the third available zone, the business system receives the data processing request end message sent by the primary database;

[0052] If the second availability zone is the same as the third availability zone, the business system receives the data processing request end message sent by the standby database.

[0053] In a fifth aspect, the present application provides a backup database, including: a processor, a memory;

[0054] The memory stores computer-executable instructions;

[0055] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the data processing method as described in the first aspect.

[0056] In a sixth aspect, the present application provides a business system, including: a processor, a storage;

[0057] The memory stores computer-executable instructions;

[0058] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the data processing method as described in the second aspect.

[0059] In a seventh aspect, the present application provides a data processing system, comprising the standby database described in the fifth aspect, the business system described in the sixth aspect, and a main database, wherein:

[0060] The primary database is used to receive a data processing request sent by the standby database, and to send a data synchronization request to the standby database.

[0061] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, which are used to implement any of the data processing methods described above when the computer execution instructions are executed by a processor.

[0062] The present application provides a data processing method, device, standby database and business system, wherein the standby database receives a data processing request sent by the business system, wherein the standby database and the business system are in the same availability zone, the standby database sends a data processing request to the main database, and receives a data synchronization request corresponding to the data processing request sent by the main database, wherein the standby database and the main database are in different availability zones, the standby database updates the data according to the data synchronization request, and sends a message of successful data processing to the business system. In the above method, when the business system receives a data processing request, the business system can first send a data processing request to the standby database in the same availability zone, and then send a data processing request to the main database in a different availability zone through the standby database, and after the main database processes the data, it synchronizes the data through the standby database, so that only one cross-availability zone is needed to synchronize and update the data for both the main database and the standby database, thereby reducing the delay of data transmission and improving the efficiency of data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of a business processing process provided in an embodiment of the present application;

[0064] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;

[0065] Figure 3 A schematic diagram of receiving a data synchronization request provided in an embodiment of the present application;

[0066] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application;

[0067] Figure 5 A process diagram of a data processing method provided in an embodiment of the present application;

[0068] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0069] Figure 7 A schematic diagram of the structure of another data processing device provided in an embodiment of the present application;

[0070] Figure 8 A schematic diagram of the hardware structure of the terminal device provided for this application;

[0071] Fig. 9 A schematic diagram of the hardware structure of the business system provided for this application. DETAILED DESCRIPTION

[0072] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0073] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0074] In related technologies, the business data of the cloud network can be stored using a dual-active network architecture. When performing business processing, the data of the primary copy must be updated first, and then the data of the secondary copy must be updated synchronously, and finally the update result must be fed back to the business system through the primary copy. At present, the two copies in the dual-active network architecture are respectively set in different availability zones, and each availability zone can be set up with a corresponding business system. Since the data transmission delay within the availability zone is small, the data processing efficiency within the same availability zone is high. However, when the receiving business system and the primary copy are located in different availability zones, data updates, synchronization, and feedback need to be processed across availability zones multiple times, resulting in a large delay in data transmission, which in turn leads to low data processing efficiency.

[0075] Next, combine Figure 1 , the above business processing process is explained.

[0076] Figure 1 A schematic diagram of a business processing process provided by an embodiment of this application. Figure 1, including business system A, business system B, primary database and standby database. Among them, business system A and primary database are located in availability zone A, and business system B and standby database are located in availability zone B. When business system B receives a data processing request, business system B needs to send a data processing request to the primary database so that the primary database can update the data. After the primary database is updated, the primary database sends a data synchronization request to the standby database. The standby database updates the data according to the data synchronization request and returns a confirmation message to the primary database. When the primary database receives the confirmation message sent by the standby database, it sends an end message of the business processing request to the business system. In this way, one business processing request requires two network requests across availability zones, resulting in low data processing efficiency.

[0077] In order to solve the technical problem of low efficiency of data processing in the related technology, the embodiment of the present application provides a data processing method, wherein the standby database receives a data processing request sent by the business system, wherein the standby database and the business system are in the same availability zone, the standby database obtains the request type of the data processing request, and when the request type is a read operation type, sends the data corresponding to the data processing request to the business system, and when the request type is a write operation type, sends the data processing request to the main database, and receives the data synchronization request corresponding to the data processing request sent by the main database, wherein the standby database and the main database are in different availability zones, the standby database updates the data according to the data synchronization request, and sends a data processing end message to the business system. In this way, when the business system and the main database are in different availability zones, the business system can first send a data processing request to the standby database, and forward the data processing request to the main database through the standby database. After the standby database updates the data according to the data synchronization request of the main database, the standby database sends a data processing end message to the business system. In the entire data processing process, only one available zone needs to be crossed to synchronize and update the data of both the main database and the standby database, thereby reducing the delay of data transmission and improving the efficiency of data processing.

[0078] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0079] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application. Figure 2 , the method may include:

[0080] S201. The standby database receives a data processing request sent by the business system.

[0081] The execution subject of the embodiment of the present application may be a standby database, or a data processing device arranged in the standby database. The data processing device may be implemented by software, or by a combination of software and hardware.

[0082] Optionally, the standby database can be a backup copy of the active-active network architecture. In the active-active network architecture, the same data can include two copies (primary copy and backup copy), and both copies can provide read and write services to the outside world. For example, the business system can read data in the backup copy, and can also update the data in the backup copy.

[0083] Optionally, the data processing request is used to process the data in the database. For example, the data processing request can read the data in the database, update the data in the database, or write new data in the database. The business system can receive the data processing request sent by the user. For example, the business system can receive the data update request (such as a request to create a new account, change a password, etc.) sent by the user, and process the data update request.

[0084] Optionally, the standby database and the business system are in the same availability zone. An availability zone refers to a physical area in the same geographical area where the power supply and network are independent of each other. For example, an availability zone is not affected by failures in other availability zones. The same geographical area can include multiple availability zones. Different availability zones are physically isolated, but the intranets are interconnected. This not only ensures the independence of the availability zones, but also reduces network latency within the availability zones. For example, in order to reduce network latency, a business system can be set up in each availability zone. If a business system in the availability zone where the standby database is located receives a data processing request, it is determined that the standby database and the business system are in the same availability zone. If a business system in an availability zone other than the availability zone where the standby database is located receives a data processing request, it is determined that the standby database and the business system are in different availability zones.

[0085] S202: The standby database sends the data processing request to the primary database.

[0086] Optionally, the master database may be a master copy of an active-active network architecture. For example, data in an active-active network architecture may include a master copy and a backup copy. Storing data in two copies may improve data security.

[0087] Optionally, the standby database and the primary database are in different availability zones. For example, the same geographic region includes availability zone A and availability zone B. If the standby database is set in availability zone A, the primary database can be set in availability zone B. If the standby database is set in availability zone B, the primary database can be set in availability zone A. By setting two copies of the same data in different availability zones, the security of data storage can be improved (for example, when one availability zone fails, a copy in another availability zone can be used).

[0088] Optionally, the data processing priority of the primary database is greater than the data processing priority of the standby database. For example, when the business system receives a data processing request, since the data processing priority of the primary database is greater than the data processing priority of the standby database, the data of the primary database needs to be processed first, and after the data processing of the primary database is completed, the data of the standby database is processed. For example, in the process of writing or updating data, in order to ensure that the transaction is correct and reliable, the data processing must have atomicity (atomicity, or indivisibility), consistency (consistency), isolation (isolation, also known as independence) and durability (durability). Since the business has cross-availability ACID requirements for data, the data write or update operations need to be synchronized consistently in different availability zones. Data processing can be performed on the primary database first, and then on the standby database.

[0089] Optionally, a data processing request may be sent to the primary database according to the following feasible implementation: the standby database obtains the request type of the data processing request, and the standby database sends the data processing request to the primary database according to the request type. The request type is a read operation type or a write operation type. Optionally, a data processing request of a read operation type may read data in a database. For example, if the request type of the data processing request is a read operation type, the data processing request may read data in a database. For example, if the data processing request is used to query data in a database, the request type of the data processing request is a read operation type.

[0090] Optionally, a data processing request of a write operation type can change data in a database. For example, if the request type of a data processing request is a write operation type, the data processing request can change data in a database. For example, if the data processing request is to change a password, the request type of the data processing request is a write operation type.

[0091] Optionally, the standby database sends a data processing request to the primary database according to the request type, specifically: when the request type is a read operation type, the standby database sends the data corresponding to the data processing request to the business system. For example, if the request type of the data processing request is a read operation type, it means that the data processing request will not change the data in the database, nor will it add new data to the database. Therefore, the standby database can send the data corresponding to the data processing request to the business system without sending the data processing request to the primary database, thereby reducing the delay of data processing and improving the efficiency of data processing.

[0092] When the request type is a write operation type, the standby database sends a data processing request to the primary database. For example, if the request type of the data processing request is a write operation type, it means that the data processing request needs to change the data in the database (such as data update, data addition, etc.). Since the data priority of the primary database is greater than the data priority of the standby database, the standby database needs to send the business processing request to the primary database so that the primary database updates the data according to the data processing request.

[0093] Optionally, before the standby database sends a data processing request to the primary database, Figure 2 The data processing method shown also includes: the standby database adds a request identifier to the data processing request. For example, when the standby database receives a data processing request sent by the business system, if the data processing request needs to be forwarded to the primary database, the standby database can add a request identifier to the data processing request so that the primary database updates the data according to the request identifier.

[0094] S203: Receive a data synchronization request corresponding to the data processing request sent by the primary database.

[0095] Optionally, the data synchronization request includes data updated by the primary database according to the data processing request. For example, if the primary database updates data A to data B in the primary database according to the data processing request, the data synchronization request includes information on updating data A to data B.

[0096] Optionally, the data synchronization request may include a request identifier. For example, after the primary database updates the data according to the data processing request, the primary database may add a request identifier in the data synchronization request. When the standby database receives the data synchronization request, the standby database determines the data to be updated according to the request identifier. For example, the standby database has sent a data processing request A and a data processing request B to the primary database, and the data processing request A includes the request identifier A, and the data processing request B includes the request identifier B. If the data synchronization request received by the standby database includes the request identifier A, the standby database determines that the primary database has completed processing the data processing request A, and then updates the data.

[0097] Next, combine Figure 3 , the process of receiving a data synchronization request is described.

[0098] Figure 3 A schematic diagram of receiving a data synchronization request provided in an embodiment of the present application. Figure 3 , including a primary database and a standby database. The standby database sends a data processing request to the primary database. When the primary database receives the data processing request sent by the standby database, it processes the data according to the data processing request and sends a data synchronization request to the standby database.

[0099] S204: The standby database updates data according to the data synchronization request.

[0100] Optionally, when the standby database receives a data synchronization request, the standby database may update the data according to the data synchronization request. For example, when the standby database receives a data synchronization request, the standby database may update the data according to the data to be synchronized in the data synchronization request.

[0101] S205: Send a data processing completion message to the business system.

[0102] Optionally, after the standby database updates the data, it can send a data processing completion message to the business system, so that the business system determines that the data corresponding to this data processing request has been updated in the primary database and the standby database. For example, if the data processing request received by the business system is to update data A to data B, if the business system receives a data processing completion message sent by the standby database, the business system determines that both the primary database and the standby database have updated data A to data B.

[0103] The embodiment of the present application provides a data processing method, in which a standby database receives a data processing request sent by a business system, wherein the standby database and the business system are in the same availability zone, the standby database obtains the request type of the data processing request, and when the request type is a write operation type, the standby database can send a data processing request to the main database, and receive a data synchronization request corresponding to the data processing request sent by the main database, wherein the standby database and the main database are in different availability zones, the standby database updates the data according to the data synchronization request, and sends a data processing end message to the business system. According to the above method, when the business system and the main database are in different availability zones, the business system can first send a data processing request to the standby database, and forward the data processing request to the main database through the standby database, after the standby database updates the data according to the data synchronization request of the main database, the standby database sends a data processing end message to the business system, in this way, the data processing request can be added to the data synchronization link, the data processing request and the synchronization link can be associated, and only one availability zone is needed to synchronize and update the data for both the main database and the standby database, thereby reducing the delay of data transmission and improving the efficiency of data processing.

[0104] exist Figure 2 Based on the embodiment shown below, combined with Figure 4 , another data processing method is explained.

[0105] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application. Figure 4 The method flow includes:

[0106] S401: The business system receives a data processing request.

[0107] The execution subject of the embodiment of the present application may be a business system, or a data processing device arranged in the business system. The data processing device may be implemented by software, or by a combination of software and hardware.

[0108] Optionally, the data processing request includes data to be processed. For example, if the data processing request is used to read data, the data to be processed is the identifier of the read data, and if the data processing request is used to update data, the data to be processed is the data to be updated. For example, if the data processing request is used to add data A and data B to the database, the data to be processed is data A and data B.

[0109] S402: The business system obtains the first availability zone where the primary database is located and the second availability zone where the standby database is located.

[0110] Optionally, the first availability zone is different from the second availability zone. For example, the availability zone where the primary database is located is different from the availability zone where the standby database is located. For example, when the business system receives a data processing request, it can obtain the identifier of the availability zone where the primary database is located and the identifier of the availability zone where the standby database is located, and then determine the first availability zone and the second availability zone.

[0111] S403: The business system sends a data processing request according to the first availability zone and the second availability zone, and receives a data processing request completion message.

[0112] Optionally, the business system may send a data processing request according to the following feasible implementation method: obtain the third availability zone where the business system is located. If the first availability zone is the same as the third availability zone, the business system sends a data processing request to the primary database. For example, if the first availability zone is the same as the third availability zone, it means that the primary database and the business system are located in the same availability zone, and the business system can send a data processing request to the primary database. If the second availability zone is the same as the third availability zone, the business system sends a data processing request to the standby database. For example, if the second availability zone is the same as the third availability zone, it means that the standby database and the business system are located in the same availability zone, and the business system can send a data processing request to the standby database.

[0113] Optionally, if the business system sends a data processing request to the primary database, the primary database processes the data according to the data processing request and sends a data synchronization request to the standby database so that the standby database processes the data according to the data synchronization request.

[0114] Optionally, if the first availability zone is the same as the third availability zone, the business system receives a data processing request completion message sent by the primary database. For example, if the first availability zone is the same as the third availability zone, it means that the primary database and the business system are located in the same availability zone. After the standby database synchronizes the data, it can send a response message to the primary database. The primary database sends a data processing request completion message to the business system based on the response message. In this way, data can be processed with only one cross-availability zone access, thereby improving data processing efficiency.

[0115] If the second availability zone is the same as the third availability zone, the business system receives the data processing request end message sent by the standby database. For example, if the second availability zone is the same as the third availability zone, it means that the standby database and the business system are located in the same availability zone. After receiving the data synchronization request from the primary database, the standby database can synchronize the data and send a data processing request end message to the business system. In this way, data can be processed with only one cross-availability zone access, which improves the efficiency of data processing.

[0116] The embodiment of the present application provides a data processing method, in which a business system receives a data processing request, and the business system sends the data processing request according to the first availability zone and the second availability zone, and receives a data processing request end message. In this way, when the business system receives the data processing request, it can send the data processing request to the database in the same availability zone, and receive the data processing request end message sent by the database in the same availability zone. Regardless of whether the database in the same availability zone is the primary database or the standby database, only one cross-availability zone network access is required to synchronize and update the data of the primary database and the standby database, thereby reducing the delay of data transmission and improving the efficiency of data processing.

[0117] Based on any of the above embodiments, Figure 5 , the process of the above data processing method is explained.

[0118] Figure 5 A process diagram of a data processing method provided in an embodiment of the present application. Figure 5 , including business system A, business system B, primary database and standby database. Among them, business system A and primary database are located in availability zone A, and business system B and standby database are located in availability zone B. When business system B receives a business processing request, business system B sends a data processing request to the standby database. When the standby database receives a data processing request, it sends the data processing request to the primary database.

[0119] See also Figure 5 When the primary database receives a data processing request, it updates the data according to the data processing request. When the primary database finishes updating the data, the primary database can send a data synchronization request to the standby database. The standby database performs data synchronization updates according to the data synchronization request and sends a data processing request end message to the business system. In this way, by adding the data processing request to the data synchronization link and associating the data processing request with the synchronization link, data synchronization updates can be performed on both the primary database and the standby database only across the available zones once, thereby reducing the delay of data transmission and improving the efficiency of data processing.

[0120] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. Figure 6 The data processing device 10 includes a receiving module 11, a sending module 12 and an updating module 13, wherein:

[0121] The receiving module 11 is used to receive a data processing request sent by a business system, and the standby database and the business system are in the same availability zone;

[0122] The sending module 12 is used to send the data processing request to the primary database, and receive a data synchronization request corresponding to the data processing request sent by the primary database, and the standby database and the primary database are in different availability zones;

[0123] The updating module 13 is used to update the data according to the data synchronization request and send a data processing completion message to the business system.

[0124] In a possible implementation manner, the sending module 12 is specifically configured to:

[0125] Obtaining a request type of the data processing request, where the request type is a read operation type or a write operation type;

[0126] According to the request type, a data processing request is sent to the primary database.

[0127] In a possible implementation manner, the sending module 12 is specifically configured to:

[0128] When the request type is a read operation type, sending data corresponding to the data processing request to the business system;

[0129] When the request type is a write operation type, the data processing request is sent to the primary database.

[0130] In a possible implementation, the data processing priority of the primary database is greater than the data processing priority of the standby database.

[0131] In a possible implementation manner, the sending module 12 is further configured to:

[0132] A request identifier is added to the data processing request.

[0133] The data processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0134] Figure 7 This is a schematic diagram of the structure of another data processing device provided in an embodiment of the present application. Figure 7 The data processing device 20 includes a receiving module 21, an acquiring module 22 and a sending module 23, wherein:

[0135] The receiving module 21 is used to receive a data processing request;

[0136] The acquisition module 22 is used to acquire a first availability zone where the primary database is located and a second availability zone where the standby database is located, wherein the first availability zone is different from the second availability zone;

[0137] The sending module 23 is used to send the data processing request according to the first available zone and the second available zone, and receive the data processing request end message.

[0138] In a possible implementation manner, the sending module 23 is specifically configured to:

[0139] Obtain the third available zone where the business system is located;

[0140] If the first availability zone is the same as the third availability zone, the business system sends the data processing request to the primary database;

[0141] If the second availability zone is the same as the third availability zone, the business system sends the data processing request to the standby database.

[0142] In a possible implementation manner, the sending module 23 is specifically configured to:

[0143] If the first available zone is the same as the third available zone, the business system receives the data processing request end message sent by the primary database;

[0144] If the second availability zone is the same as the third availability zone, the business system receives the data processing request end message sent by the standby database.

[0145] The data processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0146] Figure 8 The hardware structure diagram of the standby database provided for this application. Figure 8 The standby database 30 may include: a processor 31 and a memory 32, wherein the processor 31 and the memory 32 may communicate; illustratively, the processor 31 and the memory 32 communicate via a communication bus 33, the memory 32 is used to store program instructions, and the processor 31 is used to call the program instructions in the memory to execute the data processing method shown in any of the above method embodiments.

[0147] Optionally, the standby database 30 may further include a communication interface, which may include a transmitter and / or a receiver.

[0148] Fig. 9 The hardware structure diagram of the business system provided for this application. Fig. 9The business system 40 may include: a processor 41 and a memory 42, wherein the processor 41 and the memory 42 can communicate; illustratively, the processor 41 and the memory 42 communicate via a communication bus 43, the memory 42 is used to store program instructions, and the processor 41 is used to call the program instructions in the memory to execute the data processing method shown in any of the above method embodiments.

[0149] Optionally, the business system 40 may further include a communication interface, which may include a transmitter and / or a receiver.

[0150] Optionally, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0151] The present application provides a data processing system, wherein the data processing system includes Figure 8 The standby database shown, Fig. 9 The business system and the primary database are shown. Optionally, the primary database is used to receive data processing requests sent by the standby database and send data synchronization requests to the standby database.

[0152] An embodiment of the present application provides a readable storage medium, on which a computer program is stored; the computer program is used to implement the data processing method described in any of the above embodiments.

[0153] An embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, a computer executes the above data processing method.

[0154] All or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.

[0155] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

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

[0157] These computer program instructions can also be loaded onto a computer or other programmable terminal device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0158] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0159] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. A data processing method, characterized in that: include: The standby database receives a data processing request sent by the business system, and the standby database and the business system are in the same availability zone; The business system is used to receive a data processing request sent by a client; The standby database obtains a request type of the data processing request, which is a read operation type or a write operation type; if the request type is a read operation type, the standby database sends data corresponding to the data processing request to the business system; if the request type is a write operation type, the standby database adds a request identifier to the data processing request, the standby database sends the data processing request to the primary database, and receives a data synchronization request corresponding to the data processing request sent by the primary database, and the standby database and the primary database are in different availability zones; If the data synchronization request includes the request identifier in the data processing request and it is determined that the primary database has completed processing the data processing request, the standby database updates the data according to the request identifier in the data synchronization request and sends a data processing completion message to the business system.

2. The method according to claim 1, characterized in that The data processing priority of the primary database is greater than the data processing priority of the standby database.

3. A data processing method, characterized in that: include: The business system receives the data processing request; The business system obtains a first availability zone where the primary database is located and a second availability zone where the standby database is located, where the first availability zone is different from the second availability zone; The business system sends the data processing request according to the first available zone and the second available zone, and receives a data processing request end message; The business system sends the data processing request according to the first availability zone and the second availability zone, including: Obtain the third available zone where the business system is located; If the first availability zone is the same as the third availability zone, the business system sends the data processing request to the primary database; If the second availability zone is the same as the third availability zone, the business system sends the data processing request to the standby database; the request type is a read operation type or a write operation type; if the request type is a read operation type, the standby database sends the data corresponding to the data processing request to the business system; if the request type is a write operation type, the standby database adds a request identifier in the data processing request, and the standby database sends the data processing request to the primary database; if the data synchronization request includes the request identifier in the data processing request, the standby database determines that the primary database has finished processing the data processing request, receives the data synchronization request corresponding to the request identifier in the data processing request sent by the primary database, and updates the data according to the data synchronization request. The standby database and the primary database are in different availability zones.

4. The method according to claim 3, characterized in that Receiving the data processing request end message includes: If the first available zone is the same as the third available zone, the business system receives the data processing request end message sent by the primary database; If the second availability zone is the same as the third availability zone, the business system receives the data processing request end message sent by the standby database.

5. A data processing device, characterized in that: It includes a receiving module, a sending module and an updating module, wherein: The receiving module is used to receive a data processing request sent by a business system, and the standby database and the business system are in the same availability zone; the business system is used to receive a data processing request sent by a client; The sending module is used to obtain the request type of the data processing request, where the request type is a read operation type or a write operation type; when the request type is a read operation type, the standby database sends the data corresponding to the data processing request to the business system; if the request type is a write operation type, the standby database adds a request identifier to the data processing request, the standby database sends the data processing request to the primary database, and receives a data synchronization request corresponding to the data processing request sent by the primary database, and the standby database and the primary database are in different availability zones; The update module is used to, if the data synchronization request includes the request identifier in the data processing request and determines that the primary database has completed processing the data processing request, update the data according to the request identifier in the data synchronization request and send a data processing completion message to the business system.

6. A data processing device, characterized in that: It includes a receiving module, an acquiring module and a sending module, wherein: The receiving module is used to receive a data processing request; The acquisition module is used to acquire a first availability zone where the primary database is located and a second availability zone where the standby database is located, wherein the first availability zone is different from the second availability zone; The sending module is used to send the data processing request according to the first available zone and the second available zone, and receive the data processing request end message; The sending module is specifically used to obtain the third available zone where the business system is located; If the first availability zone is the same as the third availability zone, the business system sends the data processing request to the primary database; If the second availability zone is the same as the third availability zone, the business system sends the data processing request to the standby database; the request type is a read operation type or a write operation type; if the request type is a read operation type, the standby database sends the data corresponding to the data processing request to the business system; if the request type is a write operation type, the standby database adds a request identifier in the data processing request, and the standby database sends the data processing request to the primary database; if the data synchronization request includes the request identifier in the data processing request, the standby database determines that the primary database has finished processing the data processing request, the standby database receives the data synchronization request corresponding to the data processing request sent by the primary database, and updates the data according to the request identifier in the data synchronization request, and the standby database and the primary database are in different availability zones.

7. A standby database, characterized in that: include: Processor, memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the data processing method according to claim 1 or 2.

8. A business system, characterized in that: include: Processor, storage; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the data processing method according to claim 3 or 4.

9. A data processing system, characterized in that: It comprises the standby database as claimed in claim 7, the business system as claimed in claim 8 and the main database, wherein: The primary database is used to receive a data processing request sent by the standby database, and to send a data synchronization request to the standby database.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data processing method according to claim 1 or 2, or the data processing method according to claim 3 or 4.

11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the data processing method according to claim 1 or 2, or the data processing method according to claim 3 or 4.

Citation Information

Patent Citations

  • Multi-database data access method and system and proxy server

    CN106101055A

  • Data synchronization method and device

    CN111182014A