Database content synchronization method and device and electronic equipment

By obtaining the device status information of the target device, the database content data is split into multiple data blocks, and multiple data block synchronization tasks are generated, and assigned to multiple target devices for synchronization, solving the problem of slow synchronization efficiency of a single client. Efficient database content synchronization is achieved.

CN119441354APending Publication Date: 2025-02-14BEIJING DUYOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411547280.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Currently, when a single client synchronizes content data from the server, the synchronization efficiency is slow due to the large amount of data.

Method used

By obtaining the device status information of the target device, the database content data is split into multiple data blocks, and multiple data block synchronization tasks are generated, and assigned to multiple target devices for synchronization, realizing parallel synchronization of multiple devices.

Benefits of technology

It improves the efficiency of database content synchronization, reduces the interface input/output frequency during single-device synchronization, avoids the problem of equipment heating, and realizes the accuracy and flexibility of task allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441354A_ABST
    Figure CN119441354A_ABST
Patent Text Reader

Abstract

The invention provides a database content synchronization method, and relates to the technical field of database data synchronization, in particular to the technical field of data synchronization of a client side and a server side. According to the specific implementation scheme, in response to received database content synchronization requests sent by multiple pieces of target equipment, equipment state information, contained in the database content synchronization requests, of the target equipment is obtained; based on the device state information of the multiple target devices, database content data corresponding to the database content synchronization request is split into multiple data blocks corresponding to the multiple target devices; a plurality of data block synchronization tasks are generated based on the plurality of data blocks, the plurality of data block synchronization tasks are allocated to the plurality of target devices, and any one of the plurality of target devices is configured to respond to the received data block synchronization task sent by the server. And executing the data block synchronization task to synchronize the corresponding data block to a local target device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of database data synchronization, and in particular to the technical field of client-side and server-side data synchronization. Background Art

[0002] Clients on some devices, such as cloud disk clients, need to synchronize database content when in use. Database content synchronization is to compare the local file collection of the device with the file collection on the server to obtain the difference in content data, and then synchronize the database content on the client and server to make the content data on the server and client consistent.

[0003] Currently, if a single client synchronizes content data from a server, there is a problem of slow synchronization efficiency due to the large amount of data. Summary of the invention

[0004] The present disclosure provides a database content synchronization method, device, and electronic device for solving at least one of the above technical problems.

[0005] According to one aspect of the present disclosure, a method for synchronizing database content is provided, wherein the method is applied to a server and comprises:

[0006] In response to receiving database content synchronization requests sent by multiple target devices, acquiring device status information of the target devices included in the database content synchronization requests;

[0007] Based on the device status information of the plurality of target devices, splitting the database content data corresponding to the database content synchronization request into a plurality of data blocks corresponding to the plurality of target devices;

[0008] A plurality of data block synchronization tasks are generated based on the plurality of data blocks, and the plurality of data block synchronization tasks are assigned to the plurality of target devices, wherein any one of the plurality of target devices is configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server.

[0009] According to one aspect of the present disclosure, a method for synchronizing database content is provided, wherein the method is applied to a target device and comprises:

[0010] Generate a database content synchronization request carrying device status information and send it to the server;

[0011] In response to receiving the data block synchronization task sent by the server, executing the data block synchronization task to synchronize the corresponding data block to the local target device;

[0012] The server is configured to generate and send the data block synchronization task in the above-mentioned manner.

[0013] According to another aspect of the present disclosure, a database content synchronization device is provided, comprising:

[0014] an acquisition module, configured to, in response to receiving database content synchronization requests sent by multiple target devices, acquire device status information of the target devices contained in the database content synchronization requests;

[0015] a splitting module, configured to split the database content data corresponding to the database content synchronization request into a plurality of data blocks corresponding to the plurality of target devices based on the device status information of the plurality of target devices;

[0016] A generation module is used to generate multiple data block synchronization tasks based on the multiple data blocks, and assign the multiple data block synchronization tasks to the multiple target devices, wherein any target device among the multiple target devices is configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server.

[0017] According to another aspect of the present disclosure, a database content synchronization device is provided, comprising:

[0018] A request module, used to generate a database content synchronization request carrying device status information and send it to the server;

[0019] An execution module, configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server;

[0020] The server is configured to generate and send the data block synchronization task in the above manner.

[0021] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0022] at least one processor; and

[0023] a memory communicatively connected to the at least one processor; wherein,

[0024] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above method.

[0025] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the above method.

[0026] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method when executed by a processor.

[0027] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0029] Figure 1 It is a flowchart of a database content synchronization method provided by the first embodiment of the present disclosure;

[0030] Figure 2 is an exemplary schematic diagram of an application scenario;

[0031] Figure 3 is a flowchart of a database content synchronization method provided by the second embodiment of the present disclosure;

[0032] Figure 4 is an exemplary flow chart of S203;

[0033] Figure 5 is an exemplary flow chart of S2031;

[0034] Figure 6 is an exemplary flow chart of S205;

