Data processing method, device, electronic device and storage medium

By comparing data timestamps in a distributed data management system, the problem of write conflicts in multiple live computer rooms is solved, and data stability and consistency are achieved.

CN115104295BActive Publication Date: 2024-12-31SHENZHEN HEYTAP TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080096825.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-25
Publication Date
2024-12-31
Estimated Expiration
2040-03-25

AI Technical Summary

Technical Problem

When multiple computer rooms write the same data at the same time, it is impossible to determine which data should be used as the basis, resulting in a write conflict and affecting stability.

Method used

In a distributed data management system, when the first-level computer room receives data sent by the second-level computer room, compare the time stamps of the data. If the same data exists in the first-level computer room and the timestamp of the second-level computer room is older, delete the old data and store the new one. Data; if the same data exists in the secondary computer room and the time stamp of the primary computer room is older, write will be refused.

Benefits of technology

It avoids simultaneous write conflicts in multiple computer rooms, improves the data processing stability of multiple computer rooms, and ensures data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115104295B_ABST
    Figure CN115104295B_ABST
Patent Text Reader

Abstract

The present application provides a data processing method, device, electronic device and storage medium, the method comprising: when receiving first data sent by a secondary computer room, obtaining the first content and the first timestamp contained in the first data; if there is second data with the same content as the first content in the memory of the primary computer room, obtaining the second timestamp of the second data; if the first timestamp is greater than the second timestamp, deleting the second data in the memory of the primary computer room and storing the first data in the memory of the primary computer room. The method divides the multi-active computer room into a primary computer room and a secondary computer room, the secondary computer room sends data to the primary computer room, and the primary computer room determines which data to save based on the timestamp. The method can effectively avoid simultaneous write conflicts in multiple active computer rooms and ensure data consistency in multiple active computer rooms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of distributed data management, and in particular to a data processing method, device, electronic device and storage medium. Background Art

[0002] Today, society has entered the era of the Internet and big data. When an enterprise that serves Internet users reaches a certain scale, it is inevitable that it needs to consider avoiding the problem of single computer room failure. Multi-active computer rooms in different locations are an effective way to solve this problem. In addition, multi-active computer rooms can also improve user access speed and reduce deployment costs.

[0003] The current management model of multi-active data centers is to manage a portion of data for each data center or region, and the data is first written in one data center and then synchronized to other data centers. This method cannot determine which data is used as the standard when multiple data centers write the same data at the same time, that is, there is a simultaneous write conflict, which affects the stability of the multi-active data center. SUMMARY OF THE INVENTION

[0005] Technical issues

[0006] The current management model of multi-active data centers is to manage a portion of data for each data center or region, and the data is first written in one data center and then synchronized to other data centers. This method cannot determine which data is used as the standard when multiple data centers write the same data at the same time, that is, there is a simultaneous write conflict, which affects the stability of the multi-active data center.

[0007] Solution to the problem

[0008] Technical Solutions

[0009] A first aspect of an embodiment of the present application provides a data processing method, which is applied to a primary computer room, wherein the primary computer room is in a distributed data management system, and the distributed data management system includes a primary computer room and one or more secondary computer rooms. The method includes:

[0010] When receiving the first data sent by the secondary computer room, extracting the first content and the first timestamp contained in the first data;

[0011] If there is second data with the same content as the first content in the memory of the first-level computer room, extracting a second timestamp of the second data;

[0012] If the first timestamp is greater than the second timestamp, the second data in the memory of the first-level computer room is deleted and the first data is stored in the memory of the first-level computer room.

[0013] A second aspect of an embodiment of the present application provides a data processing method, which is applied to a secondary computer room, wherein the secondary computer room is in a distributed data management system, and the distributed data management system includes a primary computer room and one or more secondary computer rooms. The method includes:

[0014] When data writing is detected, obtaining the source of the first data to be written;

[0015] If the first data originates from a first-level computer room, extracting first content and a first timestamp included in the first data;

[0016] If there is second data with the same content as the first content in the memory of the secondary computer room, extracting a second timestamp included in the second data;

[0017] If the first timestamp is greater than the second timestamp, the second data in the secondary computer room memory is deleted and the first data is stored in the secondary computer room memory.

[0018] A third aspect of the present application embodiment provides a data processing device, which is applied to a primary computer room, wherein the primary computer room is in a distributed data management system, wherein the distributed data management system includes a primary computer room and one or more secondary computer rooms, wherein the device includes:

