A data processing method, device and system
By implementing data processing methods in the database, determining the main cluster and backup cluster, and performing imperceptible switching in case of failure, the problem of long database failure recovery time is solved and the system response speed and availability are improved.
Patent Information
- Application Number
- CN202010778531.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-05
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2040-08-05
AI Technical Summary
When an existing commercial relational database Oracle fails in a database instance, cluster or node, it takes a certain amount of time to recover and switch, resulting in slower system response speed and affect service quality.
This paper proposes a data processing method that obtains the processing rules of transaction processing requests, determines the main cluster and backup cluster, queries the node status, and performs data operations in the main cluster or backup cluster to ensure imperceptible switching of nodes.
It realizes fast switching and response of database in case of failure, improves system availability and response speed, and reduces dependence on commercial databases.
Smart Images

Figure CN112000735B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular, relates to a data processing method, device and system. Background Art
[0002] The current commercial relational database Oracle usually uses a single cluster to deploy the database, or multiple clusters to deploy the database, but only one cluster can provide services to the outside world. When a database instance, cluster, or node fails, it takes a certain amount of time for a single cluster to recover, and a certain amount of time for a multi-cluster deployment to switch. This slows down the system's response speed and affects the service quality. Summary of the invention
[0003] In order to solve the problems of the prior art, the present invention proposes a data processing method, device and system. The method solves the defect that the existing commercial relational database Oracle cannot support distributed cluster deployment, improves the response time of the system, and further improves the availability of the system.
[0004] The specific technical solutions provided by the embodiments of the present invention are as follows:
[0005] In a first aspect, the present invention provides a data processing method, the method comprising:
[0006] When receiving a transaction processing request, obtaining a processing rule corresponding to the transaction processing request;
[0007] According to the processing rule, determining a primary cluster and a backup cluster;
[0008] Querying the main cluster for a status of a node corresponding to the transaction processing request;
[0009] When a node in the main cluster is available, performing a data operation corresponding to the transaction processing request on the node;
[0010] When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node;
[0011] The processing rules are used to limit the access order of the clusters.
[0012] Preferably, when the transaction processing request is a data write request, when a node in the primary cluster is available, performing a data operation corresponding to the transaction processing request on the node specifically includes:
[0013] When a node in the main cluster is available, synchronizing the changed data generated by the data write request to the corresponding node in the main cluster;
[0014] The method further comprises:
[0015] After the changed data is synchronized to the corresponding node in the primary cluster, the changed data is synchronized to the corresponding nodes in the remaining backup clusters, and the changed data is synchronized to the persistent database at the same time.
[0016] Preferably, the method further comprises:
[0017] When the change data fails to be synchronized on the corresponding node in any standby cluster, a failure log is generated;
[0018] The status of the corresponding node in the unsynchronized standby cluster is periodically queried, and when the corresponding node in the unsynchronized standby cluster is available, the changed data is synchronized to the corresponding node in the unsynchronized standby cluster according to the failure log.
[0019] Preferably, the method further comprises:
[0020] When the change data fails to be synchronized in the persistent database, a failure log is generated;
[0021] According to the preset timed task, the changed data is synchronized to the persistent database according to the failure log.
[0022] Preferably, the method further comprises:
[0023] When no node corresponding to the data write request can be found in the main cluster, the changed data generated by the data write request is synchronized to any available node in the main cluster.
[0024] Preferably, when the transaction processing request is a data write request, when a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node specifically includes:
[0025] When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and synchronizing the changed data generated by the data write request to the available node;
[0026] The method further comprises:
[0027] After the changed data is synchronized to the available nodes in the standby cluster, the status of the corresponding nodes in the remaining standby clusters that have not yet performed data synchronization is obtained;
[0028] When the corresponding nodes in the remaining standby clusters that have not performed data synchronization are available, the changed data are synchronized to the corresponding nodes in the remaining standby clusters that have not performed data synchronization, and the changed data are synchronized to the persistent database at the same time.
[0029] Preferably, the method further comprises:
[0030] Get the status of nodes in each cluster regularly;
[0031] When a node in the cluster fails, the state of the failed node is set to unavailable.
[0032] Preferably, the number of the primary cluster is one, and the number of the backup clusters is three.
[0033] In a second aspect, the present invention provides a data processing device, the device comprising:
[0034] An acquisition module, configured to acquire a processing rule corresponding to a transaction processing request when receiving the transaction processing request; and determine a primary cluster and a backup cluster according to the processing rule;
[0035] A query module, configured to query the status of a node corresponding to the transaction processing request in the main cluster;
[0036] an operation module, configured to perform a data operation corresponding to the transaction processing request on a node in the main cluster when the node is available;
[0037] When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node;
[0038] The processing rules are used to limit the access order of the clusters.
[0039] Preferably, when the transaction processing request is a data write request, the operation module specifically includes a first synchronization module, which is used to:
[0040] When a node in the main cluster is available, synchronizing the changed data generated by the data write request to the corresponding node in the main cluster;
[0041] The first synchronization module is also used for: after the changed data is synchronized to the corresponding node in the primary cluster, synchronizing the changed data to the corresponding nodes in the remaining backup clusters, and synchronizing the changed data to the persistent database at the same time.
[0042] Preferably, the device further comprises:
[0043] A first generating module, configured to generate a failure log when synchronization of the change data on a corresponding node in any standby cluster fails;
[0044] The first scheduled task module is used to periodically query the status of the corresponding nodes in the standby cluster that has not been successfully synchronized;
[0045] The first synchronization module is further configured to synchronize the changed data to the corresponding node in the unsynchronized standby cluster according to the failure log when the corresponding node in the unsynchronized standby cluster is available.
[0046] Preferably, the device further comprises:
[0047] A second generating module, configured to generate a failure log when synchronization of the change data in the persistent database fails;
[0048] The second scheduled task module is used to synchronize the changed data to the persistent database according to the failure log according to a preset scheduled task.
[0049] Preferably, the first synchronization module is further used for:
[0050] When no node corresponding to the data write request can be found in the main cluster, the changed data generated by the data write request is synchronized to any available node in the main cluster.
[0051] Preferably, when the transaction processing request is a data write request, the device further comprises a second synchronization module, configured to:
[0052] When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and synchronizing the changed data generated by the data write request to the available node;
[0053] The second synchronization module is further used for: after the changed data is synchronized to the available nodes in the standby cluster, obtaining the status of the corresponding nodes in the remaining standby clusters that have not performed data synchronization;
[0054] When the corresponding nodes in the remaining standby clusters that have not performed data synchronization are available, the changed data are synchronized to the corresponding nodes in the remaining standby clusters that have not performed data synchronization, and the changed data are synchronized to the persistent database at the same time.
[0055] Preferably, the device further comprises:
[0056] A third generating module, configured to generate a failure log when synchronization of the changed data fails on a corresponding node in any other standby cluster that has not performed data synchronization;
[0057] A third scheduled task module is used to periodically query the status of the corresponding node in the standby cluster that has not been successfully synchronized when the change data fails to be synchronized on the corresponding node in any other standby cluster that has not performed data synchronization;
[0058] The second synchronization module is further configured to synchronize the change data to the corresponding node in the standby cluster that has not been successfully synchronized according to the failure log when the corresponding node in the standby cluster that has not been successfully synchronized is available.
[0059] Preferably, the device further comprises:
[0060] The detection module is used to periodically obtain the status of nodes in each cluster;
[0061] When a node in the cluster fails, the state of the failed node is set to unavailable.
[0062] Preferably, the number of the primary cluster is one, and the number of the backup clusters is three.
[0063] In a third aspect, the present invention provides a computer system, comprising:
[0064] one or more processors; and
[0065] A memory associated with the one or more processors, the memory being used to store program instructions, wherein when the program instructions are read and executed by the one or more processors, the program instructions perform the following operations:
[0066] When receiving a transaction processing request, obtaining a processing rule corresponding to the transaction processing request;
[0067] According to the processing rule, determining a primary cluster and a backup cluster;
[0068] Querying the main cluster for a status of a node corresponding to the transaction processing request;
[0069] When a node in the main cluster is available, performing a data operation corresponding to the transaction processing request on the node;
[0070] When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node;
[0071] The processing rules are used to limit the access order of the clusters.
[0072] The embodiments of the present invention have the following beneficial effects:
[0073] This solution enables the commercial database Oracle to support distributed cluster deployment. When a database instance, any cluster, node, etc. fails, the node can be seamlessly switched to ensure that the system provides continuous and stable services to the outside world, and external access is not affected. At the same time, it improves the system's response speed, reduces transaction time, and uses autonomous and controllable technology to reduce dependence on the currently used commercial database Oracle. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0075] Figure 1 This is a schematic diagram of the system architecture of the solution provided in Example 1 of the present application;
[0076] Figure 2 is a flow chart of the data processing method provided in Example 1 of the present application;
[0077] Figure 3 , Figure 4 It is a schematic diagram of the application environment of the data processing method provided in Example 1 of the present application;
[0078] Figure 5 It is a structural diagram of the computer system provided in Example 3 of the present application. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0080] Embodiment 1
[0081] As described in the background technology, the commercial relational database Oracle adopts a single cluster to deploy the database or multiple clusters to deploy the database but only one cluster can provide services to the outside. Therefore, when the database instance, cluster, or node fails, the recovery time is slow, which affects the service quality of the system. Based on this, the present application provides a data processing method, so that the commercial database Oracle supports distributed cluster deployment. When the database instance, any cluster, node, etc. fails, the node can be switched imperceptibly, which improves the response speed of the system, thereby improving the availability of the system and ensuring that the system provides continuous and stable services to the outside.
[0082] like Figure 1 , which is a system architecture diagram of the application environment of the data processing method of the present application.
[0083] In this application, the system architecture is designed as four layers, including:
[0084] 1. Service interface layer: implements the conversion operations of interface technology protocols and message formats.
[0085] 2. Business logic layer: The business processing steps are composed of one or more memory data set operation objects according to the data processing flow.
[0086] 3. Data operation layer: The memory database operation function encapsulates the basic operations of the distributed memory database system. The connection management object implements distributed multi-node connection management. The index processing object implements batch query operations on memory data. The memory data set operation object encapsulates all methods of memory data set operations and can be directly generated by the tool.
[0087] 4. Data storage layer: implement system data storage, including memory data, persistent data, and logical operation log files.
[0088] In this solution, the data storage layer is improved in the following aspects:
[0089] The in-memory database is designed to be deployed in multiple clusters and multiple nodes.
[0090] Among them, each cluster node corresponds to a data synchronization process, which realizes memory data cluster synchronization and persistence operations, and has node monitoring, data backup and recovery functions, etc.
[0091] Based on the above system architecture, a data processing method is proposed, such as Figure 2 As shown, including:
[0092] S1. When a transaction processing request is received, a processing rule corresponding to the transaction processing request is obtained.
[0093] The transaction processing request includes a data write request and a data read request; the processing rule is used to limit the access order of the cluster. The processing rules corresponding to the transaction processing request include: a data write processing rule and a data read processing rule.
[0094] For example, if the current number of clusters is four (Cluster A, Cluster B, Cluster C, and Cluster D), the access order of the clusters defined by the data write processing rules is: Cluster A -> Cluster B -> Cluster C -> Cluster D, and the access order of the clusters defined by the data read processing rules is: Cluster C -> Cluster B -> Cluster A -> Cluster D.
[0095] S2. Determine the main cluster and the backup cluster according to the processing rules.
[0096] Among them, the cluster with the first access order is the primary cluster, and the cluster with the second access order is the backup cluster. Combining the above examples, it can be seen that the primary cluster defined by the data write processing rule is cluster A, and clusters B, C, and D are backup clusters; the primary cluster defined by the data read processing rule is cluster C, and clusters A, B, and D are backup clusters.
[0097] S3. Query the status of the node corresponding to the transaction processing request in the main cluster.
[0098] In this solution, a service (process) can be used to detect the status of nodes in each cluster. The specific method is as follows:
[0099] 1. Regularly obtain the status of nodes in each cluster;
[0100] 2. When a node in the cluster fails, set the status of the failed node to unavailable.
[0101] S4. When a node in the main cluster is available, perform data operations corresponding to the transaction processing request on the node.
[0102] When the transaction processing request is a data writing request, the above step S4 is specifically as follows:
[0103] When a node in the primary cluster is available, the changed data generated by the data write request is synchronized to the corresponding node in the primary cluster.
[0104] After the nodes of the main cluster are synchronized, the following steps are also included:
[0105] 1. After the changed data is synchronized to the corresponding node in the primary cluster, the changed data is synchronized to the corresponding nodes in the remaining backup clusters, and the changed data is synchronized to the persistent database at the same time;
[0106] In this solution, the persistent database is the commercial relational database Oracle.
[0107] 2. When the synchronization of the changed data on the corresponding node in any standby cluster fails, a first failure log is generated;
[0108] 3. Periodically query the status of the corresponding node in the standby cluster that has not been successfully synchronized. When the corresponding node in the standby cluster that has not been successfully synchronized is available, synchronize the changed data to the corresponding node in the standby cluster that has not been successfully synchronized according to the first failure log;
[0109] 4. When the change data fails to be synchronized in the persistent database, a second failure log is generated;
[0110] 5. According to the preset scheduled task, the changed data is synchronized to the persistent database according to the second failure log.
[0111] In addition, if no node corresponding to the data write request can be found in the main cluster, the solution may also include:
[0112] Synchronize the changed data to any available node in the main cluster.
[0113] When the transaction processing request is a data read request, the above step S4 is specifically as follows:
[0114] When a node in the primary cluster is available, data required by the data read request is read on a corresponding node in the primary cluster.
[0115] S5. When a node in the primary cluster is unavailable, the status of the corresponding node in the standby cluster is queried according to the processing rules until an available node is obtained, and data operations corresponding to the transaction processing request are performed on the available node.
[0116] If the transaction processing request is a data write request, the data write processing rule corresponding to the data write request defines that the main cluster is cluster A, and clusters B, C, and D are standby clusters, then the above step S5 is specifically as follows:
[0117] When a node in cluster A is unavailable, the status of the corresponding node in cluster B is queried according to the data writing rules. If the corresponding node in cluster B is available, the changed data generated by the data write request is synchronized to the corresponding node in cluster B. If the corresponding node in cluster B is unavailable, the available nodes in other clusters are queried according to the writing rules, and the changed data generated by the data write request is synchronized to the available nodes.
[0118] After completing the above steps, this solution also includes:
[0119] 1. After the changed data is synchronized to the available nodes in the standby cluster, obtain the status of the corresponding nodes in the remaining standby clusters that have not yet synchronized data;
[0120] 2. When the corresponding nodes in the remaining standby clusters that have not yet performed data synchronization are available, the changed data is synchronized to the corresponding nodes in the remaining standby clusters that have not yet performed data synchronization, and the changed data is synchronized to the persistent database at the same time;
[0121] 3. When the changed data fails to be synchronized on the corresponding node in any other standby cluster that has not performed data synchronization, a third failure log is generated;
[0122] 4. Regularly query the status of the corresponding node in the standby cluster that has not been successfully synchronized. When the corresponding node in the standby cluster that has not been successfully synchronized is available, synchronize the changed data to the corresponding node in the standby cluster that has not been successfully synchronized according to the third failure log;
[0123] 5. When the change data fails to be synchronized in the persistent database, a fourth failure log is generated;
[0124] 6. According to the preset scheduled task, the changed data is synchronized to the persistent database according to the fourth failure log.
[0125] In addition, when the transaction processing request is a data read request, the above step S5 is specifically as follows:
[0126] When a node in the main cluster is unavailable, the status of the corresponding node is queried in the standby cluster according to the processing rule until an available node is obtained, and the data required for the data read request is read on the available node.
[0127] The method can be applied to a system such as Figure 3 , 4 As shown, there are two centers deployed in the system, namely: production center and disaster recovery center. Each center has two clusters, the main cluster and the secondary cluster, and each cluster has N nodes.
[0128] After using the data processing method provided by this solution, the current system can implement the data write operation by accessing the node 2 of the main cluster of the disaster recovery center -> the node 2 of the secondary cluster of the disaster recovery center -> the node 2 of the main cluster of the production center -> the node 2 of the secondary cluster of the production center (1'->2'->3'->4'). In addition, the data read operation can also be implemented by accessing the node 1 of the main cluster of the production center -> the node 1 of the secondary cluster of the production center (1->2).
[0129] In this way, the current system can achieve the situation where the faulty memory database node is switched to the corresponding cluster node of the backup database without perception in the event of failure at any level such as the memory database instance, cluster, and center, thus ensuring that the system provides continuous and stable services to the outside world.
[0130] Embodiment 2
[0131] Corresponding to the first embodiment, the present application further provides a data processing device, including:
[0132] An acquisition module, configured to acquire a processing rule corresponding to a transaction processing request when receiving the transaction processing request; and determine a primary cluster and a backup cluster according to the processing rule;
[0133] A query module, used to query the status of the node corresponding to the transaction processing request in the main cluster;
[0134] An operation module, used for performing data operations corresponding to the transaction processing request on the nodes when the nodes in the main cluster are available;
[0135] When a node in the main cluster is unavailable, the status of the corresponding node in the standby cluster is queried according to the processing rules until an available node is obtained, and data operations corresponding to the transaction processing request are performed on the available node;
[0136] The above processing rules are used to limit the access order of the cluster.
[0137] Preferably, when the transaction processing request is a data write request, the operation module specifically includes a first synchronization module, which is used to:
[0138] When a node in the main cluster is available, the changed data generated by the data write request is synchronized to the corresponding node in the main cluster;
[0139] The first synchronization module is also used for: after the changed data is synchronized to the corresponding node in the primary cluster, synchronizing the changed data to the corresponding nodes in the remaining backup clusters, and synchronizing the changed data to the persistent database at the same time.
[0140] Preferably, the above device further comprises:
[0141] A first generating module, used for generating a failure log when synchronization of the changed data on the corresponding node in any standby cluster fails;
[0142] The first scheduled task module is used to periodically query the status of the corresponding nodes in the standby cluster that has not been successfully synchronized;
[0143] The first synchronization module is further configured to synchronize the changed data to the corresponding node in the unsynchronized standby cluster according to the failure log when the corresponding node in the unsynchronized standby cluster is available.
[0144] Preferably, the above device further comprises:
[0145] The second generation module is used to generate a failure log when the change data fails to be synchronized in the persistent database;
[0146] The second scheduled task module is used to synchronize the changed data to the persistent database according to the failure log according to the preset scheduled task.
[0147] Preferably, the first synchronization module is further used for:
[0148] When no node corresponding to the data write request can be found in the main cluster, the changed data is synchronized to any available node in the main cluster.
[0149] Preferably, when the transaction processing request is a data write request, the apparatus further comprises a second synchronization module, which is used to:
[0150] When a node in the primary cluster is unavailable, the status of the corresponding node in the standby cluster is queried according to the processing rules until an available node is obtained, and the changed data generated by the data write request is synchronized to the available node;
[0151] The second synchronization module is further used to: after the changed data is synchronized to the available nodes in the standby cluster, obtain the status of the corresponding nodes in the remaining standby clusters that have not yet performed data synchronization;
[0152] When the corresponding nodes in the remaining standby clusters that have not yet performed data synchronization are available, the changed data is synchronized to the corresponding nodes in the remaining standby clusters that have not yet performed data synchronization, and the changed data is synchronized to the persistent database at the same time.
[0153] Preferably, the above device further comprises:
[0154] A third generating module is used to generate a failure log when the synchronization of the changed data fails on the corresponding node in any other standby cluster that has not performed data synchronization;
[0155] The third scheduled task module is used to query the status of the corresponding node in the standby cluster that has not been successfully synchronized when the changed data fails to be synchronized on the corresponding node in any other standby cluster that has not been synchronized;
[0156] The second synchronization module is further configured to synchronize the changed data to the corresponding node in the unsynchronized standby cluster according to the failure log when the corresponding node in the unsynchronized standby cluster is available.
[0157] Preferably, the above device further comprises:
[0158] The detection module is used to periodically obtain the status of nodes in each cluster;
[0159] When a node in the cluster fails, the state of the failed node is set to unavailable.
[0160] Preferably, the number of the main clusters is one, and the number of the standby clusters is three.
[0161] Embodiment 3
[0162] The present application also provides a computer system, comprising:
[0163] one or more processors; and
[0164] A memory associated with the one or more processors, the memory being used to store program instructions, wherein when the program instructions are read and executed by the one or more processors, the program instructions perform the following operations:
[0165] When receiving a transaction processing request, obtaining a processing rule corresponding to the transaction processing request;
[0166] According to the processing rules, determine the main cluster and the backup cluster;
[0167] Query the status of the node corresponding to the transaction processing request in the main cluster;
[0168] When a node in the main cluster is available, data operations corresponding to the transaction processing request are performed on the node;
[0169] When a node in the main cluster is unavailable, the status of the corresponding node in the standby cluster is queried according to the processing rules until an available node is obtained, and data operations corresponding to the transaction processing request are performed on the available node;
[0170] The above processing rules are used to limit the access order of the cluster.
[0171] in, Figure 5 The computer system architecture is shown as an example, which may include a processor 32, a video display adapter 34, a disk drive 36, an input / output interface 38, a network interface 310, and a memory 312. The processor 32, the video display adapter 34, the disk drive 36, the input / output interface 38, the network interface 310, and the memory 312 may be communicatively connected via a communication bus 314.
[0172] Among them, the processor 32 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided in this application.
[0173] The memory 312 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 312 can store an operating system 316 for controlling the operation of the computer system 30 and a basic input and output system (BIOS) 318 for controlling the low-level operation of the computer system. In addition, a web browser 320, a data storage management system 322, etc. can also be stored. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 312 and is called and executed by the processor 32.
[0174] The input / output interface 38 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0175] The network interface 310 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0176] The communication bus 314 comprises a pathway for transmitting information between the various components of the device (eg, the processor 32, the video display adapter 34, the disk drive 36, the input / output interface 38, the network interface 310, and the memory 312).
[0177] In addition, the computer system can also obtain information on specific collection conditions from the virtual resource object collection condition information database for use in condition judgment, etc.
[0178] It should be noted that although the above device only shows a processor 32, a video display adapter 34, a disk drive 36, an input / output interface 38, a network interface 310, a memory 312, a communication bus 314, etc., during the specific implementation process, the device may also include other components necessary to achieve normal operation.
[0179] It can be seen from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a cloud service end, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0180] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention. In addition, the computer system, data processing device and data processing method provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0181] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A data processing method, characterized in that: The method further comprises: When receiving a transaction processing request, obtaining a processing rule corresponding to the transaction processing request; Determine a primary cluster and a backup cluster according to the processing rule; Querying the main cluster for a status of a node corresponding to the transaction processing request; When a node in the main cluster is available, performing a data operation corresponding to the transaction processing request on the node; When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node; Wherein, the processing rule is used to limit the access order of the cluster; When the transaction processing request is a data write request, when a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node specifically includes: When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and synchronizing the changed data generated by the data write request to the available node; The method further comprises: After the changed data is synchronized to the available nodes in the standby cluster, the status of the corresponding nodes in the remaining standby clusters that have not yet performed data synchronization is obtained; When the corresponding nodes in the remaining standby clusters that have not performed data synchronization are available, the changed data are synchronized to the corresponding nodes in the remaining standby clusters that have not performed data synchronization, and the changed data are synchronized to the persistent database at the same time.
2. The method according to claim 1, characterized in that When the transaction processing request is a data write request, when a node in the primary cluster is available, performing a data operation corresponding to the transaction processing request on the node specifically includes: When a node in the main cluster is available, synchronizing the changed data generated by the data write request to the corresponding node in the main cluster; The method further comprises: After the changed data is synchronized to the corresponding node in the primary cluster, the changed data is synchronized to the corresponding nodes in the remaining backup clusters, and the changed data is synchronized to the persistent database at the same time.
3. The method according to claim 2, characterized in that The method further comprises: When the change data fails to be synchronized on the corresponding node in any standby cluster, a failure log is generated; The status of the corresponding node in the unsynchronized standby cluster is periodically queried, and when the corresponding node in the unsynchronized standby cluster is available, the changed data is synchronized to the corresponding node in the unsynchronized standby cluster according to the failure log.
4. The method according to claim 2, characterized in that: The method further comprises: When the change data fails to be synchronized in the persistent database, a failure log is generated; According to the preset timed task, the changed data is synchronized to the persistent database according to the failure log.
5. The method according to claim 2, characterized in that: The method further comprises: When no node corresponding to the data write request can be found in the main cluster, the changed data generated by the data write request is synchronized to any available node in the main cluster.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Get the status of nodes in each cluster regularly; When a node in the cluster fails, the state of the failed node is set to unavailable.
7. The method according to any one of claims 1 to 5, characterized in that: The number of the primary cluster is one, and the number of the backup clusters is three.
8. A data processing device, characterized in that: The device comprises: An acquisition module, configured to acquire a processing rule corresponding to a transaction processing request when receiving the transaction processing request; and determine a primary cluster and a backup cluster according to the processing rule; A query module, configured to query the status of a node corresponding to the transaction processing request in the main cluster; an operation module, configured to perform a data operation corresponding to the transaction processing request on a node in the main cluster when the node is available; When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node; The processing rules are used to limit the access order of the clusters.
9. A computer system, characterized in that: include: one or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions, wherein when the program instructions are read and executed by the one or more processors, the program instructions perform the following operations: When receiving a transaction processing request, obtaining a processing rule corresponding to the transaction processing request; Determine a primary cluster and a backup cluster according to the processing rule; Querying the main cluster for a status of a node corresponding to the transaction processing request; When a node in the main cluster is available, performing a data operation corresponding to the transaction processing request on the node; When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node; Wherein, the processing rule is used to limit the access order of the cluster; When the transaction processing request is a data write request, when a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and performing a data operation corresponding to the transaction processing request on the available node specifically includes: When a node in the primary cluster is unavailable, querying the status of the corresponding node in the standby cluster according to the processing rule until an available node is obtained, and synchronizing the changed data generated by the data write request to the available node; After the changed data is synchronized to the available nodes in the standby cluster, the status of the corresponding nodes in the remaining standby clusters that have not yet performed data synchronization is obtained; When the corresponding nodes in the remaining standby clusters that have not performed data synchronization are available, the changed data are synchronized to the corresponding nodes in the remaining standby clusters that have not performed data synchronization, and the changed data are synchronized to the persistent database at the same time.
Citation Information
Patent Citations
High available system and method for data writing
CN105871987A
Inter-cluster data backup method, device and system
CN108123976A