[0035] Figure 7 is a schematic diagram of an exemplary scenario of database content synchronization;

[0036] Figure 8 is a flowchart of another database content synchronization method provided by the third embodiment of the present disclosure;

[0037] Fig. 9 is an exemplary flow chart of S302;

[0038] Fig.10 is a flowchart of another method for synchronizing database contents;

[0039] Fig.11 is an exemplary flow chart of S303b;

[0040] Fig.12 is a schematic diagram of an exemplary database synchronization scenario;

[0041] Fig.13 A schematic diagram of the structure of a database content synchronization device provided by a third embodiment of the present disclosure;

[0042] Fig.14 A schematic diagram of the structure of a database content synchronization device provided by a fourth embodiment of the present disclosure;

[0043] Fig.15 The block diagram is a block diagram of an electronic device for implementing the method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0044] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0045] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0046] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0047] The terminology used herein is for describing particular embodiments only and is not intended to limit the present disclosure.As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0048] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.

[0049] The database content synchronization method according to the present disclosure can be executed by an electronic device such as a terminal device or a server, and the terminal device can be a vehicle-mounted device, a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory. Alternatively, the database content synchronization method provided by the present disclosure can be executed by a server.

[0050] In the first embodiment disclosed, see Figure 1 , Figure 1 A flowchart of a method for synchronizing database content provided by the first embodiment of the present disclosure is shown. The method can be applied to a server, and the method includes:

[0051] S101 . In response to receiving database content synchronization requests sent by multiple target devices, obtaining device status information of the target devices included in the database content synchronization requests.

[0052] S102: Based on device status information of multiple target devices, split database content data corresponding to the database content synchronization request into multiple data blocks corresponding to the multiple target devices.

[0053] S103: Generate multiple data block synchronization tasks based on the multiple data blocks, and assign the multiple data block synchronization tasks to multiple target devices.

[0054] Any target device among the multiple target devices is configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server.

[0055] See also Figure 2 , Figure 2 A schematic diagram of an exemplary application scenario is shown. The figure exemplarily includes n target devices, where n is an integer greater than 1, and the target devices need to synchronize database content. As an example, a target device loaded with a client needs to synchronize database content with a server after reinstalling the client or changing the client code and restarting the client. Database content synchronization can be achieved by comparing text instructions (diff). The server splits the database content data corresponding to the complete database content synchronization request into n data blocks, generates n data block synchronization tasks respectively, and then sends them to target devices 1-target devices n. Target devices 1-target devices n synchronously execute the assigned data block synchronization tasks to achieve database content synchronization of multiple devices in parallel.

[0056] Among them, the device status information is used to indicate the current device status of the target device. For example, the device status information includes at least one of the following items: the central processing unit (CPU) sub-information of the target device, which is used to reflect the current status of the CPU of the target device, such as occupancy rate, temperature, etc.; the graphics processing unit (GPU) sub-information is used to reflect the current status of the GPU of the target device, such as occupancy rate, temperature, etc.; the network status sub-information is used to reflect the current network status of the target device, such as bandwidth, transmission speed, etc.; the device performance score sub-information is used to reflect the overall performance of the target device. Of course, it can also include any other information that can represent the current device status of the target device, which is not limited here.

[0057] In some examples, multiple target devices may be target devices connected to the same local area network. The type of local area network may be contact or contactless. Specifically, the local area network includes at least one of the following: a wired local area network, a Bluetooth local area network, a wireless compatibility certification (WI-FI) network, a nearlink network, etc. Of course, other types of local area networks may also be included, which are not limited here. By assigning multiple data block synchronization tasks to multiple target devices under the same local area network, after multiple target devices complete their own data block synchronization tasks, they can analyze the data blocks corresponding to the data block synchronization tasks to other target devices through the local area network, in other words, using near field communication.

[0058] The method provided by the present disclosure divides the complete database content data into multiple data blocks according to the device status information of multiple target devices, generates multiple data block synchronization tasks based on the multiple data blocks, and distributes the multiple data blocks to multiple target devices, so that the multiple target devices can synchronously execute the data block synchronization tasks. In this way, compared with the method of performing database content synchronization on a single device, the method provided by the present disclosure uses multiple devices to synchronously execute data block synchronization tasks, which significantly improves the efficiency of database content synchronization, and for a single device, the input / output frequency of the interface is greatly reduced, so the problem of device heating can be effectively avoided; and in the present disclosure, data blocks are allocated based on the device status information of each device, thereby achieving accuracy and flexibility in task allocation.

[0059] In disclosing the second embodiment, see Figure 3 , Figure 3 A flowchart of a database content synchronization method provided by the second embodiment of the present disclosure is shown. The method can be applied to a server, and the method includes:

[0060] S201: In response to receiving database content synchronization requests sent by multiple target devices, obtain device status information of the target devices included in the database content synchronization requests.