[0019] A first extraction module, configured to extract first content and a first timestamp contained in the first data when receiving the first data sent by the secondary computer room;

[0020] A second extraction module, configured to extract a second timestamp of the second data if there is second data identical to the first content in the memory of the first-level computer room;

[0021] A processing module is used to delete the second data in the memory of the first-level computer room and store the first data in the memory of the first-level computer room if the first timestamp is greater than the second timestamp.

[0022] A fourth aspect of an embodiment of the present application provides a data processing device, which is applied to a secondary computer room, wherein the secondary computer room is in a distributed data management system, and the distributed data management system includes a primary computer room and one or more secondary computer rooms, wherein the device includes:

[0023] An acquisition module, used for acquiring the source of the first data to be written when data writing is detected;

[0024] A first extraction module, configured to extract a second timestamp included in the second data if there is second data having the same content as the first content in the memory of the secondary computer room;

[0025] A second extraction module, configured to extract a second timestamp included in the second data if there is second data having the same content as the first content in the memory of the secondary computer room;

[0026] A processing module is used for deleting the second data in the memory of the secondary computer room and storing the first data in the memory of the secondary computer room if the first timestamp is greater than the second timestamp.

[0027] The fifth aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the data processing method provided in the first aspect and the second aspect are implemented.

[0028] The sixth aspect of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the data processing method provided in the first aspect and the second aspect are implemented.

[0029] Advantageous Effects of the Invention

[0030] Beneficial Effects

[0031] The data processing method, device, storage medium and electronic device provided by the present application include: when receiving first data sent by the secondary computer room, obtaining first content and a first timestamp contained in the first data;

[0032] If there is second data with the same content as the first content in the memory of the first-level computer room, obtain the second timestamp of the second data; if the first timestamp is greater than the second timestamp, delete the second data in the memory of the first-level computer room and store the first data in the memory of the first-level computer room. This method divides the multi-active computer room into a first-level computer room and a second-level computer room. The second-level computer room sends the data to the first-level computer room, and the first-level computer room determines which data to save based on the timestamp. When multiple computer rooms are writing at the same time, all the written data are sent to the first-level computer room. If there is no data with the same content as the received data in the first-level computer room, the received data is saved. If there is already data with the same content as the received data in the first-level computer room, the timestamps of the data are compared and the data with the larger timestamp is saved. In this way, the problem of simultaneous writing conflicts in multiple computer rooms can be avoided, and the stability of data processing in multiple active computer rooms can be improved.

[0033] Brief description of the accompanying drawings BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a structural diagram of a distributed data management system;

[0035] Figure 2A schematic diagram of a flow chart of a data processing method provided in an embodiment of the present application;

[0036] Figure 3 Another flowchart of the data processing method provided in the embodiment of the present application;

[0037] Figure 4 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0038] Figure 5 Another structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0039] Figure 6 A schematic diagram of the structure of an electronic device.

[0040] Embodiments of the invention

[0041] Embodiments of the present invention

[0042] In order to make the invention purpose, features, and advantages of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0043] Figure 1 A schematic diagram of the structure of a distributed data management system is shown. The data processing method provided in the embodiment of the present application can be applied to Figure 1 In the distributed data management system 10 shown.

[0044] like Figure 1 As shown, the distributed data management system 10 includes a primary computer room 101 and one or more secondary computer rooms 102 (only three are shown in the figure). The primary computer room 101 is used to receive data information synchronized by the secondary computer room 102, and synchronize the information to other secondary computer rooms, so as to maintain data consistency. The secondary computer room 102 can receive the written data of the local user, and synchronize the written data to the primary computer room 101. The secondary computer room 102 can also receive data synchronized from the primary computer room 101.

[0045] Based on the above-mentioned distributed data management system 10, in order to solve the problem that when multiple secondary computer rooms simultaneously write the same data in such a distributed data management system, there is a simultaneous writing conflict, which affects the stability of the computer room, the present application provides a data processing method, such as Figure 2The figure is a flow chart of a data processing method provided in an embodiment of the present application. The data processing method is applied to a primary computer room. The method comprises the following steps:

[0046] Step 201: upon receiving first data sent by a secondary computer room, extracting first content and a first timestamp contained in the first data.

