Data synchronization method and device, equipment and storage medium
By using wireless direct connection technology and identity authentication verification, the problems of data synchronization efficiency being affected by network signal and manufacturer compatibility issues have been solved, achieving efficient and accurate data transmission between devices.
Patent Information
- Application Number
- CN202410486508.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-22
- Publication Date
- 2025-10-31
AI Technical Summary
Existing data synchronization solutions rely on the Internet, which makes data synchronization efficiency susceptible to network signal interference, and synchronization between devices from different manufacturers may cause data corruption or incompatibility.
Wireless direct connection technology enables old devices to communicate directly with new devices. The synchronization service device sends and verifies identity authentication information to ensure that the devices are from the same manufacturer and have the same version before data synchronization. Data types are classified and labeled to ensure accurate transmission.
It achieves efficient data synchronization without the influence of network signals, avoids data corruption and incompatibility between devices from different manufacturers, and ensures the accuracy and reliability of the data.
Smart Images

Figure CN120881561A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data synchronization, and more particularly to data synchronization methods, apparatus, devices, and storage media. Background Technology
[0002] As time goes by and technology advances, the performance and reliability of older terminal devices may decline. Newer terminal devices usually have more advanced hardware and software technologies than older ones. When older terminal devices can no longer meet user needs or adapt to new technologies, users may consider replacing them with newer terminal devices.
[0003] When replacing old terminal devices with new ones, it's necessary to synchronize data from the old devices to the new ones so they can be quickly put into normal use. A common data synchronization solution involves the old device uploading the data to be synchronized to a cloud server via the internet, and then the cloud server downloading the data to the new device via the internet. This synchronization method relies on the internet, and the upload and download speeds of both the old and new devices are affected by network signal strength, making it difficult to guarantee efficient data synchronization. Summary of the Invention
[0004] This application provides a data synchronization method, apparatus, device, and storage medium to solve the technical problem of data synchronization between new and old devices.
[0005] Firstly, a data synchronization method is provided, applied to a data receiving device in a wireless direct connection system, wherein the wireless direct connection system includes a synchronization service device and the data receiving device, and the synchronization service device and the data receiving device communicate based on wireless direct connection technology;
[0006] The method includes:
[0007] The system receives first synchronization service information sent by the synchronization service device, the first synchronization service information carrying the identity authentication information of the synchronization service device, the identity authentication information of the synchronization service device including the manufacturer identifier of the synchronization service device;
[0008] Verify the manufacturer identifier of the synchronization service device;
[0009] If the verification of the manufacturer's identifier of the synchronization service device is successful, data synchronization is performed with the synchronization service device.
[0010] In this technical solution, after receiving the first synchronization service information sent by the synchronization service device, the data receiving device verifies the manufacturer identifier of the synchronization service device carried in the first synchronization service information. If the verification of the manufacturer identifier of the synchronization service device passes, data synchronization is performed with the synchronization service device. Since the data receiving device and the synchronization service device communicate based on wireless direct connection technology, the synchronization speed is not affected by network signal, thus ensuring the efficiency of data synchronization. In addition, data synchronization is only performed with the synchronization service device if the verification of the manufacturer identifier passes, which avoids data corruption or incompatibility caused by data synchronization between devices from different manufacturers, ensuring the accuracy and reliability of the data updated and synchronized by the device.
[0011] In conjunction with the first aspect, in one possible implementation, the authentication information of the synchronization service device further includes the device version of the synchronization service device; before synchronizing data with the synchronization service device, the method further includes: verifying the device version of the synchronization service device; and if the verification of the device version of the synchronization service device passes, then the step of synchronizing data with the synchronization service device is performed. Only synchronizing data with the synchronization service device after verifying its device version avoids the situation where data from a new device is synchronized to an old device, ensuring the accuracy of iterative updates between new and old devices.
[0012] In conjunction with the first aspect, in one possible implementation, the verification of the device version of the synchronization service device includes: determining whether the device version of the synchronization service device is earlier than the device version of the data receiving device; if the device version of the synchronization service device is earlier than the device version of the data receiving device, determining that the verification of the device version of the synchronization service device has passed.
[0013] In conjunction with the first aspect, in one possible implementation, the verification of the manufacturer identifier of the synchronization service device includes: determining whether the manufacturer identifier of the synchronization service device is the same as the manufacturer identifier of the data receiving device; if the manufacturer identifier of the synchronization service device is the same as the manufacturer identifier of the data receiving device, determining that the verification of the manufacturer identifier of the synchronization service device has passed.
[0014] In conjunction with the first aspect, in one possible implementation, the first synchronization service information is obtained by encrypting the second synchronization service information by the synchronization service device, the second synchronization service information including the authentication information of the synchronization service device; before verifying the vendor identifier of the synchronization service device, the method further includes: decrypting the first synchronization service information; and, if the second synchronization service information is obtained after decryption, performing the step of verifying the vendor identifier of the synchronization service device. By encrypting the synchronization service information sent by the synchronization service device, the privacy and security of the synchronization service provided by the synchronization service device can be guaranteed.
[0015] In conjunction with the first aspect, in one possible implementation, the data synchronization with the synchronization service device includes: sending a data synchronization request to the synchronization service device; and receiving a synchronization data stream sent by the synchronization service device in response to the data synchronization request, wherein the synchronization data stream is obtained by the synchronization service device sorting the data to be synchronized in the synchronization service device. By sending a data synchronization request to the synchronization service device through a data receiving device, the synchronization service device can simultaneously synchronize data with multiple data receiving devices, achieving batch data synchronization.
[0016] In conjunction with the first aspect, in one possible implementation, the synchronization data stream is obtained by the synchronization service device classifying the data to be synchronized according to data type and marking the classified data to be synchronized, with different marks corresponding to different storage paths; after receiving the synchronization data stream sent by the synchronization service device in response to the data synchronization request, the method further includes: sequentially combining data packets with the same mark in the synchronization data stream to obtain data to be stored; and storing the data to be stored in the data receiving device in the storage path corresponding to the mark of the data to be stored. By classifying and marking the data to be synchronized according to data type before transmission, and storing it in the data receiving device according to the mark, the data can be accurately restored in the data receiving device.
[0017] Secondly, a data synchronization method is provided, which is applied to a synchronization service device in a wireless direct connection system. The wireless direct connection system includes the synchronization service device and a data receiving device, and the synchronization service device and the data receiving device communicate based on wireless direct connection technology.
[0018] The method includes:
[0019] Send first synchronization service information to the data receiving device. The first synchronization service information carries the identity authentication information of the synchronization service device, and the identity authentication information of the synchronization service device includes the manufacturer identifier of the synchronization service device.
[0020] If the data receiving device passes the verification of the manufacturer's identifier of the synchronization service device, data synchronization is performed with the data receiving device.
[0021] In this technical solution, the synchronization service device sends first synchronization service information to the data receiving device. This first synchronization service information carries the authentication information of the synchronization service device, including its manufacturer identifier. Data synchronization occurs only after the data receiving device verifies the manufacturer identifier of the synchronization service device. Since the data receiving device and the synchronization service device communicate based on wireless direct connection technology, the synchronization speed is unaffected by network signal strength, thus ensuring efficient data synchronization. Furthermore, the fact that data synchronization only occurs after verifying the manufacturer identifier of the synchronization service device avoids data corruption or incompatibility caused by data synchronization between devices from different manufacturers, ensuring the accuracy and reliability of the updated and synchronized data.
[0022] In conjunction with the second aspect, in one possible implementation, the authentication information of the synchronization service device further includes the device version of the synchronization service device; the step of synchronizing data with the data receiving device only after the data receiving device has successfully verified the manufacturer identifier of the synchronization service device includes: synchronizing data with the data receiving device only after the data receiving device has successfully verified both the manufacturer identifier and the device version of the synchronization service device. Only synchronizing data with the data receiving device after the data receiving device has successfully verified the device version of the synchronization service device avoids the situation where data from a new device is synchronized to an old device, ensuring the accuracy of iterative updates between new and old devices.
[0023] In conjunction with the second aspect, in one possible implementation, before sending the first synchronization service information to the data receiving device, the method further includes: encrypting the second synchronization service information to obtain the first synchronization service information, wherein the second synchronization service information includes the identity authentication information of the synchronization service device. By encrypting the synchronization service information sent by the synchronization service device, the privacy and security of the synchronization service provided by the synchronization service device can be guaranteed.
[0024] In conjunction with the second aspect, in one possible implementation, the data synchronization with the data receiving device includes: receiving a data synchronization request sent by the data receiving device; responding to the data synchronization request, sorting the data to be synchronized in the synchronization service device to obtain a synchronization data stream; and sending the synchronization data stream to the data receiving device. By having the data receiving device send a data synchronization request to the synchronization service device to perform data synchronization, the synchronization service device can simultaneously synchronize data with multiple data receiving devices, achieving batch data synchronization.
[0025] In conjunction with the second aspect, in one possible implementation, before sorting the data to be synchronized in the synchronization service device to obtain the synchronized data stream, the method further includes: classifying the data to be synchronized according to data type, and marking the classified data to be synchronized, with different marks corresponding to different storage paths. By classifying and marking the data to be synchronized according to data type before transmission, it can be ensured that the data can be accurately restored in the data receiving device.
[0026] Thirdly, a data synchronization device is provided, which is applied to a data receiving device in a wireless direct connection system. The wireless direct connection system includes a synchronization service device and the data receiving device, and the synchronization service device and the data receiving device communicate based on wireless direct connection technology.
[0027] The device includes:
[0028] A receiving module is configured to receive first synchronization service information sent by the synchronization service device, wherein the first synchronization service information carries the identity authentication information of the synchronization service device, and the identity authentication information of the synchronization service device includes the manufacturer identifier of the synchronization service device.
[0029] The verification module is used to verify the manufacturer identifier of the synchronization service device;
[0030] The synchronization module is used to synchronize data with the synchronization service device if the verification of the manufacturer's identifier of the synchronization service device is successful.
[0031] Fourthly, another data synchronization device is provided, which is applied to a synchronization service device in a wireless direct connection system. The wireless direct connection system includes the synchronization service device and a data receiving device, and the synchronization service device and the data receiving device communicate based on wireless direct connection technology.
[0032] The device includes:
[0033] The sending module is used to send first synchronization service information to the data receiving device. The first synchronization service information carries the identity authentication information of the synchronization service device, and the identity authentication information of the synchronization service device includes the manufacturer identifier of the synchronization service device.
[0034] The synchronization module is used to synchronize data with the data receiving device when the data receiving device passes the verification of the manufacturer identifier of the synchronization service device.
[0035] Fifthly, a computer device is provided, including a memory, a communication interface, and one or more processors, wherein the communication interface is used for transmitting data, the memory is connected to the one or more processors, and the one or more processors are used to execute one or more computer programs stored in the memory, wherein when the one or more processors execute the one or more computer programs, the computer device implements the data synchronization method of the first or second aspect described above.
[0036] In a sixth aspect, a computer-readable storage medium is provided, which stores a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the data synchronization method of the first or second aspect.
[0037] This application can achieve the following technical effects: Since the data receiving device and the synchronization service device communicate based on wireless direct connection technology, and the data synchronization is performed based on wireless direct connection technology, the synchronization speed is not affected by the network signal, thus ensuring the efficiency of data synchronization; In addition, data synchronization with the synchronization service device is only performed after the manufacturer's identification of the synchronization service device is verified, which can avoid data corruption or data incompatibility caused by data synchronization between devices from different manufacturers, and ensure the accuracy and reliability of the data updated and synchronized by the device. Attached Figure Description
[0038] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a schematic diagram of the system architecture of the wireless direct connection system provided in the embodiments of this application;
[0040] Figure 2 A flowchart illustrating a data synchronization method provided in an embodiment of this application;
[0041] Figure 3 A schematic diagram illustrating the interaction between the data receiving device and the synchronization service device for data synchronization provided in this application embodiment;
[0042] Figure 4 A flowchart illustrating another data synchronization method provided in an embodiment of this application;
[0043] Figure 5 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of this application;
[0044] Figure 6 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of this application;
[0045] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0047] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. Moreover, the terms "first," "second," and "third" used in this application do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0048] The technical solution of this application applies to data synchronization scenarios, which refer to scenarios where data from one device is synchronously saved to another device. Specifically, a data synchronization scenario can be a replacement scenario between old and new devices, where data from the old device is synchronously saved to the new device.
[0049] A feasible data synchronization scheme involves both the old and new devices connecting to a cloud server via the internet. The old device uploads the data to be synchronized (hereinafter referred to as the data to be synchronized) to the cloud server, and the new device downloads and saves the data to be synchronized from the cloud server, thus completing the data synchronization. This data synchronization scheme relies on the internet, and the upload speed of the old device and the download speed of the new device are both limited by the device's network signal. If the network signal is poor, synchronization interruptions are likely to occur, making it difficult to guarantee synchronization efficiency.
[0050] In view of this, this application proposes a new data synchronization scheme. An old device and a new device form a wireless direct connection system, communicating via wireless direct connection technology. The old device acts as a synchronization service device in the wireless direct connection system, and the new device acts as a data receiving device. The synchronization service device initiates the data synchronization service and sends synchronization service information to the data receiving device. This synchronization service information carries the authentication information of the synchronization service device, including its manufacturer identifier. Upon receiving the synchronization service information, the data receiving device verifies the manufacturer identifier of the synchronization service device carried in the synchronization service information. Upon successful verification, data synchronization occurs with the synchronization service device. Since the data receiving device and the synchronization service device communicate based on wireless direct connection technology, they do not rely on the Internet. Data synchronization is unaffected by network signal strength, ensuring efficient data synchronization. Because there are many devices communicating based on wireless direct connection technology in the same space, and these devices may be from different manufacturers, the data receiving device only synchronizes with the synchronization service device after successfully verifying the manufacturer's identifier. This avoids data synchronization between devices from different manufacturers, preventing data corruption or incompatibility and ensuring the accuracy and reliability of the updated and synchronized data.
[0051] The technical solution of this application can be applied to wireless direct connection systems. For ease of understanding, the wireless direct connection system of this application is first introduced. See [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram of the system architecture of the wireless direct connection system provided in the embodiments of this application, such as... Figure 1 As shown, the wireless direct connection system 10 includes a synchronization service device 101 and a data receiving device 102. In the wireless direct connection system 10, there can be one or more synchronization service devices 101 and data receiving devices 102. The synchronization service device 101 is the device that initiates the data synchronization service, that is, the device that needs to synchronize data to other devices. For example, the synchronization service device 101 can be the old device in a replacement scenario. The data receiving device 102 is the device that receives the data transmitted by the synchronization service device 101. For example, the data receiving device can be the new device in a replacement scenario.
[0052] The synchronization service device 101 and the data receiving device 102 communicate based on wireless direct connection technology, which refers to a technology that enables two or more devices to transmit and communicate directly without the need for intermediate devices.
[0053] In one specific implementation, the synchronization service device 101 and the data receiving device 102 can communicate based on the Wi-Fi Neighbor Awareness Networking (NAN) protocol. The synchronization service device 101 can be the master device in the Wi-Fi NAN cluster and can create a NAN cluster for data synchronization services. The data receiving device 102 can be a non-master device in the Wi-Fi NAN cluster and can join the NAN cluster created by the synchronization service device 101 for data synchronization services to communicate with the synchronization service device 101 via Wi-Fi NAN and thus synchronize data with the synchronization service device.
[0054] based on Figure 1 The wireless direct connection system shown can implement the technical solution of this application. The technical solution of this application is described in detail below.
[0055] See Figure 2 , Figure 2 This is a flowchart illustrating a data synchronization method provided in an embodiment of this application. The method is applied to a wireless direct connection system, which can, as follows: Figure 1 As shown. Figure 2 As shown, the method includes the following steps:
[0056] S201, the synchronization service device sends the first synchronization service information to the data receiving device, and the data receiving device receives the first synchronization service information.
[0057] For the definitions of synchronization service equipment and data receiving equipment, please refer to the preceding text. Figure 1 The corresponding description.
[0058] The first synchronization service information is the service information issued by the synchronization service device during the data synchronization service process. This information can be used to indicate the data synchronization service published by the synchronization service device and the device's identity. The first synchronization service information may carry the service name of the data synchronization service provided by the synchronization service device and the device's authentication information. The service name indicates that the service published by the synchronization service device is a data synchronization service; the device's authentication information includes the manufacturer's identifier, which indicates the manufacturer to which the synchronization service device belongs, i.e., the manufacturer that produced the synchronization service device.
[0059] In some possible scenarios, the synchronization service device can encrypt the second synchronization service information to obtain the first synchronization service information. The second synchronization service information includes the service name of the data synchronization service provided by the synchronization service device and the authentication information of the synchronization service device. Specifically, the synchronization service device can use a key pre-stored in the synchronization service device to encrypt the second synchronization service information to obtain the first synchronization service information. By encrypting the synchronization service information sent by the synchronization service device, the privacy and security of the synchronization service provided by the synchronization service device can be guaranteed.
[0060] The synchronization service device can initiate a data synchronization service and send the first synchronization service information to the data receiving device after the synchronization service device is started, or it can initiate a data synchronization service and send the first synchronization service information to the data receiving device after the user triggers data synchronization on the synchronization service device. The data receiving device can initiate a data receiving service and receive the first synchronization service information sent by the synchronization service device after the data receiving device is started, or it can initiate a data receiving service and receive the first synchronization service information sent by the synchronization service device after the user triggers data synchronization on the data receiving device.
[0061] In one specific implementation, the synchronization service device can periodically send the first synchronization service information to the data receiving device in a discovery window (DW). The synchronization service device can also broadcast the first synchronization service information to the data receiving device in the DW. The data receiving device can receive the first synchronization service information by scanning in the DW. If the first synchronization service information is detected in the DW, it has received the first synchronization service information.
[0062] S202, the data receiving device verifies the manufacturer identifier of the synchronization service device carried in the first synchronization service information.
[0063] Specifically, the data receiving device can determine whether the manufacturer identifier of the synchronization service device is the same as that of the data receiving device. The manufacturer identifier of the data receiving device indicates the manufacturer to which the data receiving device belongs, that is, the manufacturer that produces the data receiving device. If the manufacturer identifier of the synchronization service device is the same as that of the data receiving device, it means that the synchronization service device and the data receiving device are from the same manufacturer, and the verification of the manufacturer identifier of the synchronization service device is confirmed to be successful. If the manufacturer identifier of the synchronization service device is different from that of the data receiving device, it means that the synchronization service device and the data receiving device are not from the same manufacturer, and the verification of the manufacturer identifier of the synchronization service device is confirmed to be unsuccessful.
[0064] When the first synchronization service information is obtained by encrypting the second synchronization service information by the synchronization service device, the data receiving device needs to decrypt the first synchronization service information before verifying the manufacturer identifier of the synchronization service device in the first synchronization information. If the second synchronization service information is obtained through decryption, the identity authentication identifier of the synchronization service device is obtained from the second synchronization service information, thereby obtaining the manufacturer identifier of the synchronization service device, and step S202 is executed; if the second synchronization service information is not obtained through decryption, it indicates that the synchronization service device and the data receiving device are not compatible, and the data receiving device waits to receive synchronization service information sent by other synchronization service devices. The data receiving device can use a key pre-stored in the data receiving device to decrypt the second synchronization service information.
[0065] If the verification of the manufacturer identifier of the synchronization service device carried in the first synchronization service information passes, the data receiving device executes step S203; if the verification of the manufacturer identifier of the synchronization service device carried in the first synchronization service information fails, the data receiving device waits to receive synchronization service information sent by other synchronization service devices.
[0066] S203, The data receiving device and the synchronization service device perform data synchronization.
[0067] In one feasible implementation, the data receiving device and the synchronization service device can communicate via... Figure 3 The process shown is for data synchronization, such as... Figure 3 As shown, the process includes the following steps S2031 to S2033.
[0068] S2031, the data receiving device sends a data synchronization request to the synchronization service device, and the synchronization service device receives the data synchronization request.
[0069] Here, a data synchronization request is used to request the establishment of a communication link with the synchronization service device for the transmission of data to be synchronized. The data synchronization request may carry the device identifier of the data receiving device, which is used to uniquely identify the data receiving device.
[0070] Upon receiving a data synchronization request from the data receiving device, the synchronization service device can create a socket and specify the corresponding communication port for the socket to establish a communication link with the data receiving device.
[0071] S2032, the synchronization service device responds to the data synchronization request, sorts the data to be synchronized in the synchronization service device, and obtains the synchronization data stream.
[0072] Here, the data to be synchronized refers to the data that the synchronization service device needs to synchronize to provide data synchronization services, that is, the data that needs to be transmitted to the data receiving device. The synchronization service device can respond to this data synchronization request, obtain the data to be synchronized from its local storage, and encapsulate the data to be synchronized into one or more data packets according to the data transmission format corresponding to the wireless communication protocol used by the wireless direct connection system. The encapsulated data packets are then sorted to form a synchronization data stream. There can be one or more synchronization data streams.
[0073] In some possible scenarios, before sorting the data to be synchronized and obtaining the synchronization data stream, the synchronization service device can also classify the data to be synchronized according to its data type and mark the classified data to be synchronized, with different marks corresponding to different storage paths; then, according to the data transmission format corresponding to the wireless communication protocol adopted by the wireless direct connection system, the classified and marked data to be synchronized is encapsulated according to the wireless direct connection system to obtain one or more data packets.
[0074] For example, corresponding tags can be set for different storage paths to establish a correspondence between storage paths and tags. One tag corresponds to one storage path, that is, the tag is used to uniquely indicate the storage path. The data to be synchronized is divided into text data, image data, video data, audio data, and application configuration data according to data type. Text data is combined to form a text dataset, image data is combined to form an image dataset, video data is combined to form a video dataset, audio data is combined to form an audio dataset, and application configuration data of each application is combined to form an application configuration dataset for each application. Then, according to the storage path of each data in each dataset and the correspondence between storage paths and tags, tags corresponding to the storage paths are added to each data.
[0075] S2033, the synchronization service device sends a synchronization data stream to the data receiving device, and the data receiving device receives the synchronization data stream.
[0076] Among them, the synchronization service device can send synchronization data streams to the data receiving device in parallel through multiple threads, and the data receiving device can receive synchronization data streams in parallel.
[0077] In this scenario, where the synchronization service device categorizes the data to be synchronized according to data type and marks the categorized data, before sending the synchronization data stream to the data receiving device, the synchronization service device can also send path configuration data corresponding to the synchronization data stream. This path configuration data carries the correspondence between storage paths and marks; the data receiving device can receive this path configuration data. After receiving the synchronization data stream, the data receiving device can sequentially combine data packets with the same mark in the synchronization data stream to obtain the data to be stored, and then store the data to be stored in the storage path corresponding to the mark of the data to be stored in the data receiving device. By categorizing and marking the data to be synchronized according to data type before transmission, and then storing it in the data receiving device according to the mark, the data can be accurately restored in the data receiving device.
[0078] In steps S2031 to S2033 above, data synchronization is performed by sending a data synchronization request from the data receiving device to the synchronization service device. The synchronization service device can synchronize data with multiple data receiving devices simultaneously to achieve batch data synchronization.
[0079] In the above Figure 2 In the corresponding technical solution, after receiving the first synchronization service information sent by the synchronization service device, the data receiving device verifies the manufacturer identifier of the synchronization service device carried in the first synchronization service information. If the verification of the manufacturer identifier of the synchronization service device passes, data synchronization is performed with the synchronization service device. Since the data receiving device and the synchronization service device communicate based on wireless direct connection technology, the synchronization speed is not affected by network signal, thus ensuring the efficiency of data synchronization. In addition, data synchronization is only performed with the synchronization service device if the verification of the manufacturer identifier passes, which avoids data corruption or incompatibility caused by data synchronization between devices from different manufacturers, ensuring the accuracy and reliability of the data updated and synchronized by the device.
[0080] In some possible cases, the authentication information of the synchronization service device carried in the first synchronization service information may also include the device version of the synchronization service device. Before synchronizing data with the synchronization service device, the data receiving device also needs to verify the device version of the synchronization service device. See also Figure 4 , Figure 4 This is a flowchart illustrating another data synchronization method provided in an embodiment of this application. This method is applied to a wireless direct connection system, which can be used as follows: Figure 1 As shown. Figure 4 As shown, the method includes the following steps:
[0081] S301, the synchronization service device sends the first synchronization service information to the data receiving device, and the data receiving device receives the first synchronization service information.
[0082] The specific implementation of step S301 can be found in the description of step S201 above, and will not be repeated here.
[0083] S302, the data receiving device verifies the manufacturer identifier of the synchronization service device carried in the first synchronization service information.
[0084] The specific implementation of step S302 can be found in the description of step S202 above, and will not be repeated here.
[0085] If the verification of the manufacturer identifier of the synchronization service device carried in the first synchronization service information passes, the data receiving device executes step S303; if the verification of the manufacturer identifier of the synchronization service device carried in the first synchronization service information fails, the data receiving device waits to receive synchronization service information sent by other synchronization service devices.
[0086] S303, the data receiving device verifies the device version of the synchronization service device carried in the first synchronization service information.
[0087] In one feasible implementation, the data receiving device can determine whether the device version of the synchronization service device is earlier than the device version of the data receiving device. If the device version of the synchronization service device is earlier than the device version of the data receiving device, it indicates that the synchronization service device is an older device compared to the data receiving device, and the device version verification of the synchronization service device is confirmed to have passed. If the device version of the synchronization service device is later than the device version of the data receiving device, it indicates that the synchronization service device is a newer device compared to the data receiving device, and the device version verification of the synchronization service device is confirmed to have failed.
[0088] For example, let v1, v2, ... vn represent the device version. The larger the number after v, the later the device version. Suppose the device version of the data receiving device is v2. If the device version of the synchronization service device is v3, then the device version of the synchronization service device is later than the device version of the data receiving device, and the device version verification of the synchronization service device fails. If the device version of the synchronization service device is v1, then the device version of the synchronization service device is earlier than the device version of the data receiving device, and the device version verification of the synchronization service device passes.
[0089] In another feasible implementation, the data receiving device can also determine whether the device version of the synchronization service device is the previous device version of the data receiving device. If the device version of the synchronization service device is the previous device version of the data receiving device, the device version verification of the synchronization service device is determined to be successful; if the device version of the synchronization service device is not the previous device version of the data receiving device, the device version verification of the synchronization service device is determined to be unsuccessful.
[0090] For example, let v1, v2, ... vn represent the device version. The larger the number after v, the later the device version. Suppose the device version of the data receiving device is v3. If the device version of the synchronization service device is v2, then the device version of the synchronization service device is the previous device version of the data receiving device, and the device version verification of the synchronization service device passes. If the device version of the synchronization service device is v1, then the device version of the synchronization service device is not the previous device version of the data receiving device, and the device version verification of the synchronization service device passes.
[0091] The device version verification of the synchronization service device is only confirmed when the device version of the synchronization service device is the previous device version of the data receiving device, thus ensuring that data synchronization can be performed between devices with adjacent device versions.
[0092] If the device version verification of the synchronization service device carried in the first synchronization service information passes, step S304 is executed; if the verification of the device version carried in the first synchronization service information or the synchronization service device fails, the data receiving device waits to receive synchronization service information sent by other synchronization service devices.
[0093] S304, The data receiving device and the synchronization service device perform data synchronization.
[0094] For details on the specific implementation of step S304, please refer to the description of step S203 above, which will not be repeated here.
[0095] In the above Figure 4 In the corresponding technical solution, after receiving the first synchronization service information sent by the synchronization service device, the data receiving device verifies the manufacturer identifier of the synchronization service device carried in the first synchronization service information and verifies the device version of the synchronization service device in the first synchronization service information. Only when the verification of the manufacturer identifier and the device version of the synchronization service device both pass, data synchronization with the synchronization service device is performed. This not only avoids data corruption or incompatibility caused by data synchronization between devices from different manufacturers, ensuring the accuracy of data update synchronization, but also avoids the situation where data from a new device is synchronized to an old device, ensuring the accuracy of iterative updates between new and old devices.
[0096] The method of this application has been described above; the apparatus of this application will be described below.
[0097] See Figure 5 , Figure 5 This is a schematic diagram of a data synchronization device provided in an embodiment of this application, which is a data receiving device applied in a wireless direct connection system. The wireless direct connection system can be used as follows: Figure 1 As shown. Figure 5 As shown, the data synchronization device 40 includes:
[0098] The receiving module 401 is used to receive first synchronization service information sent by the synchronization service device, wherein the first synchronization service information carries the identity authentication information of the synchronization service device, and the identity authentication information of the synchronization service device includes the manufacturer identifier of the synchronization service device.
[0099] Verification module 402 is used to verify the manufacturer identifier of the synchronization service device;
[0100] The synchronization module 403 is used to synchronize data with the synchronization service device if the verification of the manufacturer's identifier of the synchronization service device is successful.
[0101] In one possible design, the identity authentication information of the synchronization service device also includes the device version of the synchronization service device; the verification module 402 is further used to: verify the device version of the synchronization service device; the synchronization module 403 is used to execute the step of data synchronization with the synchronization service device if the verification of the device version of the synchronization service device passes.
[0102] In one possible design, the verification module 402 is specifically used to: determine whether the device version of the synchronization service device is earlier than the device version of the data receiving device; if the device version of the synchronization service device is earlier than the device version of the data receiving device, determine that the verification of the device version of the synchronization service device has passed.
[0103] In one possible design, the verification module 402 is specifically used to: determine whether the manufacturer identifier of the synchronization service device is the same as the manufacturer identifier of the data receiving device; if the manufacturer identifier of the synchronization service device is the same as the manufacturer identifier of the data receiving device, determine that the verification of the manufacturer identifier of the synchronization service device has passed.
[0104] In one possible design, the first synchronization service information is obtained by encrypting the second synchronization service information by the synchronization service device, and the second synchronization service information includes the identity authentication information of the synchronization service device; the above-mentioned verification module 402 is further used to: decrypt the first synchronization service information; and, if the second synchronization service information is obtained by decryption, perform the step of verifying the manufacturer identifier of the synchronization service device.
[0105] In one possible design, the synchronization module 403 is specifically used to: send a data synchronization request to the synchronization service device; receive a synchronization data stream sent by the synchronization service device in response to the data synchronization request, wherein the synchronization data stream is obtained by the synchronization service device sorting the data to be synchronized in the synchronization service device.
[0106] In one possible design, the synchronization data stream is obtained by the synchronization service device classifying the data to be synchronized according to data type and marking the classified data to be synchronized, with different marks corresponding to different storage paths; the synchronization module 403 is specifically used to: sequentially combine data packets with the same mark in the synchronization data stream to obtain data to be stored; and store the data to be stored in the storage path corresponding to the mark of the data to be stored in the data receiving device.
[0107] It should be noted that, Figure 5 For any content not mentioned in the corresponding embodiments, please refer to the description of the foregoing method embodiments, which will not be repeated here.
[0108] After receiving the first synchronization service information sent by the synchronization service device, the aforementioned device verifies the manufacturer identifier of the synchronization service device carried in the first synchronization service information. If the verification of the manufacturer identifier of the synchronization service device passes, it performs data synchronization with the synchronization service device. Since the data receiving device and the synchronization service device communicate based on wireless direct connection technology, the synchronization speed is not affected by network signal, thus ensuring the efficiency of data synchronization. In addition, the fact that data synchronization with the synchronization service device only occurs after the verification of the manufacturer identifier passes avoids data corruption or incompatibility caused by data synchronization between devices from different manufacturers, ensuring the accuracy and reliability of the data updated and synchronized by the device.
[0109] See Figure 6 , Figure 6 This is a schematic diagram of a data synchronization device provided in an embodiment of this application, applied to a synchronization service device in a wireless direct connection system. The wireless direct connection system can, as... Figure 1 As shown. Figure 6As shown, the data synchronization device 50 includes:
[0110] The sending module 501 is used to send first synchronization service information to the data receiving device. The first synchronization service information carries the identity authentication information of the synchronization service device, and the identity authentication information of the synchronization service device includes the manufacturer identifier of the synchronization service device.
[0111] The synchronization module 502 is used to synchronize data with the data receiving device when the data receiving device passes the verification of the manufacturer identifier of the synchronization service device.
[0112] In one possible design, the identity authentication information of the synchronization service device also includes the device version of the synchronization service device; the synchronization module 502 is specifically used to: synchronize data with the data receiving device when the data receiving device passes the verification of the manufacturer identifier and the device version of the synchronization service device.
[0113] In one possible design, the sending module 501 is further configured to encrypt the second synchronization service information to obtain the first synchronization service information, wherein the second synchronization service information includes the identity authentication information of the synchronization service device.
[0114] In one possible design, the synchronization module 502 is specifically used to: receive a data synchronization request sent by the data receiving device; respond to the data synchronization request, sort the data to be synchronized in the synchronization service device to obtain a synchronization data stream; and send the synchronization data stream to the data receiving device.
[0115] In one possible design, the synchronization module 502 is specifically used to: classify the data to be synchronized according to data type, and mark the classified data to be synchronized, with different marks corresponding to different storage paths.
[0116] It should be noted that, Figure 6 For any content not mentioned in the corresponding embodiments, please refer to the description of the foregoing method embodiments, which will not be repeated here.
[0117] The aforementioned device sends first synchronization service information to a data receiving device. This first synchronization service information carries the authentication information of the synchronization service device, including its manufacturer identifier. If the data receiving device successfully verifies the manufacturer identifier of the synchronization service device, data synchronization occurs between them. Since the data receiving device and the synchronization service device communicate based on wireless direct connection technology, the synchronization speed is unaffected by network signals, thus ensuring efficient data synchronization. Furthermore, by only synchronizing data with the synchronization service device after successful verification of its manufacturer identifier, data corruption or incompatibility caused by data synchronization between devices from different manufacturers can be avoided, ensuring the accuracy and reliability of the updated and synchronized data.
[0118] See Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device 60 provided in an embodiment of this application. The computer device 60 includes a processor 601, a memory 602, and a communication interface 603. The memory 602 is connected to the processor 601, for example, via a bus.
[0119] Processor 601 is configured to support the computer device 60 in performing the corresponding functions in the methods described in the above method embodiments. Processor 601 may be a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0120] Memory 602 is used to store program code, etc. Memory 602 may include volatile memory (VM), such as random access memory (RAM); memory 602 may also include non-volatile memory (NVM), such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); memory 602 may also include combinations of the above types of memory.
[0121] Communication interface 603 is used for data transmission.
[0122] When the computer device 60 is used as a data receiving device, the processor 601 can call the program code to perform the following operations:
[0123] The system receives first synchronization service information sent by a synchronization service device, the first synchronization service information carrying the identity authentication information of the synchronization service device, the identity authentication information of the synchronization service device including the manufacturer identifier of the synchronization service device;
[0124] Verify the manufacturer identifier of the synchronization service device;
[0125] If the verification of the manufacturer's identifier of the synchronization service device is successful, data synchronization is performed with the synchronization service device.
[0126] When computer device 60 is used as a synchronization service device, processor 601 can call the program code to perform the following operations:
[0127] Send first synchronization service information to the data receiving device. The first synchronization service information carries the identity authentication information of the synchronization service device, and the identity authentication information of the synchronization service device includes the manufacturer identifier of the synchronization service device.
[0128] If the data receiving device passes the verification of the manufacturer's identifier of the synchronization service device, data synchronization is performed with the data receiving device.
[0129] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the method described in the foregoing embodiments.
[0130] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0131] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data synchronization method, characterized in that, A data receiving device applied in a wireless direct connection system, wherein the wireless direct connection system includes a synchronization service device and the data receiving device, and the synchronization service device and the data receiving device communicate based on wireless direct connection technology; The method includes: The system receives first synchronization service information sent by the synchronization service device, the first synchronization service information carrying the identity authentication information of the synchronization service device, the identity authentication information of the synchronization service device including the manufacturer identifier of the synchronization service device; Verify the manufacturer identifier of the synchronization service device; If the verification of the manufacturer's identifier of the synchronization service device is successful, data synchronization is performed with the synchronization service device.
2. The method according to claim 1, characterized in that, The identity authentication information of the synchronization service device also includes the device version of the synchronization service device; Before synchronizing data with the synchronization service device, the method further includes: The device version of the synchronization service device is verified; If the device version verification of the synchronization service device passes, the step of synchronizing data with the synchronization service device is performed.
3. The method according to claim 2, characterized in that, The verification of the device version of the synchronization service device includes: Determine whether the device version of the synchronization service device is earlier than the device version of the data receiving device; If the device version of the synchronization service device is earlier than the device version of the data receiving device, the verification of the device version of the synchronization service device is deemed successful.
4. The method according to claim 1, characterized in that, The verification of the manufacturer identifier of the synchronization service device includes: Determine whether the manufacturer identifier of the synchronization service device is the same as the manufacturer identifier of the data receiving device; If the vendor identifier of the synchronization service device is the same as the vendor identifier of the data receiving device, the verification of the vendor identifier of the synchronization service device is deemed successful.
5. The method according to claim 1, characterized in that, The first synchronization service information is obtained by encrypting the second synchronization service information by the synchronization service device, and the second synchronization service information includes the identity authentication information of the synchronization service device; Before verifying the vendor identifier of the synchronization service device, the method further includes: Decrypt the first synchronization service information; If the second synchronization service information is obtained through decryption, the step of verifying the manufacturer identifier of the synchronization service device is performed.
6. The method according to any one of claims 1-5, characterized in that, The data synchronization with the synchronization service device includes: Send a data synchronization request to the synchronization service device; The system receives a synchronization data stream sent by the synchronization service device in response to the data synchronization request. The synchronization data stream is obtained by the synchronization service device sorting the data to be synchronized in the synchronization service device.
7. The method according to claim 6, characterized in that, The synchronization data stream is obtained by the synchronization service device classifying the data to be synchronized according to data type and marking the classified data to be synchronized. Different marks correspond to different storage paths. After receiving the synchronization data stream sent by the synchronization service device in response to the data synchronization request, the method further includes: Data packets with the same tag in the synchronous data stream are combined sequentially to obtain the data to be stored; The data to be stored is stored in the storage path corresponding to the tag of the data to be stored in the data receiving device.
8. A data synchronization method, characterized in that, A synchronization service device is used in a wireless direct connection system, the wireless direct connection system including the synchronization service device and a data receiving device, the synchronization service device and the data receiving device communicating based on wireless direct connection technology; The method includes: Send first synchronization service information to the data receiving device. The first synchronization service information carries the identity authentication information of the synchronization service device, and the identity authentication information of the synchronization service device includes the manufacturer identifier of the synchronization service device. If the data receiving device passes the verification of the manufacturer's identifier of the synchronization service device, data synchronization is performed with the data receiving device.
9. The method according to claim 8, characterized in that, The identity authentication information of the synchronization service device also includes the device version of the synchronization service device; The step of synchronizing data with the data receiving device after the data receiving device passes the verification of the manufacturer identifier of the synchronization service device includes: If the data receiving device successfully verifies the manufacturer identifier and device version of the synchronization service device, it will synchronize data with the data receiving device.
10. The method according to claim 8, characterized in that, Before sending the first synchronization service information to the data receiving device, the method further includes: The second synchronization service information is encrypted to obtain the first synchronization service information, wherein the second synchronization service information includes the identity authentication information of the synchronization service device.
11. The method according to claim 8, characterized in that, The data synchronization with the data receiving device includes: Receive the data synchronization request sent by the data receiving device; In response to the data synchronization request, the data to be synchronized in the synchronization service device is sorted to obtain a synchronization data stream; The synchronization data stream is sent to the data receiving device.
12. The method according to claim 11, characterized in that, Before sorting the data to be synchronized in the synchronization service device to obtain the synchronization data stream, the method further includes: The data to be synchronized is categorized according to data type, and the categorized data is marked, with different marks corresponding to different storage paths.
13. A computer device, characterized in that, The device includes a memory, a processor, and a communication interface, wherein the memory is connected to the processor, the communication interface is used for transmitting data, and the processor is used to execute one or more computer programs stored in the memory, wherein when the processor executes the one or more computer programs, it causes the computer device to perform the method as described in any one of claims 1-7 or any one of claims 8-12.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-7 or any one of claims 8-12.