CN110674156A - Multi-machine room data synchronization method, computing equipment and computer storage medium - Google Patents

Multi-machine room data synchronization method, computing equipment and computer storage medium Download PDF

Info

Publication number
CN110674156A
CN110674156A CN201910927224.XA CN201910927224A CN110674156A CN 110674156 A CN110674156 A CN 110674156A CN 201910927224 A CN201910927224 A CN 201910927224A CN 110674156 A CN110674156 A CN 110674156A
Authority
CN
China
Prior art keywords
data
synchronized
machine room
rooms
machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910927224.XA
Other languages
Chinese (zh)
Other versions
CN110674156B (en
Inventor
贺鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ireader Technology Co Ltd
Zhangyue Technology Co Ltd
Original Assignee
Zhangyue Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhangyue Technology Co Ltd filed Critical Zhangyue Technology Co Ltd
Priority to CN201910927224.XA priority Critical patent/CN110674156B/en
Publication of CN110674156A publication Critical patent/CN110674156A/en
Application granted granted Critical
Publication of CN110674156B publication Critical patent/CN110674156B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The invention discloses a method for synchronizing data of multiple computer rooms, a computing device and a computer storage medium, wherein the method comprises the following steps: when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room; sequentially comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms to obtain a plurality of size relations corresponding to a plurality of machine rooms; and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing. The scheme of the invention can accurately find the data conflict between the machine rooms, provide basis for service check, and avoid the influence of inconsistent data on the external service provision of the machine rooms.

Description

Multi-machine room data synchronization method, computing equipment and computer storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method for synchronizing multi-computer-room data, computing equipment and a computer storage medium.
Background
With the increase of the service volume and the expansion of the service range, a single machine room often cannot provide stable and reliable services, and under the condition, the deployment of multiple machine rooms is a common choice. Meanwhile, the data in each machine room are kept consistent and synchronous, and accurate and consistent service can be provided for the outside independently. In the prior art, in a scheme of performing data synchronization processing on multiple computer rooms, only inconsistent data in multiple computer rooms are simply synchronized, and the scheme has a good synchronization effect on the situation of inconsistent data caused by normal data update.
However, in practice, there are many situations that may cause the same data in at least two rooms to be abnormally inconsistent, i.e., to conflict. For example, in the synchronization process, updated data is not synchronized to the machine room a, and the same data in the machine room a is updated, so that the same data in the machine room a and other machine rooms conflict; for another example, if the same data in room a and room B are updated almost simultaneously in a short time interval, a data collision may also occur. The synchronization scheme in the prior art cannot find the data conflicts, so that some verification services lack verification bases, and even the data synchronization cannot be effectively performed for the conflicts.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method, a computing device and a computer storage medium for synchronizing multi-room data that overcome or at least partially solve the above-mentioned problems.
According to an aspect of the present invention, there is provided a method for synchronizing multi-room data, including:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
According to yet another aspect of the present invention, there is provided a computing device comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
According to yet another aspect of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
According to the multi-machine room data synchronization method, the computing equipment and the computer storage medium, whether data of any two machine rooms conflict or not is determined through comparison of the data update values of the two machine rooms corresponding to the same machine room in the data update identifications, so that the data conflict can be accurately found, and the conflict information can be conveniently recorded subsequently for guiding actual services; and after data conflicts of any two computer rooms are found, data synchronization processing is carried out according to the time identification so as to ensure data consistency between the computer rooms, and each computer room can independently provide consistent service for the outside. Therefore, according to the scheme of the invention, by comparing the data updating identifiers and carrying out data synchronization processing through the time identifiers after the conflict is found through comparison, the data conflict can be accurately found, a basis is provided for service check, the data synchronization can be effectively carried out under the condition that the conflict is found, and the condition that the service is provided by a machine room due to the fact that the data are inconsistent is avoided.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart illustrating a method embodiment of the synchronization of multi-room data of the present invention;
FIG. 2 is a flow chart illustrating another embodiment of a method for synchronizing multi-room data in accordance with the present invention;
FIG. 3 shows a schematic diagram of a computing device of an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 shows a flowchart of an embodiment of the synchronization method of multi-room data of the present invention. The method is used for discovering data conflict among the computer rooms and finishing data synchronization under the conflict condition. As shown in fig. 1, the method comprises the steps of:
step S110: when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to the machine rooms, and any data updating value is used for marking the data updating operation of any machine room.
For each machine room, each service data has its data update identifier in the machine room, and the data update identifier of each service data in the machine room is related to the update condition of the service data in multiple machine rooms, specifically, any data update value constituting the data update identifier is related to the update operation of the service data in any machine room, for example, the number of updates is in direct proportion to the data update value, and the greater the number of updates, the greater the update data value. And the data updating mark is composed of a plurality of data updating values corresponding to a plurality of machine rooms, wherein each updating value is in one-to-one correspondence with the data updating operation of the corresponding machine room. It should be noted that, in the present invention, the specific form of the data update identifier is not limited, and may be in a vector form, an encoded form, a matrix form, or the like. The data update identification is illustrated below in vector form:
for example, assuming that there are 3 rooms, namely, rooms a, B and C, for the data to be synchronized S1, the data update flag of the data to be synchronized S1 in room C can be represented as {1, 0, 2} if the data to be synchronized S1 in the 3 rooms are updated for 1, 0 and 2 times, and the data update flag of the data to be synchronized S1 in both rooms a and B can be represented as {1, 0, 1} if the data to be synchronized S1 in room C is not synchronized with rooms a and B.
And the time identification represents the time of the latest data updating operation of the data to be synchronized in each computer room. Continuing with the above example, assuming that the time of the last data update operation of the data to be synchronized S1 in room A is 20 hours, 20 minutes and 20 seconds, the time stamp of the data to be synchronized S1 in room A can be represented as 20:20: 20.
Step S120: and sequentially comparing the data to be synchronized with two data updating values corresponding to the same machine room in the data updating marks of any two machine rooms to obtain a plurality of size relations corresponding to a plurality of machine rooms.
In the invention, the data conflict between the machine rooms is discovered through the data updating identification, and then the conflict information can be accurately obtained so as to guide the actual checking business, such as the reconciliation business.
Specifically, for any two computer rooms in the multiple computer rooms, the two data update values of the data to be synchronized corresponding to the same computer room in the data update identifiers of the any two computer rooms are compared in size, so that multiple size relationships corresponding to the multiple computer rooms can be obtained. Wherein the size relationship includes greater than, equal to, and/or less than. Namely: if the multiple machine rooms are n machine rooms (where n is an integer greater than or equal to 2), the data update identifier of each machine room in any two machine rooms is composed of n data update values of the n machine rooms, and when the data update identifiers of the two machine rooms are compared, each machine room in the n machine rooms is traversed, the data update value of the traversed machine room in the data update identifier of the first machine room in any two machine rooms is compared with the data update value of the traversed machine room in the data update identifier of the second machine room in any two machine rooms, and then n size relationships corresponding to the n machine rooms traversed sequentially can be obtained.
Still taking the example in step S110, if any two machine rooms are the machine room B and the machine room C, the data update identifier of the machine room B is {1, 0, 1}, and the data update identifier of the machine room C is {1, 0, 2}, then the data update values 1, 0, 1 corresponding to the machine rooms a, B, C in the data update identifier of the machine room B are respectively compared with the data update values 1, 0, 2 corresponding to the machine rooms a, B, C in the data update identifier of the machine room C, to obtain the size relationship of the data update value of the corresponding machine room a as 1, the size relationship of the data update value of the corresponding machine room B as 0, and the size relationship of the data update value of the corresponding machine room C as 1< 2.
Step S130: and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
The plurality of size relationships are completely consistent, namely the plurality of size relationships are all larger than or equal to each other, or the plurality of size relationships are all smaller than or equal to each other; otherwise, the magnitude relationship is considered not to be completely consistent.
Specifically, if the size relationships of the data update values corresponding to the same machine room are completely consistent, it is indicated that the size relationships corresponding to the multiple machine rooms all show that the data to be synchronized in the first machine room in any two machine rooms is at least newer than the data to be synchronized in the second machine room, or the data to be synchronized in the first machine room in any two machine rooms is at least older than the data to be synchronized in the second machine room, and at this time, there is no data conflict. Otherwise, that is, the size relationships of the data update values corresponding to the same machine room are not completely consistent, it indicates that the old and new conditions of the data to be synchronized displayed corresponding to the size relationships of different machine rooms are not consistent, and at this time, there is a data conflict.
In the above comparison result between the data update identifier of the machine room B and the data update identifier of the machine room C, if the data update values corresponding to the machine rooms in the data update identifier of the machine room B are all smaller than or equal to the data update values of the same machine room in the data update values of the machine room C (1 is 1, 0 is 0, and 1 is 2), then there is no data conflict. If the data to be synchronized S1 is updated in room B at the same time as the data to be synchronized S1 is updated in room C, the data update identifier of the machine room B is updated to {1, 1, 1}, the data update values 1, 1, 1 of the corresponding machine rooms a, B, C in the data update identifier of the machine room B are respectively compared with the data update values 1, 0, 2 of the same corresponding machine rooms a, B, C in the data update identifier of the machine room C, and the size relationship of the data update value of the corresponding machine room a is 1, the size relationship of the data update value corresponding to the machine room B is 1>0, and the size relationship of the data update value corresponding to the machine room C is 1<2, and obviously, the size relationships of the data update values of the machine room B and the machine room C are inconsistent (1>0 and 1<2 are inconsistent), then the data collision generated after the almost simultaneous update can be found.
Furthermore, when data conflict is found through comparison of the data updating marks, the data to be synchronized under the conflict condition are synchronized through the time marks. The time identification can reflect the time for updating the data, the more the time identification is updated, the more the data to be synchronized is updated, based on the time identification, the latest data to be synchronized in any two machine rooms can be determined according to the time identification of the data to be synchronized in any two machine rooms, and further data synchronization processing can be performed according to the latest data to be synchronized in any two machine rooms. In this way, the synchronous processing of the data can be completed under the condition that data conflict exists, so that the data consistency among the machine rooms is ensured. It should be noted that, in the present invention, a specific synchronization manner is not limited, and alternatively, data synchronization may be performed between any two machine rooms only by using the time identifiers of the any two machine rooms, or data synchronization may be performed between all machine rooms by using the time identifiers of the any two machine rooms and the time identifiers of other machine rooms.
According to the synchronization method of the multi-machine room data provided by the embodiment, whether the data of any two machine rooms conflict or not is determined by comparing the sizes of the data update values corresponding to the same machine room in the data update identifications of any two machine rooms, so that the data conflict can be accurately found, and the conflict information can be conveniently recorded subsequently for guiding the actual service; and after data conflicts of any two computer rooms are found, data synchronization processing is carried out according to the time identification so as to ensure data consistency between the computer rooms, and each computer room can independently provide consistent service for the outside. Therefore, according to the scheme of the embodiment, by comparing the data updating identifiers and performing data synchronization processing through the time identifiers after the conflict is found through comparison, the data conflict can be accurately found, a basis is provided for service check, data synchronization can be effectively performed under the condition that the conflict is found, and the condition that the external service provision of a machine room is influenced due to the inconsistency of the data is avoided.
Fig. 2 is a flow chart of another embodiment of the synchronization method of multi-room data of the present invention. As shown in fig. 2, the method comprises the steps of:
step S210: when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to the machine rooms, and any data updating value is used for marking the data updating operation of any machine room.
The trigger mode can trigger to find conflict and carry out data synchronization in time when any data to be synchronized of a certain machine room is updated, so that the data height of each machine room is ensured to be consistent; or, the data synchronization of multiple machine rooms can be triggered at regular time, and the triggering mode can periodically perform conflict detection and data synchronization, so that the calculation amount is reduced.
Specifically, for any data to be synchronized, the data to be synchronized has its data update identifier and time identifier in each machine room. For each machine room, when it is detected that the data to be synchronized in the machine room is updated, the data update identifier and the time identifier of the machine room are updated, that is, the data update identifier and the time identifier of the data to be synchronized in each machine room are updated according to the update of the data to be synchronized in the machine room. The time identification is the time for updating data, and when the data to be synchronized in the machine room is detected to be updated, the time identification is determined according to the updating time; and the data updating mark is composed of data updating values of a plurality of machine rooms, when the data updating mark of the machine room is updated, the data updating value of the machine room in the updating mark of the machine room is added according to a preset added value, and the data updating values of other machine rooms in the updating mark of the machine room are kept unchanged, in other words, when the data to be synchronized of a certain machine room is updated, the data updating value of the machine room in the data updating mark of the certain machine room is added.
For example, the data update identifier of the data to be synchronized S2 in the machine room a is {0, 0}, where the first 0 is the data update value corresponding to the machine room a, the second 0 is the data update value corresponding to the machine room B, and at this time, the data to be synchronized S2 is an initial value, and if the data to be synchronized S2 is updated in the machine room a, the first 0 in the data update identifier of the machine room a is processed by adding 1, and the data update identifier of the data to be synchronized in the machine room a is obtained by updating {0, 0 }.
Furthermore, in actual implementation, an identification field for storing a data update identification and a time identification may be added for each service data line, and when data update is performed on the service data line, the data update identification and the time identification in the identification field are updated at the same time, and when data is read, the data update identification and the time identification in the identification field are read. The method for maintaining the data updating identification and the time identification can be widely applied to a synchronous scene of multi-computer-room data based on various databases, and typically, a proxy server is added in front of MYSQL in a MYSQL database, when business personnel update the business data through the proxy server, the data updating identification and the time identification in the identification field of the business data are updated at the same time, and the field value of the identification field is read when binlog is read, so that the data updating identification and the time identification corresponding to the business data are obtained.
Step S220: and sequentially comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms to obtain a plurality of size relations corresponding to a plurality of machine rooms.
Any two computer rooms are taken as a group, and data conflict is determined between any two computer rooms through comparison of data updating values in the data updating marks, and data synchronization processing is carried out.
Specifically, any two machine rooms are selected for comparison, wherein in the embodiment that data synchronization of multiple machine rooms is triggered by updating of data to be synchronized, the any two machine rooms comprise the machine rooms with the updated data to be synchronized, so that whether conflict exists in current updating or not can be determined quickly; alternatively, in other embodiments, any two rooms are any two of the multiple rooms. When the comparison is carried out, the data updating values of the data to be synchronized in the same machine rooms in the data updating marks of any two machine rooms are compared in size, and then a plurality of size relations corresponding to the plurality of machine rooms can be obtained. For example, if there are 2 rooms, 2 size relationships are obtained, and if there are 3 rooms, 3 size relationships are obtained.
Step S230: judging whether the size relations are completely consistent; if not, go to step S240; if yes, go to step S250.
The multiple size relationships are completely consistent, that is, the multiple size relationships are all greater than or equal to each other, or the multiple size relationships are all less than or equal to each other, the multiple size relationships include that the data update value of any one machine room in the data update identifications of the first machine rooms in any two machine rooms is greater than or equal to the data update value of any one machine room in the data update identifications of the second machine room, and at the moment, the multiple size relationships corresponding to the multiple machine rooms display that the data to be synchronized of the first machine room in any two machine rooms are at least new to the data to be synchronized of the second machine room; or the data update value of any one of the data update identifications of the first machine room in any two machine rooms is smaller than or equal to the data update value of any one of the data update identifications of the second machine room in any two machine rooms, and at the moment, the data to be synchronized of the first machine room in any two machine rooms is displayed at least older than the data to be synchronized of the second machine room corresponding to a plurality of size results of the plurality of machine rooms.
Conversely, if the plurality of size relationships are not all greater than or equal to or not all less than or equal to, the size relationships are considered to be not completely consistent. Accordingly, the case where the magnitude relationship is not completely consistent further includes: the data updating value of some machine rooms in the data updating marks of the first machine rooms in any two machine rooms is larger than the data updating value of some machine rooms in the data updating marks of the second machine room, and the data updating values of other machine rooms in the data updating marks of the first machine rooms in any two machine rooms, except the some machine rooms, are smaller than the data updating values of the other machine rooms in the data updating marks of the second machine room; or the data update values of some of the data update identifications of the first machine room in any two machine rooms are smaller than the data update values of some of the data update identifications of the second machine room, and the data update values of other machine rooms except the some of the data update identifications of the first machine room in any two machine rooms are larger than the data update values of the other machine rooms in the data update identifications of the second machine room. In both of the above two cases, the comparison result of the sizes of the corresponding machine rooms shows that the data to be synchronized in the first machine room is updated, and the data update values corresponding to other machine rooms show that the data to be synchronized in the second machine room is updated, so that data conflict exists.
Step S240: and calling the time identifications of the data to be synchronized in any two computer rooms to perform data synchronization processing.
Specifically, if the size relationships corresponding to the multiple machine rooms are not completely consistent, which indicates that the data to be synchronized conflicts between any two machine rooms, the time identifiers of the data to be synchronized in any two machine rooms are called to perform data synchronization processing.
Furthermore, during synchronization, data synchronization processing can be performed only according to the time identifications of the data to be synchronized in any two machine rooms, and the time identification with the latest update time distance from the time identifications of the data to be synchronized in any two machine rooms is determined and used as the synchronization time identification; performing data synchronization processing between any two machine rooms according to the data to be synchronized in the machine room corresponding to the synchronization time identifier, synchronizing the latest data to be synchronized to the machine room with the older data in any two machine rooms, and then the data synchronization of any two machine rooms is completed, and the synchronization of the data to be synchronized between other machine rooms in the plurality of machine rooms can be further completed by selecting any two machine rooms and comparing and synchronizing the data updating marks, a data conflict that exists between any two rooms may be discovered and data synchronized between the any two rooms for the conflict situation, and then all conflicts of the data to be synchronized can be found, the data synchronization can be carried out in a targeted manner, sufficient basis can be provided for the follow-up auditing work depending on the conflict information, and the accurate auditing work can be favorably carried out.
Or, during synchronization, data to be synchronized may be synchronized between multiple computer rooms according to the time identifier of the data to be synchronized in each computer room (including the time identifiers in any two computer rooms). When data conflict exists between the data to be synchronized in any two computer rooms, searching the latest time identifier from the time identifiers of the data to be synchronized in each computer room, and synchronizing the data to be synchronized in the computer room corresponding to the latest time identifier to other computer rooms. Through the mode, when data conflict is found, the data to be synchronized in the multiple machine rooms are synchronized uniformly, so that the data synchronization in the multiple machine rooms is finished at one time, the synchronization times are reduced, and the synchronization efficiency is improved.
In addition, in some alternative embodiments of the present invention, after determining that the plurality of size relationships are not completely consistent, the step S240 is not directly performed, and the data type of the data to be synchronized is further determined. And when the data type of the data to be synchronized is determined to be the assignment type, executing the step S240, that is, invoking the time identifiers of the data to be synchronized in any two computer rooms to perform data synchronization processing. The data to be synchronized of the assignment type is data which can be modified in an assignment mode, for example, a nickname of a user is the assignment type, each modification only needs to assign a new nickname to the nickname, and for the data of the type, the latest data is determined by using the time identifier and is synchronized to other machine rooms. By the method, whether the data to be synchronized is suitable for synchronization by using the time identifier is determined according to the data type, and the problem that the synchronization result is inaccurate when the synchronization method is used for synchronization of other types of data is avoided, so that the synchronization accuracy is further improved while the time identifier is called to perform data synchronization to ensure the consistency of the data of multiple computer rooms.
And when the data type of the data to be synchronized is judged to be the addition type, accumulating the multiple updating operations according to the data updating records of the data to be synchronized in any two machine rooms, and performing synchronous processing on the data to be synchronized in any two machine rooms according to the accumulation result. Wherein, the addition type data to be synchronized is data that can be modified through addition operation, for example, the account balance is an assignment type, after each time the user charges or consumes, the user needs to further perform addition operation (including adding a charge amount or subtracting a consumption amount) on the basis of the original balance, for this type of data, according to the data update record in any two machine rooms, it can be determined that the data to be synchronized is updated in each machine room of any two machine rooms last time, then two times of the latest update operations in any two machine rooms are accumulated, the accumulation operation is performed on the basis of the data to be synchronized in any two machine rooms before the latest update operation, for example, before the latest update, the account balances in machine rooms a and B are both 10 yuan, the update record in machine room a shows that the latest update operation is 5 blocks of charge, and the update record in the machine room B shows that the latest update operation is 8 blocks consumed, the accumulation is 10+5-8, the obtained latest account balance is 7 yuan, and the result is synchronized into the machine room A and the machine room B.
Step S250: and calling the update marks of the data to be synchronized in any two computer rooms to perform data synchronization processing between any two computer rooms.
Specifically, if the size relationships corresponding to the multiple machine rooms are completely consistent, it is indicated that data conflict does not exist between any two machine rooms for the data to be synchronized, and when attention needs to be paid, it can only be indicated that the data to be synchronized does not exist between any two machine rooms, and accordingly, data synchronization processing can only be performed between any two machine rooms, and synchronization between all machine rooms is not appropriate. And as for data synchronization between other machine rooms, any two machine rooms are selected from the other machine rooms to compare data updating marks and then synchronization is carried out.
Further, when data synchronization processing is performed according to the update identifier, the machine room where the latest data to be synchronized in any two machine rooms is located is determined according to the plurality of size relationships corresponding to the plurality of machine rooms, which are obtained through comparison. If non-equal relations (including greater or less) exist in the plurality of size relations in any two machine rooms, and the data updating values corresponding to all the machine rooms in the data updating marks of the first machine room in the non-equal relations are greater than the data updating values of the same machine room in the data updating marks of the second machine room, determining that the latest data to be synchronized is in the first machine room; or the data update values corresponding to all the machine rooms in the data update identifications of the first machine room in the non-equal relation are all smaller than the data update values of the same machine room in the data update identifications of the second machine room, and then the latest data to be synchronized are determined to be in the second machine room. And then, synchronizing the data to be synchronized in the determined machine room to another machine room. It should be noted that, if there is no non-equal relationship (i.e. all equal relationships) in the size relationships, it indicates that the data to be synchronized in any two rooms are consistent, and there is no need to perform synchronization processing between any two rooms.
In the embodiment, only for the case of conflict, the time identifier is used for synchronization, so that the dependence on time is reduced, and the influence on the accuracy of synchronization caused by the inconsistency of the clocks of a plurality of machine rooms is avoided.
In addition, after the data synchronization process is performed in step S240 or step S250, the data update flag and the time flag of the synchronized destination room are updated to the data update flag and the time flag of the synchronized source room. After the data to be synchronized of the source machine room is synchronized to the target machine room, the data updating identification and the time identification of the source machine room are further synchronized to the target machine room, so that the data updating identification and the time identification of the synchronized data in the target machine room are the same as those of the source data, and further the accurate judgment and synchronization of subsequent data conflicts are facilitated.
According to the synchronization method of the multi-machine room data provided by the embodiment, whether the data of any two machine rooms conflict or not is determined by comparing the sizes of the data update values corresponding to the same machine room in the data update identifications of any two machine rooms, so that the data conflict can be accurately found, and the conflict information can be conveniently recorded subsequently for guiding the actual service; after data conflicts of any two machine rooms are found, data synchronization processing is carried out according to the time identification so as to ensure data consistency between the machine rooms, and each machine room can independently provide consistent service for the outside; in addition, for any two machine rooms without data conflict, data synchronization processing is carried out according to the data updating marks, so that data synchronization under normal conditions does not depend on time marks, and the problem that the accuracy of synchronization is influenced due to the fact that clocks of a plurality of machine rooms are inconsistent is avoided.
The embodiment of the invention provides a nonvolatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the synchronization method of the multi-computer-room data in any method embodiment.
The executable instructions may be specifically configured to cause the processor to:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
In an optional manner, the case that the plurality of size relationships are completely consistent further includes:
the data updating value of any one of the data updating marks of the first machine room in any two machine rooms is larger than or equal to the data updating value of any one of the data updating marks of the second machine room; alternatively, the first and second electrodes may be,
and the data updating value of any machine room in the data updating marks of the first machine rooms in any two machine rooms is smaller than or equal to the data updating value of any machine room in the data updating marks of the second machine room in any two machine rooms.
In an alternative, upon determining that the plurality of magnitude relationships are not completely consistent, the executable instructions further cause the processor to: judging the data type of the data to be synchronized;
the step of calling the time identifiers of the data to be synchronized in any two computer rooms for data synchronization processing further comprises the following steps: and when the type of the data to be synchronized is judged to be an assignment type, calling the time identifications of the data to be synchronized in any two machine rooms for data synchronization processing.
In an alternative, the executable instructions further cause the processor to:
determining a time identifier with the updating time nearest to the current time from the time identifiers of the data to be synchronized in any two computer rooms, and using the time identifier as a synchronization time identifier;
and carrying out data synchronization processing between any two machine rooms according to the data to be synchronized in the machine room corresponding to the synchronization time identifier.
In an alternative, the executable instructions further cause the processor to: and when the data type of the data to be synchronized is judged to be the addition type, accumulating the multiple updating operations according to the data updating records of the data to be synchronized in any two machine rooms, and modifying the data to be synchronized in any two machine rooms according to the accumulation result to obtain the latest value of the data to be synchronized in any two machine rooms.
In an alternative, if the plurality of size relationships are determined to be completely consistent, the executable instructions further cause the processor to: and calling the update marks of the data to be synchronized in any two computer rooms to perform data synchronization processing between any two computer rooms.
In an alternative, after the data synchronization process between any two rooms, the executable instructions further cause the processor to: and updating the data updating identification and the time identification of the synchronous destination machine room into the data updating identification and the time identification of the synchronous source machine room.
In an alternative, the executable instructions further cause the processor to: and for each machine room, when the data to be synchronized of the machine room is detected to be updated, updating the data updating identifier and the time identifier of the machine room.
In an alternative, the executable instructions further cause the processor to: and adding the data updating value of the machine room in the updating mark of the machine room according to a preset added value, and keeping the data updating values of other machine rooms in the updating mark of the machine room unchanged.
Fig. 3 is a schematic structural diagram of an embodiment of the computing device of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 3, the computing device may include: a processor (processor)302, a communication Interface 304, a memory 306, and a communication bus 308.
Wherein: the processor 302, communication interface 304, and memory 306 communicate with each other via a communication bus 308. A communication interface 304 for communicating with network elements of other devices, such as clients or other servers. The processor 302, configured to execute the program 310, may specifically perform relevant steps in the above-described embodiment of the method for synchronizing multi-room data for a computing device.
In particular, program 310 may include program code comprising computer operating instructions.
The processor 302 may be a central processing unit CPU, or an application specific Integrated circuit (asic), or one or more Integrated circuits configured to implement an embodiment of the present invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 306 for storing a program 310. Memory 306 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 310 may specifically be configured to cause the processor 302 to perform the following operations:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
In an optional manner, the case that the plurality of size relationships are completely consistent further includes:
the data updating value of any one of the data updating marks of the first machine room in any two machine rooms is larger than or equal to the data updating value of any one of the data updating marks of the second machine room; alternatively, the first and second electrodes may be,
and the data updating value of any machine room in the data updating marks of the first machine rooms in any two machine rooms is smaller than or equal to the data updating value of any machine room in the data updating marks of the second machine room in any two machine rooms.
In an alternative, upon determining that the plurality of magnitude relationships are not completely consistent, the program 310 causes the processor to: judging the data type of the data to be synchronized;
the step of calling the time identifiers of the data to be synchronized in any two computer rooms for data synchronization processing further comprises the following steps: and when the type of the data to be synchronized is judged to be an assignment type, calling the time identifications of the data to be synchronized in any two machine rooms for data synchronization processing.
In an alternative, the program 310 causes the processor to:
determining a time identifier with the updating time nearest to the current time from the time identifiers of the data to be synchronized in any two computer rooms, and using the time identifier as a synchronization time identifier;
and carrying out data synchronization processing between any two machine rooms according to the data to be synchronized in the machine room corresponding to the synchronization time identifier.
In an alternative, the program 310 causes the processor to: and when the data type of the data to be synchronized is judged to be the addition type, accumulating the multiple updating operations according to the data updating records of the data to be synchronized in any two machine rooms, and modifying the data to be synchronized in any two machine rooms according to the accumulation result to obtain the latest value of the data to be synchronized in any two machine rooms.
In an alternative, if it is determined that the magnitude relationships are completely consistent, the program 310 causes the processor to: and calling the update marks of the data to be synchronized in any two computer rooms to perform data synchronization processing between any two computer rooms.
In an alternative, the program 310 causes the processor to: and updating the data updating identification and the time identification of the synchronous destination machine room into the data updating identification and the time identification of the synchronous source machine room.
In an alternative, the program 310 causes the processor to: and for each machine room, when the data to be synchronized of the machine room is detected to be updated, updating the data updating identifier and the time identifier of the machine room.
In an alternative, the program 310 causes the processor to: and adding the data updating value of the machine room in the updating mark of the machine room according to a preset added value, and keeping the data updating values of other machine rooms in the updating mark of the machine room unchanged.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.
The invention discloses: A1. a method for synchronizing multi-computer-room data comprises the following steps:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
A2. The method according to a1, wherein the case where the plurality of size relationships are completely consistent further comprises:
the data updating value of any one of the data updating marks of the first machine room in any two machine rooms is larger than or equal to the data updating value of any one of the data updating marks of the second machine room; alternatively, the first and second electrodes may be,
and the data updating value of any machine room in the data updating marks of the first machine rooms in any two machine rooms is smaller than or equal to the data updating value of any machine room in the data updating marks of the second machine room in any two machine rooms.
A3. The method of a1 or a2, wherein, upon determining that the plurality of size relationships are not completely consistent, the method further comprises: judging the data type of the data to be synchronized;
the step of calling the time identifiers of the data to be synchronized in any two computer rooms for data synchronization processing further comprises the following steps: and when the type of the data to be synchronized is judged to be an assignment type, calling the time identifications of the data to be synchronized in any two machine rooms for data synchronization processing.
A4. The method according to any one of a1-A3, wherein the data synchronization processing according to the time identifiers of the data to be synchronized in any two computer rooms specifically comprises:
determining a time identifier with the updating time nearest to the current time from the time identifiers of the data to be synchronized in any two computer rooms, and using the time identifier as a synchronization time identifier;
and carrying out data synchronization processing between any two machine rooms according to the data to be synchronized in the machine room corresponding to the synchronization time identifier.
A5. The method of a3, wherein the method further comprises: and when the data type of the data to be synchronized is judged to be the addition type, accumulating the multiple updating operations according to the data updating records of the data to be synchronized in any two machine rooms, and synchronizing the data to be synchronized in any two machine rooms according to the accumulation result.
A6. The method of a1, wherein if it is determined that the size relationships are completely consistent, the method further comprises: and calling the update marks of the data to be synchronized in any two computer rooms to perform data synchronization processing between any two computer rooms.
A7. The method of any of a1-a6, wherein after the data synchronization process between any two rooms, the method further comprises: and updating the data updating identification and the time identification of the synchronous destination machine room into the data updating identification and the time identification of the synchronous source machine room.
A8. The method of any one of a1-a7, wherein the method further comprises: and for each machine room, when the data to be synchronized of the machine room is detected to be updated, updating the data updating identifier and the time identifier of the machine room.
A9. The method according to A8, wherein the data update flag for updating the machine room is specifically: and adding the data updating value of the machine room in the updating mark of the machine room according to a preset added value, and keeping the data updating values of other machine rooms in the updating mark of the machine room unchanged.
The invention discloses: B10. a computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
B11. The computing device of B10, wherein the plurality of instances of full correspondence in size further comprises:
the data updating value of any one of the data updating marks of the first machine room in any two machine rooms is larger than or equal to the data updating value of any one of the data updating marks of the second machine room; alternatively, the first and second electrodes may be,
and the data updating value of any machine room in the data updating marks of the first machine rooms in any two machine rooms is smaller than or equal to the data updating value of any machine room in the data updating marks of the second machine room in any two machine rooms.
B12. The computing device of either B10 or B11, wherein, upon determining that the plurality of size relationships are not completely consistent, the executable instructions further cause the processor to: judging the data type of the data to be synchronized;
the step of calling the time identifiers of the data to be synchronized in any two computer rooms for data synchronization processing further comprises the following steps: and when the type of the data to be synchronized is judged to be an assignment type, calling the time identifications of the data to be synchronized in any two machine rooms for data synchronization processing.
B13. The computing device of any one of B10-B12, wherein the executable instructions further cause the processor to:
determining a time identifier with the updating time nearest to the current time from the time identifiers of the data to be synchronized in any two computer rooms, and using the time identifier as a synchronization time identifier;
and carrying out data synchronization processing between any two machine rooms according to the data to be synchronized in the machine room corresponding to the synchronization time identifier.
B14. The computing device of B12, wherein the executable instructions further cause the processor to: and when the data type of the data to be synchronized is judged to be the addition type, accumulating the multiple updating operations according to the data updating records of the data to be synchronized in any two machine rooms, and modifying the data to be synchronized in any two machine rooms according to the accumulation result to obtain the latest value of the data to be synchronized in any two machine rooms.
B15. The computing device of B10, wherein, if it is determined that the plurality of size relationships are completely consistent, the executable instructions further cause the processor to: and calling the update marks of the data to be synchronized in any two computer rooms to perform data synchronization processing between any two computer rooms.
B16. The computing device of any of B10-B15, wherein, after the data synchronization processing between the any two rooms, the executable instructions further cause the processor to: and updating the data updating identification and the time identification of the synchronous destination machine room into the data updating identification and the time identification of the synchronous source machine room.
B17. The computing device of any one of B10-B16, wherein the executable instructions further cause the processor to: and for each machine room, when the data to be synchronized of the machine room is detected to be updated, updating the data updating identifier and the time identifier of the machine room.
B18. The computing device of B17, wherein the executable instructions further cause the processor to: and adding the data updating value of the machine room in the updating mark of the machine room according to a preset added value, and keeping the data updating values of other machine rooms in the updating mark of the machine room unchanged.
The invention discloses: C19. a computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
C20. The computer storage medium of C19, wherein the plurality of instances of complete correspondence further comprises:
the data updating value of any one of the data updating marks of the first machine room in any two machine rooms is larger than or equal to the data updating value of any one of the data updating marks of the second machine room; alternatively, the first and second electrodes may be,
and the data updating value of any machine room in the data updating marks of the first machine rooms in any two machine rooms is smaller than or equal to the data updating value of any machine room in the data updating marks of the second machine room in any two machine rooms.
C21. The computer storage medium of C19 or C20, wherein upon determining that the plurality of size relationships are not completely consistent, the executable instructions further cause the processor to: judging the data type of the data to be synchronized;
the step of calling the time identifiers of the data to be synchronized in any two computer rooms for data synchronization processing further comprises the following steps: and when the type of the data to be synchronized is judged to be an assignment type, calling the time identifications of the data to be synchronized in any two machine rooms for data synchronization processing.
C22. The computer storage medium of any of C19-C21, wherein the executable instructions further cause the processor to:
determining a time identifier with the updating time nearest to the current time from the time identifiers of the data to be synchronized in any two computer rooms, and using the time identifier as a synchronization time identifier;
and carrying out data synchronization processing between any two machine rooms according to the data to be synchronized in the machine room corresponding to the synchronization time identifier.
C23. The computer storage medium of C21, wherein the executable instructions further cause the processor to: and when the data type of the data to be synchronized is judged to be the addition type, accumulating the multiple updating operations according to the data updating records of the data to be synchronized in any two machine rooms, and modifying the data to be synchronized in any two machine rooms according to the accumulation result to obtain the latest value of the data to be synchronized in any two machine rooms.
C24. The computer storage medium of C19, wherein the executable instructions further cause the processor to, if it is determined that the plurality of size relationships are completely consistent: and calling the update marks of the data to be synchronized in any two computer rooms to perform data synchronization processing between any two computer rooms.
C25. The computer storage medium of any of C19-C24, wherein the executable instructions, after the data synchronization process between the any two rooms, further cause the processor to: and updating the data updating identification and the time identification of the synchronous destination machine room into the data updating identification and the time identification of the synchronous source machine room.
C26. The computer storage medium of any of C19-C25, wherein the executable instructions further cause the processor to: and for each machine room, when the data to be synchronized of the machine room is detected to be updated, updating the data updating identifier and the time identifier of the machine room.
C27. The computer storage medium of C26, wherein the executable instructions further cause the processor to: and adding the data updating value of the machine room in the updating mark of the machine room according to a preset added value, and keeping the data updating values of other machine rooms in the updating mark of the machine room unchanged.

Claims (10)

1. A method for synchronizing multi-computer-room data comprises the following steps:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
2. The method of claim 1, wherein the plurality of cases where the size relationship is completely consistent further comprises:
the data updating value of any one of the data updating marks of the first machine room in any two machine rooms is larger than or equal to the data updating value of any one of the data updating marks of the second machine room; alternatively, the first and second electrodes may be,
and the data updating value of any machine room in the data updating marks of the first machine rooms in any two machine rooms is smaller than or equal to the data updating value of any machine room in the data updating marks of the second machine room in any two machine rooms.
3. The method according to claim 1 or 2, wherein upon determining that the plurality of magnitude relationships are not completely consistent, the method further comprises: judging the data type of the data to be synchronized;
the step of calling the time identifiers of the data to be synchronized in any two computer rooms for data synchronization processing further comprises the following steps: and when the type of the data to be synchronized is judged to be an assignment type, calling the time identifications of the data to be synchronized in any two machine rooms for data synchronization processing.
4. The method according to any one of claims 1 to 3, wherein the performing data synchronization processing according to the time identifiers of the data to be synchronized in any two computer rooms specifically comprises:
determining a time identifier with the updating time nearest to the current time from the time identifiers of the data to be synchronized in any two computer rooms, and using the time identifier as a synchronization time identifier;
and carrying out data synchronization processing between any two machine rooms according to the data to be synchronized in the machine room corresponding to the synchronization time identifier.
5. The method of claim 3, wherein the method further comprises: and when the data type of the data to be synchronized is judged to be the addition type, accumulating the multiple updating operations according to the data updating records of the data to be synchronized in any two machine rooms, and synchronizing the data to be synchronized in any two machine rooms according to the accumulation result.
6. The method of claim 1, wherein if it is determined that the plurality of size relationships are completely consistent, the method further comprises: and calling the update marks of the data to be synchronized in any two computer rooms to perform data synchronization processing between any two computer rooms.
7. The method of any of claims 1-6, wherein after the synchronizing data between any two of the rooms, the method further comprises: and updating the data updating identification and the time identification of the synchronous destination machine room into the data updating identification and the time identification of the synchronous source machine room.
8. The method of any of claims 1-7, wherein the method further comprises: and for each machine room, when the data to be synchronized of the machine room is detected to be updated, updating the data updating identifier and the time identifier of the machine room.
9. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
10. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to:
when multi-machine room data synchronization is triggered, acquiring data updating marks and time marks of data to be synchronized in each machine room aiming at any data to be synchronized; the data updating mark of the data to be synchronized in each machine room comprises a plurality of data updating values corresponding to each machine room, and any data updating value is used for marking the data updating operation of any machine room;
comparing two data updating values of the data to be synchronized corresponding to the same machine room in the data updating marks of any two machine rooms in sequence to obtain a plurality of size relations corresponding to a plurality of machine rooms;
and judging whether the size relations are completely consistent, if not, calling the time identifications of the data to be synchronized in any two machine rooms to perform data synchronization processing.
CN201910927224.XA 2019-09-27 2019-09-27 Multi-machine room data synchronization method, computing equipment and computer storage medium Active CN110674156B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910927224.XA CN110674156B (en) 2019-09-27 2019-09-27 Multi-machine room data synchronization method, computing equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910927224.XA CN110674156B (en) 2019-09-27 2019-09-27 Multi-machine room data synchronization method, computing equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN110674156A true CN110674156A (en) 2020-01-10
CN110674156B CN110674156B (en) 2020-06-26

Family

ID=69079713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910927224.XA Active CN110674156B (en) 2019-09-27 2019-09-27 Multi-machine room data synchronization method, computing equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN110674156B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112487007A (en) * 2020-12-01 2021-03-12 银清科技有限公司 Multi-inter-network flow synchronous management method, device and system
CN112487007B (en) * 2020-12-01 2024-05-10 银清科技有限公司 Method, device and system for synchronously managing flow among multiple networks

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080098042A1 (en) * 2006-01-19 2008-04-24 Huawei Technologies Co., Ltd. Method for data synchronization and apparatus thereof
CN103399129A (en) * 2013-07-24 2013-11-20 西安交通大学 Method for measuring in-vitro release degree and adhering time/corrosion time of bioadhesive preparation
CN104967536A (en) * 2015-06-29 2015-10-07 北京奇虎科技有限公司 Method and device for realizing data consistency of multiple machine rooms
CN105490868A (en) * 2015-11-17 2016-04-13 世纪龙信息网络有限责任公司 Bidirectional synchronous monitoring method and system for remote computer room data
CN107404540A (en) * 2017-09-01 2017-11-28 北京奇虎科技有限公司 The synchronous method and device of data
CN108573006A (en) * 2017-06-06 2018-09-25 北京金山云网络技术有限公司 Across computer room data synchronous system, method and device, electronic equipment
CN109376197A (en) * 2018-09-28 2019-02-22 掌阅科技股份有限公司 A kind of method of data synchronization, server and computer storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080098042A1 (en) * 2006-01-19 2008-04-24 Huawei Technologies Co., Ltd. Method for data synchronization and apparatus thereof
CN103399129A (en) * 2013-07-24 2013-11-20 西安交通大学 Method for measuring in-vitro release degree and adhering time/corrosion time of bioadhesive preparation
CN104967536A (en) * 2015-06-29 2015-10-07 北京奇虎科技有限公司 Method and device for realizing data consistency of multiple machine rooms
CN105490868A (en) * 2015-11-17 2016-04-13 世纪龙信息网络有限责任公司 Bidirectional synchronous monitoring method and system for remote computer room data
CN108573006A (en) * 2017-06-06 2018-09-25 北京金山云网络技术有限公司 Across computer room data synchronous system, method and device, electronic equipment
CN107404540A (en) * 2017-09-01 2017-11-28 北京奇虎科技有限公司 The synchronous method and device of data
CN109376197A (en) * 2018-09-28 2019-02-22 掌阅科技股份有限公司 A kind of method of data synchronization, server and computer storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112487007A (en) * 2020-12-01 2021-03-12 银清科技有限公司 Multi-inter-network flow synchronous management method, device and system
CN112487007B (en) * 2020-12-01 2024-05-10 银清科技有限公司 Method, device and system for synchronously managing flow among multiple networks

Also Published As

Publication number Publication date
CN110674156B (en) 2020-06-26

Similar Documents

Publication Publication Date Title
CN107315761B (en) Data updating method, data query method and device
US11481765B2 (en) Blockchain-based transaction processing method and apparatus and electronic device
CN108055343B (en) Data synchronization method and device for computer room
CN107590207B (en) Data synchronization method and device and electronic equipment
US11250395B2 (en) Blockchain-based transaction processing methods and apparatuses and electronic devices
CN110069346B (en) Method and device for sharing resources among multiple processes and electronic equipment
EP3905172A1 (en) Blockchain-based invoice voiding method and apparatus, and electronic device
CN111897558A (en) Kubernets upgrading method and device for container cluster management system
CN110968478A (en) Log collection method, server and computer storage medium
JP6975153B2 (en) Data storage service processing method and equipment
CN111639965A (en) Integral updating method and device
CN107368513B (en) Method and device for updating client database
CN111383038A (en) Advertisement display method and device of mobile terminal, mobile terminal and storage medium
CN107391539B (en) Transaction processing method, server and storage medium
CN110674156B (en) Multi-machine room data synchronization method, computing equipment and computer storage medium
CN111061654B (en) Cache refreshing processing method and device and electronic equipment
CN106878365B (en) data synchronization method and device
CN112328602A (en) Method, device and equipment for writing data into Kafka
CN109408265B (en) IOS abnormal operation protection method and device, terminal equipment and storage medium
CN108959548B (en) Service request processing method and device
CN112948501B (en) Data analysis method, device and system
CN110515901B (en) Information pushing method, computing device and computer storage medium
CN111147568B (en) Identity data synchronization method and device
CN111371818B (en) Data request verification method, device and equipment
CN111061744B (en) Graph data updating method and device, computer equipment and storage medium

Legal Events

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