[0047] In an embodiment of the present application, when a local user of a secondary computer room writes data in the secondary computer room, the secondary computer room synchronizes the data written by the local user to the primary computer room so that the primary computer room synchronizes the data to other secondary computer rooms, thereby ensuring the consistency of data in multiple active computer rooms. When the primary computer room receives the first data sent by the secondary computer room, the primary computer room first extracts information from the first data before synchronously writing the first data into the memory of the primary computer room, and extracts the first content and the first timestamp contained in the primary data. The so-called timestamp refers to a complete and verifiable data that can indicate that a piece of data existed before a certain time. The timestamp is a piece of data, and the size of the timestamp can reflect the time when a piece of data was generated. Specifically, the larger the timestamp, the later the data was generated. The first data contains the first timestamp information, indicating that when the data in the secondary computer room is written, the secondary computer room will assign a timestamp to the written data.

[0048] Step 202: If there is second data with the same content as the first content in the storage of the first-level computer room, extract the timestamp of the second data.

[0049] In the embodiment of the present application, after extracting the first content of the received first data, the memory of the first computer room is searched to see whether there is data with the same content as the first content. If the second data with the same content as the first content is retrieved, the second timestamp of the second data is extracted. It can be understood that since the second computer room will give a timestamp to the written data when writing data, and the data in the first computer room is synchronized from the second computer room, the first computer room itself does not have the data writing function, so the data stored in the memory of the first computer room are all data with timestamps. That is, the second timestamp contained in the second data can be extracted from the second data.

[0050] Step 203: If the first timestamp is greater than the second timestamp, the second data in the memory of the first-level computer room is deleted and the first data is stored in the memory of the first-level computer room.

[0051] In the embodiment of the present application, the extracted first timestamp is compared with the second timestamp. When the first timestamp is greater than the second timestamp, it means that the generation time of the first data is after the generation time of the second data. The data generated first is deleted from the memory of the first-level computer room, and the data generated later is stored in the memory of the first-level computer room, that is, the first data is stored in the memory. If the first timestamp is less than the second timestamp, it means that the generation time of the first data is before the generation time of the second data, so the second data stored in the first-level computer room still needs to be saved, so the first-level computer room refuses to write the first data.

[0052] According to the above description, the data processing method provided by the embodiment of the present application includes: when receiving the first data sent by the secondary computer room, extracting the first content and the first timestamp contained in the first data; if there is second data with the same content as the first content in the memory of the primary computer room, extracting the timestamp of the second data; if the first timestamp is greater than the second timestamp, deleting the second data in the memory of the primary computer room and storing the first data in the memory of the primary computer room. This method is based on a hierarchical distributed data storage system. When the secondary computer room synchronizes data to the primary computer room, the primary computer room judges the data to be synchronized based on the content of the data and the timestamp of the data. For data with the same content, only the data with a larger timestamp is accepted for synchronization, thereby avoiding data writing conflicts and improving the stability of multi-active computer rooms.

[0053] Further, if the first timestamp is greater than the second timestamp, after deleting the second data in the memory of the primary computer room and storing the first data in the memory of the primary computer room, the method further includes:

[0054] The first data is sent to all secondary computer rooms.

[0055] In an embodiment of the present application, after determining that the first data meets the write condition and storing the first data in the memory of the primary computer room, the primary computer room will resynchronize and send the first data to all secondary computer rooms, so as to achieve the consistency of the latest data in all computer rooms. It can be understood that the above-mentioned first data is also synchronized to the primary computer room by one of the secondary computer rooms. Here, the secondary computer room that sends the above-mentioned first data to the primary computer room can be called the initial computer room. After the primary computer room stores the first data in the memory of the primary computer room, it is also possible to no longer synchronously send the first data to the initial computer room. It only needs to be sent to other secondary computer rooms.

[0056] Furthermore, the data processing method further includes:

[0057] If the second data having the same content as the first data does not exist in the memory of the first computer room, storing the first data in the memory of the first computer room;

[0058] Send primary data to all secondary computer rooms.

[0059] In the embodiment of the present application, if it is determined that there is no second data with the same content as the first data in the memory of the first-level computer room, the first data is stored in the memory of the first-level computer room to achieve data synchronization. After the first data is stored in the memory of the first-level computer room, the first-level computer room sends the first data to all the second-level computer rooms to achieve data consistency in all computer rooms.

[0060] like Figure 3 FIG. 1 is another flow chart of a data processing method provided in an embodiment of the present application. The data processing method is applied to a secondary computer room. The method includes the following steps:

[0061] Step 301, when a first data write request is detected, the source of the first data to be written is obtained;

