Application data read-write separation method, device, computer equipment and storage medium

Through the synchronization mechanism of distributed message middleware between the master cluster and the slave cluster, a global message sequence is generated for data synchronization, which solves the problem of low reading and writing efficiency in traditional technology, realizes fast reading and writing of application data, and avoids multiple network transmission.

CN113535430BActive Publication Date: 2024-09-13ARCHFORCE FINANCIAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110806768.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-16
Publication Date
2024-09-13
Estimated Expiration
2041-07-16

AI Technical Summary

Technical Problem

In traditional application data reading and writing separation technology, the reading and writing process involves multiple file operations and network transmission, resulting in low efficiency, especially in the case of multiple database backup nodes.

Method used

Distributed message middleware is used to receive and process data requests. Through the synchronization mechanism between the master cluster and the slave cluster, a global message sequence is generated for data synchronization, avoiding the direct use of the database for read and write operations, and achieving fast reading of application data in memory. Write.

Benefits of technology

It improves the reading and writing efficiency of application data, reduces the number of network transmissions, and improves the speed and reliability of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535430B
    Figure CN113535430B
Patent Text Reader

Abstract

This application relates to an application data read / write separation method, apparatus, computer device, and storage medium. The method includes: a master cluster receiving a write request for external data through a distributed message middleware, and synchronously sending the external data to an application according to the write request; the application performing corresponding data processing based on the external data to obtain the target write data; and a slave cluster receiving a query request from a data requesting end through the distributed message middleware, reading the external data according to the query request, obtaining the corresponding query result, and sending the query result to the data requesting end through the distributed message middleware. This method can improve application data read / write efficiency to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of application data processing, and in particular to a method, device, computer equipment and storage medium for separating application data reading and writing. Background Art

[0002] With the development of application data processing, in order to prevent application data from being constrained by each other during the reading and writing processes, the application data read-write separation technology has emerged.

[0003] In traditional technology, the read-write separation function of the application is realized with the help of the master-slave replication function of the database. The application writes data to the master database through SQL. After the slave database synchronizes the SQL record file executed by the master database, it executes SQL locally again in the same order and writes the data again to the slave database for application query.

[0004] However, in traditional methods, the entire process involves multiple file read and write operations, and the synchronization cycle is long. When there are multiple database backup nodes, multiple network transmissions are required, which reduces the efficiency of application data reading and writing to a certain extent. Summary of the invention

[0005] Based on this, it is necessary to provide an application data read-write separation method, device, computer equipment and storage medium that can improve the application data read-write efficiency in response to the above technical problems.

[0006] A method for separating application data from reading and writing, the method comprising:

[0007] The main cluster receives a write request for external data through the distributed message middleware, and synchronously sends the external data to the application according to the write request; the application is used to perform corresponding data processing according to the external data to obtain the target write data;

[0008] The slave cluster receives a query request sent by a data request end through a distributed message middleware, reads the external data according to the query request, obtains a corresponding query result, and sends the query result to the data request end through the distributed message middleware.

[0009] In one embodiment, the master cluster includes a first master node, and the slave cluster includes at least one first slave node; the first master node and the first slave node are process instances running on each server;

[0010] When the first master node receives the external data, the first master node generates a global message sequence according to the external data;

[0011] According to the global message sequence, the first master node synchronizes the external data to the first slave node of each slave cluster.

[0012] In one embodiment, the main cluster further includes at least two first standby nodes, the first main node and each of the first standby nodes use the same software program, and when the first main node receives the external data, the first main node generates a global message sequence according to the external data, further comprising:

[0013] According to the global message sequence, the first master node synchronizes the external data to each of the first backup nodes.

[0014] In one embodiment, the method further comprises:

[0015] When an abnormal connection between the first master node and the first slave node is detected, any one of the first backup nodes is used as a backup master node;

[0016] The standby master node is communicatively connected to the first slave node.

[0017] In one embodiment, synchronously sending the external data to the application according to the write request includes:

[0018] According to the write request, in accordance with the order in which the main cluster receives the external data, the external data received by each main cluster are sequentially and incrementally numbered to obtain external data with numbers;

[0019] Through the message confirmation mechanism, each of the numbered external data is synchronously delivered to the application in the order of the numbers.

[0020] In one embodiment, taking any first standby node as a standby master node includes:

[0021] The name sequence of each of the first backup nodes is obtained, and the first backup node whose name sequence is closest to the name sequence of the first primary node is used as the backup primary node.

[0022] An application data read-write separation device, the device comprising:

