CN114661743A - Data processing method and device, standby database and service system - Google Patents

Data processing method and device, standby database and service system Download PDF

Info

Publication number
CN114661743A
CN114661743A CN202210314943.6A CN202210314943A CN114661743A CN 114661743 A CN114661743 A CN 114661743A CN 202210314943 A CN202210314943 A CN 202210314943A CN 114661743 A CN114661743 A CN 114661743A
Authority
CN
China
Prior art keywords
data processing
database
request
processing request
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210314943.6A
Other languages
Chinese (zh)
Inventor
陈梁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Cloud Computing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Cloud Computing Ltd filed Critical Alibaba Cloud Computing Ltd
Priority to CN202210314943.6A priority Critical patent/CN114661743A/en
Publication of CN114661743A publication Critical patent/CN114661743A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a data processing method, a data processing device, a standby database and a service system, wherein the method comprises the following steps: a standby database receives a data processing request sent by a service system, wherein the standby database and the service system are in the same available area; the standby database sends the data processing request to a main database and receives a data synchronization request corresponding to the data processing request sent by the main database, and the standby database and the main database are in different available areas; and the standby database updates the data according to the data synchronization request and sends a data processing end message to the service system. The efficiency of data processing is improved.

Description

Data processing method and device, standby database and service system
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a data processing method and apparatus, a backup database, and a service system.
Background
In a live-active network architecture of service data of a cloud network, both copies can provide read-write service to the outside, and when service processing is performed, data of a master copy needs to be updated first, data of slave copies needs to be updated synchronously, and finally an update result is fed back to a service system through the master copy.
At present, two copies in a dual active network architecture are respectively arranged in different available areas, each available area can be provided with a corresponding service system, and data transmission delay in the available areas is small, so that data processing (such as data updating and adding in a database) efficiency in the same available area is high. However, when the service system receiving the service and the primary replica are located in different available areas, the updating, synchronization, and feedback of the data need to be processed across the available areas for multiple times, so that the delay of data transmission is large, and further, the efficiency of data processing is low.
Disclosure of Invention
The application provides a data processing method, a data processing device, a standby database and a service system, which are used for solving the technical problem of low data processing efficiency in the prior art.
In a first aspect, the present application provides a data processing method, including:
a standby database receives a data processing request sent by a service system, wherein the standby database and the service system are in the same available area;
the standby database sends the data processing request to a main database and receives a data synchronization request corresponding to the data processing request sent by the main database, and the standby database and the main database are in different available areas;
and the standby database updates the data according to the data synchronization request and sends a data processing end message to the service system.
In one possible embodiment, the sending of the data processing request from the standby database to the primary database includes:
the standby database acquires a request type of the data processing request, wherein the request type is a read operation type or a write operation type;
and the standby database sends a data processing request to the main database according to the request type.
In one possible embodiment, sending a data processing request to the master database according to the request type includes:
when the request type is a read operation type, the standby database sends data corresponding to the data processing request to the service system;
and when the request type is a write operation type, the standby database sends the data processing request to the main database.
In one possible embodiment, the data processing priority of the primary database is greater than the data processing priority of the backup database.
In a possible embodiment, before the backup database sends the data processing request to the primary database, the method further includes:
and the standby database adds a request identifier in the data processing request.
In a second aspect, the present application provides another data processing method, including:
the business system receives a data processing request;
the business system acquires a first available area where a main database is located and a second available area where a standby database is located, wherein the first available area is different from the second available area;
and the service system sends the data processing request according to the first available area and the second available area, and receives a data processing request end message.
In a possible implementation manner, the sending, by the service system, the data processing request according to the first available area and the second available area includes:
acquiring a third available area where the service system is located;
if the first available area is the same as the third available area, the business system sends the data processing request to the master database;
and if the second available area is the same as the third available area, the service system sends the data processing request to the standby database.
In one possible implementation, receiving the data processing request end message includes:
if the first available area is the same as the third available area, the service system receives the data processing request end message sent by the master database;
and if the second available area is the same as the third available area, the service system receives the data processing request end message sent by the standby database.
In a third aspect, the present application provides a data processing apparatus, including a receiving module, a sending module, and an updating module, where:
the receiving module is used for receiving a data processing request sent by a service system, and the standby database and the service system are in the same available area;
the transmitting module is used for transmitting the data processing request to a main database and receiving a data synchronization request corresponding to the data processing request transmitted by the main database, and the standby database and the main database are in different available areas;
and the updating module is used for updating the data according to the data synchronization request and sending a data processing end message to the service system.
In a possible implementation manner, the sending module is specifically configured to:
acquiring a request type of the data processing request, wherein the request type is a read operation type or a write operation type;
and sending a data processing request to the master database according to the request type.
In a possible implementation manner, the sending module is specifically configured to:
when the request type is a read operation type, sending data corresponding to the data processing request to the service system;
and when the request type is a write operation type, sending the data processing request to the master database.
In one possible embodiment, the data processing priority of the primary database is greater than the data processing priority of the backup database.
In a possible implementation, the sending module is further configured to:
and adding a request identifier in the data processing request.
In a fourth aspect, the present application provides another data processing apparatus, including a receiving module, an obtaining module, and a sending module, where:
the receiving module is used for receiving a data processing request;
the acquisition module is used for acquiring a first available area where a main database is located and a second available area where a standby database is located, wherein the first available area is different from the second available area;
the sending module is configured to send the data processing request according to the first available region and the second available region, and receive a data processing request end message.
In a possible implementation manner, the sending module is specifically configured to:
acquiring a third available area where the service system is located;
if the first available area is the same as the third available area, the business system sends the data processing request to the master database;
and if the second available area is the same as the third available area, the service system sends the data processing request to the standby database.
In a possible implementation manner, the sending module is specifically configured to:
if the first available area is the same as the third available area, the service system receives the data processing request end message sent by the master database;
and if the second available area is the same as the third available area, the service system receives the data processing request end message sent by the standby database.
In a fifth aspect, the present application provides a backup database, comprising: a processor, a memory;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory, causing the processor to perform the data processing method of the first aspect.
In a sixth aspect, the present application provides a business system, including: a processor, storing;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory, causing the processor to perform the data processing method of the second aspect.
In a seventh aspect, the present application provides a data processing system, comprising the backup database of the fifth aspect, the business system of the sixth aspect, and the primary database,
the main database is used for receiving the data processing request sent by the standby database and sending a data synchronization request to the standby database.
In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the computer-readable storage medium is used for implementing the data processing method of any one of the foregoing items.
The application provides a data processing method, a device, a standby database and a service system, wherein the standby database receives a data processing request sent by the service system, the standby database and the service system are in the same available area, the standby database sends the data processing request to a 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 available areas, and the standby database updates data according to the data synchronization request and sends a message that the data processing is successful to the service system. In the method, when the service system receives the data processing request, the service system can firstly send the data processing request to the standby database in the same available area, then send the data processing request to the main databases in different available areas through the standby databases, and after the main databases process the data, perform data synchronization through the standby databases, so that the data synchronization update can be performed on both the main databases and the standby databases only by crossing the available areas once, thereby reducing the delay of data transmission and improving the efficiency of data processing.
Drawings
Fig. 1 is a schematic view of a service processing process provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of receiving a data synchronization request according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another data processing method according to an embodiment of the present application;
fig. 5 is a schematic process diagram of a data processing method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic diagram of a hardware structure of a terminal device provided in the present application;
fig. 9 is a schematic diagram of a hardware structure of a service system provided in the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the related technology, the service data of the cloud network can be stored by using a live-active network architecture, and when the service is processed, the data of the master copy needs to be updated first, then the data of the slave copy needs to be updated synchronously, and finally the update result is fed back to the service system through the master copy. At present, two copies in a dual active network architecture are respectively arranged in different available areas, each available area can be provided with a corresponding service system, and the data transmission delay in the available areas is small, so that the data processing efficiency in the same available area is high. However, when the receiving service system and the primary replica are located in different available areas, data updating, synchronization, and feedback need to be processed across the available areas multiple times, so that the delay of data transmission is large, and the efficiency of data processing is low.
The service processing procedure will be described with reference to fig. 1.
Fig. 1 is a schematic view of a service processing process provided in an embodiment of the present application. Referring to fig. 1, the system includes a service system a, a service system B, a primary database and a backup database. The service system A and the main database are located in the available area A, and the service system B and the standby database are located in the available area B. When the service system B receives the data processing request, the service system B needs to send the data processing request to the master database, so that the master database updates the data. After the updating of the main database is finished, the main database sends a data synchronization request to the standby database, the standby database updates data according to the data synchronization request and returns a confirmation message to the main database, and when the main database receives the confirmation message sent by the standby database, the main database sends a service processing request finishing message to the service system. Thus, 1 service processing request requires 2 network requests across the available area, which results in inefficient data processing.
In order to solve the technical problem of low efficiency of data processing in the related art, an embodiment of the present application provides a data processing method, in which a backup database receives a data processing request sent by a service system, where the backup database is in the same available area as the service system, the backup database obtains a request type of the data processing request, sends data corresponding to the data processing request to the service system when the request type is a read operation type, sends the data processing request to a main database when the request type is a write operation type, and receives a data synchronization request corresponding to the data processing request sent by the main database, where the backup database and the main database are in different available areas, and the backup database updates data according to the data synchronization request and sends a data processing end message to the service system. Therefore, when the service system and the main database are in different available areas, the service system can firstly send a data processing request to the standby database, and forwards the data processing request to the main database through the standby database, and after the standby database updates data according to the data synchronization request of the main database, the standby database sends a data processing end message to the service system.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present disclosure. Referring to fig. 2, the method may include:
s201, receiving a data processing request sent by a service system by a standby database.
The execution subject of the embodiment of the application may be a standby database, or may be a data processing device disposed in the standby database. The data processing device may be implemented by software, or may be implemented by a combination of software and hardware.
Alternatively, the backup database may be a backup copy of the live-active network architecture. In the dual active network architecture, the same data may include two copies (a primary copy and a backup copy), and both copies may provide read-write services to the outside. For example, the service system may read data from the backup copy, or may update data in the backup copy.
Optionally, the data processing request is used to process data in the database. For example, the data processing request may read data in the database, update data in the database, or write new data in the database. The service system can receive a data processing request sent by a user side. For example, the service system may receive a data update request (e.g., a request for creating an account, modifying a password, etc.) sent by the user side, and process the data update request.
Optionally, the standby database is in the same available area as the service system. The available area refers to a physical area in which power and a network are independent in the same geographical area. For example, one available area is not affected by the failure of other available areas, and multiple available areas can be included in the same geographic area, and different available areas are physically isolated, but intranet intercommunication can ensure the independence of the available areas and reduce the network delay in the available areas. For example, in order to reduce network latency, a service system may be provided in each available area, and if a service system in the available area where the backup database is located receives a data processing request, it is determined that the backup database is in the same available area as the service system, and if a service system in another available area than the available area where the backup database is located receives a data processing request, it is determined that the backup database is in a different available area from the service system.
S202, the standby database sends the data processing request to the main database.
Alternatively, the master database may be the master copy of the live-active network architecture. For example, data in the dual active network architecture may include a primary copy and a secondary copy, and the security of the data may be improved by storing the data through the two copies.
Optionally, the standby database is in a different available area than the primary database. For example, the same geographical area includes an available area a and an available area B, and if the spare database is provided in the available area a, the primary database may be provided in the available area B, and if the spare database is provided in the available area B, the primary database may be provided in the available area a, and by providing two copies of the same data in different available areas, the security of data storage may be improved (e.g., when one available area fails, a copy in the other available area may also be used).
Optionally, the data processing priority of the primary database is greater than the data processing priority of the standby database. For example, when the service system receives a data processing request, the data processing priority of the primary database is higher than that of the standby database, so that the data of the primary database needs to be processed preferentially, and after the data processing of the primary database is finished, the data of the standby database is processed. For example, in the process of writing or updating data, in order to ensure that a transaction (transaction) is correct and reliable, atomicity (or inseparability), consistency (consistency), isolation (independence), and durability (durability) that data processing must have are required, and since a service has a demand for data to cross an available area ACID, the writing or updating operation of data needs to be synchronized consistently between different available areas, data processing may be performed on a primary database first, and then data processing may be performed on a standby database.
Optionally, the data processing request may be sent to the master database according to the following feasible implementation manners: and the standby database acquires the request type of the data processing request, and sends the data processing request to the main database according to the request type. Wherein the request type is a read operation type or a write operation type. Alternatively, a data processing request of the read operation type may read data in the 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 the 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.
Alternatively, a write operation type data processing request may alter data in the database. For example, if the request type of the data processing request is a write operation type, the data processing request may change data in the database. For example, if the data processing request is a change password, the request type of the data processing request is a write operation type.
Optionally, the standby database sends a data processing request to the primary database according to the request type, specifically: and when the request type is a read operation type, the standby database sends data corresponding to the data processing request to the service system. For example, if the request type of the data processing request is a read operation type, it indicates that the data processing request does not change the data in the database, and does not add new data to the database, so that the standby database can send the data corresponding to the data processing request to the service system, and does not need to send the data processing request to the primary database, thereby reducing the delay of data processing and improving the efficiency of data processing.
And when the request type is a write operation type, the standby database sends a data processing request to the main database. For example, if the request type of the data processing request is a write operation type, it indicates that the data processing request needs to change the data in the database (e.g., data update, data addition, etc.), and 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 service processing request to the primary database so that the primary database updates the data according to the data processing request.
Optionally, before the standby database sends the data processing request to the primary database, the data processing method shown in fig. 2 further 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 a service system, if the data processing request needs to be forwarded to the primary database, the standby database may add a request identifier to the data processing request, so that the primary database updates data according to the request identifier.
S203, receiving a data synchronization request corresponding to the data processing request sent by the main database.
Optionally, the data synchronization request includes data updated by the master database according to the data processing request. For example, if the master database updates data a to data B in the master database according to the data processing request, the data synchronization request includes information for updating data a to data B.
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 to the data synchronization request, and when the backup database receives the data synchronization request, the backup 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, where the data processing request a includes a request identifier a, and the data processing request B includes a request identifier B, and if the data synchronization request received by the standby database includes the request identifier a, the standby database determines that the primary database has finished processing the data processing request a, and then updates the data.
Next, a procedure of receiving a data synchronization request will be described with reference to fig. 3.
Fig. 3 is a schematic diagram of receiving a data synchronization request according to an embodiment of the present application. See fig. 3, which includes a primary database and a backup database. Wherein, the standby database sends a data processing request to the main database. And when the main database receives the data processing request sent by the standby database, the main database processes the data according to the data processing request and sends a data synchronization request to the standby database.
And S204, the standby database updates the data according to the data synchronization request.
Optionally, when the standby database receives the data synchronization request, the data may be updated according to the data synchronization request. For example, when the standby database receives the data synchronization request, the data in the standby database may be updated according to the data to be synchronized in the data synchronization request.
And S205, sending a data processing end message to the service system.
Optionally, after the data is updated by the standby data, a data processing end message may be sent to the service system, so that the service system determines that the data corresponding to the data processing request is updated in the main database and the standby database. For example, the service system receives a data processing request to update data a to data B, and if the service system receives a data processing end message sent by the standby database, the service system determines that both the primary database and the standby database have updated data a to data B.
The embodiment of the application provides a data processing method, wherein a standby database receives a data processing request sent by a service system, the standby database and the service system are in the same available area, the standby database acquires a request type of the data processing request, when the request type is a write operation type, the standby database can send the data processing request to a main database and receive 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 available areas, and the standby database updates data according to the data synchronization request and sends a data processing end message to the service system. According to the method, when the service system and the main database are in different available areas, the service system can firstly send a data processing request to the standby database, and forwards the data processing request to the main database through the standby database, and after the standby database updates data according to the data synchronization request of the main database, the standby database sends a data processing end message to the service system, so that the data processing request can be added into the data synchronization link, the data processing request is associated with the synchronization link, the main database and the standby database can be updated synchronously only by crossing the available areas once, the data transmission delay is further reduced, and the data processing efficiency is improved.
On the basis of the embodiment shown in fig. 2, another data processing method will be described below with reference to fig. 4.
Fig. 4 is a schematic flowchart of another data processing method according to an embodiment of the present application. Referring to fig. 4, the process of the method includes:
s401, the service system receives a data processing request.
The execution subject of the embodiment of the present application may be a service system, and may also be a data processing apparatus set in the service system. The data processing device may be implemented by software, or may be implemented by a combination of software and hardware.
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 the 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 in the database, the data to be processed is data a and data B.
S402, the service system acquires a first available area where the main database is located and a second available area where the standby database is located.
Optionally, the first usable area is different from the second usable area. For example, the primary database may be located in a different available area than the standby database. For example, when the service system receives a data processing request, the service system may obtain an identifier of an available area where the primary database is located and an identifier of an available area where the standby database is located, thereby determining the first available area and the second available area.
S403, the service system sends a data processing request according to the first available area and the second available area, and receives a data processing request end message.
Optionally, the service system may send the data processing request according to the following feasible implementation manners: and acquiring a third available area where the service system is located. And if the first available area is the same as the third available area, the service system sends a data processing request to the master database. For example, if the first and third available areas are the same, it indicates that the master database and the service system are located in the same available area, and the service system may send a data processing request to the master database. And if the second available area is the same as the third available area, the service system sends a data processing request to the standby database. For example, if the second available area is the same as the third available area, it indicates that the backup database is located in the same available area as the service system, and the service system may send a data processing request to the backup database.
Optionally, if the service 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.
Optionally, if the first available area is the same as the third available area, the service system receives a data processing request end message sent by the master database. For example, if the first available area is the same as the third available area, it indicates that the primary database and the service system are located in the same available area, after the backup database synchronizes data, a response message may be sent to the primary database, and the primary database sends a data processing request end message to the service system according to the response message, so that data can be processed only by one access across the available areas, thereby improving the efficiency of data processing.
And if the second available area is the same as the third available area, the service system receives a data processing request end message sent by the standby database. For example, if the second available area is the same as the third available area, it indicates that the backup database and the service system are located in the same available area, and after receiving the data synchronization request of the primary database, the backup database may perform synchronization processing on the data and send a data processing request end message to the service system, so that the data may be processed only by one access across the available areas, thereby improving the efficiency of data processing.
The embodiment of the application provides a data processing method, wherein a service system receives a data processing request, and sends the data processing request and receives a data processing request ending message according to a first available area and a second available area. Therefore, when the service system receives the data processing request, the service system can send the data processing request to the database in the same available area and receive the data processing request ending message sent by the database in the same available area, and the data synchronous updating can be carried out on the main database and the standby database only by one-time network access crossing the available area no matter the database in the same available area is the main database or the standby database, so that the data transmission delay is reduced, and the data processing efficiency is improved.
On the basis of any of the above embodiments, the following describes a procedure of the above data processing method with reference to fig. 5.
Fig. 5 is a schematic process diagram of a data processing method according to an embodiment of the present application. Referring to fig. 5, the system includes a service system a, a service system B, a primary database and a backup database. The service system A and the main database are located in the available area A, and the service system B and the standby database are located in the available area B. And when the service system B receives the service processing request, the service system B sends the data processing request to the standby database. And when receiving the data processing request, the standby database sends the data processing request to the main database.
Referring to fig. 5, when the primary database receives a data processing request, the primary database updates data according to the data processing request, and when the primary database finishes updating the data, the primary database may send a data synchronization request to the backup database. And the standby database performs data synchronization updating according to the data synchronization request and sends a data processing request ending message to the service system. Therefore, the data processing request is added into the data synchronization link, the data processing request is associated with the data synchronization link, and the data synchronization update can be carried out on the main database and the standby database only by crossing the available area once, so that the data transmission delay is reduced, and the data processing efficiency is improved.
Fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application. Referring to fig. 6, the data processing apparatus 10 includes a receiving module 11, a sending module 12, and an updating module 13, wherein:
the receiving module 11 is configured to receive a data processing request sent by a service system, where the standby database is in the same available area as the service system;
the sending module 12 is configured to send the data processing request to a primary database, and receive a data synchronization request corresponding to the data processing request sent by the primary database, where the standby database and the primary database are in different available areas;
the update module 13 is configured to update data according to the data synchronization request, and send a data processing end message to the service system.
In a possible implementation manner, the sending module 12 is specifically configured to:
acquiring a request type of the data processing request, wherein the request type is a read operation type or a write operation type;
and sending a data processing request to the master database according to the request type.
In a possible implementation manner, the sending module 12 is specifically configured to:
when the request type is a read operation type, sending data corresponding to the data processing request to the service system;
and when the request type is a write operation type, sending the data processing request to the master database.
In one possible embodiment, the data processing priority of the primary database is greater than the data processing priority of the backup database.
In a possible implementation, the sending module 12 is further configured to:
and adding a request identifier in the data processing request.
The data processing apparatus provided in the embodiment of the present application may execute the technical solutions shown in the foregoing method embodiments, and the implementation principles and beneficial effects thereof are similar and will not be described herein again.
Fig. 7 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application. Referring to fig. 7, the data processing apparatus 20 includes a receiving module 21, an obtaining module 22, and a sending module 23, wherein:
the receiving module 21 is configured to receive a data processing request;
the obtaining module 22 is configured to obtain a first available area where a primary database is located and a second available area where a standby database is located, where the first available area is different from the second available area;
the sending module 23 is configured to send the data processing request according to the first available region and the second available region, and receive a data processing request end message.
In a possible implementation manner, the sending module 23 is specifically configured to:
acquiring a third available area where the service system is located;
if the first available area is the same as the third available area, the business system sends the data processing request to the master database;
and if the second available area is the same as the third available area, the service system sends the data processing request to the standby database.
In a possible implementation manner, the sending module 23 is specifically configured to:
if the first available area is the same as the third available area, the service system receives the data processing request end message sent by the master database;
and if the second available area is the same as the third available area, the service system receives the data processing request end message sent by the standby database.
The data processing apparatus provided in the embodiment of the present application may execute the technical solutions shown in the foregoing method embodiments, and the implementation principles and beneficial effects thereof are similar and will not be described herein again.
Fig. 8 is a schematic diagram of a hardware structure of the backup database provided in the present application. Referring to fig. 8, the backup database 30 may include: a processor 31 and a memory 32, wherein the processor 31 and the memory 32 may be in communication; illustratively, the processor 31 and the memory 32 communicate via a communication bus 33, the memory 32 being adapted to store program instructions, the processor 31 being adapted to call the program instructions in the memory to execute the data processing method according to any of the method embodiments described above.
Optionally, the backup database 30 may also include a communication interface, which may include a transmitter and/or a receiver.
Fig. 9 is a schematic diagram of a hardware structure of a service system provided in the present application. Referring to fig. 9, the service system 40 may include: a processor 41 and a memory 42, wherein the processor 41 and the memory 42 may be in communication; illustratively, the processor 41 and the memory 42 communicate via a communication bus 43, the memory 42 being configured to store program instructions, the processor 41 being configured to invoke the program instructions in the memory to perform the data processing method illustrated in any of the above-described method embodiments.
Optionally, business system 40 may also include a communication interface, which may include a transmitter and/or a receiver.
Optionally, the Processor may be a Central Processing Unit (CPU), or may be another general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in this application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in a processor.
An embodiment of the present application provides a data processing system, where the data processing system includes a standby database shown in fig. 8, a business system shown in fig. 9, and a primary database. Optionally, the primary database is configured to receive a data processing request sent by the standby database, and send a data synchronization request to the standby database.
An embodiment of the present application provides a readable storage medium, on which a computer program is stored; the computer program is for implementing a data processing method as described in any of the embodiments above.
An embodiment of the present application provides a computer program product, which includes instructions that, when executed, cause a computer to execute the above data processing method.
All or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The aforementioned program may be stored in a readable memory. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state disk, magnetic tape (magnetic tape), floppy disk (flexible disk), optical disk (optical disk), and any combination thereof.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable terminal device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable terminal equipment to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable terminal device to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the embodiments of the present application without departing from the spirit and scope of the application. Thus, if such 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 encompass such modifications and variations.
In this application, the terms "include," "includes," and variations thereof may refer to non-limiting inclusions; the term "or" and variations thereof may mean "and/or". The terms "first," "second," and the like in this application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. In the present application, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.