[0062] In the embodiment of the present application, when the secondary computer room detects data writing, the source of the first data to be written is obtained. The first data to be written to the secondary computer room can be sent to the secondary computer room during data synchronization in the primary computer room, or can be written by a local user in the secondary computer room.

[0063] Step 302: If the first data originates from a primary computer room, extract the first content and the first timestamp contained in the first data.

[0064] In an embodiment of the present application, when it is determined that the first data originates from the first-level computer room, that is, the first data is sent to the second-level computer room when the first-level computer room performs data synchronization, the first content and the first timestamp contained in the first data are extracted.

[0065] Step 303: If there is second data with the same content as the first content in the storage of the secondary computer room, extract the second timestamp contained in the second data.

[0066] In the embodiment of the present application, after extracting the first content of the first data, a search is performed in the memory of the secondary computer room to determine whether there is second data with the same content as the first content based on the first content. When the second data with the same content as the first content is found in the memory of the secondary computer room, a second timestamp included in the second data is extracted.

[0067] Step 304: If the first timestamp is greater than the second timestamp, the second data in the secondary computer room memory is deleted and the first data is stored in the secondary computer room memory.

[0068] In an embodiment of the present application, the first timestamp of the extracted first data is compared with the second timestamp of the second data. When the first timestamp is greater than the second timestamp, it indicates that the generation time of the first data is later than the generation time of the second data. The second data stored in the memory of the secondary computer room is deleted and the first data is stored in the memory of the secondary computer room, that is, the data stored in the memory of the secondary computer room is updated to the first data, that is, the first data in the first computer room is synchronized to the secondary computer room. It can be understood that if the first time error is not greater than the second timestamp, it means that the generation time of the first data is earlier than the generation time of the second data. In this case, the secondary computer room does not accept the writing of the first data and still retains the second data. Furthermore, since the second data stored in the secondary computer room will also be synchronized to the primary computer room, the primary computer room will update the first data stored in the memory of the primary computer room to the second data and synchronize the second data to other secondary computer rooms, thereby achieving consistency of data in multiple active computer rooms.

[0069] Furthermore, the above method also includes:

[0070] If the second data having the same content as the first data does not exist in the secondary computer room memory, the first data is stored in the secondary computer room memory.

[0071] In an embodiment of the present application, when it is detected that there is no second data in the secondary computer room memory having the same content as the first data sent from the primary computer room, it means that the first data is new data, so the first data is stored in the memory of the secondary computer room.

[0072] Furthermore, the above method also includes:

[0073] If the first data is locally input from the secondary computer room, obtain the third content included in the first data and generate a third timestamp for the first data;

[0074] If there is fourth data with the same content as the third content in the memory of the secondary computer room, obtaining a fourth timestamp included in the fourth data;

[0075] If the third timestamp is greater than the fourth timestamp, the fourth data in the memory of the secondary computer room is deleted and the first data is stored in the memory of the secondary computer room, and the first data is sent to the primary computer room;

[0076] If the third timestamp is not greater than the fourth timestamp, generate fifth data, the fifth data includes the third content and the fifth timestamp, the value of the fifth timestamp is equal to the fourth timestamp plus one, store the fifth data in the memory of the secondary computer room and send the fifth data to the primary computer room.

[0077] In an embodiment of the present application, if it is identified that the first data is sourced from a local input in a secondary computer room, the content of the data is obtained, and the content of the first data is determined to be the third content. The secondary computer room automatically generates a corresponding third timestamp for the data based on the time of data input. It is searched whether there is fourth data with the same content as the third content in the memory of the secondary computer room. If so, a fourth timestamp of the fourth data is obtained. The third timestamp is compared with the fourth timestamp. If the third timestamp is greater than the fourth timestamp, the fourth data in the memory of the secondary computer room is deleted and the first data is stored in the memory of the secondary computer room. The first data is sent to the primary computer room so that the primary computer room can synchronize the data to other secondary computer rooms. If the third timestamp is not greater than the fourth timestamp, the fifth data is generated. The fifth data includes the third content and the fifth timestamp. The value of the fifth timestamp is equal to the fourth timestamp plus 1. For example, the third timestamp of the first data input is 123456, and the fourth timestamp of the fourth data stored in the memory of the secondary computer room is 123459, which means that the fourth data is not input locally but synchronized from the primary computer room. Since there are certain differences in the local stamps of different secondary computer rooms, the timestamp of the data stored in the secondary computer room may be greater than the timestamp of the same data input locally. At this time, a fifth timestamp is determined to be 123459+1=123460, and it is determined that the fifth data contains the third content and the fifth timestamp. The fifth data is stored in the memory of the secondary computer room, and the fifth data is sent to the primary computer room so that the primary computer room can synchronize the data to other secondary computer rooms.