[0061] When any target device needs to synchronize database content, multiple target devices generate database content synchronization requests based on their own device identification and device status information and send them to the server. The server receives multiple database content synchronization requests, parses the database content synchronization requests respectively, and obtains the device status information of each target device.

[0062] Among them, the device status information is used to indicate the current device status of the target device. For example, the device status information includes at least one of the following items: CPU sub-information of the target device, used to reflect the current status of the CPU of the target device, such as occupancy, temperature, etc.; GPU sub-information is used to reflect the current status of the GPU of the target device, such as occupancy, temperature, etc.; network status sub-information is used to reflect the current network status of the target device, such as bandwidth, transmission speed, etc.; device performance score sub-information is used to reflect the overall performance of the target device. Of course, it can also include any other information that can represent the current device status of the target device, which is not limited here.

[0063] S202: Determine a minimum data unit according to the database content data and the number of multiple target devices.

[0064] In the present disclosure, the size of the data block of the data block synchronization task that the target device needs to execute is reasonably allocated based on the device status of each target device, so as to achieve accurate and flexible task allocation, so that the size of the data block of the data block synchronization task assigned to each target device matches the device itself. Therefore, a basic unit of data block size, namely the smallest data unit (SDU), can be set first to define the data unit with the smallest amount of data that can be executed by database content synchronization, and then the size of the final data block can be determined based on the device status information of the device.

[0065] Specifically, when determining the minimum data unit, it can be determined based on the data size of the database content data to be synchronized and the number of target devices currently participating in the data block synchronization task. In other words, the size of the minimum data unit is positively correlated with the data size of the database content data, and negatively correlated with the number of multiple target devices.

[0066] S203: For any target device, determine the size of the data block allocated to the target device based on the device status information and the minimum data unit.

[0067] There are many implementations for determining the data block size based on the device status information and the minimum data unit. For example, in one implementation, for S203, see Figure 4 , Figure 4 An exemplary flow chart of S203 is shown, where S203 includes:

[0068] S2031. Determine a device evaluation value of the target device based on the device status information.

[0069] The device evaluation value is used to indicate the ability of the target device to perform the data block synchronization task. Specifically, the device evaluation value can be determined in a variety of ways. For example, a deep learning model can be used to determine the device evaluation value by taking the device status information as input and the device evaluation value as output. For another example, in one implementation, the device status information includes multiple device status sub-information. In this case, see Figure 5 , Figure 5 An exemplary flow chart of S2031 is shown, where S2031 includes:

[0070] S20311. Obtain a single evaluation value of each device status sub-information according to each device status sub-information and a corresponding preset sub-information weight.

[0071] In some examples, the plurality of device status sub-information includes at least two of the following: CPU sub-information, GPU sub-information, network status sub-information, and device performance score sub-information. Of course, the device status sub-information may also be other types of device status sub-information, which is not limited here.

[0072] Since each device status sub-information has different characteristics, the proportion of each device status sub-information may be different when determining the data block size. Therefore, different sub-information weights may be pre-set for each device status sub-information. After obtaining the device status sub-information of each target device, for multiple device status sub-information of any target device, the individual evaluation values ​​of each device status sub-information and the corresponding sub-information weight are calculated respectively. Specifically, the sub-information weight corresponding to each device status sub-information may be set as needed, and no limitation is made here.

[0073] S20312. Obtain a device evaluation value according to the sum of individual evaluation values ​​of each device status sub-information.

[0074] Specifically, the single evaluation values ​​of each device status sub-information are summed to obtain the device evaluation value. In other words, weighted calculation is performed based on multiple device status sub-information and their corresponding sub-information weights to obtain the final total weight value (single total score, STS) as the device evaluation value.

[0075] Specifically, the equipment evaluation value can be determined using the following formula:

[0076] STS_1 = (CPU_s × sub-information weight 1) + (GPU_s × sub-information weight 2) + (WP_s × sub-information weight 2) + (SC_s × sub-information weight 2);

[0077] Among them, STS_1 represents the device evaluation value, CPU_s represents the CPU sub-information, GPU_s represents the GUP sub-information, WP_s represents the network status sub-information, SC_s represents the device performance score sub-information, and the content in each bracket is a single evaluation value.

[0078] S2032: Determine a data block size based on the device evaluation value and the minimum data unit.

[0079] After obtaining the device evaluation value indicating the ability of the target device to perform the data block synchronization task, the data block size finally allocated to the target device is determined based on the device evaluation value and the minimum data unit. Specifically, the data block size may be determined in a variety of ways. In some implementations, S2032 specifically includes:

[0080] The size of the data block is obtained according to the product of the device evaluation value and the minimum data unit.

[0081] That is, it is calculated according to the following formula:

[0082] DATA = SDU_1 × STS_1;

[0083] Among them, DATA represents the size of the data block, SDU_1 represents the size of the minimum data unit, and STS_1 represents the device evaluation value of the target device.

[0084] For any target device among the multiple target devices, the above method is adopted to determine the size of the data block allocated to each target device.

