CN113934742B - Data updating method, node information storage method, electronic device and medium - Google Patents

Data updating method, node information storage method, electronic device and medium Download PDF

Info

Publication number
CN113934742B
CN113934742B CN202111244440.8A CN202111244440A CN113934742B CN 113934742 B CN113934742 B CN 113934742B CN 202111244440 A CN202111244440 A CN 202111244440A CN 113934742 B CN113934742 B CN 113934742B
Authority
CN
China
Prior art keywords
node
nodes
electronic device
data
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111244440.8A
Other languages
Chinese (zh)
Other versions
CN113934742A (en
Inventor
丁峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Abies Spruce Beijing Technology Co ltd
Original Assignee
Abies Spruce Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Abies Spruce Beijing Technology Co ltd filed Critical Abies Spruce Beijing Technology Co ltd
Priority to CN202111244440.8A priority Critical patent/CN113934742B/en
Publication of CN113934742A publication Critical patent/CN113934742A/en
Application granted granted Critical
Publication of CN113934742B publication Critical patent/CN113934742B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application discloses a data updating method, a node information storage method, corresponding electronic equipment and a storage medium. The data updating method can be applied to the electronic device needing to update the data, and comprises the following steps: the second electronic device determines a second target set, receives the first set, the second set and the third set from the first electronic device, and then updates the node state of the deleted node in the second target set and updates data corresponding to the second class node by using the parent node identifiers and the node identifiers in the first set, the third set and the second target set. By adopting the implementation mode, the resource occupation of the interactive equipment related to data updating can be reduced, the data quantity to be transmitted is reduced, the time required by the updating process is shortened, and the user experience is improved.

Description

Data updating method, node information storage method, electronic device and medium
Technical Field
The present disclosure relates to the field of data updating technologies, and in particular, to a data updating method and a node information storage method. The application further relates to an electronic device, and a computer-readable storage medium.
Background
A database (database) is a repository that organizes, stores and manages data according to a certain data structure (data structure). Its storage space is often large, and millions, tens of millions, or even more, of data may be stored. The data structure is a way of database storage, organizing data, such as a linear queue, stack, linear table, or a nonlinear tree, graph, etc. Whichever data structure organizes the data, the data or data structures may be represented as nodes, as well as relationships between the nodes. For example, FIG. 2 is a schematic diagram of a graphical representation of an exemplary data set, wherein each node may represent a folder or a file, with the folder or file represented by a child node belonging to the file or folder represented by its corresponding parent node.
In some application scenarios, a database exists on a server, and data is stored in the database in a certain data structure. A terminal or other server may be communicatively coupled to the server to alter the data stored on the server. For example, fig. 1 is a schematic system architecture diagram of an exemplary application scenario. A plurality of terminals (including terminal a and terminal B) of the user have applications (apps) such as cloud disk installed thereon. Each terminal is respectively connected with the server in a communication way, so that a user can upload, view and change the data belonging to the user in the database of the server through the app on the terminal. In some cases, the user may upload new data or modify the original data on the server with one terminal a, and then wish to view the data on the server itself through another terminal B. At this time, the terminal B needs to update the latest data of the user on the server to the local area of the terminal B, synchronize the local area with the data on the server, and then display the synchronized data.
In general, the server will send data represented by all nodes of the user to the terminal, which updates the data of all nodes accordingly. With such an update method, the amount of data to be transmitted between the server and the terminal is large, which is a problem to be solved by those skilled in the art.
Disclosure of Invention
An object of the present application is to provide a data updating method. By adopting the method, the data transmission quantity can be reduced, the resource occupation of the interactive equipment involved in data updating can be reduced, the time required by the updating process is shortened, and the user experience is further improved.
A first aspect of the present application provides a data updating method, applied to a second electronic device, including:
determining a second target set, the second target set comprising information of at least one node, the information of each node comprising: node identification, father node identification and node status;
receiving a first set, a second set and a third set from a first electronic device, wherein the first set, the second set and the third set respectively correspond to the second target set;
updating the node state of the deleted node in the second target set by utilizing the father node identifiers and the node identifiers in the first set, the third set and the second target set, wherein the data corresponding to the deleted node is deleted on the first electronic equipment;
Updating data corresponding to the second class node, wherein the node identification of the second class node in the second target set is the same as one node identification in the second set.
With reference to the first aspect, in a possible implementation manner, a parent node identifier of the deleted node is the same as at least one parent node identifier in the second target set and is the same as one node identifier in the first set; and the node identification of the deleted node is the same as one node identification in the second target set and is different from any node identification in the third set.
With reference to the first aspect, in a possible implementation manner, updating the node state of the deleted node in the second target set with the parent node identifier and the node identifier in the first set, the third set, and the second target set includes:
updating the node state of the first type of nodes in the second target set to be an inactive state; wherein, the father node identification of the first type node in the second target set is the same as one node identification in the first set;
Updating the node state of the third class node in the second target set to be an activated state; and the node identification of the third class of nodes in the second target set is the same as one node identification in the third set.
With reference to the first aspect, in a possible implementation manner, updating the node state of the deleted node in the second target set with the parent node identifier and the node identifier in the first set, the third set, and the second target set includes:
updating the node state of the fourth node in the second target set to be an inactive state under the condition that the node identifier of the third node has a corresponding first mark; wherein the node identification of the third node is a node identification in the first set; the father node identification of the fourth node is the same as the node identification of the third node;
and updating the node state of the fourth node in the second target set to be an active state under the condition that the node identification of the fourth node is the same as one node identification in the third set.
A second aspect of the present application provides a data updating method, applied to a first electronic device, including:
Determining a first set from the first set of targets; wherein the first target set includes information of at least one node, the information of each node including: node identification, father node identification, time when the child node has changed last time, and time when the node has changed last time; the first set includes: node identifiers of all nodes of which the time of the last change of the child node is within a preset time period;
determining a second set from the first set of targets; wherein the second set comprises: node identifiers of all nodes with the time of the last change of the node being in the preset time period;
determining a third set from the first target set according to the first set; wherein the third set comprises: a parent node identifies node identifications of all nodes belonging to the first set;
and sending the first set, the second set and the third set to a second electronic device so that the second electronic device can update data by using the first set, the second set and the third set.
With reference to the second aspect, in a possible implementation manner, the first set further includes: the first identification corresponds to the node identification of the first node, and the data corresponding to at least one child node of the first node is deleted within a preset time period.
A third aspect of the present application provides a data updating method, applied to a second electronic device, including:
determining a second target set, the second target set comprising information of at least one node, the information of each node comprising: node identification, father node identification and node status;
receiving a first set and a third set from a first electronic device, wherein the first set and the third set respectively correspond to the second target set;
updating the node state of the deleted node in the second target set by utilizing the father node identifiers and the node identifiers in the first set, the third set and the second target set, wherein the data corresponding to the deleted node is deleted on the first electronic equipment;
updating the data corresponding to the third class node, wherein the node identifier of the third class node in the second target set is the same as one node identifier in the third set.
A fourth aspect of the present application provides a data updating method, applied to a first electronic device, including:
determining a first set from the first set of targets; wherein the first target set includes information of at least one node, the information of each node including: node identification, father node identification, time when the child node has changed last time, and time when the node has changed last time; the first set includes: node identifiers of all nodes of which the time of the last change of the child node is within a preset time period;
Determining a third set from the first target set according to the first set; wherein the third set comprises: a parent node identifies node identifications of all nodes belonging to the first set;
the first set and the third set are sent to a second electronic device to enable the second electronic device to update data with the first set and the third set.
A fifth aspect of the present application provides a data updating method, applied to a second electronic device, including:
determining a second target set, the second target set comprising information of at least one node, the information of each node comprising: node identification, father node identification and node status;
receiving a fourth set from the first electronic device, the fourth set corresponding to the second target set;
determining a first set and a third set from the fourth set; wherein the first set comprises: node identifiers of all nodes of which the time of the last change of the child node is within a preset time period; the third set includes: a parent node identifies node identifications of all nodes belonging to the first set;
updating the node states of the deleted nodes in the second target set by utilizing the father node identifiers and the node identifiers in the first set, the third set and the second target set;
Updating data corresponding to the third class node; the node identification of the third class node in the second target set is the same as one node identification in the third set; or alternatively, the process may be performed,
updating data corresponding to the second class node under the condition that the second set is determined from the fourth set; wherein the second set comprises: node identifiers of all nodes with the time of the last change of the node being in the preset time period; and the node identification of the second class of nodes in the second target set is the same as the node identification in the second set.
A sixth aspect of the present application provides a data updating method, applied to a first electronic device, including:
determining a fourth set from the first set of targets; wherein the fourth set comprises: node identification of the fourth class node and corresponding time, node identification of the sixth class node; alternatively, the fourth set includes: node identifiers of the fourth class of nodes and corresponding times, node identifiers of the fifth class of nodes and corresponding times, and node identifiers of the sixth class of nodes; the fourth class of nodes are all nodes of which the time of the last change of the sub-nodes in the first target set is within a preset time period; the sixth class node is all nodes of which the father node is a fourth class node in the first target set; the fifth type of nodes are all nodes of which the time of the last change of the nodes in the first target set is within a preset time period;
And sending the fourth set to a second electronic device so that the second electronic device can update data by using the fourth set.
A seventh aspect of the present application provides a method for storing information of a node, applied to a first electronic device, including:
storing information of at least one node corresponding to at least one data respectively, wherein the information of each node comprises: node identification, father node identification, time when the child node has changed last time, and time when the node has changed last time;
when the data corresponding to the fifth node changes except deleted, the following information of the fifth node is updated based on the time of the change: the time when the node has changed last time;
deleting information of the fifth node under the condition that data corresponding to the fifth node is deleted;
when the data corresponding to the fifth node changes, based on the time of the change, updating the following information of the father node of the fifth node: the time when the child node has changed last time;
wherein the fifth node is any one of the at least one node.
With reference to the seventh aspect, in a possible implementation manner, the method further includes:
In the case that the data corresponding to the fifth node is deleted, the following information of the parent node of the fifth node is added: a first identifier.
An eighth aspect of the present application provides an electronic device, including:
a memory configured to store predetermined computer instructions;
a processor configured to execute the predetermined computer instructions to perform any of the methods of the first, third or fifth aspects.
A ninth aspect of the present application provides an electronic device, comprising:
a memory configured to store predetermined computer instructions;
a processor configured to execute the predetermined computer instructions to perform any of the methods of the second, fourth, sixth or seventh aspects.
A tenth aspect of the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform any of the methods of the first, second, third, fourth, fifth, sixth or seventh aspects.
In the above implementation manner, on the one hand, the information of the node stored in the first electronic device includes several parameters, such as an update_time when the child node has changed last TIME, a modify_time when the node has changed last TIME, and the like, which are used for respectively recording a last TIME when the data corresponding to the child node has changed, and a last TIME when the data corresponding to the node has changed. Thus, when the first electronic device and the second electronic device need to synchronize data, the first electronic device can set the searching condition by using the update_time and the modified_time, and find out the corresponding sets (the first set list0, the third set list2 and the second set list1 possibly), so that father nodes and brother nodes with changed nodes are filtered out and transmitted to the second electronic device. After receiving the respective sets, the second electronic device can use the sets and the node state parameter to determine the deleted node and update other nodes generating changes, so as to accurately synchronize the data with the changes on the first electronic device to the second electronic device.
On the other hand, since the two parameters update_time and modify_time relate only to the node with the change and its parent node, the nodes in the set screened by the first electronic device relate only to the parent node, the sibling node and itself of the node with the change. This allows the second electronic device to also focus on the parent, sibling, and self-contained nodes of the changed node during the entire data update process, without excessively involving those nodes that have not changed. Therefore, by adopting the scheme, the resource occupation of the first electronic equipment and the second electronic equipment can be reduced, the data quantity required to be transmitted to the second electronic equipment by the first electronic equipment in the updating process is reduced, the time required in the updating process is shortened, and the user experience is improved.
Drawings
Fig. 1 is a schematic system architecture diagram of an exemplary application scenario of the present application.
FIG. 2 is a schematic diagram of a graphical representation of an exemplary data set in accordance with an embodiment of the present application.
Fig. 3 is a flow chart of a first data updating method according to an embodiment of the present application.
FIG. 4 is a schematic diagram of a graphical representation of another exemplary data set in accordance with an embodiment of the present application.
Fig. 5 is a schematic diagram illustrating a range of updating data of a second electronic device in a first data updating method according to an embodiment of the present application.
Fig. 6 is a schematic view of the range of update data of method 2 according to an embodiment of the present application.
Fig. 7 is a flowchart of a second data updating method according to an embodiment of the present application.
Fig. 8 is a schematic diagram illustrating a range of updating data of a second electronic device in a second data updating method according to an embodiment of the present application.
Fig. 9 is a flowchart of a third data updating method according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of an exemplary first electronic device according to an embodiment of the present application.
Detailed Description
For a clear and complete description of the technical solutions of the present application, reference will be made to the following further description in conjunction with the examples and the accompanying drawings.
The foregoing method for updating data of all nodes by the terminal (hereinafter referred to as method 1 for convenience of reference and distinction) has a problem that the time required for synchronization is long and resources of excessive servers and terminals are occupied, in addition to a problem that the amount of transmission data is large.
In addition to method 1, another possible data update method (hereinafter referred to as method 2 for ease of reference and distinction) may be employed. The server finds out the parent nodes with changed nodes and then sends the data of all nodes (child nodes, grandchild nodes, etc. until the leaf nodes) under these parent nodes to the terminal. After the terminal receives the data, the father node with the changed node is searched, then all the data corresponding to all the original nodes under the father node are deleted, and then the data received from the server is updated under the father node, so that the data on the terminal is synchronized with the server. Compared with the method 1, the method 2 needs to update all nodes (including child nodes, grandchild nodes and the like, and the leaf nodes) under the parent node of the changed node, so that the problems of resources occupation, data transmission quantity, synchronization time and the like are relieved, but there is still room for improvement.
For this purpose, the embodiment of the application proposes an inventive concept: and updating part or all of the nodes (including the nodes with changes and possibly the nodes with no changes) in the next level of child nodes of the father node with the changes, thereby reducing the resource occupation of the interaction equipment involved in the data updating, reducing the data quantity to be transmitted, shortening the time required by the updating process and improving the user experience.
In order to realize the technical conception, the embodiment of the application provides a mode for storing information of the node, and a new data updating method is provided on the basis.
The method in the embodiment of the application can be applied between electronic devices needing to update data. The aforementioned electronic devices include an electronic device on the side where data is to be updated (hereinafter referred to as a second electronic device for convenience of distinction), and an electronic device on the side where data is to be updated (hereinafter referred to as a first electronic device for convenience of distinction).
The first electronic device may be a terminal device or a server device, which is not limited in this application. Similarly, the second electronic device may be a terminal device or a server device, which is not limited in this application. Illustratively, in the exemplary scenario shown in fig. 1, the first electronic device may be a server and the second electronic device may be terminal B.
The terminal in the embodiment of the present application may include, but is not limited to, a terminal device such as a mobile phone, a usb key, a tablet computer, a personal computer (Personal Computer, PC), a wearable device, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a personal digital assistant (Personal Digital Assistant, PDA), etc., and the specific product form/type of the terminal is not limited in this application.
The server in the embodiment of the present application may be an independent physical server, may be a server cluster formed by a plurality of physical servers, may also be a cloud server or a cloud computing service center, may also be a combination of a physical server and a cloud server, or the like, and the specific product form of the server is not limited in this application.
There is one data set on the first electronic device. Illustratively, in the scenario of FIG. 1, the data set may be a set of some or all of the data that a user stores on a server. In another exemplary application scenario, multiple users may share a collection of some or all of the data on a server. For example, for an enterprise application scenario, users in a company, a department, or a specific group may share a specific data set, and some or all users may perform operations such as adding, modifying, deleting, etc. on data in the specific data set. When one user uploads some new data to the data set on the server or modifies or deletes some data in the data set, the other user needs to update the data set to the terminal of the user when necessary so as to perform operations such as checking. It will be appreciated that for this data set, if the second electronic device (e.g. terminal) is synchronized with the first electronic device (e.g. server) at some point in the past, then there is also one and the same data set on the second electronic device.
It should be appreciated that the data in the data set may be any type of data, such as text, pictures, video, audio, folders, etc., which is not limited in this embodiment of the present application. One data set may include one or more types of data, which is not limited in the embodiments of the present application.
The data set on the first electronic device may change due to user operation, system operation, etc., and thus become different from the previously synchronized data set on the second electronic device. Illustratively, at some time T0, the second electronic device synchronizes a data set G0 on the first electronic device. At some time T1 after T0, G0 on the first electronic device may have become G1 because of being modified. And G0 is still on the second electronic device at this time, and the G0 and the G correspond to each other, but the specific contents are different. The second electronic device may update the local G0 to synchronize with G1 on the first electronic device when needed.
For convenience of distinguishing and describing, in the embodiment of the present application, a certain data set to be synchronized at a time on a first electronic device is referred to as a first data set, and a data set corresponding to the first data set on a second electronic device, that is, a data set that needs to be updated at a time, is referred to as a second data set, which corresponds to the first data set.
It should be appreciated that other data or data sets may be present on the first electronic device in addition to the first data set and on the second electronic device in addition to the second data set, as this application is not limited in this regard. Illustratively, taking the scenario shown in fig. 1 as an example, there may be other users or organizations of data on the server, and other data of the current user or data of other users on the terminal B.
The data in the data set on the first electronic device may be organized in a node-wise manner. The nodes correspond to data. Illustratively, a folder may correspond to a node, and a file under the folder may correspond to a child node of the node. It should be noted that, the node may or may not include specific content of the data, which is not limited in this application, and no matter whether the node includes specific content of the data, the correspondence between the node and the data is not affected. It should also be noted that nodes may be used by those skilled in the art to refer to data without substantial impact on the presentation and understanding.
The information of the node is used to describe a node, which may or may not include data corresponding to the node, and this application is not limited thereto. For convenience of distinguishing and describing, in the embodiment of the present application, the set of information of the node corresponding to the first data set is referred to as a first target set, and the set of information of the node corresponding to the second data set is referred to as a second target set, where the two sets correspond to each other.
The first target set may include information for one or more nodes, and the information for each node may include: node identification, parent node identification, time when the child node last changed, and time when the node last changed. Optionally, the information of one node may further include information of a node name, a node state, and the like.
Illustratively, the first set of targets may be presented in the form of a list, as shown in table 1. Wherein each row identifies information of one node, and different columns represent different information categories.
TABLE 1
ID NAME PARENT_ID UPDATE_TIME MODIFY_TIME ACTIVE ……
2 Fruit 1 YY:MM:DD:AA:AA YY:MM:DD:BB:BB Y ……
3 Apple tree 2 NA YY:MM:DD:AA:AA Y ……
0 Food product NA YY:MM:DD:CC:CC YY:MM:DD:EE:EE Y ……
…… …… …… …… …… …… ……
Wherein, ID represents a node identification for uniquely identifying a node within a certain range. For example, it should be noted that 0,1,2,3 and … … in table 1 or fig. 4 may be more complex in practical application, and in this embodiment, a simplified manner is adopted for convenience of description and understanding.
NAME indicates the node NAME. For example, the name may be the name of a folder of a certain hierarchy, the name of a file of a certain hierarchy, or the like.
Part_id represents the PARENT node identification, i.e., the node identification of the PARENT node. For example, part_id of node 2 in table 1 is "1", and part_id of node 3 is "2".
It should be noted that, in the case where a root node exists, the root node (e.g., node 0 in fig. 4) has no parent node, and thus no corresponding parent node identifier, or its parent node identifier may be marked as "null", "NA", or the like.
UPDATE _ TIME indicates the TIME when the child node last changed. When the data corresponding to a node changes, such as adding, deleting, renaming, modifying, etc., the update_time of the parent node is updated, and the TIME when the data corresponding to the node changes is recorded. For example, when the last change of the data corresponding to the node 3 is YY MM DD AA, the update_time value of the parent node (node 2) is updated to YY MM DD AA.
It should be noted that a leaf node (e.g., node 3 in FIG. 4 or Table 1) is the endmost node, which has no child nodes and thus no corresponding UPDATE_TIME, or which UPDATE_TIME may be marked as "null", "NA", etc.
The modified_time indicates the TIME when the node last changed. When the data corresponding to a node changes, such as adding, renaming, modifying, etc., the modified_time of the node is updated, and the TIME when the data corresponding to the node changes is recorded. For example, when the last TIME the data corresponding to the node 3 changes is yy:mm:dd:aa, the modified_time of the node 3 is yy:mm:dd:aa; the last TIME the data corresponding to the node 2 changes is YY:MM:DD:BB, and the modified_TIME of the node 2 is YY:MM:DD:BB:BB.
ACTIVE represents the node state. Illustratively, the node states may include an active state (active), an inactive state (inactive). The activation state and the deactivation state are respectively and correspondingly indicated by Y, N in table 1.
It should be noted that the node status may be associated with certain characteristics of the data corresponding to the node, such as whether it is visible to the user, whether it can be used, etc. For example, the node status may be associated with whether the corresponding data is visible to the user. The data corresponding to the node in the active state may be configured to be viewable by the user, while the data corresponding to the node in the inactive state may be configured to be not viewable by the user. Thus, for the user, the second electronic device is not shown, and the user can understand that it has been deleted, although some of the data that cannot be viewed is actually left on the second electronic device. It should be noted that, for a node having a child node, when the state of the node is inactive, data corresponding to all the nodes (child node, grandchild node, and up to leaf node) below the node cannot be seen by the user.
It should be understood that the active state and the inactive state in the embodiments of the present application are only exemplary identification manners of two node states, and other words may be used to distinguish the two different node states in different contexts or application scenarios. The specific identification manner of the node state is not limited in this application, as long as the two can be distinguished and correspond to some characteristics of the data.
It should be understood that the first set of targets may be presented in other possible forms besides a list-like form, which is not limited in this application.
It should also be appreciated that, as previously described, the first target set may not include the specific content of the data corresponding to the node, i.e., not include the data in the first data set. Of course, the first target set may also include specific content of the data corresponding to the node, in which case the element (i.e., data) corresponding to the first data set is taken as an element or component of the element in the first target set. Thus, although the first data set and the first target set are conceptually distinguished for the sake of more clearly explaining the solution of the present application, in practical application, they may be integrated into one entity or regarded as one entity. The present application is not limited to the specific content of whether the first target set includes data. Similarly, the case of the subsequent second data set, second target set, is similar.
In general, data corresponding to a node is deleted, and information of the node is deleted accordingly. For some application scenarios, however, when some data needs to be deleted, the server may not delete immediately, but may remain for a period of time. For example, for some applications, when a user erroneously deletes data stored on their server, the user may wish to be able to recover the erroneously deleted data, so the server may keep the data for a period of time in order to be able to provide the user with these functions when the user wishes to recover. For some application scenarios, when some data needs to be deleted, if the information of the node does not include the specific content of the data, the server may directly delete the specific content of the data and the corresponding node information thereof, or delete only the specific content of the data and retain the corresponding node information for a period of time, or retain all the specific content of the data for a period of time; when the information of the node includes the specific content of the data, the server may delete all the information of the node directly or may delete only a part of the information of the node. In either case, for the first target set in the embodiments of the present application, if data corresponding to one node is deleted, the first target set will no longer include information of the node. Of course, in practical applications, for example, in some application scenarios, the node information and the specific data content of the node may be still reserved in other storage spaces of the server side, which does not affect implementation of the solution of the embodiment.
It should be noted that, in general, data/node information corresponding to a node having a child node on a server is deleted, and information of the data/node corresponding to the child node may be deleted accordingly, or may be reserved for some purposes, which is not limited in this application. But for the first target set in this embodiment, the node information of the node and the node information of the child node are deleted from the first target set accordingly. In this case, the information of the corresponding node, including the aforementioned modification_time, is naturally not present in the first target set for the deleted data.
The second target set may include information for one or more nodes, and the information for each node may include: node identification, parent node identification, node status. Optionally, the information of a node may further include information such as a node name, a time when the child node has changed last time, a time when the node has changed last time, and so on. Regarding the node identifier, the parent node identifier, the node status, the node name, the time when the child node has been changed last time, and the time when the node has been changed last time, reference may be made to the foregoing related description, and details thereof will not be repeated here.
Similar to the first set of targets, the second set of targets may also be presented in other possible forms besides the form of a list of similar targets, which is not limited in this application. The second target set may or may not include specific content of data corresponding to the node, which is not limited in this application. In the case where the second target set includes data corresponding to the node, elements (i.e., data) corresponding to the second data set are included as elements or components of elements in the second target set.
It should be noted that the information included in the first target set and the second target set may or may not be identical. Illustratively, the first target set may include the node identification, the parent node identification, the time the child node was last changed, and the time the node was last changed, while the corresponding second target set may include the node identification, the parent node identification, the node status, and so on.
Based on the foregoing inventive concepts, embodiments of the present application provide three data updating methods. In addition, the embodiment of the application also provides a method for storing the information of the node. These four methods will be described below, respectively.
According to the first data updating method provided by the embodiment of the application, part of steps in the method can be realized by the first electronic device, and the other part of steps can be realized by the second electronic device. By adopting the method, the second electronic equipment can update the data corresponding to the changed nodes without updating the data of the nodes which are not changed, so that the resource occupation of the interactive equipment related to the data update can be reduced, the data quantity required to be transmitted is reduced, and the time required by the update process is shortened.
Referring to fig. 3, fig. 3 is a flow chart of a first data updating method according to an embodiment of the present application. The method may include the following steps S101 to S108.
S101: the first electronic device determines a first set from a first set of targets, the first set comprising: in the first target set, node identifiers of all nodes of which the time of the last change of the child nodes is within a preset time period are identified.
The preset time period may be determined by the first electronic device according to the time of last synchronizing the data set and the time of this synchronizing the data set. For example, the first electronic device may determine, as the start time of the preset period, the time at which the update was completed for the data set as the time of the previous synchronization; and taking the current time as the time of the synchronization, and determining the current time as the ending time of the preset time period. Of course, the first electronic device may also determine the preset time period in other possible manners. For example, the first electronic device may determine the preset time period by advancing for n hours or n days based on the current time according to different demands of the user; also, for example, the first electronic device may also determine the time period specified by the user as a preset time period according to different needs of the user.
The main purpose of determining the first set is to find out the node with the characteristic that the data corresponding to the child node thereof changes within the preset time period, namely, the parent node of the node corresponding to the data changing within the preset time period.
The first set may include only the node identifier of the node having the above characteristics, and may further include other information, such as a corresponding parent node identifier, a time when the child node has been changed last, a time when the node has been changed last, a node state, and the like. Since the first set subsequently needs to be sent to the second electronic device, the amount of data of the first set that needs to be transmitted is relatively small in case only the node identification is included.
It should be further noted that, for a node indicated in the first set, at least one child node thereof changes within a preset time period, and the node itself may change (e.g., node 9 in fig. 4) or may not change (e.g., node 8 in fig. 4) within the preset time period.
Illustratively, FIG. 4 is a schematic illustration of a graphical representation of an exemplary data set of the present application. The data set may be on the first electronic device. Wherein each node represents a folder or a file. The serial number on a node is the ID of that node.
At a certain time T1, these folders/files may have changed relative to a previous certain time T0. For example, files/folders are renamed, the contents of files are modified, new files/folders have been added, or some files/folders that were originally deleted, etc. In the example of fig. 4, the name of the data corresponding to node 3 is renamed; the data corresponding to the node 5 is deleted, and the data corresponding to the child node 6 is also deleted; the data corresponding to the nodes 9, 10 and 11 are modified. Whereas the data corresponding to node 0, node 1, node 2, node 4, node 7, node 8, node 12, node 13, node 14, node 15, and other untagged ID nodes, is unchanged for the period T0-T1.
The first target set includes information of all nodes shown in fig. 4 except the deleted node (i.e., node 5, node 6). According to whether the UPDATE _ TIME of each node belongs to [ T0, T1], the information of the node satisfying the condition can be found. If T1 is the current TIME, then UPDATE_TIME > T0 may also be used as a lookup condition. The searched node identifier is used as an element in the first set list0, and the element of the first set list0 comprises: 2,4,8,9.
It should be appreciated that in some cases, the first set may be empty, for example, in a case where there is a root node, in a case where only data corresponding to the root node is modified within a preset period of time, or in a case where all data in the first data set has not changed within the preset period of time.
S102: the first electronic device determines a second set from the first set of targets, the second set comprising: in the first target set, node identification of all nodes with the last time of the node change within a preset time period is provided.
The main purpose of determining the second set is to find the node to which the data that has changed (not including deletion) within the preset time period corresponds. It should be noted that, for the data deleted within the preset period, the information of the corresponding nodes does not exist in the first target set at present, so the second set also does not include the information of the nodes correspondingly.
For the node indicated by the node identification in the second set, the corresponding data must be changed, so the node identification of its parent node must be in the first set. Of course, when the node identification of the root node is included in the second set, there is no node identification of its corresponding parent node in the first set because the parent node does not exist in the root node.
The second set may include only the node identifier of the node having the above characteristics, and may further include other information, such as the corresponding parent node identifier, the time when the child node has been changed last, the time when the node has been changed last, the node status, and so on. Since the second set subsequently needs to be sent to the second electronic device, the amount of data of the second set that needs to be transmitted is relatively smaller in case only the node identification is included. The second set may further include data corresponding to the nodes such that a subsequent second electronic device may update the data corresponding to the node identifications in the second set. When the second set does not include the data corresponding to the nodes, the first electronic device may further send the data corresponding to the nodes indicated by all the node identifiers in the second set to the second electronic device alone or together with the second set.
Using the example of fig. 4, information of nodes satisfying the condition can be found according to whether the modification_time of each node belongs to [ T0, T1 ]. If T1 is the current TIME, then modified_TIME > T0 may also be used as the search condition. And taking the searched node identification as an element in the second set list1, wherein the element of the second set list1 comprises the following components: 3,9,10,11.
It will be appreciated that in some cases the second set may be empty, for example in the case where all changes in the data have been deleted within a preset time period, or in the case where all data in the first set have not been changed within a preset time period.
S103: the first electronic device determines a third set from the first target set according to the first set, wherein the third set comprises: in the first target set, the parent node identifies node identifications of all nodes belonging to the first set.
The main purpose of determining the third set is to find out the node having the characteristic that the next level child node of the parent node of the node corresponding to the data changed in the preset time period, namely the node corresponding to the data changed in the preset time period (excluding the node corresponding to the deleted data) and the brother node thereof.
It can be seen that, in general, for node identities in the second set, it is also in the third set, whereas node identities in the third set are not necessarily all in the second set. Of course, when the second set includes the node identifier of the root node, since the root node does not have a parent node, the first set does not have the node identifier of its corresponding parent node, and thus, when the third set is determined according to the first set, the determined third set also does not include the node identifier of the root node.
It should be noted that, for the data deleted within the preset period, the information of the corresponding nodes does not exist in the first target set at present, so the third set also does not include the information of the nodes correspondingly.
It should be further noted that, the data corresponding to the sibling node in the next level child node may or may not change within the preset time period. If the data corresponding to a brother node is deleted within the preset time period, the information of the brother node does not exist in the first target set currently, and therefore the third set correspondingly does not contain the information of the brother node.
The third set may include only the node identifier of the node having the above characteristics, and may further include other information, such as the corresponding parent node identifier, the time when the child node has been changed last, the time when the node has been changed last, the node status, and so on. Since the third set subsequently needs to be sent to the second electronic device, the amount of data of the third set that needs to be transmitted is relatively small in case only the node identification is included.
Using the example of fig. 4, according to the node identifier [2,4,8,9] in the first set, the information of the nodes with which the part_id matches, that is, the information of the node 3, the node 7, the node 9, the node 12, the node 10, and the node 11, are respectively found in the first target set. And taking the searched node identification as an element in the third set list2, wherein the element of the third set list2 comprises: 3,7,9,12,10,11.
It should be appreciated that in some cases, the second set may be empty. For example, when there is a root node and only the data corresponding to the root node changes within the preset time period, or when the data changes within the preset time period are all deleted, and the data corresponding to the sibling node of the node corresponding to the deleted data has also been deleted within the preset time period, or a combination of the first two cases, or when all the data in the first data set has not changed within the preset time period.
S104: the first electronic device sends the first set, the second set, and the third set to the second electronic device.
The first electronic device may send the first set, the second set, the third set to the second electronic device in a direct or indirect manner. The first electronic device may send the first set, the second set, and the third set to the second electronic device, respectively, or may send the first set, the second set, and the third set together, for example, package the three sets into a whole, and send the three sets to the second electronic device. When the first electronic device transmits the sets at least twice, the transmission manners may be the same or different. The present application is not limited in this regard.
After the second electronic device receives the three sets, the data local to the second electronic device may be updated with the three sets.
It should be appreciated that in most cases none of the first, second and third sets are empty sets, but in few cases some or all of them may be empty sets.
For example, when a root node exists in the nodes indicated by the first target set, only the data corresponding to the root node changes, and the change is not deletion, the first set and the third set are both empty sets, and the second set is not an empty set.
For another example, when only the data corresponding to the node indicated by the first target set is deleted and no other change occurs, the second set is an empty set, and the first set and the third set may not be empty sets. In this case, the first set is typically not an empty set as long as the deletion is not the root node. For the deleted nodes, if the data corresponding to any one node is deleted and the data corresponding to its sibling node is also deleted, the third set is an empty set; if the data corresponding to a certain node is deleted, the data corresponding to its brother node is not all deleted, and the third set is not an empty set. If the root node is deleted, the whole first target set may be considered to contain no information of any node, that is, the first data set is deleted, at this time, the first electronic device does not need to synchronize the data to the second electronic device, which may inform the second electronic device that all the data has been deleted.
Of course, if no data change occurs within the preset time period, the first set, the second set and the third set are empty sets accordingly.
It should also be understood that various sets of embodiments of the present application may be presented in different specific forms, such as lists, arrays, linked lists, etc., when in actual use. The specific form thereof does not substantially affect achievement of the primary advantageous effects of the embodiments of the present application, and thus the present application is not limited to the specific form thereof. The schematic diagrams of the graphical representations of fig. 2, 4 are presented as tree structures, which are merely illustrative of the present application as an example and not limiting of the present application.
Optionally, when a certain data in the first data set is deleted, the first electronic device may add a specific identifier to a parent node of its corresponding node, so that the second electronic device can know that at least one child node of the parent node has been deleted, and update the data on the second electronic device according to a different policy.
For convenience of description, a node corresponding to one of the deleted data in the first data set will be hereinafter referred to as a second node, and a parent node of the second node will be hereinafter referred to as a first node. When the data is deleted, the information of the second node is correspondingly deleted, and a corresponding first identifier is added in the information of the first node. Thus, when the first set is determined from the first target set, the first set includes the node identification of the first node and the first identification corresponding thereto.
It should be noted that, similarly to the case where the data corresponding to the second node is deleted, if the data corresponding to the first node is also deleted but the data corresponding to the parent node of the first node is not deleted within the preset period, when the first set is determined from the first target set, the first set naturally also does not include the node identifier of the first node and the corresponding first identifier, but includes the node identifier of the parent node of the first node and the corresponding first identifier.
S105: the second electronic device determines a second target set, the second target set including information for at least one node, the information for each node including: node identification, parent node identification, and node status.
The second target set is local to the second electronic device and includes information of nodes corresponding to data local to the second electronic device. The information included in the method can be referred to in the related description, and is not repeated here.
The second electronic device may determine the second set of targets by itself or in response to some operation. In an exemplary scenario where the user wishes to synchronize his own data periodically or at a specific time, the second electronic device may determine the data set for which the update is performed by itself when the time of the periodic synchronization or the specific time is reached, and determine the corresponding second target set. Also for example, when a user logs in to an app such as a cloud disk on the second electronic device, the second electronic device may automatically determine, in response to the user logging in, data pertaining to the user or data that the user has authority to operate (e.g., view, edit, etc.) as a data set for which the update is directed, and determine a corresponding second target set.
The second electronic device may determine the second target set corresponding to the first target set according to the instruction from the first electronic device, or may notify the first electronic device after determining the second target set, so that the first electronic device may determine the corresponding first target set according to the second target set. That is, the present application does not limit the order of determination of the first target set and the second target set, as long as they are corresponding. For example, the second electronic device may determine a second set of targets in response to the user's indication and then send a request to update the data to the first electronic device. The first electronic device determines a first set of targets corresponding to the second set of targets, and then determines the first set, the second set, the third set, etc. based on the first set of targets.
Since the data set on the second electronic device corresponds to the data set on the first electronic device, both should be identical after the last synchronization, the example of fig. 4 is still used. The second target set includes information for nodes 0-15 shown in FIG. 4 and other nodes not labeled with node IDs.
S106: the second electronic device receives a first set, a second set and a third set from the first electronic device, the first set, the second set and the third set corresponding to the second target set, respectively.
For the first set, the second set, and the third set, reference may be made to the foregoing related descriptions, and details are not repeated here. Since the second set of targets corresponds to the first set of targets, the first set, the second set, and the third set are again determined based on the first set of targets, and thus the first set, the second set, and the third set also correspond to the second set of targets.
S107: and the second electronic equipment updates the node state of the deleted node in the second target set by using the father node identifiers and the node identifiers in the first set, the third set and the second target set.
The data deleted on the first electronic device within the preset time period may be referred to as deleted data. It should be understood that deleted data is data that is deleted within the scope of the data set for which the current update is directed. Reference is made to the foregoing related description for the preset time period, and no further description is given here.
As previously described, for data that has been deleted (i.e., deleted data) on the first electronic device within the preset period of time, the information of its corresponding nodes is not already present in the first target set, and therefore the second set correspondingly does not contain the information of these nodes. In this step, the first set and the third set are mainly used for comparing with the parent node identifier and the node identifier in the second target set, so as to determine the nodes corresponding to the data which have been deleted on the first electronic device but not deleted on the second electronic device.
Using the parent node identification and node identification in the first set, the third set, and the second target set, a deleted node may be determined. The data corresponding to the deleted node has been deleted on the first electronic device and has not been deleted on the second electronic device. The second electronic device updates the node status of the deleted nodes and synchronizes the deleted data with the first electronic device. The node state of the deleted node here is different before and after the update, e.g. it may be an active state before the update and an inactive state after the update. That is, the node status after the update of the nodes actually indicates the status of the data corresponding to the nodes, i.e. the data has been deleted on the first electronic device.
For a deleted node, its parent node identity is the same as at least one parent node identity in the second target set; its parent node identity is also the same as one node identity in the first set. Meanwhile, for the deleted node, the node identifier is the same as one node identifier in the second target set, but is different from any node identifier in the third set. That is, the parent node identity of the deleted node exists in both the first set and the second target set, while the node identity of the deleted node also exists in the second target set, but does not already exist in the third set.
Based on the characteristics of the deleted nodes described above, there are many different implementations for determining deleted nodes and updating their node states. Two exemplary ways are provided below for further explanation.
In some implementations, the step of S107 may include:
s1071: updating the node state of the first type of nodes in the second target set to be an inactive state;
s1072: and updating the node state of the third class node in the second target set to be an activated state.
The first type of node refers to a node with the following characteristics: its parent node is identified in the second target set and is identical to one node in the first set. The node states of the first class nodes are updated to inactive states.
The third class of nodes refers to nodes with the following characteristics: the node identity of which is in the second target set and is the same as one node identity in the third set. The node states of these third class nodes are updated again to the active state.
As described with the example of fig. 4, it is assumed that the node states of the nodes on the second electronic device, to which the node IDs have been marked, are all active states.
The first set list0 includes: 2,4,8,9.
The second electronic device may determine that the first type of node includes: node 3, node 5, node 7, node 9, node 12, node 10, node 11. The node states of the first type nodes in the second target set are respectively updated to be inactive states (inactive).
The third set list2 includes: 3,7,9,12,10,11.
The second electronic device may determine that the third class of nodes includes: node 3, node 7, node 9, node 12, node 10, node 11. The node states of the third class nodes in the second target set are updated to active states (active) respectively.
Through the above steps, the states of these nodes are as follows:
the node 3active is used to determine the active,
the node 5inactive is used to determine the node,
the node 7 is active and has the function of,
the node 9 is active and has the function of,
the node 12 is active and has a function,
the node 10 is active and has a function,
node 11active.
The second electronic device can determine that the node 5 is a deleted node, and the data corresponding to the node 5 and all the nodes (node 6) below the node 5 are deleted on the first electronic device within a preset time period.
It should be noted that, the second electronic device may update the node states of the first type of nodes first in a unified manner, and then update the node states of the third type of nodes, or may update the node states of the third type of nodes one by one with a single node as a target, which is not limited in this application.
In other implementations, in the case that the first electronic device marks a specific mark (for example, the first mark described above) for the node corresponding to the deleted data, the second electronic device may correspondingly update the node by using different policies according to whether the node mark has the corresponding specific mark, so as to further shorten the time required for synchronization and reduce the occupation of resources of the second electronic device.
For a certain node identifier in the first set, if the node identifier has a corresponding specific mark, it is stated that at least one of all the child nodes of the node indicated by the node identifier is deleted in a preset time period on the first electronic device. In this case, the second electronic device may determine the deleted node using a method similar to that in the previous implementation, and then update the deleted node with the data corresponding to the corresponding node in the second set. A node identifier of the first set (hereinafter referred to as a node identifier of the third node) will be further described below as an example.
Illustratively, the step of S107 may include:
s1073: under the condition that the node identification of the third node has a corresponding first mark, updating the node state of the fourth node in the second target set to be an inactive state;
S1074: and updating the node state of the fourth node in the second target set to be an activated state under the condition that the node identification of the fourth node is the same as one node identification in the third set.
It will be appreciated that in the case that the node identity of the third node has a corresponding first tag, it may be the node identity of the first node as described hereinbefore.
The fourth node here refers to a node having the following characteristics: the parent node identity is the same as the node identity of the third node. That is, the fourth node is a child node of the node on the second electronic device that corresponds to the third node on the first electronic device. In some cases, there may be one or more fourth nodes. The state of these point nodes is updated to inactive state.
Continuing with the example of FIG. 4, for node 4 in the first set list0, it is assumed that it has a first identification.
First, the second electronic device marks the node states of all the next-level child nodes (i.e., the fourth node) of the node 4 as inactive. At this time, the states of the node 5 and the node 7 are both inactive.
Then, the second electronic device determines, from the third set list2, that the parent node is the node of the node 4 (in this case, the list2 also needs to contain information of the parent node ID corresponding to the node ID), and updates the node states of these nodes to active. Alternatively, the second electronic device searches for the presence or absence of the same node ID as the ID of the node 5 or 7 from the third set list2 (in this case, list2 may not contain information of the parent node ID), and updates the node status of these nodes to active. With either operation, the node states of the next level child nodes of node 4 in the final second target set are as follows:
The node 5inactive is used to determine the node,
node 7active.
It can be seen that the data corresponding to node 5 and all nodes below it (node 6) have been deleted on the first electronic device within a preset period of time.
If a node identifier in the third set is the same as a node identifier of a fourth node, which indicates that the fourth node is not deleted, the node state of the fourth node is updated to an active state. And if none of the node identifiers in the third set is the same as the node identifier of the fourth node, indicating that the fourth node has been deleted, the node state of the fourth node remains in the previous state, i.e. in the inactive state.
For a node identifier in the first set, if the node identifier does not have a corresponding specific mark, it indicates that at least one of the child nodes of the node on the first electronic device has a change within a preset time period, but the change is not deleted. In this case, the second electronic device may directly update with the data corresponding to the corresponding node in the second set, without updating the node state. That is, the method may further include:
s1081: and updating the data corresponding to the fourth node under the condition that the node identification of the third node does not have the corresponding first mark.
S108: the second electronic device updates data corresponding to the second class node.
The second class node refers to a node having the following characteristics: the node identity of which is in the second target set and is the same as one node identity in the second set.
As mentioned above, the second set may include only the node identifier of the node having the above characteristics, and may also include other information, such as data corresponding to the node. When the second set does not include the data corresponding to the nodes, the first electronic device may further send the data corresponding to the nodes indicated by all the node identifiers in the second set to the second electronic device alone or together with the second set, so that the second electronic device may update the data corresponding to the second class of nodes.
Using the example of fig. 4, the second set list1 includes: 3,9,10,11.
The second electronic device may determine that the second class of nodes includes: node 3, node 9, node 10, node 11. The data corresponding to each of these 4 nodes is updated as shown in fig. 5.
Adopting the method 1, the data of all nodes under the root node need to be transmitted and updated; with method 2, the data of all nodes under node 2 and node 4 need to be transmitted and updated, as shown in fig. 6. In contrast, by adopting the data updating method in this embodiment, the first electronic device only needs to transmit the first set, the second set, the third set, and the data corresponding to the second class node to the second electronic device, and only the second class node actually needs to update the data. The method reduces the data quantity required to be transmitted during data synchronization, occupies relatively less resources for the first electronic equipment and the second electronic equipment, and requires relatively shorter time for synchronization as a whole.
Optionally, the second electronic device may update the information of the corresponding node and/or its parent node at the same time or after updating the data. In one implementation, the method may further include: the second electronic device updates the following information of the second class node in the second target set: the time the node last changed. In another implementation, the method may further include: the second electronic device updates the following information of the father node of the second class node in the second target set: the time the child node last changed.
It should be understood that, for the above information of the second class node and the information of the parent node of the second class node, only one of them may be updated, or both may be updated, which is not limited in this application.
Optionally, the second electronic device may also clean up data corresponding to nodes in the second electronic device that have been deleted on the first electronic device. In one implementation, the second electronic device deletes data corresponding to the nodes and their children nodes whose node states are inactive in the second target set.
It should be noted that, in some implementations, when the second electronic device updates the data, it does not clean up those data that should be deleted; when the second electronic equipment cleans up the data which should be deleted, the second electronic equipment does not perform the data updating operation; that is, the two are not performed simultaneously, so as to reduce the occupation of local resources of the second electronic device in the same or almost the same time period, and avoid affecting the use experience of the user as much as possible.
Optionally, the second electronic device may clean up the data periodically, or may clean up the data at idle, so as to reduce occupation of local resources of the second electronic device. The idle time mainly refers to the running state of the second electronic device. When some preset conditions are met, whether the second electronic equipment is idle or not can be judged. For example, the determination may be made according to the occupation amount of the CPU, the memory, the disk, or the like, or the number of running processes, or the like, of the second electronic device at a certain time or during a certain period of time.
The embodiment of the application also provides a second data updating method. The main difference between this method and the first method is that the first method only updates the information or data of the changed nodes, and the method may update a part of nodes which are not changed, besides the information or data of the changed nodes. However, the method does not require updating for nodes that have not changed in another part. Therefore, compared with the method of the mode 2, which needs to update all the child nodes below the parent node, the method can still update less nodes with unchanged parts, thereby reducing the occupation of server and terminal resources, reducing the data transmission quantity and shortening the synchronization time.
Referring to fig. 7, fig. 7 is a flow chart of a second data updating method according to an embodiment of the present application. The data update method may include the following steps S201 to S207. Some of the steps in the method may be implemented by a first electronic device and another part of the steps may be implemented by a second electronic device.
S201: the first electronic device determines a first set from a first set of targets.
S202: the first electronic device determines a third set from the first set of targets according to the first set.
S203: the first electronic device sends the first set and the third set to the second electronic device.
Regarding the steps including the first target set, the first set, the third set, and the implementation manner of each step, reference may be made to the related descriptions of the steps S101, S103, and S104, which are not repeated herein.
Compared with the first method, the first electronic device does not need to determine the second set any more, and the subsequent second electronic device updates by using the first set and the third set.
It should be noted that, the third set may include only the node identifier, or may further include other information, for example, data corresponding to the node, so that the second electronic device may update the data corresponding to the node identifier in the third set. When the third set does not include the data corresponding to the nodes, the first electronic device may further send the data corresponding to the nodes indicated by all the node identifiers in the third set to the second electronic device alone or together with the third set.
S204: the second electronic device determines a second target set, the second target set including information for at least one node, the information for each node including: node identification, parent node identification, and node status.
S205: the second electronic device receives a first set and a third set from the first electronic device, wherein the first set and the third set respectively correspond to the second target set.
S206: and the second electronic equipment updates the node state of the deleted node in the second target set by using the father node identifiers and the node identifiers in the first set, the third set and the second target set.
Regarding the above steps, including the second target set, the respective information of the nodes, the deleted nodes, the updated node status, the implementation manner of each step, and the like, reference may be made to the related descriptions of the steps S105 to S107, which are not repeated here.
S207: and the second electronic equipment updates the data corresponding to the third class node.
And the node identification of the third class of nodes in the second target set is the same as one node identification in the third set.
The third class of nodes in this step may refer to the related description in the aforementioned step S107. And updating the data corresponding to the third class node, which is similar to the data corresponding to the second class node.
The steps of S206 and S207 may be performed together, sequentially, or alternatively, may be performed alternately, which is not limited in this application. For example, the second electronic device may update the node states of the first type of nodes to the inactive state, and update the data corresponding to the third type of nodes while updating the node states corresponding to the third type of nodes to the active state.
Still referring to fig. 4, the first set, the third set, etc. are the same as the previous example. Assume that the original node states of the nodes marked with the node IDs on the second electronic device are all active states.
The second electronic device may determine that the first type of node includes: node 3, node 5, node 7, node 9, node 12, node 10, node 11. The node states of the first type nodes in the second target set are respectively updated to be inactive states (inactive).
The second electronic device may determine that the third class of nodes includes: node 3, node 7, node 9, node 12, node 10, node 11. And updating the data of the third class nodes, and respectively updating the node states of the third class nodes in the second target set into active states.
Through the above steps, the states of these nodes are as follows:
the node 3 active is used to determine the active,
the node 5 inactive is used to determine the node,
the node 7 is active and has the function of,
the node 9 is active and has the function of,
the node 12 is active and has a function,
the node 10 is active and has a function,
node 11 active.
The final state of the node is the same as in the previous example of embodiment. The difference is that nodes 7, 12 are unchanged nodes, and in the first approach no update is required, but in the present solution an update is possible. In contrast to the foregoing method 2, the update of the nodes 13, 14 and 15 may not be required with this scheme, as shown in fig. 8. Therefore, the adoption of the scheme can still reduce the number of nodes to be updated to a certain extent, reduce the occupation of the first electronic equipment and the second electronic equipment, reduce the data transmission quantity and shorten the time for updating the synchronous vehicle.
By adopting the updating method provided by the application, on one hand, the information of the node stored in the first electronic device comprises several parameters such as update_time and modification_time, which are used for respectively recording the last TIME of the change of the data corresponding to the child node and the last TIME of the change of the data corresponding to the node. Thus, when the first electronic device and the second electronic device need to synchronize data, the first electronic device can set the searching condition by using the update_time and the modified_time, and find out the corresponding sets (the first set list0, the third set list2 and the second set list1 possibly), so that father nodes and brother nodes with changed nodes are filtered out and transmitted to the second electronic device. After receiving the respective sets, the second electronic device can use the sets and the node state parameter to determine the deleted node and update other nodes generating changes, so as to accurately synchronize the data with the changes on the first electronic device to the second electronic device.
On the other hand, since the two parameters update_time and modify_time relate only to the node with the change and its parent node, the nodes in the set screened by the first electronic device relate only to the parent node, the sibling node and itself of the node with the change. This allows the second electronic device to also focus on the parent, sibling, and self-contained nodes of the changed node during the entire data update process, without excessively involving those nodes that have not changed. Therefore, by adopting the scheme, the resource occupation of the first electronic equipment and the second electronic equipment can be reduced, the data quantity required to be transmitted to the second electronic equipment by the first electronic equipment in the updating process is reduced, the time required in the updating process is shortened, and the user experience is improved.
In the third data updating method provided by the embodiment of the present application, part of the steps in the method may be implemented by the first electronic device, and another part of the steps may be implemented by the second electronic device. The main difference between the method and the first two methods is that the first electronic device can screen out the information of the nodes meeting the conditions of update_time, modification_time and the like, and integrally send the information to the second electronic device, the second electronic device determines the first set and the third set (and the second set if any) and then UPDATEs the data on the second electronic device. In some application scenarios, the method may alleviate the stress of the first electronic device (e.g., the server) to some extent.
Referring to fig. 9, fig. 9 is a flow chart of a third data updating method according to an embodiment of the present application. The method may comprise all or part of the steps of S501 to S508 below.
S501: the first electronic device determines a fourth set from the first set of targets, the fourth set comprising: node identification of the fourth class node and corresponding time, node identification of the sixth class node.
The fourth type node is all nodes of which the time of the last change of the child node in the first target set is within a preset time period, and the sixth type node is all nodes of which the parent node in the first target set is identified as belonging to the fourth type node.
Regarding all nodes whose time at which the child node has changed last in the first target set is within the preset period of time, reference may be made to the description of correlation or the like in the foregoing step S101; identifying all nodes belonging to the fourth class of nodes in the first target set by parent nodes, reference being made to the description of correlation or the like in the preceding step S103; and will not be described in detail herein.
Illustratively, still taking fig. 4 as an example, in one implementation, the fourth set of determinations may be as follows: [ (2, time 2,); (4, time 4,); (8, time 8,); (9, time 9-1,); (3, 2,); (7, 4,); (9, 8,); (12, 8,); (10, 9,); (11,9,) ].
Each element in the fourth set is an array, and consists of four parts, namely node ID, part_ID, update_time and modification_time. When the screening is performed, which parameter is used, the parameter value corresponding to the ID is placed at the corresponding position, so that after the second electronic device receives such fourth set, the first set and the third set similar to those in the first method can be parsed again.
It should be appreciated that for parameters not involved, the parameter values at their corresponding locations may be null, as in the previous example the second and fourth portions of the first 4 elements are null and the third and fourth portions of the last 5 elements are null. It should also be appreciated that some elements of the fourth set may contain only node identifications, without the corresponding parameter values, as long as they can be resolved by the second electronic device. For example the last 5 elements in the previous example, which may carry only the node identification. Even if the corresponding PARENT node identifier part_id is not carried, the second electronic device can also distinguish which type the screened node identifier belongs to according to whether the parameter values in different positions are empty.
It should be further understood that, for the same node ID screened using different screening conditions, the parameter values of the corresponding parameters may be expressed together in one element or may be expressed as a plurality of elements, such as the node 9 in the foregoing example, which is not limited in this application.
The fourth set may include the aforementioned information when updating data using similar ideas to the aforementioned second method. Optionally, when the data is updated according to a similar concept as the first method, the fourth set may further include: node identification of the fifth class node and corresponding time. The fifth type of nodes are all nodes of which the time of the last change of the nodes in the first target set is within a preset time period.
Illustratively, still taking fig. 4 as an example, in one implementation, the fourth set of determinations may be as follows: [ (2, time 2,); (4, time 4,); (8, time 8,); (9, time 9-1,); (3, time 3); (9, time 9-2); (10, time 10); (11, time 11); (3, 2,); (7, 4,); (9, 8,); (12, 8,); (10, 9,); (11,9,) ].
In an exemplary implementation, the conditions such as update_time and modify_time, and the sub-nodes of the nodes selected according to the update_time may be determined, and connected in an "or" manner to form a query condition for querying, so as to obtain a corresponding fourth set.
S502: the first electronic device sends the fourth set to the second electronic device.
The first electronic device may send the fourth set to the second electronic device either directly or indirectly. After receiving the fourth set, the second electronic device can determine the first set and the third set similar to the previous methods, and if necessary, the second set, so as to update the data local to the second electronic device by using the sets.
S503: the second electronic device determines a second target set, the second target set including information for at least one node, the information for each node including: node identification, parent node identification, and node status.
This step may refer to the related description of step S105 in the foregoing embodiment, and will not be repeated here.
S504: the second electronic device receives a fourth set from the first electronic device, the fourth set corresponding to the second target set.
Since the second set of targets corresponds to the first set of targets, the fourth set is in turn determined based on the first set of targets, and thus the fourth set also corresponds to the second set of targets.
S505: the second electronic device determines the first set and the third set from the fourth set.
In one implementation, the first electronic device and the second electronic device may have previously agreed upon parameters represented by the constituent elements in each element of the fourth set. In this way, the second electronic device may query whether there are eligible elements from the corresponding location of each element in the fourth set, thereby determining the first set and the third set. The second set may also be determined from the fourth set, if necessary. Illustratively, following the example of FIG. 4 in step S401 described above,
each element in the fourth set, which is agreed in advance, comprises four parts, namely node ID, part_id, update_time, modified_time, each separated by commas. After receiving the fourth set in the foregoing example, the second electronic device may screen out node IDs in the elements that meet the conditions to form the first set, on the condition whether the time point of the third portion is within the preset time period; screening out node IDs in the elements meeting the conditions to form a second set on the condition that whether the time point of the fourth part is in a preset time period or not; the third set may be formed by screening out the content of the second part of the elements in the case that the content of the second part is not empty and belongs to the first set, on the condition that whether the content of the second part is empty and belongs to the first set.
Regarding the first set, the second set, and the third set, reference may also be made to the foregoing related descriptions, which are not repeated here.
The second electronic device may update the local data with the first set and the third set when the second set is absent, and the second electronic device may update the local data with the three sets when the second set is present. These two types of implementations can be referred to in the description of the first and second embodiments described above.
In one implementation, the method further comprises:
s506: and the second electronic equipment updates the node state of the deleted node in the second target set by using the father node identifiers and the node identifiers in the first set, the third set and the second target set.
S507: the second electronic device updates data corresponding to the second class node. The second class node refers to a node having the following characteristics: the node identity of which is in the second target set and is the same as one node identity in the second set. Alternatively, S508: and the second electronic equipment updates the data corresponding to the third class node. The third class of nodes refers to nodes with the following characteristics: the node identity of which is in the second target set and is the same as one node identity in the third set.
The above steps may refer to the relevant descriptions in steps S107 to S108 and S206 to S207, and will not be repeated here.
The embodiment of the application also provides a method for storing the information of the node. The method may be performed by a first electronic device. Of course, the second electronic device may also perform the method or some of the steps thereof. The method may include the following steps S301 to S304.
S301: storing information of at least one node corresponding to at least one data respectively, wherein the information of each node comprises: node identification, parent node identification, time when the child node last changed, and time when the node last changed.
Regarding the relationship between data and nodes, the relationship between data and information of nodes, various information of nodes, and exemplary implementations, etc., reference may be made to the foregoing related description. It should be appreciated that the information of the node may also include the node status, node name, corresponding data, etc.
S302: when the data corresponding to the fifth node changes except deleted, the following information of the fifth node is updated based on the time of the change: the time the node last changed.
S303: and deleting the information of the fifth node under the condition that the data corresponding to the fifth node is deleted.
Wherein the fifth node is any one of the at least one node. When the data corresponding to a node changes, such as adding, renaming, modifying, etc., the modified_time of the node is updated, and the TIME when the data corresponding to the node changes is recorded. When data corresponding to a node is deleted, the information of the node is deleted accordingly.
S304: when the data corresponding to the fifth node changes, based on the time of the change, updating the following information of the father node of the fifth node: the time the child node last changed.
When the data corresponding to a node changes, whether the data is deleted or not, such as adding, deleting, renaming, modifying and the like, the update_time of the parent node is updated, and the TIME when the data corresponding to the node changes is recorded.
The descriptions of the steps related to the foregoing storage, updating, etc. of the information about the node may be referred to and combined with each other as long as they are not contradictory, and are not repeated here.
By adopting the scheme, the first electronic equipment introduces the parameters of UPDATE_TIME, MODIFY_TIME and the like when storing the information of the nodes, thereby providing a realization foundation for executing the data updating method.
Optionally, the method may further include:
s305: in the case where the data corresponding to the fifth node is deleted, the following information of the parent node of the fifth node is added: a first identifier.
When the data corresponding to the fifth node is deleted, the information of the fifth node is deleted accordingly, and at this TIME, in addition to updating the update_time of the parent node of the fifth node, the first identifier may be added to the parent node. It should be appreciated that the first identification may be added as information of the node of the parent node, or may be marked in other possible ways.
Referring to fig. 10, in an embodiment of the present application, an electronic device 400 may further include:
a memory 401 configured to store predetermined computer instructions;
a processor 402 configured to execute the predetermined computer instructions to implement some or all of the steps implemented by the second electronic device in any of the implementations previously described.
The embodiment of the application also provides electronic equipment, which can include:
a memory configured to store predetermined computer instructions;
a processor configured to execute the predetermined computer instructions to implement some or all of the steps implemented by the first electronic device in any of the foregoing implementations. It should be understood that the steps implemented by the first electronic device may include steps of a data updating method, and may also include steps of a node information storing method.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, apparatus, computer-readable storage medium, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
The present application may also take the form of a computer program product embodied on one or more computer-readable storage media having computer-usable program code embodied therein. That is, in an embodiment of the present application, there is further provided a computer readable storage medium storing a computer program, where the computer program when executed by a processor causes the processor to perform some or all of the steps implemented by the first electronic device or the second electronic device in any one of the foregoing implementations. Of course, in some cases, the storage medium may also store computer programs for execution by two electronic devices.
When implemented in software, these functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The product embodiments described above are merely illustrative. For example, the division of units is merely a logical function division, and there may be another division manner in actual implementation, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted or not performed.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Those skilled in the art may select some or all of the units according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the part of the technical solution of the present application that contributes to the prior art, or the part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RandomAccess Memory, RAM), a magnetic disk, an optical disk, or other various media capable of storing a program.
In addition, the embodiment of the application also discloses another data updating method aiming at some other possible application scenes.
As previously mentioned, for some application scenarios, when some data needs to be deleted, the first electronic device (e.g., server) may not delete immediately, but may remain for a period of time. For example, when some data needs to be deleted, in a case where the information of the node does not include specific content of the data, the first electronic device may delete only the specific content of the data and retain the corresponding node information for a period of time, and may also retain both the data and the corresponding node information for a period of time. Also for example, in case the information of the node contains specific content of the data, the first electronic device may delete only a part of the content in the information of the node, e.g. only the part containing the specific content of the data, while leaving the other information of the node for a period of time. Of course, the first electronic device may also hold all information of the node for a period of time.
In addition, the first electronic device may mark the deleted data for resolution. For example, the first electronic device may add a flag to the node information to indicate whether it has been deleted. Also, for example, the first electronic device may also use the node state in the node information to mark whether the data corresponding to the node is deleted, for example, modify the node state that is originally in the active state to the inactive state. The first electronic device may also update one or more of the following in the node information: the time when the node changed last time, the time when the child node changed last time.
Then, since these node information are also temporarily retained on the first electronic device, when the second electronic device synchronizes data, the first electronic device can determine the node IDs corresponding to these data that have been deleted within the preset period of time and the node IDs corresponding to the data that have changed other than deletion directly according to the time when the node/child node has changed last and whether the node status of the node indicates that the corresponding data has been deleted (e.g., whether it is inactive). And then the node IDs are sent to the second electronic device so that the second electronic device updates data and synchronizes the data with the first electronic device.
For example, the first electronic device may determine the node IDs corresponding to the data deleted in the preset time period directly according to whether the time when the node has been changed last is within the preset time period and whether the node state of the node is inactive.
Also, for example, the first electronic device may find all the child nodes of the child nodes according to whether the time of the last change of the child node is within a preset time period, and then screen out the child nodes whose node states indicate that the corresponding data has been deleted.
In this way, the second electronic device can directly label the node states corresponding to the node IDs in the second target set as inactive states locally.
The first electronic device also needs to send the node IDs corresponding to the changed data except for deletion within the preset period of time to the second electronic device together with the changed data, so that the second electronic device updates the data corresponding to the node IDs.
It should be understood that the first electronic device needs to send the information to the second electronic device, which may be sent together as a whole or sent separately, and the sending manner and the organization form of these information in the data packet during sending are not limited in this application.
Compared with the method 1 or the method 2, the method can reduce the resource occupation of the interactive equipment related to the data update, reduce the data quantity to be transmitted, shorten the time required by the update process and improve the user experience.
It should be understood that, in various embodiments of the present application, the execution sequence of each step should be determined by the function and the internal logic, and the size of the sequence number of each step does not mean that the execution sequence is sequential, and does not limit the implementation process of the embodiments. For example, the step S101 and the step S102 may be performed simultaneously or may be performed in any order, which is not limited in the present application, but the step S103 needs to be performed after the step S101.
It should be further understood that, for the sake of clarity in describing the embodiments of the present application, in the embodiments of the present application, the words "first," "second," etc. are used to distinguish between identical or similar items having substantially the same function and effect, or concepts that differ somewhat. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
The same or similar parts of the various embodiments in this specification may be referred to each other. Different embodiments may be combined with each other as long as there is no logical conflict.