[0078] The data processing method provided by the method ensures that the locally input data can be input, and can keep the timestamp of the data incremented, thus avoiding data writing conflicts and effectively ensuring the consistency of data stored in multi-active computer rooms.

[0079] Furthermore, the above method also includes:

[0080] If the fourth data having the same content as the third content does not exist in the memory of the secondary computer room, the first data is stored in the memory of the secondary computer room;

[0081] The first data is sent to the primary computer room.

[0082] In an embodiment of the present application, when data with the same content cannot be retrieved from the memory of the secondary computer room when the data input locally is input, the data input locally is stored in the memory of the computer room and synchronized to the primary computer room so that the primary computer room can synchronize the data to other secondary computer rooms.

[0083] like Figure 4 FIG. 1 is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. The data processing device is used in a primary computer room and includes the following modules:

[0084] The first extraction module 401 is used to extract the first content and the first timestamp contained in the first data when receiving the first data sent by the secondary computer room;

[0085] A second extraction module 402 is used to extract a second timestamp of the second data if there is second data with the same content as the first data in the memory of the first computer room;

[0086] The processing module 403 is used to delete the second data in the memory of the first-level computer room and store the first data in the memory of the first-level computer room if the first timestamp is greater than the second timestamp.

[0087] It can be understood that the functions of the various modules of the data processing device provided in the embodiment of the present application are similar to those of Figure 2 The contents of each step recorded in the embodiments are consistent and will not be repeated here.

[0088] Furthermore, if Figure 5 FIG. 1 is another structural diagram of a data processing device provided in an embodiment of the present application. The data processing device is used in a secondary computer room and includes the following modules:

[0089] An acquisition module 501 is used to acquire the source of the first data to be written when a first data writing request is detected;

[0090] A first extraction module 502 is used to extract a second timestamp included in the second data if there is second data with the same content as the first content in the storage of the secondary computer room;

[0091] The second extraction module 503 is used to extract the second timestamp contained in the second data if there is second data with the same content as the first content in the memory of the secondary computer room;

[0092] The processing module 504 is used to delete the second data in the secondary computer room memory and store the first data in the secondary computer room memory if the first timestamp is greater than the second timestamp.

[0093] It can be understood that the functions of the various modules of the data processing device provided in the embodiment of the present application are similar to those of Figure 3 The contents of each step of the data processing method provided in the embodiment are the same and will not be repeated here.

[0094] Furthermore, an embodiment of the present application also provides an electronic device. The electronic device can be used to implement the data processing method in the above embodiment. Figure 6 As shown, the electronic device mainly includes:

[0095] The memory 601, the processor 602, the bus 603, and the computer program stored in the memory 601 and executable on the processor 602, the memory 601 and the processor 602 are connected via the bus 603. When the processor 602 executes the computer program, the data processing method in the aforementioned embodiment is implemented. The number of processors may be one or more.

[0096] The memory 601 may be a high-speed random access memory (RAM) memory, or a non-volatile memory, such as a disk memory. The memory 601 is used to store executable program codes, and the processor 602 is coupled to the memory 601 .

[0097] Furthermore, the present application also provides a storage medium, which may be provided in the electronic device in the above embodiments. The computer-readable storage medium may be the above Figure 6 Memory in the illustrated embodiment.

[0098] The storage medium stores a computer program, and when the program is executed by the processor, the data processing method in the aforementioned embodiment is implemented. Furthermore, the computer storable medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk or an optical disk, and other media that can store program codes.

[0099] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0100] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0101] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0102] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a readable storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned readable storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0103] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0104] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0105] The above is a description of the data processing method, device, electronic device and readable storage medium provided in the present application. For technicians in this field, according to the ideas of the embodiments of the present application, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data processing method, applied to a primary computer room, wherein the primary computer room is in a distributed data management system, wherein the distributed data management system includes a primary computer room and one or more secondary computer rooms, wherein: The primary computer room is used to receive data information synchronized by the secondary computer room, and synchronize the data information to other secondary computer rooms. The method is applied to writing the same data to multiple secondary computer rooms at the same time in a distributed data management system. The method includes: When receiving the first data sent by the secondary computer room, extracting the first content and the first timestamp contained in the first data; If there is second data with the same content as the first content in the memory of the first-level computer room, extracting a second timestamp of the second data; If the first timestamp is greater than the second timestamp, deleting the second data in the memory of the first-level computer room and storing the first data in the memory of the first-level computer room; If the second data having the same content as the first content does not exist in the memory of the first-level computer room, storing the first data in the memory of the first-level computer room; The first data is sent to all secondary computer rooms.

