Collaborative data synchronization error correction method, device, equipment and storage medium
By using global hash values between standard-party equipment and follow-up equipment to detect data consistency and correct it, the complexity and incompleteness of data asymmetry problem in the prior art is solved, and efficient multi-party collaboration is achieved.
Patent Information
- Application Number
- CN202110015314.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-06
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-01-06
AI Technical Summary
When solving the problem of data out-of-synchronization, the solutions are complicated and not comprehensive enough to solve all out-of-synchronization situations at one time, resulting in low efficiency.
By using global hash values between the standard and follower devices for data consistency detection, and sending the list to be synchronized and the target line segment data for correction when inconsistencies are inconsistent, we ensure that the handwriting display in multi-party collaboration is consistent.
It realizes efficient detection and correction of whether the inconsistency of the line segment data of each line segment displayed in "standard party equipment" and "multiple follower equipment", solves the problem of data out-synchronization caused by various reasons, and improves the cooperation of multiple parties. efficiency.
Smart Images

Figure CN112667429B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a collaborative data synchronization error correction method, device, equipment and storage medium. Background Art
[0002] With the rapid development of video conferencing and intelligent collaboration technology, the remote video conferencing model of "cloud + terminal + collaboration" is gradually becoming the general trend of the industry. In the electronic whiteboard collaboration, users write handwriting on the electronic whiteboard, and each participant transmits the handwriting data to other participants through the network. Other participants draw the corresponding handwriting based on the received handwriting data to achieve the purpose of multi-party collaboration. However, when the participants transmit data through the network, network communication may sometimes be unstable, and packet loss may occur, which may lead to the inability to fully synchronize the drawing data.
[0003] At present, the problem of data asynchrony is generally dealt with in a targeted manner according to different causes. For example, if the problem is caused by network packet loss, a retransmission confirmation mechanism is added; if the problem is asynchronous control signaling, a synchronous cache data instruction is used.
[0004] However, the existing methods for solving data asynchrony are cumbersome and complex, and are not comprehensive enough to solve all asynchrony situations at one time, resulting in low efficiency in solving data asynchrony. Summary of the invention
[0005] The purpose of this application is to provide a collaborative data synchronization error correction method, device, equipment and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problem of data asynchrony caused by various reasons, make the handwriting display of the "standard party device" and the "multiple follower party devices" consistent, and improve the efficiency of multi-party collaboration.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a collaborative data synchronization error correction method, which is applied to a standard party device, including:
[0008] Acquire the line segment data of each line segment displayed by the standard square device; wherein the line segment data includes: coordinates, width, and color of each point constituting the line segment;
[0009] Obtaining a first global hash value according to the line segment data of each line segment;
[0010] Receiving a second global hash value sent by a follower device;
[0011] If the first global hash value is inconsistent with the second global hash value, sending the first global hash value to the follower device;
[0012] Receiving a to-be-synchronized list sent by the follower device, wherein the to-be-synchronized list includes a target identifier of at least one line segment, and each line segment is a line segment in the follower device that is inconsistent with that in the standard device;
[0013] The line segment data of the target line segment is sent to the follower device, where the target line segment is a line segment with the target identifier displayed in the standard device.
[0014] Optionally, obtaining a first global hash value according to the line segment data of each line segment includes:
[0015] Generating an identifier for each of the line segments;
[0016] Determine the hash value of each line segment according to the line segment data of each line segment;
[0017] The first global hash value is obtained according to the hash value of each line segment and the identifier of each line segment.
[0018] Optionally, obtaining the first global hash value according to the hash value of each line segment and the identifier of each line segment includes:
[0019] The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments;
[0020] According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence;
[0021] A hash value of the target sequence is calculated, and the hash value of the target sequence is used as the first global hash value.
[0022] In a second aspect, an embodiment of the present application further provides a collaborative data synchronization error correction method, which is applied to a follower device, including:
[0023] Receiving a first global hash value sent by a standard party device;
[0024] Parsing the first global hash value to obtain the identifier of each line segment displayed in the standard party device and the hash value of each line segment, wherein the line segment data includes: the coordinates, width, and color of each point constituting the line segment;
[0025] According to the identifier of each line segment displayed in the standard party device and the hash value of each line segment, and the identifier of each line segment displayed in the follower party device and the hash value of each line segment, a list to be synchronized is obtained, wherein the list to be synchronized includes a target identifier of at least one line segment, and each line segment is a line segment in the follower party device that is inconsistent with that in the standard party device;
[0026] Sending the to-be-synchronized list to the standard party device;
[0027] receiving line segment data of a target line segment sent to the standard party device, the target line segment being a line segment with the target identifier displayed in the standard party device;
[0028] The line segment data of the line segment with the target identifier in the follower device is replaced with the line segment data of the target line segment.
[0029] Optionally, obtaining the to-be-synchronized list according to the identifiers of each line segment displayed in the standard party device and the hash values of each line segment, and the identifiers of each line segment displayed in the follower party device and the hash values of each line segment, includes:
[0030] If the line segment with the first identifier does not exist in the standard device, and the line segment with the first identifier exists in the follower device, then deleting the line segment with the first identifier in the follower device;
[0031] If the line segment with the second identifier exists in the standard device, and the line segment with the second identifier does not exist in the follower device, adding the second identifier to the to-be-synchronized list;
[0032] If there is a line segment with a third identifier in both the standard party device and the follower party device, and the hash value of the line segment with the third identifier in the standard party device is inconsistent with the hash value of the line segment with the third identifier in the follower party device, then the line segment with the third identifier in the follower party device is deleted, and the third identifier is added to the list to be synchronized.
[0033] Optionally, it also includes:
[0034] Acquire line segment data of each line segment displayed by the follower device;
[0035] Obtaining a second global hash value according to the line segment data of each line segment;
[0036] The second global hash value is sent to the standard party device.
[0037] Optionally, obtaining a second global hash value according to the line segment data of each line segment includes:
[0038] Generating an identifier for each of the line segments;
[0039] Determine the hash value of each line segment according to the line segment data of each line segment;
[0040] The second global hash value is obtained according to the hash value of each line segment and the identifier of each line segment.
[0041] Optionally, obtaining the second global hash value according to the hash value of each line segment and the identifier of each line segment includes:
[0042] The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments;
[0043] According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence;
[0044] Calculate a hash value of the target sequence, and use the hash value of the target sequence as the second global hash value.
[0045] In a third aspect, an embodiment of the present application further provides a collaborative data synchronization error correction device, which is applied to a standard party device, and the device includes: an acquisition module, a processing module, a receiving module, and a sending module;
[0046] The acquisition module is used to acquire the line segment data of each line segment displayed by the standard square device; wherein the line segment data includes: the coordinates, width, and color of each point constituting the line segment;
[0047] The processing module is used to obtain a first global hash value according to the line segment data of each line segment;
[0048] The receiving module is used to receive a second global hash value sent by a follower device;
[0049] The sending module is configured to send the first global hash value to the follower device if the first global hash value is inconsistent with the second global hash value;
[0050] The receiving module is further configured to receive a to-be-synchronized list sent by the follower device, wherein the to-be-synchronized list includes a target identifier of at least one line segment, and each line segment is a line segment in the follower device that is inconsistent with that in the standard device;
[0051] The sending module is further used to send the line segment data of the target line segment to the follower device, where the target line segment is the line segment with the target identifier displayed in the standard device.
[0052] Optionally, the processing module is further used to:
[0053] Generating an identifier for each of the line segments;
[0054] Determine the hash value of each line segment according to the line segment data of each line segment;
[0055] The first global hash value is obtained according to the hash value of each line segment and the identifier of each line segment.
[0056] Optionally, the processing module is further used to:
[0057] The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments;
[0058] According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence;
[0059] A hash value of the target sequence is calculated, and the hash value of the target sequence is used as the first global hash value.
[0060] In a fourth aspect, an embodiment of the present application further provides a collaborative data synchronization error correction device, which is applied to a follower device, and the device includes: a receiving module, a parsing module, a processing module, a sending module, and a replacement module;
[0061] The receiving module is used to receive a first global hash value sent by a standard party device;
[0062] The parsing module is used to parse the first global hash value to obtain the identifier of each line segment displayed in the standard square device and the hash value of each line segment, wherein the line segment data includes: the coordinates, width, and color of each point constituting the line segment;
[0063] The processing module is used to obtain a list to be synchronized according to the identifier of each line segment displayed in the standard party device and the hash value of each line segment, and the identifier of each line segment displayed in the follower party device and the hash value of each line segment, wherein the list to be synchronized includes a target identifier of at least one line segment, and each line segment is a line segment in the follower party device that is inconsistent with that in the standard party device;
[0064] The sending module is used to send the to-be-synchronized list to the standard party device;
[0065] The receiving module is further used to receive line segment data of a target line segment sent to the standard party device, wherein the target line segment is a line segment with the target identifier displayed in the standard party device;
[0066] The replacement module is used to replace the line segment data of the line segment with the target identifier in the follower device with the line segment data of the target line segment.
[0067] Optionally, the processing module is further used to:
[0068] If the line segment with the first identifier does not exist in the standard device, and the line segment with the first identifier exists in the follower device, then deleting the line segment with the first identifier in the follower device;
[0069] If the line segment with the second identifier exists in the standard device, and the line segment with the second identifier does not exist in the follower device, adding the second identifier to the to-be-synchronized list;
[0070] If there is a line segment with a third identifier in both the standard party device and the follower party device, and the hash value of the line segment with the third identifier in the standard party device is inconsistent with the hash value of the line segment with the third identifier in the follower party device, then the line segment with the third identifier in the follower party device is deleted, and the third identifier is added to the list to be synchronized.
[0071] Optionally, the device further comprises: an acquisition module;
[0072] The acquisition module is used to acquire the line segment data of each line segment displayed by the follower device;
[0073] The processing module is further used to obtain a second global hash value according to the line segment data of each line segment;
[0074] The sending module is further configured to send the second global hash value to the standard party device.
[0075] Optionally, the processing module is further used to:
[0076] Generating an identifier for each of the line segments;
[0077] Determine the hash value of each line segment according to the line segment data of each line segment;
[0078] The second global hash value is obtained according to the hash value of each line segment and the identifier of each line segment.
[0079] Optionally, the processing module is further used to:
[0080] The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments;
[0081] According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence;
[0082] Calculate a hash value of the target sequence, and use the hash value of the target sequence as the second global hash value.
[0083] In the fifth aspect, an embodiment of the present application also provides a standard party device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the standard party device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the method provided in the first aspect.
[0084] In the sixth aspect, an embodiment of the present application also provides a follower device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the follower device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the method provided in the second aspect.
[0085] In a seventh aspect, an embodiment of the present application further provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method provided in the first aspect or the second aspect are executed.
[0086] The beneficial effects of this application are:
[0087] The embodiments of the present application provide a collaborative data synchronization error correction method, apparatus, device and storage medium, which are applied to standard party devices, including: obtaining line segment data of each line segment displayed by the standard party device; wherein the line segment data includes: coordinates, width, and color of each point constituting the line segment; obtaining a first global hash value according to the line segment data of each line segment; receiving a second global hash value sent by a follower party device; if the first global hash value is inconsistent with the second global hash value, sending the first global hash value to the follower party device; receiving a list to be synchronized sent by the follower party device, the list to be synchronized includes a target identifier of at least one line segment, and each line segment is a line segment in the follower party device that is inconsistent with that in the standard party device; sending the line segment data of the target line segment to the follower party device, and the target line segment is a line segment with a target identifier displayed in the standard party device. In this scheme, it is only necessary to determine whether the first global hash value is consistent with the second global hash value to detect whether the line segment data of each line segment displayed in the "standard party device" and the "multiple follower devices" are inconsistent. If they are inconsistent, it is only necessary to receive the target identifier of the line segment to be corrected sent by the follower device. The standard party device finds the line segment with the target identifier according to the received target identifier of the line segment to be corrected, sends the line segment data of the line segment to the follower device, and corrects the line segment to be corrected in the follower device. This scheme can solve the problem of data asynchrony caused by various reasons, so that the handwriting display of the "standard party device" and the "multiple follower devices" is consistent, thereby improving the efficiency of multi-party collaboration.
[0088] In addition, in the present application, it is only necessary to determine whether the first global hash value is inconsistent with the second global hash value to detect whether the line segment data of each line segment displayed in the "standard party device" and the "multiple follower party devices" are inconsistent, which greatly reduces the occupancy of network bandwidth resources, saves resources, and improves the efficiency of detecting inconsistencies.
[0089] Finally, in the present application, it is only necessary to receive the target identifier of the line segment to be corrected sent by the follower device, without sending the line segment data of all the line segments of the follower device, which greatly reduces the occupancy of network bandwidth resources, saves resources, and improves the real-time and synchronization of the line segment data display between the "standard party device" and the "multiple follower devices". BRIEF DESCRIPTION OF THE DRAWINGS
[0090] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0091] Figure 1 A schematic diagram of the structure of a collaborative data synchronization and error correction system provided in an embodiment of the present application;
[0092] Figure 2 A schematic diagram of the structure of a participant device in a collaborative data synchronization and error correction system provided in an embodiment of the present application;
[0093] Figure 3 A flowchart of a collaborative data synchronization error correction method provided in an embodiment of the present application;
[0094] Figure 4 A flowchart of another collaborative data synchronization error correction method provided in an embodiment of the present application;
[0095] Figure 5 A flowchart of another collaborative data synchronization error correction method provided in an embodiment of the present application;
[0096] Figure 6 A flowchart of another collaborative data synchronization error correction method provided in an embodiment of the present application;
[0097] Figure 7 A schematic diagram of an interactive process of a collaborative data synchronization error correction method provided in an embodiment of the present application;
[0098] Figure 8 A schematic diagram of the structure of another collaborative data synchronization and error correction device provided in an embodiment of the present application;
[0099] Fig. 9 A schematic diagram of the structure of another collaborative data synchronization and error correction device provided in an embodiment of the present application.
[0100] Icon: 100-Collaborative data synchronization and error correction system; 101-Network. DETAILED DESCRIPTION
[0101] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0102] The flow chart used in this application shows the operation implemented according to some embodiments of the application. It should be understood that the operation of the flow chart can be implemented out of order, and the steps without logical context can be reversed or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flow chart under the guidance of the content of this application, and can also remove one or more operations from the flow chart.
[0103] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0104] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0105] First, before describing the solution provided in this application in detail, some terms that may be involved are briefly described:
[0106] 1. Electronic whiteboard: A high-tech product developed by integrating cutting-edge electronic technology, software technology and other high-tech means. Users can write and draw on the electronic whiteboard with an electronic sensing pen or fingers, realizing paperless office and teaching.
[0107] 2. Interactive collaboration system: Multiple electronic whiteboards are connected to each other through the network, synchronizing data with each other to work collaboratively.
[0108] Among them, in the interactive collaboration system, each participant's device must synchronize the handwriting drawn by itself with each other. The handwriting is actually a series of line segments. For example, when a line segment is drawn on participant device A, participant device B must also be able to draw and display the same line segment. Generally, the data related to line segment drawing, such as "data related to line segment drawing" can be the coordinates of each point constituting each line segment, the width of the line segment, the color of the line segment, etc., is sent from participant device A to participant device B through the network, and participant device B draws according to the above data received to perform collaborative work.
[0109] Figure 1 A schematic diagram of the structure of a collaborative data synchronization and error correction system provided in an embodiment of the present application; Figure 1 As shown, the collaborative data synchronization and error correction system 100 includes: multiple participant devices and a network 101.
[0110] The collaborative data synchronization and error correction system 100 may be a subsystem in the above-mentioned interactive collaboration system, or may also refer to the above-mentioned interactive collaboration system. The collaborative data synchronization and error correction system involves multiple participant devices, such as multiple participant devices may include: participant device A, participant device B, participant device C, participant device D, participant device E and participant device F, etc. The user writes handwriting on the electronic whiteboard of participant device A, and at the same time, participant device B, participant device C, and participant device D can receive the user's handwriting data on the electronic whiteboard of participant device A through network 101, and draw the corresponding handwriting according to the received handwriting data, so as to achieve the purpose of multi-party collaboration. Among the participant devices, one of the participant devices can assume the role of the standard party device, and the other participant devices assume the role of the follower device.
[0111] In one feasible method, for example, at the beginning of multi-party collaboration, none of the participant devices is turned on to enter the electronic whiteboard interactive collaboration system, but after participant device A is actively turned on, the other multiple participant devices enter the electronic whiteboard interface, then the participant device A that actively turns on the electronic whiteboard can be selected as the standard device, and the other participant devices are called follower devices. At regular intervals (such as every 20 seconds), multiple follower devices and the standard device compare handwriting data to see if they are consistent. If the handwriting data is inconsistent, the handwriting data of the standard device shall prevail and the handwriting data of the follower devices shall be adjusted to be consistent with the handwriting data of the standard device.
[0112] Among them, multiple participant devices can all be version control system (Video conference system, referred to as VCS) terminals, each participant device can communicate via network 101, and each participant device can send data to other participant devices, and can also receive data sent by other participant devices.
[0113] The network 101 may be used for exchanging information and / or data. For example, the network 101 may be any type of wired or wireless network, or any combination thereof.
[0114] Understandably, Figure 1 The structure shown is for illustration only. The collaborative data synchronization and error correction system 100 may also include Figure 1 More or fewer modules as shown in, or with Figure 1 Different configurations are shown. Figure 1 Each module shown in the figure can be implemented by hardware, software or a combination thereof.
[0115] Figure 2 A schematic diagram of the structure of a participant device in a collaborative data synchronization and error correction system provided in an embodiment of the present application; Figure 2 As shown, each participant device includes a memory 201, a processor 202, and a communication unit 203. The memory 201, the processor 202, and the communication unit 203 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0116] The memory 201 stores software function modules in the form of software or firmware. The processor 202 executes various functional applications and data processing by running the software programs and modules stored in the memory 201, thereby realizing the motion effect processing method in the embodiment of the present invention.
[0117] The memory 201 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), etc. The memory 201 is used to store a program, and the processor 202 executes the program after receiving an execution instruction.
[0118] The processor 202 may be an integrated circuit chip with the ability to process signals. The processor 202 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), and the like.
[0119] The communication unit 203 is used to establish a communication connection between the devices of each participant through the network 101 to realize the sending and receiving operations of network signals and data information.
[0120] It is understandable that the above Figure 1 and Figure 2 Any of the multiple participant devices in the system may be a standard device or a follower device, and each participant device includes Figure 2 The same structural units as shown in .
[0121] It is worth noting that, for example, participant device A cannot be both a standard device and a follower device at the same time, but can only be one of them.
[0122] The following is an explanation of the collaborative data synchronization and error correction method applied to the standard party device through multiple embodiments, specifically how to adjust the handwriting data of multiple follower party devices according to the handwriting data of the standard party device, so that the handwriting data of the multiple follower party devices and the standard party device are consistent, so as to perform multi-party collaborative work.
[0123] Figure 3 A flowchart of a collaborative data synchronization error correction method provided in an embodiment of the present application; Figure 3 As shown, the execution subject of the method may be the standard party device selected above, and the method includes:
[0124] S301. Obtain line segment data of each line segment displayed by a standard square device.
[0125] The line segment data includes: the coordinates, width, and color of each point that constitutes the line segment.
[0126] For example, a user uses an electronic sensing pen or a finger to draw 20 different line segments on the electronic whiteboard of a standard square device, wherein the coordinates, widths, and colors of the points constituting each line segment are different. It can also be understood that the 20 line segments are drawn using different line segment data, and the drawn line segments are displayed in the standard square device according to the line segment data of the 20 line segments.
[0127] S302: Obtain a first global hash value according to the line segment data of each line segment.
[0128] Usually, there are tens of thousands of line segments displayed in the "standard party device" and "multiple follower party devices". If the original data stored in the electronic whiteboard is directly used to compare whether the line segment data of the "standard party device" and the "multiple follower party devices" are consistent, it will result in a large amount of data calculation, occupy a lot of network bandwidth resources, and reduce the efficiency of detection.
[0129] Therefore, a global processing can be performed on the line segment data of each line segment displayed in the "standard party device" and the "multiple follower party devices". For example, after each line segment is drawn, the line segment data used to draw this line segment is obtained. After drawing 20 line segments, the line segment data of the 20 line segments can be processed. For example, a hash algorithm can be used to perform data summary processing on the line segment data of the 20 line segments displayed by the standard party device to obtain the first global hash value.
[0130] The hash algorithm may be Md5, Sha, CRC32, etc. For example, the Md5 algorithm is selected to perform calculation processing on the line segment data of each line segment to obtain a first global hash value of 128 bits.
[0131] S303: Receive a second global hash value sent by the follower device.
[0132] In this embodiment, in order to more accurately and efficiently detect whether the line segment data of each line segment displayed in the "standard party device" and the "multiple follower party devices" are consistent, the same method as that for obtaining the first global hash value can be used to calculate the second global hash value of the line segment data of each line segment displayed by each of the multiple follower party devices to obtain multiple second global hash values, and the second global hash value obtained by each follower party device is sent to the standard party device, and error detection is performed on the line segment data of each line segment displayed in the multiple follower party devices in the standard party device.
[0133] S304: If the first global hash value is inconsistent with the second global hash value, send the first global hash value to the follower device.
[0134] Wherein, whether the first global hash value is consistent with the second global hash value is determined to detect whether the line segment data of each line segment displayed by the “standard party device” and the “multiple follower party devices” are inconsistent.
[0135] In one feasible method, for example, if it is determined that the first global hash value is consistent with each second global hash value, it can be determined that the line segment data of the multiple line segments displayed in the "multiple follower devices" are the same as the line segment data of the multiple line segments displayed in the "standard party device", that is, the line segment handwriting displayed on each device end is consistent.
[0136] In another achievable manner, for example, if it is determined that the first global hash value is inconsistent with a second global hash value, it can be determined that among the segment data of the multiple line segments displayed in the "follower device D" corresponding to the second global hash value, there is at least one line segment E1, whose segment data is different from the segment data of a line segment e1 among the multiple line segments displayed in the "standard party device". At this time, the first global hash value of the standard party device can be sent to the follower device D, and based on the segment data of the line segment e1 displayed in the standard party device, the segment data of the line segment E1 in the follower device D can be corrected to ensure the consistency of the segment data of each line segment displayed in the "standard party device" and each "follower device" in the collaborative system.
[0137] In this embodiment, it is only necessary to determine whether the first global hash value is inconsistent with the second global hash value to detect whether the line segment data of each line segment displayed in the "standard party device" and the "multiple follower party devices" are inconsistent, which greatly reduces the occupancy of network bandwidth resources, saves resources, and improves the efficiency of detecting inconsistencies.
[0138] S305: Receive a list to be synchronized sent by the follower device.
[0139] The list to be synchronized includes: a target identifier of at least one line segment, and each line segment is a line segment in the follower device that is inconsistent with that in the standard device.
[0140] For example, the to-be-synchronized list may be identification information of the line segment E1 that needs to be corrected in the “following device D”, such as the line segment number of the line segment E1, the hash value of the line segment E1, or coordinate information of each point constituting the line segment E1.
[0141] In this embodiment, only the target identifier of the line segment to be corrected sent by the follower device needs to be received, without sending the line segment data of all the line segments of the follower device, which greatly reduces the occupancy of network bandwidth resources, saves resources, and improves the real-time and synchronization of the line segment data display between the "standard party device" and the "multiple follower devices".
[0142] S306: Send the line segment data of the target line segment to the follower device.
[0143] The target line segment is a line segment with a target identifier displayed in a standard square device.
[0144] For example, based on the above embodiment, the line segment e1 displayed in the "standard party device" and the line segment E1 in the "follower party device D" have the same identifier "123", then the line segment data of the line segment e1 with the same identifier can be queried in the "standard party device" according to the identifier "123" of the line segment E1 that needs to be corrected in the "follower party device D", and the line segment data of the target line segment e1 is sent to the "follower party device D", and the line segment data of the line segment E1 in the "follower party device D" is adjusted to the line segment data of the target line segment e1, so that the line segment data of each line segment displayed in the "follower party device D" and the "standard party device" are the same, so as to ensure the consistency of the line segment data of each line segment displayed in the "standard party device" and each "follower party device" in the collaborative system, and achieve the purpose of multi-party collaboration.
[0145] In summary, an embodiment of the present application provides a collaborative data synchronization and error correction method, which is applied to a standard party device, including: obtaining segment data of each segment displayed by the standard party device; wherein the segment data includes: coordinates, width, and color of each point constituting the segment; obtaining a first global hash value based on the segment data of each segment; receiving a second global hash value sent by a follower device; if the first global hash value is inconsistent with the second global hash value, sending the first global hash value to the follower device; receiving a list to be synchronized sent by the follower device, the list to be synchronized includes a target identifier of at least one segment, and each segment is a segment in the follower device that is inconsistent with that in the standard party device; sending segment data of the target segment to the follower device, and the target segment is a segment with a target identifier displayed in the standard party device. In this solution, it is only necessary to determine whether the first global hash value is consistent with the second global hash value to detect whether the line segment data of each line segment displayed in the "standard party device" and the "multiple follower devices" are inconsistent. If they are inconsistent, it is only necessary to receive the target identifier of the line segment to be corrected sent by the follower device. The standard party device finds the line segment with the target identifier according to the received target identifier of the line segment to be corrected, sends the line segment data of the line segment to the follower device, and corrects the line segment to be corrected in the follower device. This solution can solve the problem of data asynchrony caused by various reasons, make the handwriting display of the "standard party device" and the "multiple follower devices" consistent, and improve the efficiency of multi-party collaboration.
[0146] Figure 4 A flowchart of another collaborative data synchronization error correction method provided in an embodiment of the present application; Figure 4 As shown, the above step S302, obtaining a first global hash value according to the line segment data of each line segment, includes:
[0147] S401. Generate a label for each line segment.
[0148] For example, a standard square device displays five line segments, and a unique identifier can be generated for each line segment. This setting enables a target line segment to be searched more quickly and accurately among multiple line segments displayed by the "standard square device" based on the identifiers of each line segment.
[0149] The identifier of each line segment may be recorded as ObjId. For example, the identifier of the first line segment is ObjId1, the identifier of the second line segment is ObjId2, and so on.
[0150] Exemplarily, an identification algorithm may be used to generate identification of each line segment, and ensure that the identification of each line segment is unique, and there is no situation where multiple line segments displayed in the "standard square device" have the same identification.
[0151] S402: Determine a hash value of each line segment according to the line segment data of each line segment.
[0152] For example, continue to use the hash algorithm to perform data summary processing on the segment data of the five line segments displayed by the standard square device to obtain the hash value of each line segment. For example, the hash value of the first line segment is recorded as Objhash1, the hash value of the second line segment is recorded as Objhash2, and so on.
[0153] S403: Obtain a first global hash value according to the hash value of each line segment and the identifier of each line segment.
[0154] In one achievable manner, for example, the hash value of each line segment and the identifier of each line segment may be used to generate multiple hash values, and then the multiple hash values are processed to obtain a first global hash value.
[0155] For example, use the identifier ObjId1 of the first line segment and the hash value Objhash1 of the first line segment to generate a hash value hash1; continue to use the identifier ObjId2 of the second line segment and the hash value Objhash2 of the second line segment to generate another hash value hash2, and so on, you can get the hash values of the five line segments displayed in the "Standard Square Device", namely hash1, hash2, hash3, hash4 and hash5, and then, process hash1, hash2, hash3, hash4 and hash5 to get a first global hash value, recorded as Hash1.
[0156] In another achievable manner, for example, the hash values of each line segment and the identifiers of each line segment may be processed as a whole to obtain a first global hash value. The specific process is as follows: Figure 5 The embodiments provided in the present invention are shown in the examples, and no detailed explanation is given here.
[0157] Figure 5A flowchart of another collaborative data synchronization error correction method provided in an embodiment of the present application; Figure 5 As shown, the above step S403, obtaining a first global hash value according to the hash value of each line segment and the identifier of each line segment, includes:
[0158] S501 , respectively compose the identifier of each line segment and the hash value of each line segment into a subsequence corresponding to each line segment.
[0159] For example, based on the above embodiment, the identifier of the first line segment ObjId1 and the hash value Objhash1 of the first line segment may be combined into a first corresponding subsequence, which is recorded as ObjId1+Objhash1.
[0160] For another example, the identifier of the second line segment mentioned above, ObjId2, and the hash value Objhash2 of the second line segment are combined to form a second corresponding subsequence, which is recorded as ObjId2+Objhash2.
[0161] By analogy, the corresponding subsequences of the five line segments displayed by the “standard square device” can be obtained respectively, which are not listed here one by one.
[0162] S502: Combine the subsequences of the line segments into a target sequence according to the order of the identifiers of the line segments.
[0163] For example, the subsequences corresponding to the five line segments displayed by the "standard square device" may be arranged in the format shown in Table 1 below, and the subsequences of the five line segments may be combined into a target sequence, which is recorded as objhashlist1.
[0164] Table 1 Target sequence of subsequence combination of 5 segments displayed by standard square equipment
[0165] ObjId1+Objhash1 ObjId2+Objhash2 …… ObjId5+Objhash5
[0166] By analogy, assuming that the "standard square device" displays n line segments, the above method can also be used to obtain the subsequence combination of n line segments into the target sequence, as shown in Table 2:
[0167] Table 2 Target sequence of subsequence combination of n line segments displayed by standard square equipment
[0168] ObjId1+Objhash1 ObjId2+Objhash2 …… ObjIdn+Objhashn
[0169] S503: Calculate a hash value of the target sequence, and use the hash value of the target sequence as a first global hash value.
[0170] For example, in the basic row of the above embodiment, the Md5 algorithm can be used to perform a hash operation on the target sequence obtained above, and a 128-bit hash value is obtained, which is called the first global hash value Hash1.
[0171] It can be understood that both the "multiple following devices" and the "standard device" calculate the hash value of the line segment data of each displayed line segment according to the same method as above, which is also called the second global hash value. After that, the multiple following devices actively send their respective second global hash values to the "standard device". After the "standard device" receives the second global hash values of the "multiple following devices", it compares them with the first global hash value. If the first global hash value is consistent with each second global hash value, it means that the line segment data of all the line segments displayed in the "multiple following devices" received by the "standard device" are consistent.
[0172] If the first global hash value is consistent with a second global hash value, it means that among the multiple line segments displayed by the "following device D" corresponding to the second global hash value, there is at least one line segment whose line segment data is inconsistent with the corresponding line segment displayed in the "standard party device", and it is necessary to find the line segment data of the line segment to be corrected in the "following device D" and adjust it.
[0173] The collaborative data synchronization error correction method applied to the follower device is explained as follows through multiple embodiments.
[0174] Figure 6 A flowchart of another collaborative data synchronization error correction method provided in an embodiment of the present application; Figure 6 As shown, the execution subject of the method may be the "follower device D" corresponding to the second global hash value that is inconsistent with the first global hash value of the "standard device" in the above embodiment. The "follower device D" may be one or more of the multiple follower devices, and the device end that needs to correct the line segment data of at least one of the multiple line segments displayed by the "follower device D" includes:
[0175] S601: Receive a first global hash value sent by a standard party device.
[0176] The above embodiment has specifically explained how to obtain the first global hash value of all line segments displayed in the standard square device.
[0177] The “follower device D” receives the first global hash value sent by the standard device via the network.
[0178] S602: Parse the first global hash value to obtain the identifier of each line segment displayed in the standard device and the hash value of each line segment.
[0179] The line segment data includes: the coordinates, width, and color of each point that constitutes the line segment.
[0180] For example, the first global hash value is parsed in the "follower device D" to parse out the identifier objId and hash value Objhash of each line segment displayed in the "standard device". For example, the identifier and hash value of the first line segment are parsed as objId1 and Objhash1 respectively.
[0181] S603: Obtain a list to be synchronized according to the identifiers of each line segment and the hash values of each line segment displayed in the standard party device, and the identifiers of each line segment and the hash values of each line segment displayed in the follower party device.
[0182] The list to be synchronized includes a target identifier of at least one line segment, and each line segment is a line segment in the follower device that is inconsistent with that in the standard device.
[0183] For example, the identifier objId and hash value Objhash of each line segment in the parsed "standard party device" are compared one by one with the identifier objId and hash value Objhash of all line segments displayed in the "follower party device D", and the line segment E1 with different identifier objId and / or hash value Objhash in the "standard party device" and the "follower party device D" is found. The line segment E1 can also be called the line segment to be corrected, and the identifier objId100 of the line segment E1 is added to the pending synchronization list, which can also be called pendingObjList.
[0184] S604: Send the to-be-synchronized list to the standard party device.
[0185] The list to be synchronized includes: a target identifier of at least one line segment, and each line segment is a line segment in the follower device that is inconsistent with that in the standard device.
[0186] For example, the list to be synchronized includes the identifier 100 of the line segment E1 to be corrected in the above “follower device D”, that is, the identifier objId100 of the line segment E1 to be corrected is sent to the “standard device”.
[0187] S605: Receive the line segment data of the target line segment sent to the standard party device.
[0188] The target line segment is a line segment with a target identifier displayed in a standard square device.
[0189] For example, based on the above embodiment, the "standard party device" can quickly and accurately find the line segment e1 with the same identifier objId100 as the line segment E1 in the "standard party device" according to the identifier objId100 of the line segment E1 to be corrected in the synchronization list, take the line segment e1 in the "standard party device" as the target line segment, and send the line segment data of the line segment e1 to the "follower party device D".
[0190] S606: Replace the line segment data of the line segment with the target identifier in the follower device with the line segment data of the target line segment.
[0191] For example, the "follower device D" replaces the segment data of the line segment E1 to be corrected with the segment data of the target line segment e1 to ensure that the segment data of all segments displayed in the "standard device" and the "follower device D" in the collaborative system are consistent, thereby achieving the purpose of multi-party collaboration.
[0192] Optionally, according to the identifiers of each line segment and the hash values of each line segment displayed in the standard party device, and the identifiers of each line segment and the hash values of each line segment displayed in the follower party device, a list to be synchronized is obtained, including:
[0193] In this embodiment, there are three situations, as follows:
[0194] (1) If the line segment with the first identifier does not exist in the standard device, and the line segment with the first identifier exists in the follower device, the line segment with the first identifier in the follower device is deleted.
[0195] For example, the identifier objId and hash value Objhash of each line segment in the parsed "standard party device" are compared one by one with the identifiers objId and hash values Objhash of all line segments displayed in the "follower party device D". For example, the identifier of line segment E1 displayed in the "follower party device D" is objId100, and it is found that there is no line segment with the first identifier objId100 in the "standard party device", then the line segment E1 with the first identifier objId100 in the "follower party device D" is deleted.
[0196] (2) If the line segment with the second identifier exists in the standard device and the line segment with the second identifier does not exist in the follower device, the second identifier is added to the to-be-synchronized list.
[0197] For example, if a line segment e101 with the second identifier objId101 is found in the "standard party device", but no line segment with the second identifier objId101 is found in the "follower party device D", the second identifier objId101 is added to the list to be synchronized, so that the target line segment e101 with the second identifier objId101 can be found in the "standard party device", and the line segment data of the line segment e101 is sent to the "follower party device D", and the "follower party device D" draws the corresponding line segment E101 based on the received line segment data of the line segment e101.
[0198] (3) If there are line segments with the third identifier in both the standard party device and the follower party device, and the hash value of the line segment with the third identifier in the standard party device is inconsistent with the hash value of the line segment with the third identifier in the follower party device, then the line segment with the third identifier in the follower party device is deleted, and the third identifier is added to the list to be synchronized.
[0199] For example, if it is found that both the "standard party device" and the "follower party device D" have line segments e102 and E102 with the third identifier objId102, but the hash values of line segments e102 and E102 are inconsistent, the line segment e102 with the third identifier objId102 in the "follower party device D" can be deleted, and the third identifier objId102 can be added to the pending synchronization list pendingObjList, so that the target line segment e102 with the third identifier objId102 can be found in the "standard party device", and the line segment data of line segment e102 can be sent to the "follower party device D", and the "follower party device D" draws the corresponding line segment E102 according to the received line segment data of line segment e102, so as to ensure that the line segment data of all line segments displayed in the "standard party device" and the "follower party device D" in the collaborative system are consistent, so as to achieve the purpose of multi-party collaboration.
[0200] It should be noted that, in this embodiment, when correcting the line segment displayed in the "follower device D", the line segment data in the "standard device" is always used as the basis to achieve the purpose of consistent display of line segment handwriting for all participants in the collaborative system.
[0201] Optionally, the method executed in "multiple follower devices" further includes: acquiring segment data of each segment displayed by the follower device; obtaining a second global hash value based on the segment data of each segment; and sending the second global hash value to the standard device.
[0202] Among them, in the "multiple follower devices", the same method of obtaining the first global hash value mentioned above can be used to calculate the hash value of the line segment data of each line segment displayed in the "multiple follower devices", also called the second global hash value, which will not be explained in detail here.
[0203] In addition, the "multiple follower devices" only need to send their respective second global hash values to the "standard party device" to detect whether there are inconsistencies in the line segment data of each line segment displayed by the "standard party device" and the "multiple follower devices", thereby reducing the occupancy of network bandwidth resources, saving resources, and improving the efficiency of detecting inconsistencies.
[0204] Optionally, obtaining a second global hash value according to the line segment data of each line segment includes:
[0205] Generate labels for each line segment;
[0206] Determine the hash value of each line segment according to the line segment data of each line segment;
[0207] According to the hash value of each line segment and the identifier of each line segment, a second global hash value corresponding to the line segment data of all line segments displayed by each of the “multiple following devices” is obtained.
[0208] Optionally, obtaining a second global hash value according to the hash value of each line segment and the identifier of each line segment includes:
[0209] The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments;
[0210] According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence;
[0211] Calculate the hash value of the target sequence, and use the hash value of the target sequence as the second global hash value.
[0212] Please refer to the above Figure 4 and Figure 5 In the provided embodiment, how to obtain the second global hash value is not explained in detail here.
[0213] Figure 7 A schematic diagram of an interactive process of a collaborative data synchronization error correction method provided in an embodiment of the present application; Figure 7 As shown, the method includes:
[0214] S701. The standard side device obtains the line segment data of each line segment displayed by the standard side device, and generates an identifier for each line segment; and determines the hash value of each line segment according to the line segment data of each line segment.
[0215] S702: The standard party device obtains a first global hash value according to the hash value of each line segment and the identifier of each line segment.
[0216] S703: The follower device obtains the line segment data of each line segment displayed by the follower device, and generates an identifier for each line segment; and determines a hash value of each line segment according to the line segment data of each line segment.
[0217] S704: The follower device obtains a second global hash value according to the hash value of each line segment and the identifier of each line segment.
[0218] S705: The follower device sends a second global hash value to the standard device.
[0219] S706: The standard party device determines whether the first global hash value is consistent with the second global hash value.
[0220] S707: If the first global hash value is inconsistent with the second global hash value, send the first global hash value to the follower device.
[0221] S708: The follower device parses the first global hash value to obtain the identifier of each line segment displayed in the standard device and the hash value of each line segment.
[0222] S709: The follower device obtains a list to be synchronized according to the identifiers of each line segment and the hash values of each line segment displayed in the standard device and the identifiers of each line segment and the hash values of each line segment displayed in the follower device.
[0223] S710: The follower device sends a list to be synchronized to the standard device.
[0224] S711: The standard side device searches the standard side device for line segment data of a target line segment corresponding to a target identifier of at least one line segment included in the to-be-synchronized list.
[0225] S712: The standard device sends the line segment data of the target line segment to the follower device.
[0226] S713: The following device replaces the line segment data of the line segment with the target identifier in the following device with the line segment data of the target line segment.
[0227] Optionally, the specific implementation steps of the interactive method and the beneficial effects produced have been described in detail in the previous specific embodiments and will not be repeated here.
[0228] The following describes the collaborative data synchronization and error correction device and storage medium provided in this application. The specific implementation process and technical effects are described above and will not be repeated below.
[0229] Figure 8A schematic diagram of the structure of a collaborative data synchronization and error correction device provided in an embodiment of the present application; Figure 8 As shown, the device is applied to standard party equipment, and the device includes: an acquisition module 801, a processing module 802, a receiving module 803 and a sending module 804.
[0230] The acquisition module 801 is used to acquire the line segment data of each line segment displayed by the standard square device; wherein the line segment data includes: the coordinates, width, and color of each point constituting the line segment;
[0231] A processing module 802 is used to obtain a first global hash value according to the line segment data of each line segment;
[0232] A receiving module 803 is used to receive a second global hash value sent by a follower device;
[0233] A sending module 804 is configured to send the first global hash value to a follower device if the first global hash value is inconsistent with the second global hash value;
[0234] The receiving module 803 is further configured to receive a to-be-synchronized list sent by the follower device, wherein the to-be-synchronized list includes a target identifier of at least one line segment, and each line segment is a line segment in the follower device that is inconsistent with that in the standard device;
[0235] The sending module 804 is further configured to send the line segment data of the target line segment to the follower device, where the target line segment is a line segment with a target identifier displayed in the standard device.
[0236] Optionally, the processing module 802 is further configured to:
[0237] Generate labels for each line segment;
[0238] Determine the hash value of each line segment according to the line segment data of each line segment;
[0239] A first global hash value is obtained according to the hash value of each line segment and the identifier of each line segment.
[0240] Optionally, the processing module 802 is further configured to:
[0241] The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments;
[0242] According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence;
[0243] Calculate the hash value of the target sequence, and use the hash value of the target sequence as the first global hash value.
[0244] Fig. 9 A schematic diagram of the structure of another collaborative data synchronization and error correction device provided in an embodiment of the present application; Fig. 9 As shown, the device is applied to a follower device, and includes: a receiving module 901, a parsing module 902, a processing module 903, a sending module 904 and a replacing module 905.
[0245] A receiving module 901 is configured to receive a first global hash value sent by a standard party device;
[0246] The parsing module 902 is used to parse the first global hash value to obtain the identifier of each line segment displayed in the standard square device and the hash value of each line segment, wherein the line segment data includes: the coordinates, width, and color of each point constituting the line segment;
[0247] The processing module 903 is used to obtain a list to be synchronized according to the identifiers of each line segment displayed in the standard party device and the hash values of each line segment, and the identifiers of each line segment displayed in the follower party device and the hash values of each line segment, wherein the list to be synchronized includes a target identifier of at least one line segment, and each line segment is a line segment in the follower party device that is inconsistent with that in the standard party device;
[0248] A sending module 904 is used to send a list to be synchronized to a standard party device;
[0249] The receiving module 901 is further used to receive the line segment data of the target line segment sent to the standard party device, where the target line segment is a line segment with a target identifier displayed in the standard party device;
[0250] The replacement module 905 is used to replace the line segment data of the line segment with the target identifier in the follower device with the line segment data of the target line segment.
[0251] Optionally, the processing module 903 is further configured to:
[0252] If the line segment with the first identifier does not exist in the standard device, and the line segment with the first identifier exists in the follower device, then the line segment with the first identifier in the follower device is deleted;
[0253] If the line segment with the second identifier exists in the standard party device, and the line segment with the second identifier does not exist in the follower party device, the second identifier is added to the to-be-synchronized list;
[0254] If there are line segments with the third identifier in both the standard party device and the follower party device, and the hash value of the line segment with the third identifier in the standard party device is inconsistent with the hash value of the line segment with the third identifier in the follower party device, then the line segment with the third identifier in the follower party device is deleted, and the third identifier is added to the list to be synchronized.
[0255] Optionally, the device further includes: an acquisition module;
[0256] An acquisition module, used to acquire line segment data of each line segment displayed by the follower device;
[0257] The processing module is further used to obtain a second global hash value according to the line segment data of each line segment;
[0258] The sending module is further used to send the second global hash value to the standard party device.
[0259] Optionally, the processing module 903 is further configured to:
[0260] Generate labels for each line segment;
[0261] Determine the hash value of each line segment according to the line segment data of each line segment;
[0262] A second global hash value is obtained according to the hash value of each line segment and the identifier of each line segment.
[0263] Optionally, the processing module 903 is further configured to:
[0264] The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments;
[0265] According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence;
[0266] Calculate the hash value of the target sequence, and use the hash value of the target sequence as the second global hash value.
[0267] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0268] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0269] Optionally, the present invention also provides a program product, such as a computer-readable storage medium, comprising a program, which is used to execute the above method embodiment when executed by a processor.
[0270] In the several embodiments provided by the present invention, 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 the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units 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 units, which can be electrical, mechanical or other forms.
[0271] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0272] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0273] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
Claims
1. A collaborative data synchronization error correction method, characterized in that: Applicable to standard equipment, including: Acquire the line segment data of each line segment displayed by the standard square device; wherein the line segment data includes: coordinates, width, and color of each point constituting the line segment; Obtaining a first global hash value according to the line segment data of each line segment; Receiving a second global hash value sent by a follower device; If the first global hash value is inconsistent with the second global hash value, sending the first global hash value to the follower device; Receiving a to-be-synchronized list sent by the follower device, wherein the to-be-synchronized list includes a target identifier of at least one line segment, and each line segment is a line segment in the follower device that is inconsistent with that in the standard device; Sending line segment data of a target line segment to the follower device, where the target line segment is a line segment with the target identifier displayed in the standard device; The obtaining of a first global hash value according to the line segment data of each line segment includes: Generating an identifier for each of the line segments; Determine the hash value of each line segment according to the line segment data of each line segment; Obtaining the first global hash value according to the hash values of the line segments and the identifiers of the line segments; The obtaining of the first global hash value according to the hash value of each line segment and the identifier of each line segment includes: The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments; According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence; A hash value of the target sequence is calculated, and the hash value of the target sequence is used as the first global hash value.
2. A collaborative data synchronization error correction method, characterized in that: Applicable to follower devices, including: Receiving a first global hash value sent by a standard party device; Parsing the first global hash value to obtain the identifier of each line segment displayed in the standard party device and the hash value of each line segment, wherein the line segment data includes: the coordinates, width, and color of each point constituting the line segment; According to the identifier of each line segment displayed in the standard party device and the hash value of each line segment, and the identifier of each line segment displayed in the follower party device and the hash value of each line segment, a list to be synchronized is obtained, wherein the list to be synchronized includes a target identifier of at least one line segment, and each line segment is a line segment in the follower party device that is inconsistent with that in the standard party device; Sending the to-be-synchronized list to the standard party device; receiving line segment data of a target line segment sent to the standard party device, the target line segment being a line segment with the target identifier displayed in the standard party device; Replacing the line segment data of the line segment with the target identifier in the follower device with the line segment data of the target line segment; Among them, it also includes: Acquire line segment data of each line segment displayed by the follower device; Obtaining a second global hash value according to the line segment data of each line segment; Sending the second global hash value to the standard party device; Wherein, obtaining a second global hash value according to the line segment data of each line segment includes: Generating an identifier for each of the line segments; Determine the hash value of each line segment according to the line segment data of each line segment; Obtaining the second global hash value according to the hash value of each line segment and the identifier of each line segment; Optionally, obtaining the second global hash value according to the hash value of each line segment and the identifier of each line segment includes: The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments; According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence; Calculate a hash value of the target sequence, and use the hash value of the target sequence as the second global hash value.
3. The method according to claim 2, characterized in that The obtaining of a list to be synchronized according to the identifiers of each line segment displayed in the standard party device and the hash values of each line segment, and the identifiers of each line segment displayed in the follower party device and the hash values of each line segment, comprises: If the line segment with the first identifier does not exist in the standard device, and the line segment with the first identifier exists in the follower device, then deleting the line segment with the first identifier in the follower device; If the line segment with the second identifier exists in the standard device, and the line segment with the second identifier does not exist in the follower device, adding the second identifier to the to-be-synchronized list; If there is a line segment with a third identifier in both the standard party device and the follower party device, and the hash value of the line segment with the third identifier in the standard party device is inconsistent with the hash value of the line segment with the third identifier in the follower party device, then the line segment with the third identifier in the follower party device is deleted, and the third identifier is added to the list to be synchronized.
4. A collaborative data synchronization error correction device, characterized in that: Applied to standard square equipment, the device includes: an acquisition module, a processing module, a receiving module and a sending module; The acquisition module is used to acquire the line segment data of each line segment displayed by the standard square device; wherein the line segment data includes: the coordinates, width, and color of each point constituting the line segment; The processing module is used to obtain a first global hash value according to the line segment data of each line segment; The receiving module is used to receive a second global hash value sent by a follower device; The sending module is configured to send the first global hash value to the follower device if the first global hash value is inconsistent with the second global hash value; The receiving module is further configured to receive a to-be-synchronized list sent by the follower device, wherein the to-be-synchronized list includes a target identifier of at least one line segment, and each line segment is a line segment in the follower device that is inconsistent with that in the standard device; The sending module is further used to send the line segment data of the target line segment to the follower device, where the target line segment is the line segment with the target identifier displayed in the standard device; Wherein, the processing module is also used for: Generating an identifier for each of the line segments; Determine the hash value of each line segment according to the line segment data of each line segment; Obtaining the first global hash value according to the hash values of the line segments and the identifiers of the line segments; The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments; According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence; A hash value of the target sequence is calculated, and the hash value of the target sequence is used as the first global hash value.
5. A collaborative data synchronization error correction device, characterized in that: Applied to a follower device, the device comprises: a receiving module, a parsing module, a processing module, a sending module and a replacing module; The receiving module is used to receive a first global hash value sent by a standard party device; The parsing module is used to parse the first global hash value to obtain the identifier of each line segment displayed in the standard square device and the hash value of each line segment, wherein the line segment data includes: the coordinates, width, and color of each point constituting the line segment; The processing module is used to obtain a list to be synchronized according to the identifier of each line segment displayed in the standard party device and the hash value of each line segment, and the identifier of each line segment displayed in the follower party device and the hash value of each line segment, wherein the list to be synchronized includes a target identifier of at least one line segment, and each line segment is a line segment in the follower party device that is inconsistent with that in the standard party device; The sending module is used to send the to-be-synchronized list to the standard party device; The receiving module is further used to receive line segment data of a target line segment sent to the standard party device, wherein the target line segment is a line segment with the target identifier displayed in the standard party device; The replacement module is used to replace the line segment data of the line segment with the target identifier in the follower device with the line segment data of the target line segment; The device also includes: an acquisition module; The acquisition module is used to acquire the line segment data of each line segment displayed by the follower device; The processing module is further used to obtain a second global hash value according to the line segment data of each line segment; The sending module is further configured to send the second global hash value to the standard party device; The processing module is further used for: Generating an identifier for each of the line segments; Determine the hash value of each line segment according to the line segment data of each line segment; Obtaining the second global hash value according to the hash value of each line segment and the identifier of each line segment; The identifiers of the line segments and the hash values of the line segments are respectively combined into subsequences corresponding to the line segments; According to the order of the identifiers of the line segments, the subsequences of the line segments are combined into a target sequence; Calculate a hash value of the target sequence, and use the hash value of the target sequence as the second global hash value.
6. A standard square device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the standard party device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in claim 1.
7. A follower device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the follower device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as claimed in claim 2 or 3.
8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are executed.
Citation Information
Patent Citations
Data interchange device and method for supporting flash page operations and pipelined error-correcting code
CN101140543A
Handwriting data synchronization method and device, storage medium and terminal equipment
CN107196956A