[0023] The target write data acquisition module is used for the main cluster to receive a write request for external data through the distributed message middleware, and synchronously send the external data to the application according to the write request; the application is used to perform corresponding data processing according to the external data to obtain the target write data;

[0024] The query result reading module is used to receive the query request sent by the data request end from the cluster through the distributed message middleware, read the external data according to the query request, obtain the corresponding query result, and send the query result to the data request end through the distributed message middleware.

[0025] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0026] The main cluster receives a write request for external data through the distributed message middleware, and synchronously sends the external data to the application according to the write request; the application is used to perform corresponding data processing according to the external data to obtain the target write data;

[0027] The slave cluster receives a query request sent by a data request end through a distributed message middleware, reads the external data according to the query request, obtains a corresponding query result, and sends the query result to the data request end through the distributed message middleware.

[0028] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0029] The main cluster receives a write request for external data through the distributed message middleware, and synchronously sends the external data to the application according to the write request; the application is used to perform corresponding data processing according to the external data to obtain the target write data;

[0030] The slave cluster receives a query request sent by a data request end through a distributed message middleware, reads the external data according to the query request, obtains a corresponding query result, and sends the query result to the data request end through the distributed message middleware.

[0031] The above-mentioned application data read-write separation method, device, computer equipment and storage medium, the "write" process is mainly that the main cluster receives external data through the distributed message middleware and sends the external data to the application synchronously. The application performs corresponding data processing according to the content of the external data to obtain the target write data. The application gives the target write data to the data receiving end. The "read" process is mainly that the system obtains the query message sent by the data request end; the slave cluster receives the query message through the distributed message middleware, and reads the target write data according to the query message, obtains the corresponding query result from the target write data, and finally outputs the query result to the data request end through the distributed message middleware. In the whole process, both "read" and "write" are calculated in the memory of the application, and the database is not used, and the synchronization of the master and slave clusters can be completed without the help of the database. Rapid reading / writing of application data can be achieved without multiple network transmissions. Therefore, the present application can improve the efficiency of application data reading and writing to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 An application environment diagram of a data read-write separation method in one embodiment;

[0033] Figure 2 A schematic diagram of a flow chart of a method for applying data read-write separation in one embodiment;

[0034] Figure 3 A structural block diagram of a data read-write separation device applied in an embodiment;

[0035] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0037] The application data read-write separation method provided in this application can be applied to Figure 1In the application environment shown. It includes a data sending end 102, a master-slave cluster 104 and a data request end 106. The data sending end 102 sends external data and write requests to the master-slave cluster 104, and the data request end 106 obtains the query results through the master-slave cluster 102. Among them, a group of related master-slave clusters 104 includes a unique master cluster and multiple slave clusters. The master-slave set 104 group includes multiple nodes, which are deployed on multiple servers through the nodes and are interconnected through the network. Among them, the node is a process instance running on the server; the division of the master-slave cluster 104 is artificially defined, and the program developer defines the cluster to which each node belongs and writes it into the configuration file of the program.

[0038] In one embodiment, Figure 2 As shown, a method for separating application data reading and writing is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0039] Step 202: The main cluster receives a write request for external data through the distributed messaging middleware, and synchronously sends the external data to the application according to the write request; the application is used to perform corresponding data processing according to the external data to obtain the target write data.

[0040] Among them, distributed message middleware refers to AMI (Archforce Message Interconnection), which is a distributed message middleware. The application is an application on the same carrier as AMI. AMI is an infrastructure between the upper-level application and the operating system.

[0041] Specifically, when external data is written, the main cluster first obtains the write request of the external data through the distributed message middleware. When the main cluster obtains the write request, it will synchronously send the external data to the upper-layer application where the distributed message middleware is located according to the write request. The upper-layer application processes the received external data, such as mathematical operations and logical processing, and analyzes the large amount of input external data to obtain the required target write data. For example, in the stock trading of the financial industry, a large amount of input external data is the number of stocks purchased by each user, risk type, number of shares, stock name, risk type, etc. The target write data is what type of risk stocks male users aged 20-30 tend to buy. After the target write data is obtained through data processing, the application will display the target write data to the user through the display interface.

[0042] Step 204, receiving the query request sent by the data request end from the cluster through the distributed messaging middleware, reading the external data according to the query request, obtaining the corresponding query result, and sending the query result to the data request end through the distributed messaging middleware.

[0043] The data request end is the user of the application. The user sends a query request to the slave cluster through the distributed message middleware. The query request includes inputting keywords such as query object and content, and can also be semantic fuzzy search or voice intelligent search. When the number of query requests is large, multiple slave clusters can be deployed to meet different query requests at the same time.