Claims (14)

1. A data updating method applied to a second electronic device, comprising:
determining a second target set, the second target set comprising information of at least one node, the information of each node comprising: node identification, father node identification and node status;
receiving a first set, a second set and a third set from a first electronic device, the first set, the second set being determined from a first target set corresponding to the second target set, respectively, the third set being determined from the first target set based on the first set; the first target set includes information of at least one node, the information of each node including: node identification, father node identification, time when the child node has changed last time, and time when the node has changed last time; the first set includes: node identifiers of all nodes of which the time of the last change of the child node is within a preset time period; the second set includes: node identifiers of all nodes with the time of the last change of the node being in the preset time period; the third set includes: in the first target set, the parent node identifies node identifications of all nodes belonging to the first set;
Updating the node state of the deleted node in the second target set by utilizing the father node identifiers and the node identifiers in the first set, the third set and the second target set, wherein the data corresponding to the deleted node is deleted on the first electronic equipment;
updating data corresponding to the second class node, wherein the node identification of the second class node in the second target set is the same as one node identification in the second set.
2. The method of claim 1, wherein a parent node identity of the deleted node is the same as at least one parent node identity in the second target set as one node identity in the first set; and the node identification of the deleted node is the same as one node identification in the second target set and is different from any node identification in the third set.
3. The method of claim 1 or 2, wherein updating the node state of the deleted node in the second target set with the parent node identification and the node identification in the first set, the third set, and the second target set comprises:
Updating the node state of the first type of nodes in the second target set to be an inactive state; wherein, the father node identification of the first type node in the second target set is the same as one node identification in the first set;
updating the node state of the third class node in the second target set to be an activated state; and the node identification of the third class of nodes in the second target set is the same as one node identification in the third set.
4. The method of claim 1 or 2, wherein updating the node state of the deleted node in the second target set with the parent node identification and the node identification in the first set, the third set, and the second target set comprises:
updating the node state of the fourth node in the second target set to be an inactive state under the condition that the node identifier of the third node has a corresponding first mark; wherein the node identification of the third node is a node identification in the first set; the father node identification of the fourth node is the same as the node identification of the third node;
and updating the node state of the fourth node in the second target set to be an active state under the condition that the node identification of the fourth node is the same as one node identification in the third set.
5. A data updating method applied to a first electronic device, comprising:
determining a first set from the first set of targets; wherein the first target set includes information of at least one node, the information of each node including: node identification, father node identification, time when the child node has changed last time, and time when the node has changed last time; the first set includes: node identifiers of all nodes of which the time of the last change of the child node is within a preset time period;
determining a second set from the first set of targets; wherein the second set comprises: node identifiers of all nodes with the time of the last change of the node being in the preset time period;
determining a third set from the first target set according to the first set; wherein the third set comprises: a parent node identifies node identifications of all nodes belonging to the first set;
and sending the first set, the second set and the third set to a second electronic device so that the second electronic device can update data by using the first set, the second set and the third set.
6. The method of claim 5, wherein the first set further comprises: the first identification corresponds to the node identification of the first node, and the data corresponding to at least one child node of the first node is deleted within a preset time period.
7. A data updating method applied to a second electronic device, comprising:
determining a second target set, the second target set comprising information of at least one node, the information of each node comprising: node identification, father node identification and node status;
receiving a first set and a third set from a first electronic device, the first set being determined from a first set of targets corresponding to the second set of targets, the third set being determined from the first set of targets based on the first set; the first target set includes information of at least one node, the information of each node including: node identification, father node identification, time when the child node has changed last time, and time when the node has changed last time; the first set includes: node identifiers of all nodes of which the time of the last change of the child node is within a preset time period; the third set includes: in the first target set, the parent node identifies node identifications of all nodes belonging to the first set;
Updating the node state of the deleted node in the second target set by utilizing the father node identifiers and the node identifiers in the first set, the third set and the second target set, wherein the data corresponding to the deleted node is deleted on the first electronic equipment;
and updating data corresponding to the third class of nodes, wherein the node identification of the third class of nodes in the second target set is the same as one node identification in the third set.
8. A data updating method applied to a first electronic device, comprising:
determining a first set from the first set of targets; wherein the first target set includes information of at least one node, the information of each node including: node identification, father node identification, time when the child node has changed last time, and time when the node has changed last time; the first set includes: node identifiers of all nodes of which the time of the last change of the child node is within a preset time period;
determining a third set from the first target set according to the first set; wherein the third set comprises: a parent node identifies node identifications of all nodes belonging to the first set;
The first set and the third set are sent to a second electronic device to enable the second electronic device to update data with the first set and the third set.
9. The method for storing the information of the node is applied to the first electronic equipment and is characterized by comprising the following steps:
storing information of at least one node corresponding to at least one data respectively, wherein the information of each node comprises: node identification, father node identification, time when the child node has changed last time, and time when the node has changed last time;
when the data corresponding to the fifth node changes except deleted, the following information of the fifth node is updated based on the time of the change: the time when the node has changed last time;
deleting information of the fifth node under the condition that data corresponding to the fifth node is deleted;
when the data corresponding to the fifth node changes, based on the time of the change, updating the following information of the father node of the fifth node: the time when the child node has changed last time;
wherein the fifth node is any one of the at least one node.
10. The method as recited in claim 9, further comprising:
in the case that the data corresponding to the fifth node is deleted, the following information of the parent node of the fifth node is added: a first identifier.
11. A data updating method applied to a second electronic device, comprising:
determining a second target set, the second target set comprising information of at least one node, the information of each node comprising: node identification, father node identification and node status;
receiving a fourth set from the first electronic device, the fourth set comprising: node identification of the fourth class node and corresponding time, node identification of the sixth class node; the fourth type node is all nodes of which the time of the last change of the child node in the first target set corresponding to the second target set is within a preset time period, and the sixth type node is all nodes of which the father node in the first target set is identified as belonging to the fourth type node;
determining a first set and a third set from the fourth set; wherein the first set comprises: node identifiers of all nodes of which the time of the last change of the child node is within a preset time period; the third set includes: a parent node identifies node identifications of all nodes belonging to the first set;
Updating the node states of the deleted nodes in the second target set by utilizing the father node identifiers and the node identifiers in the first set, the third set and the second target set;
updating data corresponding to the third class node; the node identification of the third class node in the second target set is the same as one node identification in the third set; or alternatively, the process may be performed,
updating data corresponding to the second class node under the condition that the second set is determined from the fourth set; wherein the second set comprises: node identifiers of all nodes with the time of the last change of the node being in the preset time period; and the node identification of the second class of nodes in the second target set is the same as the node identification in the second set.
12. A data updating method applied to a first electronic device, comprising:
determining a fourth set from the first set of targets; wherein the fourth set comprises: node identification of the fourth class node and corresponding time, node identification of the sixth class node; alternatively, the fourth set includes: node identifiers of the fourth class of nodes and corresponding times, node identifiers of the fifth class of nodes and corresponding times, and node identifiers of the sixth class of nodes; the fourth class of nodes are all nodes of which the time of the last change of the sub-nodes in the first target set is within a preset time period; the sixth class node is all nodes of which the father node is a fourth class node in the first target set; the fifth type of nodes are all nodes of which the time of the last change of the nodes in the first target set is within a preset time period;
And sending the fourth set to a second electronic device so that the second electronic device can update data by using the fourth set.
13. An electronic device, comprising:
a memory configured to store predetermined computer instructions;
a processor configured to execute the predetermined computer instructions to implement the method of any one of claims 1 to 4, claim 7 and claim 11; or to implement the method of any one of claims 5 to 6, claim 8, claims 9 to 10 and claim 12.
14. A computer readable storage medium storing a computer program, which when executed by a processor causes the processor to perform the method of any one of claims 1 to 4, claim 7 and claim 11 or to implement the method of any one of claims 5 to 6, claim 8, claim 9 to 10 and claim 12.
CN202111244440.8A 2021-10-26 2021-10-26 Data updating method, node information storage method, electronic device and medium Active CN113934742B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111244440.8A CN113934742B (en) 2021-10-26 2021-10-26 Data updating method, node information storage method, electronic device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111244440.8A CN113934742B (en) 2021-10-26 2021-10-26 Data updating method, node information storage method, electronic device and medium