2. A data processing method, applied to a secondary computer room, wherein the secondary computer room is in a distributed data management system, wherein the distributed data management system includes a primary computer room and one or more secondary computer rooms, wherein: The primary computer room is used to receive data information synchronized by the secondary computer room, and synchronize the data information to other secondary computer rooms. The method is applied to writing the same data to multiple secondary computer rooms at the same time in a distributed data management system. The method includes: When data writing is detected, obtaining the source of the first data to be written; If the first data originates from a first-level computer room, extracting first content and a first timestamp included in the first data; If there is second data with the same content as the first content in the memory of the secondary computer room, extracting a second timestamp included in the second data; If the first timestamp is greater than the second timestamp, the second data in the secondary computer room memory is deleted and the first data is stored in the secondary computer room memory.

3. The data processing method according to claim 2, characterized in that: The method further comprises: If there is no second data having the same content as the first content in the secondary computer room memory, the first data is stored in the secondary computer room memory.

4. The data processing method according to claim 3, characterized in that: The method further comprises: If the first data is sourced from the local input of the secondary computer room, obtaining the third content included in the first data and generating a third timestamp for the first data; If there is fourth data having the same content as the third content in the memory of the secondary computer room, obtaining a fourth timestamp included in the fourth data; If the third timestamp is greater than the fourth timestamp, deleting the fourth data in the secondary computer room memory and storing the first data in the secondary computer room memory, and sending the first data to the first computer room; If the third timestamp is not greater than the fourth timestamp, generate fifth data, the fifth data includes the third content and the fifth timestamp, the value of the fifth timestamp is equal to the fourth timestamp plus one, store the fifth data in the memory of the secondary computer room and send the fifth data to the primary computer room.

5. The data processing method according to claim 4, characterized in that: The method further comprises: If the memory of the secondary computer room does not contain fourth data having the same content as the third content, storing the first data in the memory of the secondary computer room; The first data is sent to the primary computer room.

6. A data processing device, applied to a primary computer room, wherein the primary computer room is in a distributed data management system, wherein the distributed data management system includes a primary computer room and one or more secondary computer rooms, wherein: The primary computer room is used to receive data information synchronized by the secondary computer room, and synchronize the data information to other secondary computer rooms. The device is used to write the same data to multiple secondary computer rooms at the same time in a distributed data management system. The device includes: A first extraction module, configured to extract first content and a first timestamp contained in the first data when receiving the first data sent by the secondary computer room; A second extraction module, configured to extract a second timestamp of the second data if there is second data with the same content as the first content in the memory of the first-level computer room; A processing module, configured to delete the second data in the memory of the first-level computer room and store the first data in the memory of the first-level computer room if the first timestamp is greater than the second timestamp; If the second data having the same content as the first content does not exist in the memory of the first-level computer room, storing the first data in the memory of the first-level computer room; The first data is sent to all secondary computer rooms.

7. A data processing device, applied to a secondary computer room, wherein the secondary computer room is in a distributed data management system, wherein the distributed data management system includes a primary computer room and one or more secondary computer rooms, wherein: The primary computer room is used to receive data information synchronized by the secondary computer room, and synchronize the data information to other secondary computer rooms. The device is used to write the same data to multiple secondary computer rooms at the same time in a distributed data management system. The device includes: An acquisition module, used for acquiring the source of the first data to be written when data writing is detected; A first extraction module, configured to extract first content and a first timestamp included in the first data if the first data originates from a first-level computer room; A second extraction module, configured to extract a second timestamp included in the second data if there is second data having the same content as the first content in the memory of the secondary computer room; A processing module is used for deleting the second data in the memory of the secondary computer room and storing the first data in the memory of the secondary computer room if the first timestamp is greater than the second timestamp.

8. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the data processing method according to any one of claims 1 to 5 are implemented.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the data processing method according to any one of claims 1 to 5 are implemented.