[0085] S204: Split the database content data into multiple data blocks according to the data block sizes corresponding to the multiple target devices.

[0086] Specifically, according to the determined data block size of each device among the multiple target devices, the database content data is split into multiple data blocks, and the information of each data block at least includes: data content, index interval, verification information, and data block size.

[0087] The database content data is stored in a database of a server and has index information. For example, the index information of the complete database content data is [1-1000]. After the complete database content data is split into multiple data blocks, each data block has a corresponding index interval in the order of the data blocks. For example, the database content data is split into 5 data blocks, and the index intervals corresponding to the 5 data blocks are: [1-200], [201-400], [401-600], [601-800], [801-1000].

[0088] Among them, the verification information is used to verify the integrity and security of the data block. The verification information may include, for example, at least one of the following: cyclic redundancy check (CRC) information, message digest algorithm (MD5) verification information, and of course, other types of verification information may also be included, which are not limited here.

[0089] It should be noted that S202-204 is one implementation of S102. Currently, there are other implementations of S102, which are not limited here.

[0090] S205, arranging the multiple data blocks in a linked list structure.

[0091] Arranging multiple data blocks into a linked list structure can facilitate the acquisition of the order of the data blocks, and further facilitate the subsequent target device to splice the multiple data blocks into complete database content data. Moreover, since the linked list structure has pointer direction and order, it is convenient to perform incremental database content synchronization for data blocks at specific locations.

[0092] The linked list structure represents a non-continuous and non-sequential storage structure in a physical storage structure, and the logical order of data elements is realized by the pointer link order in the linked list. In the present disclosure, the pointer direction is that the head of any data block points to the tail of the previous data block.

[0093] For some examples, see Figure 6 , Figure 6 An exemplary flow chart of S205 is shown, where S205 includes:

[0094] S2051. For any data block, generate a tail of the data block according to the index interval of the current data block, the data size of the data block, and the check information of the data block.

[0095] S2052: Generate a header of the current data block according to the index interval and check information of the previous data block of the current data block.

[0096] The check information is used to check the integrity and security of the data block. The check information may include, for example, at least one of the following: CRC check information, MD5 check information, and of course, other types of check information may also be included, which are not limited here.

[0097] S2053. Generate a data block based on the data content, header and tail corresponding to the current data block.

[0098] S2054, arranging the multiple data blocks into a linked list structure in a head-to-tail manner.

[0099] See also Figure 7 , Figure 7 A schematic diagram of an exemplary scenario of database content synchronization is shown. In the figure, the complete database content data is divided into n data blocks, where n is an integer greater than 1, and the n data blocks are arranged in a linked list structure. Except for data block 1 arranged at the head of the linked list, the pointer direction of other data blocks is that the head of any data block points to the tail of the previous data block. The structure of each data block includes: head → data content → tail. Since the head of each data block records the index interval and verification information of the previous data block, when any data block is missing or incomplete, it can be quickly discovered through the index interval and verification information, and incremental database content synchronization can be initiated for the missing or incomplete data blocks alone.

[0100] It should be noted that, in some examples, S205 may be omitted, that is, the multiple data blocks may not adopt a linked list structure. In other implementations, the multiple data blocks may also adopt other structural forms, such as being stored as a sequence list, etc., which is not limited here.

[0101] S206: Generate a data block synchronization task for each target device based on each data block and the device identifier of the target device corresponding to each database.

[0102] The database content synchronization request sent by each target device to the server includes at least: the device identification and device status information of the target device. When the server receives the database content synchronization request, it parses the database content synchronization request to obtain the device identification and device status information of the target device. According to the multiple split data blocks and the device identification of the corresponding target device, a data block synchronization task carrying the index interval and device identification of the data block is generated. After the target device receives the data block synchronization task, it can request the server to synchronize the corresponding data block according to the index interval of the data block carried therein.

[0103] S207: Send the data block synchronization task to the target device according to the device identifier.

[0104] Any target device among the multiple target devices is configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server.

[0105] It should be noted that S206-207 is one implementation of S103. Currently, there are other implementations of S103, which are not limited here.

[0106] In disclosing the third embodiment, see Figure 8 , Figure 8 A flowchart of a method for synchronizing database content provided by the third embodiment of the present disclosure is shown. The method can be applied to a target device, and the method includes:

[0107] S301: Generate a database content synchronization request carrying device status information and send it to a server.

[0108] When any target device needs to synchronize database content, multiple target devices generate database content synchronization requests based on their own device identification and device status information and send them to the server. The server receives multiple database content synchronization requests, parses the database content synchronization requests respectively, and obtains the device status information of each target device.

[0109] Among them, the device status information is used to indicate the current device status of the target device. For example, the device status information includes at least one of the following items: CPU sub-information of the target device, used to reflect the current status of the CPU of the target device, such as occupancy, temperature, etc.; GPU sub-information is used to reflect the current status of the GPU of the target device, such as occupancy, temperature, etc.; network status sub-information is used to reflect the current network status of the target device, such as bandwidth, transmission speed, etc.; device performance score sub-information is used to reflect the overall performance of the target device. Of course, it can also include any other information that can represent the current device status of the target device, which is not limited here.