[0044] Specifically, when the main cluster obtains external data, it will be synchronized to the slave cluster. The slave cluster receives the query request sent by the data request end through the distributed message middleware. According to the query request, the slave cluster reads the external data and obtains the corresponding query result. In this query reading process, the slave cluster will only read the external data obtained by the main cluster, and will not process the external data, and will not make substantial changes to the external data. The data contained in the query result is the data extracted from the external data. For example, when the query request is "20-30 years old", "male", "stock risk preference", the corresponding query result is the statistical data of the stock risk preference of men between 20 and 30 years old.

[0045] After obtaining the corresponding query results from the cluster, the query results are sent to the data request end through the distributed messaging middleware.

[0046] In the above-mentioned application data read-write separation method, the "write" process is mainly that the main cluster receives external data through the distributed message middleware and sends the external data to the application synchronously. The application performs corresponding data processing according to the content of the external data to obtain the target write data. The application gives the target write data to the data receiving end. The "read" process is mainly that the system obtains the query message sent by the data request end; the slave cluster receives the query message through the distributed message middleware, and reads the target write data according to the query message, obtains the corresponding query result from the target write data, and finally outputs the query result to the data request end through the distributed message middleware. In the whole process, both "read" and "write" are calculated in the memory of the application without using the database, and the synchronization of the master and slave clusters can be completed without the help of the database. Rapid reading / writing of application data can be achieved without multiple network transmissions. Therefore, this application can improve the efficiency of application data reading and writing to a certain extent.

[0047] In one embodiment, the master cluster includes a first master node, and the slave cluster includes at least one first slave node; the first master node and the first slave node are process instances running on each server; the application data read-write separation method includes:

[0048] When the first master node receives the external data, the first master node generates a global message sequence according to the external data; according to the global message sequence, the first master node synchronizes the external data to the first slave node of each slave cluster.

[0049] The nodes include master nodes and standby nodes, both of which are process instances running on the server. In the master cluster, there is usually a first master node. In the slave cluster, there is usually at least one slave node, which can be a master node or a standby node. Relative to the master cluster, the slave cluster is just one or more nodes connected to the master cluster. For the sake of name uniformity, it is called a slave cluster.

[0050] In the master cluster, the master node (i.e., the first master node) is used to receive input external data and generate output externally. In the slave cluster, the slave node can be a master node or a standby node. If the slave node includes a master node and multiple standby nodes, the master node in the slave cluster outputs query results externally, and the standby node receives external data from the master cluster.

[0051] Specifically, when the first master node of the master cluster receives external data, it will generate a global message sequence based on the external data. The global message sequence is the order in which the master cluster receives each external data. The global message sequence is the basis for the master cluster to synchronize external data to each standby node in the master cluster, and it is also the basis for the master cluster to synchronize external data to each slave node in the slave cluster.

[0052] In this embodiment, the first master node generates a global message sequence based on external data, so that the external data can be synchronized to each slave cluster according to the changed global message sequence, so that the external data received by the slave cluster and the external data received by the master cluster are consistent in order, thereby preventing data omission and misalignment.

[0053] In one embodiment, the master cluster further includes at least two first standby nodes, the first master node and each of the first standby nodes use the same software program, and when the first master node receives the external data, the first master node generates a global message sequence according to the external data, further including:

[0054] According to the global message sequence, the first master node synchronizes the external data to each of the first backup nodes.

[0055] The main cluster includes a main node and multiple first standby nodes. The role of the standby node is to back up the external data obtained by the first main node and keep the data consistent with the main cluster, so that when an unrecoverable failure occurs in the first main node, other first standby nodes in the main cluster can replace the first main node to continue working, and there will be no fault in the data. In order to enable the first standby node to switch freely and back up the external data in the main cluster when an unrecoverable accident occurs in the first main node, the first main node and the first standby node use the same software program.

[0056] Specifically, when the first master node generates a global message sequence, the first master node synchronizes external data to the application according to the global message sequence, and also synchronizes the external data to each first backup node according to the global message sequence, so that each first backup node backs up the external data in the first master node in real time.

[0057] In this embodiment, a global message sequence is generated by the first master node, and the first master node synchronizes external data to each first backup node, so that each first backup node obtains a backup of the external data in the first master node. When the first master node cannot work due to a failure, the first master node can be replaced at any time to ensure the consistency and continuity of the overall service status.