Claims (14)

1. A data processing method, comprising:
a standby database receives a data processing request sent by a service system, wherein the standby database and the service system are in the same available area;
the standby database sends the data processing request to a main database and receives a data synchronization request corresponding to the data processing request sent by the main database, and the standby database and the main database are in different available areas;
and the standby database updates the data according to the data synchronization request and sends a data processing end message to the service system.
2. The method of claim 1, wherein the backup database sending the data processing request to a primary database comprises:
the standby database acquires a request type of the data processing request, wherein the request type is a read operation type or a write operation type;
and the standby database sends a data processing request to the main database according to the request type.
3. The method of claim 2, wherein sending a data processing request to the master database based on the request type comprises:
when the request type is a read operation type, the standby database sends data corresponding to the data processing request to the service system;
and when the request type is a write operation type, the standby database sends the data processing request to the main database.
4. A method according to any of claims 1 to 3, wherein the data processing priority of the primary database is greater than the data processing priority of the backup database.
5. The method of any of claims 1-4, wherein prior to the backup database sending the data processing request to the primary database, the method further comprises:
and the standby database adds a request identifier in the data processing request.
6. A data processing method, comprising:
a service system receives a data processing request;
the business system acquires a first available area where a main database is located and a second available area where a standby database is located, wherein the first available area is different from the second available area;
and the service system sends the data processing request according to the first available area and the second available area, and receives a data processing request end message.
7. The method of claim 6, wherein the service system sending the data processing request according to the first available region and the second available region comprises:
acquiring a third available area where the service system is located;
if the first available area is the same as the third available area, the business system sends the data processing request to the master database;
and if the second available area is the same as the third available area, the service system sends the data processing request to the standby database.
8. The method of claim 7, wherein receiving the data processing request end message comprises:
if the first available area is the same as the third available area, the service system receives the data processing request end message sent by the master database;
and if the second available area is the same as the third available area, the service system receives the data processing request end message sent by the standby database.
9. A data processing apparatus, comprising a receiving module, a sending module and an updating module, wherein:
the receiving module is used for receiving a data processing request sent by a service system, and the standby database and the service system are in the same available area;
the transmitting module is used for transmitting the data processing request to a main database and receiving a data synchronization request corresponding to the data processing request transmitted by the main database, and the standby database and the main database are in different available areas;
and the updating module is used for updating the data according to the data synchronization request and sending a data processing end message to the service system.
10. A data processing apparatus, comprising a receiving module, an obtaining module and a sending module, wherein:
the receiving module is used for receiving a data processing request;
the acquisition module is used for acquiring a first available area where a main database is located and a second available area where a standby database is located, wherein the first available area is different from the second available area;
the sending module is configured to send the data processing request according to the first available region and the second available region, and receive a data processing request end message.
11. A backup database, comprising: a processor, a memory;
the memory stores computer-executable instructions;
the processor executing the computer-executable instructions stored by the memory causes the processor to perform the data processing method of any of claims 1-5.
12. A business system, comprising: a processor, storing;
the memory stores computer execution instructions;
the processor executing the computer-executable instructions stored by the memory causes the processor to perform the data processing method of any of claims 6-8.
13. A data processing system comprising the standby database of claim 11, the business system of claim 12, and a primary database, wherein,
the main database is used for receiving the data processing request sent by the standby database and sending a data synchronization request to the standby database.
14. A computer-readable storage medium having stored therein computer-executable instructions for implementing the data processing method of any one of claims 1-5, or the data processing method of any one of claims 6-8, when executed by a processor.
CN202210314943.6A 2022-03-28 2022-03-28 Data processing method and device, standby database and service system Pending CN114661743A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210314943.6A CN114661743A (en) 2022-03-28 2022-03-28 Data processing method and device, standby database and service system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210314943.6A CN114661743A (en) 2022-03-28 2022-03-28 Data processing method and device, standby database and service system