[0110] S302: In response to receiving the data block synchronization task sent by the server, execute the data block synchronization task to synchronize the corresponding data block to the local target device.

[0111] After receiving the data block synchronization task, the target device obtains the index interval of the data block carried by the data block synchronization task, and can request synchronization of the corresponding data block with the server according to the index interval of the data block.

[0112] The server is configured to generate and send a data block synchronization task in the manner of the first or second disclosed embodiment.

[0113] In some examples, with respect to S301, S301 includes:

[0114] Generates a database content synchronization request based on its own device identification and device status information and sends it to the server.

[0115] In some examples, for S302, see Fig. 9 , Fig. 9 An exemplary flow chart of S302 is shown, where S302 includes:

[0116] S3021. Analyze the data block synchronization task to obtain the index range and verification information of the data block.

[0117] S3022. Request the server for corresponding data blocks based on the index interval.

[0118] S3023. Verify the integrity of the data block based on the verification information.

[0119] After receiving the data block synchronization task, the target device obtains the index interval of the data block carried by the data block synchronization task, and can synchronize the corresponding data block with the server request according to the index interval of the data block. After completing the data block synchronization task and synchronizing the data block to the local, the data block can be checked for integrity according to the verification information carried by the data block synchronization task to ensure the integrity of the downloaded data block.

[0120] The check information is used to check the integrity and security of the data block. The check information may include, for example, at least one of the following: CRC check information, MD5 check information, and of course, other types of check information may also be included, which are not limited here.

[0121] The multiple target devices include a main device and other devices, wherein the main device is a device that will eventually synchronize the database content, and the other devices are devices that assist the main device in completing the synchronization of the database content.

[0122] Based on this, see Fig.10 , Fig.10 A flowchart diagram showing another method for synchronizing database contents is shown.

[0123] When the target device is another device, after S302, the method further includes:

[0124] S303a, sending the data block to the master device.

[0125] Specifically, the data block may be synchronized to the master device via a wired network, or may be synchronized to the master device via a wireless network, which is not limited here.

[0126] In some examples, S303a includes: sending the data block to the main device via near field communication.

[0127] In some examples, the near field communication method may include at least one of the following: Bluetooth communication method, wireless compatibility authentication communication method, Star Flash network communication method, etc. Of course, other types of near field communication methods may also be included, which are not limited here. By allocating multiple data block synchronization tasks to multiple target devices under the same local area network, after multiple target devices complete their own data block synchronization tasks, they can use near field communication to analyze the data blocks corresponding to the data block synchronization tasks to other target devices. In this way, data sharing can be completed without using the Internet, avoiding network dependence.

[0128] In the case where the target device is a primary device, after S302, the method further includes:

[0129] S303b, receiving data blocks sent by other devices, and assembling the data blocks synchronized with itself and the data blocks sent by other devices into complete database content data.

[0130] The master device receives data blocks synchronized to other devices based on data block synchronization tasks, and assembles them with the data blocks synchronized to the master device by itself, thereby obtaining complete database content data.

[0131] In some examples, for S303b, see Fig.11 , Fig.11 An exemplary flow chart of S303b is shown. When the target device is a master device, S303b includes:

[0132] S303b1. Receive data blocks sent by other devices and store them in a data isolation pool.

[0133] S303b2. Obtain the head and tail of each data block from the data isolation pool, arrange the data blocks in sequence into a linked list structure, and obtain complete database content data.

[0134] See also Fig.12 , Fig.12 A schematic diagram showing an exemplary scenario of database synchronization is shown.

[0135] Among them, there are a master device and another device, data block m1 and data block m2 represent any two of n data blocks, and data block m3 represents any data block synchronized by another device. Other devices share data block m3 with the master device. Exemplarily, multiple data blocks are arranged in a linked list structure. After receiving multiple data blocks, the master device can assemble multiple data blocks in sequence and integrate them into the database according to the index interval of the previous data block recorded in the header of the data block, the index interval of the data block recorded in the tail, and the pointer direction, so as to obtain complete database content data.

[0136] For example, see Fig.12The target device can set up a data isolation pool for maintaining data blocks. The received data blocks are first placed in the isolation pool as a cache to facilitate preprocessing, and can also be used as a data security isolation pool to prevent data blocks from being directly stored in the local data center, thereby improving data security. Of course, in some cases, it is also possible not to set up a data isolation pool, which is not limited here.

[0137] In some examples, for S303b1, S303b1 includes:

[0138] Determine whether the index interval of the currently received data block is consistent with the index interval of other data blocks stored in the data isolation pool.

[0139] If they are consistent, the current data block will not be received.

[0140] If they are inconsistent, the current data block is received and stored in the data isolation pool.

[0141] In order to avoid the target device repeatedly downloading the same data block, causing waste of resources and reducing task efficiency, the target device first compares the verification information in the data block to be received with the verification information of other data blocks stored in the data isolation pool before receiving the data block. If there is consistent verification information, it means that the data block to be received is a duplicate data block and the current data block is not received; if there is no consistent verification information, it means that the data block to be received is a new data block and can be received.

[0142] In some examples, after S303b1, the method further includes:

[0143] According to the verification information of each data block, the data block is checked for integrity.

[0144] When the integrity verification fails, the index range of the incomplete data block is determined.

[0145] An incremental database content synchronization request is generated based on the index interval of the incomplete data block and sent to the server.

[0146] After receiving the data blocks shared by other devices, the master device first obtains the verification information from each data block in turn and performs integrity verification on each data block; and also performs integrity verification on the data blocks synchronized by itself; if the integrity verification of all data blocks passes, multiple data blocks are assembled to obtain complete database content data. If there are data blocks that fail the integrity verification due to network problems or database damage, the index interval of the incomplete data block is obtained, and the data block is re-requested for this data block alone. In other words, an incremental database content synchronization request is generated based on the index interval of the incomplete data block.

[0147] In the third embodiment disclosed, based on Figure 1 The same principle, Fig.13 A database content synchronization device 130 provided in the third embodiment of the present disclosure is shown, and the device includes:

[0148] The acquisition module 1301 is configured to, in response to receiving database content synchronization requests sent by multiple target devices, acquire device status information of the target devices contained in the database content synchronization requests.

[0149] The splitting module 1302 is used to split the database content data corresponding to the database content synchronization request into multiple data blocks corresponding to the multiple target devices based on the device status information of the multiple target devices.

[0150] The generation module 1303 is used to generate multiple data block synchronization tasks based on multiple data blocks, and assign the multiple data block synchronization tasks to multiple target devices, wherein any target device among the multiple target devices is configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server.

[0151] In some examples, the split module is used to:

[0152] Determine a minimum data unit according to the database content data and the number of the plurality of target devices;

[0153] For any target device, determine the data block size allocated to the target device based on the device status information and the minimum data unit;

[0154] The database content data is split into multiple data blocks according to the data block sizes corresponding to the multiple target devices.

[0155] In some examples, the splitting module always: determines, for any target device, a data block size allocated to the target device based on the device status information and the minimum data unit:

[0156] determining a device evaluation value of the target device based on the device status information;

[0157] The data block size is determined based on the device evaluation value and the minimum data unit.

[0158] In some examples, the device status information includes a plurality of device status sub-information;

[0159] In the case where the split module determines the device evaluation value of the target device based on the device status information:

[0160] Obtaining a single evaluation value of each device status sub-information according to each device status sub-information and the corresponding preset sub-information weight;

[0161] The device evaluation value is obtained by summing up the individual evaluation values ​​of each device status sub-information.

[0162] In some examples, the plurality of device status sub-information includes at least two of the following: central processing unit sub-information, graphics processing unit sub-information, network status sub-information, and device performance score sub-information.

[0163] In some examples, the splitting module, when determining the data block size based on the device evaluation value and the minimum data unit, is used to:

[0164] The size of the data block is obtained according to the product of the device evaluation value and the minimum data unit.

[0165] In some examples, the apparatus further includes:

[0166] The linked list module is used to arrange multiple data blocks in a linked list structure.

[0167] In some examples, the linked list module is specifically used to:

[0168] For any data block, the tail of the data block is generated according to the index interval of the current data block, the data size of the data block, and the check information of the data block;

[0169] Generate a header of the current data block according to the index interval and check information of the previous data block of the current data block;

[0170] Generate a data block based on the data content, header and tail corresponding to the current data block;

[0171] Arrange multiple data blocks head to tail in a linked list structure.

[0172] In some examples, the database content synchronization request includes at least: a device identification of a target device;

[0173] Generate modules for:

[0174] Based on the device identifiers of the target devices corresponding to the respective data blocks and the respective databases, a data block synchronization task for each target device is generated;

[0175] According to the device identification, the data block synchronization task is sent to the target device.

[0176] In some examples, the multiple target devices are target devices connected to the same local area network.

[0177] In the fourth embodiment disclosed, based on Figure 8 The same principle, Fig.14 A database content synchronization device 140 provided in a fourth embodiment of the present disclosure is shown, and the device includes:

[0178] Request module 1401, used to generate a database content synchronization request carrying device status information and send it to the server;

[0179] An execution module 1402 is used for executing the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server;

[0180] The server is configured to generate and send a data block synchronization task in the manner of the first or second disclosed embodiment.

[0181] In some examples, the execution module is used to:

[0182] Parse the data block synchronization task to obtain the index range and verification information of the data block;

[0183] Request the corresponding data block from the server based on the index interval;

[0184] Verify the integrity of the data block based on the checksum information.

[0185] In some examples, the target devices include: a host device and other devices;

