Data consistency determination method and device, computer equipment and storage medium
By receiving and comparing the business process information of each server in a distributed server cluster, it solves the problem in traditional technology that it is difficult to determine whether the data between servers in a distributed server cluster is consistent, and realizes data consistency check.
Patent Information
- Application Number
- CN202411358947.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-21
AI Technical Summary
In distributed server clusters, traditional techniques are difficult to determine whether the data between servers is consistent, especially when a backup process fails.
By receiving the business process information of each server sent by the main server in the distributed server cluster, and based on the business process information of each server at adjacent time points, comparing the process version number and the logical service version number to determine whether the data between the servers are consistent. .
It is difficult to determine whether the data between the servers in the distributed server cluster are difficult to determine whether the data between the distributed server clusters is uniform when the backup process is faulty, and the consistency check of the data between the servers in each server cluster is realized.
Smart Images

Figure CN119341883A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed cluster technology, and in particular to a method, device, computer equipment and storage medium for determining data consistency. Background Art
[0002] In a distributed server cluster, each type of business process runs on each server, and each business process carries one or more logical services. When a business process fails, the logical services on it will be migrated to the business processes of other servers that are running normally. When the failed process recovers, the migrated logical services will be migrated back. Therefore, ensuring the consistency of data between servers in a distributed server cluster plays an important role in the operation of distributed servers.
[0003] In traditional technology, data generated by business processes running on each server is usually backed up to each server in a distributed server cluster to ensure data consistency among the servers in the distributed server cluster.
[0004] However, in conventional technologies, when a backup process fails, it is difficult to determine whether data between servers in a distributed server cluster is consistent. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for determining data consistency in response to the above technical problems, which can determine whether the data between servers in a distributed server cluster are consistent.
[0006] In a first aspect, the present application provides a method for determining data consistency, the method comprising:
[0007] Receive the business process information of each server sent by the main server in the distributed server cluster at a preset time interval;
[0008] Whether the data between the servers are consistent is determined according to the business process information of the servers at adjacent time points.
[0009] In the embodiment of the present application, by comparing the business process information of each server at adjacent time points, it is determined whether the source action of the data between the servers is stable, and then whether the data between the servers is consistent. Compared with the traditional technology, the present application does not ensure the consistency of the data between the servers through data backup, thereby avoiding the problem of difficulty in determining whether the data between the servers in the distributed server cluster is consistent when the backup process fails.
[0010] In one embodiment, the business process information includes a process version number and a logical service version number; and determining whether data between the servers are consistent based on the business process information of the servers at adjacent time points includes:
[0011] Whether the data among the servers are consistent is determined according to the process version number and the logical service version number of each server at the adjacent time points.
[0012] In an embodiment of the present application, by comparing whether the process version numbers of each server at adjacent time points are consistent, and comparing whether the logical service version numbers are consistent, it is determined whether the source action of the data between the servers is stable, and then it is determined whether the data between the servers is consistent.
[0013] In one embodiment, determining whether data between the servers are consistent based on the process version numbers and logical service version numbers of the servers at the adjacent time points includes:
[0014] When the process version numbers of the servers at the adjacent time points are consistent and the logical service version numbers are consistent, it is determined that the data between the servers are consistent.
[0015] In an embodiment of the present application, by comparing whether the process version numbers of each server at adjacent time points are consistent, and comparing whether the logical service version numbers are consistent, it is determined whether the source actions of the data between the servers are stable, and then it is determined whether the data between the servers are consistent.
[0016] In one embodiment, the method further comprises:
[0017] When receiving each of the business process information sent by the main server, the current business process information is sent to the main server.
[0018] In an embodiment of the present application, after receiving the business process information sent by the master server, each slave server sends the current business process information to the master server, thereby enabling the master server to collect the business process information of each slave server, so as to push the latest business process information of each server to each slave server, thereby facilitating the determination of whether the data between the servers are consistent.
[0019] In one embodiment, the method further comprises:
[0020] Receive a prompt message sent by the main server; the prompt message is used to indicate that the main server determines that the duration of sending the current business process information is greater than a preset duration.
[0021] In an embodiment of the present application, the faulty slave server is removed from the distributed server cluster; this avoids the problem that the business process information of the slave server cannot be fully collected due to the server node failure, resulting in the inability to increase the pulse count, thereby affecting the subsequent business process information update.
[0022] In one embodiment, the method further comprises:
[0023] According to the process version number and the logical service version number of each server, the stored process version number and the logical service version number of each server are updated.
[0024] In an embodiment of the present application, by updating the stored process version number and logical service version number of each server, each slave server can compare the updated process version number and logical service version number of each server with the stored process version number and logical service version number of each server at the previous time point to determine the data consistency between the servers.
[0025] In a second aspect, the present application further provides a device for determining data consistency, the device comprising:
[0026] The receiving module is used to receive the business process information of each server sent by the main server in the distributed server cluster according to the preset time interval;
[0027] The determination module is used to determine whether the data between the servers are consistent according to the business process information of the servers at adjacent time points.
[0028] In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0029] Receive the business process information of each server sent by the main server in the distributed server cluster at a preset time interval;
[0030] Whether the data between the servers are consistent is determined according to the business process information of the servers at adjacent time points.
[0031] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0032] Receive the business process information of each server sent by the main server in the distributed server cluster at a preset time interval;
[0033] Whether the data between the servers are consistent is determined according to the business process information of the servers at adjacent time points.
[0034] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, which implements the following steps when executed by a processor:
[0035] Receive the business process information of each server sent by the main server in the distributed server cluster at a preset time interval;
[0036] Whether the data between the servers are consistent is determined according to the business process information of the servers at adjacent time points.
[0037] The above-mentioned method, device, computer equipment and storage medium for determining data consistency, the slave server in the distributed server cluster receives the business process information of each server sent by the main server in the distributed server cluster at a preset time interval; and then determines whether the data between the servers are consistent based on the business process information of each server at adjacent time points. In the above scheme, by comparing the business process information of each server at adjacent time points, it is determined whether the source action of the data between the servers is stable, and then it is determined whether the data between the servers is consistent. Compared with traditional technologies, the present application does not ensure the consistency of data between servers through data backup, thereby avoiding the problem of difficulty in determining whether the data between the servers in the distributed server cluster is consistent when the backup process fails. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] FIG1 is a diagram of an application environment of a method for determining data consistency in one embodiment;
[0039] Figure 2 is a flow chart of a method for determining data consistency in one embodiment;
[0040] Figure 3 A schematic diagram of logical service migration in one embodiment;
[0041] Figure 4 A schematic diagram of a process in which a master server collects information about each business process from each slave server in an embodiment;
[0042] Figure 5 A schematic diagram of a process for determining whether data between servers are consistent in one embodiment;
[0043] Figure 6 is a flow chart of another method for determining data consistency in one embodiment;
[0044] Figure 7 is a structural block diagram of a device for determining data consistency in one embodiment;
[0045] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] 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.
[0047] The method for determining data consistency provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. The distributed server cluster includes N servers, specifically including server 1 to server N.
[0048] Exemplarily, one server can be selected from N servers as the cluster master server, and the remaining servers can be selected as cluster slave servers. The cluster master server collects the business process information of each slave server at regular intervals. After the business process information of each slave server is collected, the cluster master server pushes the pulse count to increase, and pushes the pulse information to each slave server, wherein the pulse information includes the pulse count and the business process information of each server. Each slave server updates the pulse count and the stored business process information stored in the memory dashboard.
[0049] When determining whether the data between the servers in the distributed server cluster is consistent, any server can obtain the business process information in the pulse information of each server in the memory dashboard of the server, and compare whether the business process information of each server corresponding to two adjacent pulse counts is consistent, thereby determining whether the data between the servers in the distributed server cluster is consistent. Compared with the traditional technology, the present application does not determine whether the data between the servers is consistent through data backup, thereby avoiding the problem of difficulty in determining whether the data between the servers in the distributed server cluster is consistent when the backup process fails.
[0050] In one embodiment, Figure 2 As shown, a method for determining data consistency is provided, which is described by taking the method applied to the cluster slave server in FIG1 as an example, and includes the following steps:
[0051] S201, receiving the business process information of each server sent by the main server in the distributed server cluster at a preset time interval.
[0052] The business process information is information that can reflect the running status of the business process, for example, the running status of the business process or an identifier corresponding to the running status of the business process. The preset time interval can be set according to actual usage and is not specifically limited here.
[0053] First, it should be noted that the business process information of each server in this embodiment includes the business process information of the master server in the distributed server cluster and the business process information of each slave server. Optionally, in this embodiment, the master server in the distributed server cluster collects the business process information of each slave server at a preset time interval, and each time the master server collects the business process information of each slave server, a pulse count will correspond. When the business process information of each slave server is collected, the pulse count will increase by one count. When the business process information of each slave server is collected in the next round, the master server pushes the business process information of each server collected in this round to each slave server, and each slave server receives the business process information of each server sent by the master server. It can be understood that the master server collects the business process information of each slave server at a preset time interval, so, accordingly, each slave server in the distributed server cluster also receives the business process information of each server sent by the master server at the preset time interval.
[0054] Optionally, each slave server may store the business process information of each server sent by the master server in a memory dashboard of the server, and obtain the business process information of each server in the distributed server cluster from its own memory dashboard.
[0055] S202: Determine whether data between the servers are consistent based on business process information of the servers at adjacent time points.
[0056] Exemplarily, the consistency of data between the servers can be determined by comparing whether the business process information of each server at adjacent time points is consistent. For example, the business process information of each server at adjacent time points can be obtained from the memory dashboard of the slave server. For each business process running in each server, it is determined whether the business operation status of the business process at adjacent time points is consistent. If consistent, it can be considered that the business process in the server is running stably.
[0057] Furthermore, when it is determined that each business process in each server is running stably, it is considered that the source action of the data between the servers is stable, and further it can be determined that the data between the servers is consistent.
[0058] If the business operation status of the business process at adjacent time points is inconsistent, for example, the operation status of the business process corresponding to the previous time point is normal operation, and the operation status of the business process corresponding to the next time point is abnormal operation, then it is determined that the source action of the data between the servers is unstable, that is, it can be considered that the data between the servers involved in the business process are inconsistent.
[0059] In the above method for determining data consistency, the slave server in the distributed server cluster receives the business process information of each server sent by the master server in the distributed server cluster at a preset time interval; and then determines whether the data between the servers are consistent based on the business process information of each server at adjacent time points. In the above scheme, by comparing the business process information of each server at adjacent time points, it is determined whether the source action of the data between the servers is stable, and then it is determined whether the data between the servers is consistent. Compared with traditional technologies, the present application does not ensure the consistency of data between servers through data backup, thereby avoiding the problem of difficulty in determining whether the data between the servers in the distributed server cluster is consistent when the backup process fails.
[0060] For example, see Figure 3 , Figure 3 A schematic diagram of logical service migration is provided. When a process running in a server fails, the logical services on the failed process will be migrated to other normally running processes. When the failed process recovers, the migrated logical services will be migrated back. The other normally running processes can be other normally running processes in the same server as the failed process, or they can be normal processes on other servers.
[0061] The failure of a business process will cause the migration of the logical service running on the business process. The logical service is the smallest unit for processing business requests. When the logical service is migrated, some business requests may not be fully executed, resulting in inconsistent data between servers.
[0062] Based on this, in an embodiment of the present application, each state change version of a process and a logical service can be recorded in the memory dashboard of each server. Exemplarily, as long as the state of the process changes, the version number of the process will increase. For example, if a process fails, the version number of the process increases; if the process recovers from the failure and runs normally, the version number of the process will also increase. Similarly, as long as the logical service migrates, the version number of the logical service will increase. For example, if the logical service migrates to other business processes due to a business process failure, the version number of the logical service will increase; if the logical service migrates back to the business process due to business process failure recovery, the version number of the logical service will also increase.
[0063] In some optional implementations, the business process information in the embodiments of the present application may include a process version number and a logical service version number. Based on this, the specific implementation process of determining whether the data between the servers is consistent may include: determining whether the data between the servers is consistent based on the process version number and the logical service version number of each server at adjacent time points.
[0064] Exemplarily, in this embodiment, whether the data between the servers are consistent can be determined based on the process version numbers and logical service version numbers of the servers at adjacent time points. For example, for each business process in each server, by determining whether the process version numbers of the business process at adjacent time points are consistent, and determining whether the process version numbers of the logical service version numbers in the business process at adjacent time points are consistent, it can be determined whether the business process is running stably, and then whether the data between the servers is consistent.
[0065] In an embodiment of the present application, by comparing whether the process version numbers of each server at adjacent time points are consistent, and comparing whether the logical service version numbers are consistent, it is determined whether the source action of the data between the servers is stable, and then it is determined whether the data between the servers is consistent.
[0066] Furthermore, in an embodiment of the present application, whether the data between the servers are consistent is determined based on the process version number and logical service version number of each server at adjacent time points. The specific implementation process is as follows: when the process version numbers of the servers at adjacent time points are consistent and the logical service version numbers are consistent, it is determined that the data between the servers are consistent.
[0067] Among them, the process version numbers of each server at adjacent time points are consistent, indicating that there is no failure in the business processes running on each server; the logical service version numbers of each server at adjacent time points are consistent, indicating that the logical services in the business processes running on each server have not been migrated; that is, it can be determined that the source action of the data between the servers is stable, and thus it can be considered that the data between the servers is consistent.
[0068] In an embodiment of the present application, by comparing whether the process version numbers of each server at adjacent time points are consistent, and comparing whether the logical service version numbers are consistent, it is determined whether the source actions of the data between the servers are stable, and then it is determined whether the data between the servers are consistent.
[0069] In some optional implementations, see Figure 4 , Figure 4 A schematic diagram of a process in which a master server collects business process information from slave servers is provided.
[0070] Exemplarily, the main server will first initialize the pulse count, for example, by attaching an initial value to the pulse count, for example, the initial value may be 0.
[0071] Furthermore, the master server will periodically collect the business process information of each slave server, wherein the business process information includes the process version number and the logical service version number. The process version number can reflect the state of the process, and the logical service version number can also reflect the state of the logical service.
[0072] After the master server collects the business process information from all slave servers, it will push the pulse count to increase. The master server synchronizes the pulse count and business process information of each server to each slave server, for example, synchronizing the pulse count, the process version number of the process on each server, and the version number of the logical service running on the process to each slave server.
[0073] When receiving the business process information sent by the master server, each slave server updates the pulse count and updates the received business process information of each server to the memory dashboard. Exemplarily, each slave server will update the stored process version number and logical service version number of other servers based on the received process version number and logical service version number of other servers; the process version number and logical service version number of each process in this server have been stored in the memory dashboard of this server, so this server does not need to update the business process information of this server based on the received business process information of this server. In addition, each slave server can compare the updated process version number and logical service version number of each server with the process version number and logical service version number of each server stored at the previous time point to determine the data consistency between the servers.
[0074] Furthermore, the current business process information is sent to the master server so that the master server can collect the business process information of each slave server again. After receiving the business process information of each server, the master server updates the business process information corresponding to each slave server.
[0075] Before the master server sends the business process information of each server to each slave server in the next round, it will first determine whether the business process information of each slave server has been collected; in the process of determining whether the collection is completed, a preset time length can be set, and the preset time length can be set according to actual conditions. No specific limit is made on the preset time length here.
[0076] If the master server has not collected the business process information of a slave server within the preset time, the slave server is considered to have failed and needs to be removed from the distributed server cluster; this is to avoid the inability to collect all the business process information of the slave server due to server node failure, which in turn causes the pulse count to fail to increase, affecting the subsequent update of business process information.
[0077] Based on this, the master server will send a prompt message to the faulty slave server, and the faulty slave server will receive the prompt message sent by the master server. The prompt message is used to indicate that the duration of the master server determining to send the business process information at the current moment is greater than the preset duration, and is used to notify the server node that it will be removed from the distributed server cluster. Then the master server can remove the faulty slave server from the distributed server cluster. When the business processes of the slave server except the faulty one are collected, the pulse count is increased, and the business process information of the remaining servers is sent to the remaining slave servers in the distributed server cluster. This avoids the problem that the business process information of the slave server cannot be fully collected due to the failure of the server node, which in turn causes the pulse count to be unable to increase, affecting the subsequent update of the business process information.
[0078] In an embodiment of the present application, after receiving the business process information sent by the master server, each slave server sends the current business process information to the master server, thereby enabling the master server to collect the business process information of each slave server, so as to push the latest business process information of each server to each slave server, thereby facilitating the determination of whether the data between the servers are consistent.
[0079] For example, see Figure 5 , Figure 5 A flowchart for determining whether data between servers is consistent is provided.
[0080] It should be noted that since the memory dashboard of any server in the distributed server cluster stores the business process information of each server, that is, the process version number of each process running on each server and the logical service version number of the logical service running on each process. Therefore, any server in the distributed server cluster can determine whether the data between the servers is consistent. The specific judgment process is as follows:
[0081] Assuming that the current time point is T1, any server in the distributed server cluster obtains business process information related to a target business in each server from the memory dashboard, and obtains the pulse count corresponding to the business process information of each server related to the target business in the memory dashboard.
[0082] Before the service process information of each server corresponding to the next time point is sent to each server, each server performs a corresponding service operation.
[0083] After checking for pulse updates, ie, receiving the service process information of each server corresponding to the next time point T2, the service process information related to the target service in each server is obtained again.
[0084] Then, the business process information related to the target business in each server obtained at time point T1 is compared with the business process information related to the target business in each server obtained at time point T2.
[0085] Determine whether the business process information related to the target business in each server is consistent. For example, compare the consistency of the process version number of the same process in the same server at time point T1 with the process version number corresponding to time point T2, and compare the logical service version number of the same logical service on the same process at time point T1 with the logical service version number corresponding to time point T2; if they are all consistent, it means that the process is running stably and the logical service has not been migrated, that is, the data on the process is consistent. If there is an inconsistency, for example, inconsistent process version numbers, inconsistent logical service version numbers, or inconsistent process version numbers and inconsistent logical service version numbers, it means that the process has failed, or the logical service on the process has migrated, which will cause inconsistent data before and after the migration, that is, the data between the servers is considered inconsistent.
[0086] Furthermore, if it is determined that the process version numbers are consistent and the logical service version numbers are also consistent, it is considered that the data between the servers is consistent, and the data consistency judgment logic can be terminated; if it is determined that there is an inconsistency between the process version number and the logical service version number, it is necessary to re-judge whether the business process information of each server at adjacent time points is consistent, until it is determined that the business process information of each server at adjacent time points is consistent, the judgment logic is terminated.
[0087] In some optional implementations, see Figure 6 , Figure 6 A flowchart of another method for determining data consistency is provided, which specifically includes the following steps:
[0088] S601, receiving the process version number and the logical service version number of each server sent by the main server in the distributed server cluster at a preset time interval.
[0089] S602: Update the stored process version number and logical service version number of each server according to the process version number and logical service version number of each server.
[0090] S603: Send the current business process information to the main server.
[0091] S604, determine whether the process version numbers of each server at adjacent time points are consistent, if they are consistent, execute S605, if they are inconsistent, execute S606.
[0092] S605, determine whether the logical service version numbers of each server at adjacent time points are consistent, if they are consistent, execute S607, if they are inconsistent, execute S606.
[0093] S606: Determine that data among the servers are inconsistent.
[0094] S607, determine whether the data between the servers are consistent.
[0095] It should be noted that the execution order of the steps in the embodiments of the present application is only an exemplary description and is not intended to limit the execution order of the steps. Other execution orders of the steps are also within the protection scope of the present application.
[0096] In the embodiment of the present application, a mechanism for querying whether the state is stable is provided to ensure whether the operation of operating data in the distributed system is stable and reliable, thereby strengthening the protection of data consistency. In addition, a unified mechanism is provided for all businesses to use, greatly reducing the complexity of each business handling failures separately.
[0097] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments 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 part of the steps in the flowcharts involved in the above-mentioned embodiments can 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 to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0098] Based on the same inventive concept, the embodiment of the present application also provides a data consistency determination device for implementing the data consistency determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more data consistency determination device embodiments provided below can refer to the limitations of the data consistency determination method above, and will not be repeated here.
[0099] In one embodiment, Figure 7 As shown, a device for determining data consistency is provided, comprising:
[0100] The receiving module 10 is used to receive the service process information of each server sent by the main server in the distributed server cluster according to a preset time interval;
[0101] The determination module 20 is used to determine whether the data between the servers are consistent according to the business process information of the servers at adjacent time points.
[0102] The above-mentioned device for determining data consistency receives the business process information of each server sent by the main server in the distributed server cluster from the server in the distributed server cluster at a preset time interval; and then determines whether the data between the servers are consistent based on the business process information of each server at adjacent time points. In the above scheme, by comparing the business process information of each server at adjacent time points, it is determined whether the source action of the data between the servers is stable, and then it is determined whether the data between the servers is consistent. Compared with traditional technologies, the present application does not ensure the consistency of data between servers through data backup, thereby avoiding the problem of difficulty in determining whether the data between the servers in the distributed server cluster is consistent when the backup process fails.
[0103] In one embodiment, the business process information includes a process version number and a logical service version number; the determination module 20 is specifically used to:
[0104] Whether the data among the servers are consistent is determined according to the process version number and the logical service version number of each server at the adjacent time points.
[0105] In one embodiment, the determination module 20 is specifically configured to:
[0106] When the process version numbers of the servers at the adjacent time points are consistent and the logical service version numbers are consistent, it is determined that the data between the servers are consistent.
[0107] In one of the embodiments, the device further includes a sending module, configured to:
[0108] When receiving each of the business process information sent by the main server, the current business process information is sent to the main server.
[0109] In one embodiment, the receiving module 10 is further configured to:
[0110] Receive a prompt message sent by the main server; the prompt message is used to indicate that the main server determines that the duration of sending the current business process information is greater than a preset duration.
[0111] In one embodiment, the update module includes:
[0112] According to the process version number and the logical service version number of each server, the stored process version number and the logical service version number of each server are updated.
[0113] Each module in the above-mentioned data consistency determination device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0114] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, and a network interface connected via a system bus. 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 business process information. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for determining data consistency is implemented.
[0115] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial 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 shown in the figure, or combine certain components, or have a different arrangement of components.
[0116] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0117] Receive the business process information of each server sent by the main server in the distributed server cluster at a preset time interval;
[0118] Based on the business process information of each server at adjacent time points, determine whether the data between the servers is consistent.
[0119] In one embodiment, the business process information includes a process version number and a logical service version number; when the processor executes the computer program, the processor also implements the following steps:
[0120] Determine whether the data between the servers are consistent based on the process version number and logical service version number of each server at adjacent time points.
[0121] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0122] When the process version numbers of the servers at adjacent time points are consistent and the logical service version numbers are consistent, it is determined that the data between the servers are consistent.
[0123] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0124] When receiving each business process information sent by the main server, the current business process information is sent to the main server.
[0125] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0126] Receive the prompt information sent by the main server; the prompt information is used to indicate that the main server determines that the duration of sending the current business process information is greater than the preset duration.
[0127] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0128] According to the process version number and the logical service version number of each server, the stored process version number and the logical service version number of each server are updated.
[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0130] Receive the business process information of each server sent by the main server in the distributed server cluster at a preset time interval;
[0131] Based on the business process information of each server at adjacent time points, determine whether the data between the servers is consistent.
[0132] In one embodiment, the business process information includes a process version number and a logical service version number; when the computer program is executed by the processor, the following steps are also implemented:
[0133] Determine whether the data between the servers are consistent based on the process version number and logical service version number of each server at adjacent time points.
[0134] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0135] When the process version numbers of the servers at adjacent time points are consistent and the logical service version numbers are consistent, it is determined that the data between the servers are consistent.
[0136] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0137] When receiving each business process information sent by the main server, the current business process information is sent to the main server.
[0138] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0139] Receive the prompt information sent by the main server; the prompt information is used to indicate that the main server determines that the duration of sending the current business process information is greater than the preset duration.
[0140] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0141] According to the process version number and the logical service version number of each server, the stored process version number and the logical service version number of each server are updated.
[0142] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0143] Receive the business process information of each server sent by the main server in the distributed server cluster at a preset time interval;
[0144] Based on the business process information of each server at adjacent time points, determine whether the data between the servers is consistent.
[0145] In one embodiment, the business process information includes a process version number and a logical service version number; when the computer program is executed by the processor, the following steps are also implemented:
[0146] Determine whether the data between the servers are consistent based on the process version number and logical service version number of each server at adjacent time points.
[0147] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0148] When the process version numbers of the servers at adjacent time points are consistent and the logical service version numbers are consistent, it is determined that the data between the servers are consistent.
[0149] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0150] When receiving each business process information sent by the main server, the current business process information is sent to the main server.
[0151] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0152] Receive the prompt information sent by the main server; the prompt information is used to indicate that the main server determines that the duration of sending the current business process information is greater than the preset duration.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0154] According to the process version number and the logical service version number of each server, the stored process version number and the logical service version number of each server are updated.
[0155] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0156] Those skilled 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 the memory, database or other medium 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, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. 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). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0157] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the embodiments of the present application 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.
[0158] The above-described 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 present application. 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 present application shall be subject to the attached claims.
Claims
1. A method for determining data consistency, characterized in that: The method comprises: Receive the business process information of each server sent by the main server in the distributed server cluster at a preset time interval; Whether the data between the servers are consistent is determined according to the business process information of the servers at adjacent time points.
2. The method according to claim 1, characterized in that The business process information includes a process version number and a logical service version number; The determining whether data between the servers are consistent according to the business process information of the servers at adjacent time points includes: Whether the data among the servers are consistent is determined according to the process version number and the logical service version number of each server at the adjacent time points.
3. The method according to claim 2, characterized in that The determining whether data between the servers are consistent according to the process version numbers and logical service version numbers of the servers at adjacent time points includes: When the process version numbers of the servers at the adjacent time points are consistent and the logical service version numbers are consistent, it is determined that the data between the servers are consistent.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When receiving each of the business process information sent by the main server, the current business process information is sent to the main server.
5. The method according to claim 4, characterized in that The method further comprises: Receive a prompt message sent by the main server; the prompt message is used to indicate that the main server determines that the duration of sending the current business process information is greater than a preset duration.
6. The method according to claim 2, characterized in that The method further comprises: According to the process version number and the logical service version number of each server, the stored process version number and the logical service version number of each server are updated.
7. A device for determining data consistency, characterized in that: The device comprises: The receiving module is used to receive the business process information of each server sent by the main server in the distributed server cluster according to the preset time interval; The determination module is used to determine whether the data between the servers are consistent according to the business process information of the servers at adjacent time points.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, 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.
10. A computer program product, comprising a computer program, 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.