[0058] In one embodiment, the application data read-write separation method further includes:

[0059] When an abnormal connection between the first master node and the first slave node is detected, any one of the first backup nodes is used as a backup master node;

[0060] The standby master node is communicatively connected to the first slave node.

[0061] Wherein, under normal circumstances, the first master node and the first slave node are connected normally, and the detection result obtained during the detection is that the connection is normal, then the step of using the first backup node as the backup master node will not be executed. When the connection between the first master node and the first slave node is abnormal, the factors that usually cause the abnormal connection may be: the network between the master and slave clusters is interrupted due to natural geological disasters, power outages, etc., and it is manually determined that it cannot be restored in a short time.

[0062] Specifically, when an abnormal connection is detected between the first master node and the first slave node, since it is difficult to recover in a short time, one of the multiple backup nodes will be used as a backup master node, and the backup master node and the first slave node will be communicated with each other, so that the communication between the main cluster and the slave cluster becomes: the backup master node and the first slave node.

[0063] In this embodiment, when an abnormal connection between the first master node and the first slave node is detected, any one of the first backup nodes is used as a backup master node, so that the backup master node replaces the original first master node and communicates with the first slave node of the slave cluster, so that the communication connection between the slave cluster and the master cluster will not be paralyzed due to the failure of the first master node.

[0064] In one embodiment, synchronously sending the external data to the application according to the write request includes:

[0065] According to the write request, in accordance with the order in which the main cluster receives the external data, the external data received by each main cluster are sequentially and incrementally numbered to obtain external data with numbers;

[0066] Through the message confirmation mechanism, each of the numbered external data is synchronously delivered to the application in the order of the numbers.

[0067] The write request is used as a signal to remind the main cluster that external data is about to be written. The receiving order is the order in which the main cluster receives external data.

[0068] Specifically, when the main cluster receives external data, it will perform continuous and incremental numbering on the external data. The numbering may be performed in increments of Arabic numerals, for example, the first external data obtained is recorded as "1", the second external data obtained is recorded as "2", etc. The continuous and incremental numbering may also be a combination of English letters and Arabic numerals, such as "a1", "a2"... or "A11", "A12", etc. After the main cluster performs continuous and incremental numbering on the external data, each external data with a number is obtained.

[0069] The message confirmation mechanism is set to prevent message loss. In this application, the ACK confirmation mechanism is adopted to enable each slave cluster to completely receive the data from the master cluster, that is, the numbered external data.

[0070] In this embodiment, the main cluster arranges each external data in the order of numbers and uses a message confirmation mechanism to enable each numbered external data to be sent to the application synchronously and completely in the order of numbers, so that the data integrity is maintained during the sending process.

[0071] In one embodiment, any first standby node is used as a standby master node, including:

[0072] The name sequence of each of the first backup nodes is obtained, and the first backup node whose name sequence is closest to the name sequence of the first primary node is used as the backup primary node.

[0073] The name sequence is the sequence of the names of the standby nodes, for example, standby node 1, standby node 2, and so on.

[0074] Specifically, when the first master node fails, the active first standby node will be re-elected, and the arbitration service node of the distributed message middleware will decide which first standby node will become the new first master node. The first standby nodes are elected by default in the order of node names. The priority can be configured to specify the first standby node to be elected first. When multiple standby nodes survive, the standby node with a higher priority will be selected as the standby master node.

[0075] In this embodiment, by selecting the first backup node whose name order is closest to the name order of the first master node, when a similar failure occurs again or even multiple times, the first backup node historically selected as the backup master node can be excluded, thereby narrowing the search scope and improving the accuracy.

[0076] It should be understood that, although the steps in each flow chart involved in the above-described embodiment are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in each flow chart involved in the above-described embodiment may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

[0077] In one embodiment, Figure 3 As shown, a device for separating application data from read-write is provided, comprising: a target write data acquisition module 301, a query result reading module 302, wherein:

[0078] The target write data acquisition module 301 is used for the main cluster to receive a write request for external data through the distributed message middleware, and synchronously send the external data to the application according to the write request; the application is used to perform corresponding data processing according to the external data to obtain the target write data;

[0079] The query result reading module 302 is used to receive the query request sent by the data request end from the cluster through the distributed message middleware, read the external data according to the query request, obtain the corresponding query result, and send the query result to the data request end through the distributed message middleware.

[0080] In one embodiment, the application data read-write separation device further includes: a global message sequence generation module and a slave cluster synchronization module, wherein:

[0081] A global message sequence generating module, configured to generate a global message sequence according to the external data when the first master node receives the external data;

[0082] The slave cluster synchronization module is used to synchronize the external data to the first slave node of each slave cluster by the first master node according to the global message sequence.

[0083] In one embodiment, the application data read-write separation device is further used to synchronize the external data to each of the first backup nodes by the first master node according to the global message sequence.

[0084] In one embodiment, the application data read-write separation device further includes: a connection anomaly detection module and a communication connection module, wherein:

[0085] a connection anomaly detection module, configured to, when detecting an abnormal connection between the first master node and the first slave node, use any one of the first backup nodes as a backup master node;

[0086] The communication connection module is used for communication connection between the standby master node and the first slave node.

[0087] In one embodiment, the target write data acquisition module further includes:

[0088] An external data acquisition module is used to sequentially and incrementally number the external data received by each main cluster according to the write request and the order in which the main cluster receives the external data, so as to obtain the external data with numbers;

[0089] The external data delivery module is used to deliver the numbered external data to the application synchronously in the order of the numbers through a message confirmation mechanism.

[0090] In one embodiment, the connection anomaly detection module is further used to obtain the name sequence of each of the first backup nodes, and use the first backup node whose name sequence is closest to the name sequence of the first master node as the backup master node.

[0091] For the specific definition of the application data read-write separation device, please refer to the definition of the application data read-write separation method above, which will not be repeated here. Each module in the above-mentioned application data read-write separation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0092] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data and reliably transmit data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for reliable data transmission is implemented.

[0093] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0094] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0095] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0096] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0097] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0098] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for separating application data reading and writing, It is characterized in that The method comprises: The main cluster receives a write request for external data through the distributed message middleware, and synchronously sends the external data to the application according to the write request; the application is used to perform corresponding data processing according to the external data to obtain the target write data; The slave cluster receives the query request sent by the data request end through the distributed messaging middleware, reads the external data according to the query request, obtains the corresponding query result, and sends the query result to the data request end through the distributed messaging middleware, wherein the data request end is a user using the application, and the master cluster synchronizes to the slave cluster when obtaining the external data.

2. The application data read-write separation method according to claim 1, It is characterized in that The master cluster includes a first master node, and the slave cluster includes at least one first slave node; The first master node and the first slave node are process instances running on respective servers; the method further includes: When the first master node receives the external data, the first master node generates a global message sequence according to the external data; According to the global message sequence, the first master node synchronizes the external data to the first slave node of each slave cluster.

3. The application data read-write separation method according to claim 2, It is characterized in that The master cluster further includes at least two first standby nodes, the first master node and each of the first standby nodes use the same software program, and when the first master node receives the external data, the first master node generates a global message sequence according to the external data, further including: According to the global message sequence, the first master node synchronizes the external data to each of the first backup nodes.

4. The application data read-write separation method according to claim 3, It is characterized in that The method further comprises: When an abnormal connection between the first master node and the first slave node is detected, any one of the first backup nodes is used as a backup master node; The standby master node is communicatively connected to the first slave node.

5. The application data read-write separation method according to claim 1, It is characterized in that Synchronously sending the external data to the application according to the write request includes: According to the write request, in accordance with the order in which the main cluster receives the external data, the external data received by each main cluster are sequentially and incrementally numbered to obtain external data with numbers; Through the message confirmation mechanism, each of the numbered external data is synchronously delivered to the application in the order of the numbers.

6. The application data read-write separation method according to claim 4, It is characterized in that Use any first standby node as a standby master node, including: The name sequence of each of the first backup nodes is obtained, and the first backup node whose name sequence is closest to the name sequence of the first primary node is used as the backup primary node.

7. An application data read-write separation device, It is characterized in that The device comprises: The target write data acquisition module is used for the main cluster to receive write requests for external data through the distributed message middleware, and synchronously send the external data to the application according to the write request; the application is used to perform corresponding data processing according to the external data to obtain the target write data; A query result reading module is used to receive a query request sent by a data request end from a cluster through a distributed messaging middleware, and read the external data according to the query request to obtain a corresponding query result, and send the query result to the data request end through the distributed messaging middleware, wherein the data request end is a user using the application, and the master cluster synchronizes to the slave cluster when obtaining the external data.

8. The application data read-write separation device according to claim 7, It is characterized in that The query result acquisition module also includes: A message sequence acquisition module, configured to generate a global message sequence according to the external data when the first master node receives the external data; The first slave node message synchronization module is used to synchronize the external data to the first slave node of each slave cluster by the first master node according to the global message sequence.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.