[0186] In the case where the target device is other devices, the apparatus further includes:

[0187] A sending module, used to send data blocks to a master device;

[0188] In the case where the target device is a master device, the apparatus further includes:

[0189] The receiving module is used to receive data blocks sent by other devices, and assemble the data blocks synchronized by itself and the data blocks sent by other devices into complete database content data.

[0190] In some examples, the sending module is specifically used to:

[0191] Receive data blocks sent by other devices and store them in the data isolation pool;

[0192] The head and tail of each data block are obtained from the data isolation pool, and each data block is arranged in sequence into a linked list structure to obtain complete database content data.

[0193] In some examples, the apparatus further includes:

[0194] A verification module, used to perform integrity verification on the data blocks according to the verification information of each data block;

[0195] In the case where the integrity verification fails, the index range of the incomplete data block is determined;

[0196] An incremental database content synchronization request is generated based on the index interval of the incomplete data block and sent to the server.

[0197] In some examples, the apparatus further includes an isolation module for determining whether an index interval of a currently received data block is consistent with an index interval of other data blocks stored in the data isolation pool;

[0198] If so, the current data block is not received;

[0199] If not, the current data block is received and stored in the data isolation pool.

[0200] In some examples, the request module is used to:

[0201] Generates a database content synchronization request based on its own device identification and device status information and sends it to the server.

[0202] In some examples, the sending module is specifically used to:

[0203] The data block is sent to the master device via near field communication.

[0204] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0205] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0206] Fig.15 A schematic block diagram of an example electronic device 1500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0207] like Fig.15As shown, the device 1500 includes a computing unit 1501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1502 or a computer program loaded from the storage unit 1502 to a random access memory (RAM) 1503. In the RAM 1503, various programs and data required for the operation of the device 1500 can also be stored. The computing unit 1501, the ROM 1502, and the RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.

[0208] A number of components in the device 1500 are connected to the I / O interface 1505, including: an input unit 1506, such as a keyboard, a mouse, etc.; an output unit 1507, such as various types of displays, speakers, etc.; a storage unit 1508, such as a disk, an optical disk, etc.; and a communication unit 1509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1509 allows the device 1500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0209] The computing unit 1501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1501 performs the various methods and processes described above, such as a database content synchronization method. For example, in some embodiments, the database content synchronization method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1500 via the ROM 1502 and / or the communication unit 1509. When the computer program is loaded into the RAM 1503 and executed by the computing unit 1501, one or more steps of the database content synchronization method described above may be performed. Alternatively, in other embodiments, the computing unit 1501 may be configured as a database content synchronization method in any other appropriate manner (for example, by means of firmware).

[0210] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0211] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0212] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0213] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0214] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0215] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0216] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0217] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for synchronizing database content, wherein: Applied on a server, the method comprises: In response to receiving database content synchronization requests sent by multiple target devices, acquiring device status information of the target devices included in the database content synchronization requests; Based on the device status information of the plurality of target devices, splitting the database content data corresponding to the database content synchronization request into a plurality of data blocks corresponding to the plurality of target devices; A plurality of data block synchronization tasks are generated based on the plurality of data blocks, and the plurality of data block synchronization tasks are assigned to the plurality of target devices, wherein any one of the plurality of target devices is configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server.

2. The method according to claim 1, wherein: The step of splitting the database content data corresponding to the database content synchronization request into a plurality of data blocks corresponding to the plurality of target devices based on the device status information of the plurality of target devices comprises: Determining a minimum data unit according to the database content data and the number of the plurality of target devices; For any of the target devices, determining a data block size allocated to the target device based on the device status information and the minimum data unit; The database content data is split into a plurality of data blocks according to the data block sizes corresponding to the plurality of target devices.

3. The method according to claim 2, wherein: The step of determining, for any of the target devices, a data block size allocated to the target device based on the device status information and the minimum data unit includes: Determine a device evaluation value of the target device based on the device status information; The data block size is determined based on the device evaluation value and the minimum data unit.

4. The method according to claim 3, wherein: The device status information includes a plurality of device status sub-information; The determining the device evaluation value of the target device based on the device status information includes: Obtaining a single evaluation value of each device status sub-information according to each device status sub-information and a corresponding preset sub-information weight; The device evaluation value is obtained according to the sum of the single evaluation values ​​of each of the device status sub-information.

5. The method according to claim 4, wherein: The multiple device status sub-information include at least two of the following: central processing unit sub-information, graphics processing unit sub-information, network status sub-information, and device performance score sub-information.

6. The method according to any one of claims 3 to 5, wherein: The determining the data block size based on the device evaluation value and the minimum data unit includes: The size of the data block is obtained according to the product of the device evaluation value and the minimum data unit.

7. The method according to any one of claims 1 to 6, wherein: After splitting the database content data corresponding to the database content synchronization request into a plurality of data blocks corresponding to the plurality of target devices, generating a plurality of data block synchronization tasks based on the plurality of data blocks, and before allocating the plurality of data block synchronization tasks to the plurality of target devices, the method further includes: Arrange the plurality of data blocks in a linked list structure.

8. The method according to any one of claim 7, wherein: Arranging the plurality of data blocks in a linked list structure comprises: For any data block, the tail of the data block is generated according to the index interval of the current data block, the data size of the data block, and the check information of the data block; Generate a header of the current data block according to the index interval and check information of the previous data block of the current data block; Generate a data block based on the data content corresponding to the current data block, the header and the tail; Arrange multiple data blocks head to tail in a linked list structure.

9. The method according to any one of claims 1 to 8, wherein: The database content synchronization request at least includes: a device identifier of a target device; The step of generating a plurality of data block synchronization tasks based on the plurality of data blocks, and allocating the plurality of data block synchronization tasks to a plurality of target devices includes: Based on the device identifiers of the target devices corresponding to the data blocks and the databases, generating data block synchronization tasks for the target devices; The data block synchronization task is sent to the target device according to the device identifier.

10. The method according to any one of claims 1 to 9, wherein: The multiple target devices are target devices connected to the same local area network.

11. A method for synchronizing database content, wherein: Applied to a target device, the method comprises: Generate a database content synchronization request carrying device status information and send it to the server; In response to receiving the data block synchronization task sent by the server, executing the data block synchronization task to synchronize the corresponding data block to the local target device; Wherein, the server is configured to generate and send the data block synchronization task according to the method of claim 1.

12. The method according to claim 11, wherein: In response to receiving the data block synchronization task sent by the server, executing the data block synchronization task to synchronize the corresponding data block to the local target device includes: Parsing the data block synchronization task to obtain the index interval and verification information of the data block; Requesting a corresponding data block from the server based on the index interval; The integrity of the data block is verified based on the check information.

13. The method according to claim 11 or 12, wherein: The target devices include: a main device and other devices; In the case where the target device is the other device, in response to receiving the data block synchronization task sent by the server, after executing the data block synchronization task to synchronize the corresponding data block to the local target device, the method further includes: Sending a data block to the master device; In the case where the target device is the master device, in response to receiving the data block synchronization task sent by the server, after executing the data block synchronization task to synchronize the corresponding data block to the local target device, the method further includes: Receive the data blocks sent by the other devices, and assemble the data blocks synchronized by itself and the data blocks sent by the other devices into complete database content data.

14. The method according to claim 13, wherein: In the case where the target device is the master device, receiving the data blocks sent by the other devices and assembling the data blocks synchronized by the self and the data blocks sent by the other devices into complete database content data includes: receiving data blocks sent by the other devices and storing the data blocks in a data isolation pool; The head and tail of each data block are obtained from the data isolation pool, and each data block is arranged in sequence into a linked list structure to obtain complete database content data.

15. The method according to claim 14, wherein: After receiving the data blocks sent by the other devices and storing them in the data isolation pool, the method further includes: Performing integrity check on the data blocks according to the check information of each of the data blocks; In the case where the integrity verification fails, the index range of the incomplete data block is determined; An incremental database content synchronization request is generated based on the index interval of the incomplete data block and sent to the server.

16. The method according to claim 14 or 15, wherein: The receiving the data blocks sent by the other devices and storing them in the data isolation pool includes: Determine whether the index interval of the data block currently received is consistent with the index interval of other data blocks stored in the data isolation pool; If yes, the current data block is not received; If not, the current data block is received and stored in the data isolation pool.

17. The method according to any one of claims 11 to 16, wherein: The step of generating a database content synchronization request carrying device status information and sending the request to the server includes: The database content synchronization request is generated based on its own device identification and device status information, and sent to the server.

18. The method according to any one of claims 13 to 17, wherein: In a case where the target device is the other device, sending the data block to the master device includes: The data block is sent to the master device via near field communication.

19. A database content synchronization device, wherein: include: an acquisition module, configured to, in response to receiving database content synchronization requests sent by multiple target devices, acquire device status information of the target devices contained in the database content synchronization requests; a splitting module, configured to split the database content data corresponding to the database content synchronization request into a plurality of data blocks corresponding to the plurality of target devices based on the device status information of the plurality of target devices; A generation module is used to generate multiple data block synchronization tasks based on the multiple data blocks, and assign the multiple data block synchronization tasks to the multiple target devices, wherein any target device among the multiple target devices is configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server.

20. A database content synchronization device, wherein: include: A request module, used to generate a database content synchronization request carrying device status information and send it to the server; An execution module, configured to execute the data block synchronization task to synchronize the corresponding data block to the local target device in response to receiving the data block synchronization task sent by the server; Wherein, the server is configured to generate and send the data block synchronization task according to the method of claim 1.

21. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any one of claims 1-10 and / or to execute the method of any one of claims 11-18.

22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10, and / or to execute the method according to any one of claims 11-18.

23. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 10 and / or implements the method according to any one of claims 11 to 18.