Publications (2)

Publication Number Publication Date
CN113934742A CN113934742A (en) 2022-01-14
CN113934742B true CN113934742B (en) 2023-07-04

Family

ID=79284281

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111244440.8A Active CN113934742B (en) 2021-10-26 2021-10-26 Data updating method, node information storage method, electronic device and medium

Country Status (1)

Country Link
CN (1) CN113934742B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116561650B (en) * 2023-07-10 2023-09-19 中汽智联技术有限公司 Scene file classification and updating method, device and equipment based on tree structure

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657170B (en) * 2015-10-28 2021-03-30 斑马智行网络(香港)有限公司 Data synchronization method and device
CN107679049A (en) * 2016-08-02 2018-02-09 北京京东尚科信息技术有限公司 Obtain the method, apparatus and system of the hop of tree structure data two
CN108737487B (en) * 2018-03-21 2020-09-29 腾讯科技(深圳)有限公司 Data synchronization method and device, storage medium and electronic device
CN111858146A (en) * 2019-04-26 2020-10-30 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for recovering data

Also Published As

Publication number Publication date
CN113934742A (en) 2022-01-14

Similar Documents

Publication Publication Date Title
US10579479B2 (en) Restoring data in a hierarchical storage management system
US8620861B1 (en) Preserving file metadata during atomic save operations
US7730097B2 (en) Smart database
CN109857724B (en) Method and equipment for supporting various databases based on block chain
US8209294B2 (en) Dynamic creation of database partitions
CN103795811B (en) Information storage and data statistical management method based on meta data storage
US20060085483A1 (en) System and method of merging contacts
CN108460041B (en) Data processing method and device
US20170031948A1 (en) File synchronization method, server, and terminal
US10013312B2 (en) Method and system for a safe archiving of data
US10346458B2 (en) Media asset access control system
US10855637B2 (en) Architecture for large data management in communication applications through multiple mailboxes
US11663192B2 (en) Identifying and resolving differences between datastores
CN113360456B (en) Data archiving method, device, equipment and storage medium
US11681691B2 (en) Presenting updated data using persisting views
JP4111881B2 (en) Data synchronization control device, data synchronization control method, and data synchronization control program
CN103546380A (en) Message forwarding method and device based on strategy routing
US11868328B2 (en) Multi-record index structure for key-value stores
CN113934742B (en) Data updating method, node information storage method, electronic device and medium
US7908240B1 (en) Facilitated use of column and field data for field record universe in a knowledge store
CN110807028B (en) Method, apparatus and computer program product for managing a storage system
CN110442645B (en) Data indexing method and device
EP3061011B1 (en) Method for optimizing index, master database node and subscriber database node
CN113760907A (en) Data uniqueness identification method in database
CN111324483B (en) Data recovery method and device and related equipment

Legal Events

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