A method, system, storage medium and device for cluster data synchronization
By deploying statement detection services and consistency detection services on all nodes in the cloud platform cluster, real-time synchronization of cloud management service data information is achieved, solving the problem that traditional cloud platform management services cannot achieve full-node data synchronization, and improving the data reliability of cloud platform.
Patent Information
- Application Number
- CN202311249410.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2043-09-26
AI Technical Summary
Traditional cloud platform management services cannot synchronize data information in all nodes of the cluster, resulting in unstable and unreliable management data information of the cloud platform.
Deploy statement detection services and consistency detection services on all nodes in the cloud platform cluster. By real-time detection of database statements issued by the cloud management service, hash calculation and number processing, and file transmission and comparison are carried out between nodes to ensure that statements are synchronized in all nodes.
Real-time data information synchronization of all nodes in the cloud platform cluster is realized, ensuring that the data information of the cloud platform is not lost, and greatly ensuring the high reliability of data in the cloud management service database.
Smart Images

Figure CN117312448B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing, and particularly to a cluster data synchronization method, system, storage medium and device. Background Art
[0002] In the era of cloud computing, migrating business systems to the cloud has become a common choice. Therefore, for the stable operation of business systems, the stable operation of the cloud platform is required. The core of cloud platform management is cloud management services, which store the data information of the entire cloud platform operation. To ensure the stable operation of the cloud platform, it is necessary to ensure the stable and reliable storage of the management data information of the cloud platform. Traditional cloud platform management services often run on a single node or a dual-node, and the data information is only stored on a single node or a dual-node, and it is impossible to synchronize the data information on all nodes of the cluster. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to propose a cluster data synchronization method, system, storage medium and device to solve the problem that the data information of the current cloud management service cannot be synchronized on all nodes of the cluster.
[0004] Based on the above purpose, the present invention provides a cluster data synchronization method, including the following steps:
[0005] Deploy statement detection services and consistency detection services on all nodes within the cloud platform cluster;
[0006] In response to the current node running the cloud management service, the statement detection service of the current node detects in real time the statements sent by the cloud management service to the database of the current node, numbers the detected statements in a preset order to obtain the current number value, and performs a hash calculation on the detected statements to obtain the current hash value, and saves the detected statements, the current hash value and the current number value to a file;
[0007] In response to the consistency detection service of the current node detecting the file, the file is sent to the consistency detection services of other nodes in the cluster. The consistency detection services of other nodes extract statements, hash values and number values from the received file, perform a hash calculation on the extracted statements, and compare the calculation result with the current hash value;
[0008] In response to the calculation result being consistent with the current hash value, the extracted statements are written into the databases of other nodes, the other nodes return the extracted number values to the current node, and the current node compares the extracted number values with the current number value;
[0009] In response to the extracted number values being consistent with the current number values, it is determined that the detected statements have been synchronized to other nodes.
[0010] In some embodiments, numbering the detected statements in a preset order includes:
[0011] Numbering the detected statements in ascending order.
[0012] In some embodiments, the method further includes:
[0013] In response to the cloud management service migrating to the next node for operation, the consistency detection service of the next node requests the maximum number value from other current nodes in the cluster, and compares the maximum number value of the next node with the maximum number values of other current nodes;
[0014] In response to the maximum number value of the next node being less than the maximum number values of other current nodes, determining that the data in the database of the next node is not the latest data, and sending a statement request to other current nodes;
[0015] In response to other current nodes receiving the statement request, sending the statements corresponding to the number difference between the maximum number value of other current nodes and the maximum number value of the next node to the next node, so that the data in the database of the next node is the latest data.
[0016] In some embodiments, the method further includes:
[0017] In response to the maximum number value of the next node being equal to or greater than the maximum number values of other current nodes, determining that the data in the database of the next node is the latest data, and determining that the next node runs the cloud management service.
[0018] In some embodiments, the method further includes:
[0019] In response to the next node receiving the statements corresponding to the number difference, sequentially executing the statements corresponding to the number difference in ascending order of the number values to write into the database of the next node.
[0020] In some embodiments, other nodes returning the extracted number value to the current node includes:
[0021] Other nodes returning a file package containing the extracted number value to the current node.
[0022] In some embodiments, the method further includes:
[0023] Saving the data information of the cloud platform where the cloud management service is located through the database of the current node.
[0024] On the other hand, the present invention further provides a cluster data synchronization system, including:
[0025] A deployment module, configured to deploy a statement detection service and a consistency detection service on all nodes in the cloud platform cluster;
[0026] A saving module, configured to, in response to the current node running a cloud management service, detect in real time, through its statement detection service, statements of a database sent by the cloud management service to the current node, number the detected statements in a preset order to obtain a current number value, perform a hash calculation on the detected statements to obtain a current hash value, and save the detected statements, the current hash value, and the current number value to a file;
[0027] A first comparison module, configured to, in response to the file being detected by the consistency detection service of the current node, send the file to the consistency detection services of other nodes in the cluster. The consistency detection services of other nodes extract statements, hash values, and number values from the received file, perform a hash calculation on the extracted statements, and compare the calculation result with the current hash value;
[0028] A second comparison module, configured to, in response to the calculation result being consistent with the current hash value, write the extracted statements into the databases of other nodes. The other nodes return the extracted number values to the current node, and the current node compares the extracted number values with the current number value; and
[0029] A synchronization module, configured to, in response to the extracted number values being consistent with the current number value, determine that the detected statements have been synchronized to other nodes.
[0030] In another aspect of the present invention, there is also provided a computer-readable storage medium storing computer program instructions, and when the computer program instructions are executed by a processor, the above method is implemented.
[0031] In still another aspect of the present invention, there is also provided a computer device including a memory and a processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the above method is executed.
[0032] The present invention has at least the following beneficial technical effects:
[0033] The cluster data synchronization method of the present invention can enable all nodes in the cloud platform cluster to synchronize data information of the cloud management service in real time, and it is real-time synchronization at the single statement granularity level; and all nodes in the cluster can perform consistency check and verification in real time, ensuring that the databases of all nodes in the cloud platform cluster save data information of the cloud platform in real time, preventing the data information of the cloud platform from being lost, and greatly guaranteeing the high reliability of the data in the cloud management service database. Description of the Drawings
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other embodiments can be obtained based on these drawings.
[0035] Figure 1 It is a schematic diagram of a cluster data synchronization method provided according to an embodiment of the present invention;
[0036] Figure 2 It is an interaction schematic diagram of a consistency detection service among nodes in a cluster provided according to an embodiment of the present invention;
[0037] Figure 3 It is an interaction schematic diagram of a consistency detection service among nodes after the migration of a cloud management service provided according to an embodiment of the present invention;
[0038] Figure 4 It is a schematic diagram of a cluster data synchronization system provided according to an embodiment of the present invention;
[0039] Figure 5 It is a schematic diagram of a computer-readable storage medium for implementing a cluster data synchronization method provided according to an embodiment of the present invention;
[0040] Figure 6 It is a schematic diagram of the hardware structure of a computer device for executing a cluster data synchronization method provided according to an embodiment of the present invention. Detailed implementation manners
[0041] To make the objectives, technical solutions, and advantages of the present invention clearer, the following further elaborates on the embodiments of the present invention in detail with reference to specific embodiments and the accompanying drawings.
[0042] It should be noted that all the expressions using "first" and "second" in the embodiments of the present invention are used to distinguish two non-identical entities or non-identical parameters with the same name. It can be seen that "first" and "second" are only for the convenience of expression and should not be construed as a limitation to the embodiments of the present invention. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units inherently includes other steps or units.
[0043] Based on the above objectives, in the first aspect of the embodiments of the present invention, an embodiment of a cluster data synchronization method is proposed. Figure 1 Shown is a schematic diagram of an embodiment of the cluster data synchronization method provided by the present invention. As Figure 1 shown, the embodiments of the present invention include the following steps:
[0044] Step S10: Deploy a statement detection service and a consistency detection service on all nodes within the cloud platform cluster;
[0045] Step S20: In response to the current node running the cloud management service, the statement detection service of the current node detects in real time the statements sent by the cloud management service to the database of the current node, numbers the detected statements in a preset order to obtain the current number value, performs a hash calculation on the detected statements to obtain the current hash value, and saves the detected statements, the current hash value, and the current number value to a file;
[0046] Step S30: In response to the consistency detection service of the current node detecting a file, send the file to the consistency detection services of other nodes within the cluster. The consistency detection services of other nodes extract the statements, hash values, and number values from the received file, perform a hash calculation on the extracted statements, and compare the calculation result with the current hash value;
[0047] Step S40: In response to the calculation result being consistent with the current hash value, write the extracted statements into the databases of other nodes. The other nodes return the extracted number value to the current node, and the current node compares the extracted number value with the current number value;
[0048] Step S50: In response to the extracted number value being consistent with the current number value, determine that the detected statements have been synchronized to other nodes.
[0049] In the embodiments of the present invention, first, a statement detection service for detecting SQL (Structured Query Language) statements written into the database is deployed on all nodes within the cloud platform cluster. When the cloud management service runs on any node, it can detect the SQL data information sent by the cloud management service; moreover, a consistency detection service for managing data consistency is also deployed on all nodes within the cluster. This consistency detection service can ensure that the database information managed on each node within the cluster is synchronized in real time and kept up-to-date. In this way, the cloud platform cluster can achieve real-time dynamic synchronization of the latest database data and use a detection mechanism to ensure that each node's data is the latest.
[0050] The cluster data synchronization method in the embodiments of the present invention can enable all nodes within the cloud platform cluster to synchronize the data information of the cloud management service in real time, and it is real-time synchronization at the single statement granularity level; moreover, all nodes within the cluster can perform consistency check verification in real time, ensuring that the databases of all nodes within the cloud platform cluster always store the data information of the cloud platform, preventing the loss of data information of the cloud platform, and greatly guaranteeing the high reliability of the data in the cloud management service database.
[0051] In some embodiments, numbering the detected statements in a preset order includes: numbering the detected statements in ascending order.
[0052] In this embodiment, by numbering the detected statements in ascending order, it is beneficial to assist in determining whether a statement is a new statement, thereby helping to update the database data.
[0053] In some embodiments, the method further includes: in response to the cloud management service migrating to the next node for operation, the consistency detection service of the next node requests the maximum number value from other current nodes in the cluster, and compares the maximum number value of the next node with the maximum number values of other current nodes; in response to the maximum number value of the next node being less than the maximum number values of other current nodes, determining that the data in the database of the next node is not the latest data, and sending a statement request to other current nodes; in response to other current nodes receiving the statement request, sending the statements corresponding to the number difference between the maximum number value of other current nodes and the maximum number value of the next node to the next node, so that the data in the database of the next node is the latest data.
[0054] In this embodiment, by comparing the maximum number value of the newly migrated operation node of the cloud management service with the maximum number values of other current nodes in the cluster, it is possible to directly determine whether the data in the database of the newly operated node (i.e., the next node) is the latest data, thereby facilitating the data update of the newly operated node and ensuring the integrity and consistency of the data in each database.
[0055] In some embodiments, the method further includes: in response to the maximum number value of the next node being equal to or greater than the maximum number values of other current nodes, determining that the data in the database of the next node is the latest data, and determining that the next node runs the cloud management service.
[0056] In this embodiment, since the statements are written in ascending order based on the passage of time, if the maximum number value of the next node is equal to or greater than the maximum number values of other current nodes, it indicates that the data in the database of the next node is the latest data and the cloud management service can be run.
[0057] In some embodiments, the method further includes: in response to the next node receiving the statements corresponding to the number difference, sequentially executing the statements corresponding to the number difference in ascending order of the number values to write into the database of the next node.
[0058] In this embodiment, the next node can ensure that the statements are written into the database in order by sequentially executing the statements corresponding to the number difference in ascending order of the number values, avoiding data chaos in the database.
[0059] In some embodiments, other nodes returning the extracted numbered values to the current node includes: other nodes returning a file package containing the extracted numbered values to the current node.
[0060] In this embodiment, the file package may be an ACK (Acknowledge character) packet. ACK is a transmission control character sent by the receiving station to the sending station in data communication, indicating that the data sent has been received and confirmed without error.
[0061] In some embodiments, the method further includes: saving the data information of the cloud platform where the cloud management service is located through the database of the current node.
[0062] In this embodiment, data information such as the configuration and management of the cloud platform is saved in the database where the cloud management service runs. Therefore, achieving data synchronization in the databases of all nodes can prevent the loss of cloud platform data information when the cloud management service migrates to other nodes.
[0063] The following is an exemplary embodiment of the cluster data synchronization method of the present invention, and the implementation process is as follows:
[0064] 1) There are nodes in the cloud platform cluster running the cloud management service, and all configuration management information about the cloud platform is saved in the database through the cloud management platform.
[0065] 2) Each node deploys an SQL statement detection service. When a node in the cloud platform cluster runs, the SQL detection service will detect in real time the SQL statements sent by the cloud management service to the database. The detected SQL data is numbered and saved in ascending order according to individual complete SQL statements. While saving, a hash calculation is performed on the SQL statement, and the hash calculation value, number, and the SQL statement are saved as an overall file.
[0066] 3) All nodes in the cloud platform cluster deploy a consistency detection service for managing data. Figure 2 Shows an interaction diagram of the consistency detection service among nodes in the cluster according to an embodiment of the present invention. As Figure 2As shown, when the detection service discovers a new file, it sends it to the consistency detection services of all other nodes in the cluster. When the consistency detection services of other nodes receive this file, they will extract the SQL statement, hash value, and the number of the SQL statement in the file. Then, they will first calculate the hash of the SQL statement. After comparing and finding that it is consistent with the received hash value (if it is inconsistent, no subsequent operations will be performed), they will write the SQL statement into the database of the current node. Then, this node will return an ack packet to the node currently running the cloud management service. This ack packet contains the value of the SQL statement number received initially. After receiving the ack packet, the running node of the cloud management service checks and finds that it is consistent with the SQL statement number in the data sent initially, indicating that the SQL statement has been synchronized to other nodes. If the ack packet is not received within the specified timeout period, the SQL statement information will be resent to the other party.
[0067] 4) When the management node migrates to run on other nodes within the cloud management platform, it is first necessary to ensure that the database data on this node is up-to-date. Figure 3 The figure shows an interaction diagram of the consistency detection services among nodes after the migration of the cloud management service provided by an embodiment of the present invention. As Figure 3 shown, the management data consistency detection service on this node will request the largest SQL statement number from other nodes in the cluster. If it is found that the largest number value returned within the cluster is the same as its own (after receiving the response packets from all nodes in the cloud platform cluster and extracting the largest SQL statement number for comparison), it means that the database data of the node where the cloud management service is to run currently is up-to-date, and the cloud management service can be run to continue the operations in steps 2) to 3) above, and perform the distributed data synchronization mechanism in real time. If it is found that the SQL number in the database of other nodes in the cluster obtained is larger than its own (after receiving the response packets from all nodes in the cloud platform cluster and extracting the largest SQL statement number for comparison), it will request the SQL statements corresponding to the difference between the largest SQL number and its own SQL number from the first node that responds with the largest SQL number (after receiving the response packet, execute the SQL statements in ascending order and write the data into the database of the current node), so as to keep the database data of the node where the cloud management service is to run currently up-to-date and consistent.
[0068] 5) If the cloud management service migrates to another node within the cluster, the operating mechanism is the same as in step 4), ensuring that the data in the database of each node running the cloud management service is up-to-date and consistent.
[0069] In the second aspect of the embodiments of the present invention, a cluster data synchronization system is further provided. Figure 4Shown is a schematic diagram of an embodiment of the cluster data synchronization system provided by the present invention. As Figure 4 shown, a cluster data synchronization system includes: a deployment module 10 configured to deploy a statement detection service and a consistency detection service on all nodes within a cloud platform cluster; a saving module 20 configured to, in response to the current node running a cloud management service, detect in real time, through its statement detection service, statements sent by the cloud management service to the database of the current node, number the detected statements in a preset order to obtain a current number value, perform a hash calculation on the detected statements to obtain a current hash value, and save the detected statements, the current hash value, and the current number value to a file; a first comparison module 30 configured to, in response to the consistency detection service of the current node detecting a file, send the file to the consistency detection services of other nodes within the cluster, the consistency detection services of the other nodes extract statements, hash values, and number values from the received file, perform a hash calculation on the extracted statements, and compare the calculation result with the current hash value; a second comparison module 40 configured to, in response to the calculation result being consistent with the current hash value, write the extracted statements into the databases of the other nodes, the other nodes return the extracted number values to the current node, and the current node compares the extracted number values with the current number value; and a synchronization module 50 configured to, in response to the extracted number values being consistent with the current number value, determine that the detected statements have been synchronized to the other nodes.
[0070] In some embodiments, the saving module 20 includes a numbering module configured to number the detected statements in ascending order.
[0071] In some embodiments, the system further includes a migration module configured to, in response to the cloud management service migrating to run on the next node, the consistency detection service of the next node requests the maximum number value from other current nodes within the cluster and compares the maximum number value of the next node with the maximum number value of the other current nodes; in response to the maximum number value of the next node being less than the maximum number value of the other current nodes, determine that the data in the database of the next node is not the latest data and send a statement request to the other current nodes; in response to the other current nodes receiving the statement request, send the statements corresponding to the number difference between the maximum number value of the other current nodes and the maximum number value of the next node to the next node so that the data in the database of the next node is the latest data.
[0072] In some embodiments, the system further includes a determination running module configured to, in response to the maximum number value of the next node being equal to or greater than the maximum number value of the other current nodes, determine that the data in the database of the next node is the latest data and determine that the next node runs the cloud management service.
[0073] In some embodiments, the system further includes an execution module configured to, in response to the next node receiving the statements corresponding to the number difference, execute the statements corresponding to the number difference in ascending order of the number values so as to write them into the database of the next node.
[0074] In some embodiments, the second comparison module 40 includes a return module configured to return the file package containing the extracted number value from other nodes to the current node.
[0075] In some embodiments, the system further includes a database module configured to save the data information of the cloud platform where the cloud management service is located through the database of the current node.
[0076] In a third aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium. Figure 5 FIG. shows a schematic diagram of a computer-readable storage medium for implementing the cluster data synchronization method according to the embodiments of the present invention. As Figure 5 shown, the computer-readable storage medium 3 stores computer program instructions 31. When the computer program instructions 31 are executed by a processor, the method of any of the above embodiments is implemented.
[0077] It should be understood that, without conflict, all the embodiments, features, and advantages described above for the cluster data synchronization method according to the present invention are equally applicable to the cluster data synchronization system and storage medium according to the present invention.
[0078] In a fourth aspect of the embodiments of the present invention, there is also provided a computer device including a memory 402 and a processor 401 as Figure 6 shown. A computer program is stored in the memory 402, and when the computer program is executed by the processor 401, the method of any of the above embodiments is implemented.
[0079] As Figure 6 shown, FIG. is a schematic hardware structure diagram of an embodiment of a computer device for implementing the cluster data synchronization method provided by the present invention. Taking the computer device as Figure 6 shown as an example, in this computer device, there is a processor 401 and a memory 402, and it may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403, and the output device 404 may be connected through a bus or other means, Figure 6 taking the connection through a bus as an example. The input device 403 can receive input digital or character information, and generate key signal inputs related to user settings and function controls of the cluster data synchronization system. The output device 404 may include a display device such as a display screen.
[0080] The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the cluster data synchronization method in the embodiments of the present application. The memory 402 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created for the use of the cluster data synchronization method, etc. In addition, the memory 402 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 402 may optionally include memories remotely provided relative to the processor 401, and these remote memories can be connected to the local module through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] By running the non-volatile software programs, instructions, and modules stored in the memory 402, the processor 401 executes various functional applications and data processing of the server, that is, implements the cluster data synchronization method in the above method embodiments.
[0082] Finally, it should be noted that the computer-readable storage medium (for example, the memory) herein may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory.
[0083] Those skilled in the art will also understand that the various exemplary logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, a general description has been given of the functions of the various illustrative components, blocks, modules, circuits, and steps. Whether this function is implemented as software or hardware depends on the specific application and the design constraints imposed on the overall system. The functions that those skilled in the art can implement in various ways for each specific application, but such implementation decisions should not be construed as causing a departure from the scope of the disclosure of the embodiments of the present invention.
[0084] The various exemplary logical blocks, modules, and circuits described in connection with the disclosure herein can be implemented or performed using the following components designed to perform the functions herein: general purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP and / or any other such configuration.
[0085] The foregoing are exemplary embodiments of the present disclosure, but it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of the present disclosure defined by the claims. The functions, steps, and / or actions of the method claims according to the disclosed embodiments herein need not be performed in any particular order. In addition, although the elements of the embodiments of the present disclosure may be described or claimed in individual form, they may also be understood as plural unless explicitly limited to the singular.
[0086] It should be understood that, as used herein, unless the context clearly supports otherwise, the singular form "a" is intended to also include the plural form. It should also be understood that the "and / or" used herein refers to any and all possible combinations of one or more of the associated listed items. The foregoing serial numbers of the disclosed embodiments of the present invention are merely for description and do not represent the superiority or inferiority of the embodiments.
[0087] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features between the above embodiments or different embodiments can also be combined, and there are many other variations in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention shall be included within the protection scope of the embodiments of the present invention.
Claims
1. A method for cluster data synchronization, characterized in that, it includes the following steps: Deploy statement detection services and consistency detection services on all nodes within the cloud platform cluster; In response to the current node running the cloud management service, its statement detection service detects in real time the statements sent by the cloud management service to the database of the current node, numbers the detected statements in a preset order to obtain the current number value, performs a hash calculation on the detected statements to obtain the current hash value, and saves the detected statements, the current hash value, and the current number value to a file; In response to the consistency detection service of the current node detecting the file, the file is sent to the consistency detection services of other nodes within the cluster. The consistency detection services of the other nodes extract statements, hash values, and number values from the received file, perform a hash calculation on the extracted statements, and compare the calculation result with the current hash value; In response to the calculation result being consistent with the current hash value, the extracted statements are written into the database of the other nodes. The other nodes return the extracted number value to the current node, and the current node compares the extracted number value with the current number value; In response to the extracted number value being consistent with the current number value, it is determined that the detected statements have been synchronized to the other nodes.
2. The method according to claim 1, characterized in that, numbering the detected statements in a preset order includes: numbering the detected statements in ascending order.
3. The method according to claim 2, characterized in that, it further includes: In response to the cloud management service migrating to the next node for operation, the consistency detection service of the next node requests the maximum number value from the current other nodes within the cluster, and compares the maximum number value of the next node with the maximum number value of the current other nodes; In response to the maximum number value of the next node being less than the maximum number value of the current other nodes, it is determined that the data in the database of the next node is not the latest data, and a statement request is sent to the current other nodes; In response to the current other nodes receiving the statement request, the statements corresponding to the number difference between the maximum number value of the current other nodes and the maximum number value of the next node are sent to the next node, so that the data in the database of the next node is the latest data.
4. The method according to claim 3, characterized in that, it further includes: In response to the maximum number value of the next node being equal to or greater than the maximum number value of the current other nodes, it is determined that the data in the database of the next node is the latest data, and it is determined that the next node runs the cloud management service.
5. The method according to claim 3, characterized in that, it further includes: In response to the next node receiving the statements corresponding to the number difference, the statements corresponding to the number difference are executed in ascending order of the number value in sequence to be written into the database of the next node.
6. The method according to claim 1, It is characterized in that the return of the extracted numbered value by the other nodes to the current node includes: the other nodes return a file package containing the extracted numbered value to the current node.
7. The method according to claim 1, it is characterized in that it further includes: saving the data information of the cloud platform where the cloud management service is located through the database of the current node.
8. A cluster data synchronization system, it is characterized in that it includes: a deployment module configured to deploy a statement detection service and a consistency detection service on all nodes within a cloud platform cluster; a saving module configured to, in response to the current node running a cloud management service, detect in real time, through its statement detection service, the statements sent by the cloud management service to the database of the current node, number the detected statements in a preset order to obtain a current numbered value, perform a hash calculation on the detected statements to obtain a current hash value, and save the detected statements, the current hash value, and the current numbered value to a file; a first comparison module configured to, in response to the consistency detection service of the current node detecting the file, send the file to the consistency detection services of other nodes within the cluster, and the consistency detection services of the other nodes extract statements, hash values, and numbered values from the received file, perform a hash calculation on the extracted statements, and compare the calculation result with the current hash value; a second comparison module configured to, in response to the calculation result being consistent with the current hash value, write the extracted statements into the database of the other nodes, the other nodes return the extracted numbered value to the current node, and the current node compares the extracted numbered value with the current numbered value; and a synchronization module configured to, in response to the extracted numbered value being consistent with the current numbered value, determine that the detected statements have been synchronized to the other nodes.
9. A computer-readable storage medium, it is characterized in that it stores computer program instructions, and when the computer program instructions are executed by a processor, the method described in any one of claims 1-7 is implemented.
10. A computer device including a memory and a processor, it is characterized in that a computer program is stored in the memory, and when the computer program is executed by the processor, the method described in any one of claims 1-7 is executed.
Citation Information
Patent Citations
Block chain data synchronization method and system based on check points
CN115495531A
Hash algorithm-based service access method, apparatus and device, and medium
CN115840639A