Publications (1)

Publication Number Publication Date
CN114661743A true CN114661743A (en) 2022-06-24

Family

ID=82032599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210314943.6A Pending CN114661743A (en) 2022-03-28 2022-03-28 Data processing method and device, standby database and service system

Country Status (1)

Country Link
CN (1) CN114661743A (en)

Similar Documents

Publication Publication Date Title
CN101595668B (en) Method and system for establishing a logical path between servers in a coordinated timing network
CN107153660B (en) Fault detection processing method and system for distributed database system
CN107181637B (en) Heartbeat information sending method and device and heartbeat sending node
US7860827B1 (en) Data synchronization method for an application database available on multiple wirelessly connected platforms
CN109862102B (en) Distributed data multi-copy concurrency control system, server and method
CN112579620A (en) Message queue-based distributed system data final consistency method
KR20140047230A (en) Method for optimizing distributed transaction in distributed system and distributed system with optimized distributed transaction
CN113010549A (en) Data processing method based on remote multi-active system, related equipment and storage medium
CN107025257B (en) Transaction processing method and device
CN111049886A (en) Multi-region SDN controller data synchronization method, server and system
CN112000444B (en) Database transaction processing method and device, storage medium and electronic equipment
JP4998010B2 (en) Database system management, database system, program and processing apparatus
CN112632093A (en) Work order processing method, device, system, storage medium and program product
CN114661743A (en) Data processing method and device, standby database and service system
CN111143040A (en) Transaction processing method, device, system and storage medium
CN113918654B (en) Block data submitting method and device
CN113342481B (en) Transaction state confirmation method and device
US20060123069A1 (en) Method and system for deferred synchronisation of data
CN101329670A (en) Method and system for keep consistency of data under copy database environment
JP2011002970A (en) Distributed data management system, data management device, data management method, and program
CN115082038A (en) System integration method and device and electronic equipment
CN109325057B (en) Middleware management method, device, computer equipment and storage medium
EP2980707A1 (en) Method for creating a database clone of a distributed database, system for creating a database clone of a distributed database, program and computer program product
US10331627B2 (en) Method and system for unified technological stack management for relational databases
CN113032477A (en) Long-distance data synchronization method and device based on GTID and computing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination