CN113934742A - 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
CN113934742A
CN113934742A CN202111244440.8A CN202111244440A CN113934742A CN 113934742 A CN113934742 A CN 113934742A CN 202111244440 A CN202111244440 A CN 202111244440A CN 113934742 A CN113934742 A CN 113934742A
Authority
CN
China
Prior art keywords
node
electronic device
data
nodes
identification
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.)
Granted
Application number
CN202111244440.8A
Other languages
Chinese (zh)
Other versions
CN113934742B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data updating method, a storage method of node information, corresponding electronic equipment and a storage medium. The data updating method can be applied to electronic equipment needing to update 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, then updates the node state of the deleted node in the second target set by using the parent node identification and the node identification in the first set, the third set and the second target set, and updates the data corresponding to the second class of nodes. By adopting the implementation mode, the resource occupation of the interactive equipment involved in data updating can be reduced, the data volume needing 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 application 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). The storage space of the device is often large, and millions, millions and more data can be stored. A data structure is the way a database stores, organizes data, e.g., linear queues, stacks, linear tables, or non-linear trees, graphs, etc. Regardless of the data structure in which the data is organized, the data or data structures may be represented as nodes, and relationships between nodes. For example, FIG. 2 is a diagram of a graphical representation of an exemplary data collection in which each node may represent a folder or a file to which the folder or file represented by the child node belongs.
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 modify the data stored on the server. For example, fig. 1 is a system architecture diagram of an exemplary application scenario. An application (app) such as a cloud disk is installed on a plurality of terminals (including a terminal a and a terminal B) of a user. Each terminal is in communication connection with the server, so that a user can upload, view and change own data in the database of the server through the app on the terminal. In some cases, a user may upload new data or modify original data on a server by using one terminal a, and then want to view his/her own data on the server by using another terminal B. At this time, the terminal B needs to update the latest data of the user on the server to the local of the terminal B, synchronize the local with the data on the server, and then display the synchronized data.
In general, the server will send the data represented by all the nodes of the user to the terminal, which updates the data of all the nodes accordingly. By adopting such an updating manner, the amount of data to be transmitted between the server and the terminal is large, which is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
It is an object of the present application 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, wherein the second target set comprises information of at least one node, and the information of each node comprises: 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 and the third set respectively corresponding to the second target set;
updating the node state of the deleted node in the second target set by using the parent node identifier and the node identifier in the first set, the third set and the second target set, wherein data corresponding to the deleted node is deleted on the first electronic device;
and updating data corresponding to a second class of nodes, wherein the node identification of the second class of nodes 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, the 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 identifier of the deleted node is the same as one node identifier in the second target set and is different from any node identifier in the third set.
With reference to the first aspect, in a possible implementation manner, updating a node state of a deleted node in the second target set by using parent node identifiers and node identifiers 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 in an inactive state; wherein, the parent node identification of the first kind of node in the second target set is the same as one node identification in the first set;
updating the node state of a third type node in the second target set into an activated state; and the node identification of the third type node 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 a node state of a deleted node in the second target set by using parent node identifiers and node identifiers in the first set, the third set, and the second target set includes:
under the condition that the node identification of the third node has the corresponding first mark, the node state of the fourth node in the second target set is updated to be in an inactive state; wherein the node identification of the third node is a node identification in the first set; the parent node identification of the fourth node is the same as the node identification of the third node;
and under the condition that the node identification of the fourth node is the same as one node identification in the third set, updating the node state of the fourth node in the second target set to be an activated state.
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 target set; wherein the first target set comprises information of at least one node, and the information of each node comprises: the node identification, the father node identification, the time when the child node changes last time, and the time when the node changes last time; the first set includes: node identifiers of all nodes of which the time when the child node changes last is within a preset time period;
determining a second set from the first target set; wherein the second set comprises: node identifiers of all nodes of which the time when the node changes last is within 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 identifying node identifications of all nodes belonging to the first set;
sending the first set, the second set, and the third set to a second electronic device to enable the second electronic device to update data with 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 data processing method comprises a first identification, wherein the first identification corresponds to a node identification of a first node, and data corresponding to at least one child node of the first node are 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, wherein the second target set comprises information of at least one node, and the information of each node comprises: node identification, father node identification and node status;
receiving a first set and a third set from a first electronic device, the first set and the third set respectively corresponding to the second target set;
updating the node state of the deleted node in the second target set by using the parent node identifier and the node identifier in the first set, the third set and the second target set, wherein data corresponding to the deleted node is deleted on the first electronic device;
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.
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 target set; wherein the first target set comprises information of at least one node, and the information of each node comprises: the node identification, the father node identification, the time when the child node changes last time, and the time when the node changes last time; the first set includes: node identifiers of all nodes of which the time when the child node changes last 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 identifying node identifications of all nodes belonging to the first set;
sending the first set and the third set 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, wherein the second target set comprises information of at least one node, and the information of each node comprises: 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 when the child node changes last is within a preset time period; the third set includes: a parent node identifying node identifications of all nodes belonging to the first set;
updating the node state of the deleted node in the second target set by using the parent node identification and the node identification in the first set, the third set and the second target set;
updating data corresponding to the third class node; wherein the node identifier of the third type node in the second target set is the same as one node identifier in the third set; alternatively, the first and second electrodes may be,
under the condition that a second set is determined from the fourth set, updating data corresponding to a second type of node; wherein the second set comprises: node identifiers of all nodes of which the time when the node changes last is within the preset time period; the node identifier of the second type node in the second target set is the same as one node identifier 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 target set; wherein the fourth set comprises: node identification of the fourth type node, corresponding time and node identification of the sixth type node; alternatively, the fourth set comprises: the node identification and the corresponding time of the fourth type node, the node identification and the corresponding time of the fifth type node and the node identification of the sixth type node; the fourth type of nodes are all nodes in a preset time period when the time of the last change of the sub-nodes in the first target set is within the preset time period; the sixth class of nodes are all nodes of which the father nodes are fourth class nodes in the first target set; the fifth type of nodes are all nodes in the first target set, wherein the time of the last change of the nodes 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, which is applied to a first electronic device, and includes:
storing information of at least one node corresponding to each of the at least one data, the information of each node including: the node identification, the father node identification, the time when the child node changes last time, and the time when the node changes last time;
when data corresponding to a fifth node changes except for being deleted, updating the following information of the fifth node based on the time of the change: the time when the node changes the last time;
deleting the information of the fifth node under the condition that the data corresponding to the fifth node is deleted;
under the condition that data corresponding to the fifth node changes, updating the following information of a parent node of the fifth node based on the time of the change: the time when the child node has changed the 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:
adding the following information of a parent node of the fifth node when the data corresponding to the fifth node is deleted: a first identification.
An eighth aspect of the present application provides an electronic apparatus 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 first, third or fifth aspects.
A ninth aspect of the present application provides an electronic apparatus 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 one of the methods of the first, second, third, fourth, fifth, sixth or seventh aspects.
In the foregoing implementation manner, on one hand, the information of the node stored in the first electronic device includes several parameters, such as a TIME UPDATE _ TIME when the child node has changed last TIME, a TIME MODIFY _ TIME when the node has changed last TIME, and the like, and is used to record a last TIME when data corresponding to the child node has changed and a last TIME when data corresponding to the node has changed last TIME, respectively. In this way, when data synchronization is required between the first electronic device and the second electronic device, the first electronic device may set a search condition by using UPDATE _ TIME and MODIFY _ TIME, and search for a corresponding set (the first set list0, the third set list2, and possibly the second set list1), so as to screen out a parent node and a sibling node of a node that has a change, and transmit the screened parent node and sibling node to the second electronic device. After receiving the sets, the second electronic device may determine the deleted node by using the parameters of the sets and the node states, and update other nodes which generate changes, so as to accurately synchronize the changed data 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 changed node and its parent, the nodes involved in the set screened by the first electronic device also relate only to the parent, sibling and itself of the changed node. This allows the second electronic device to be updated with a major focus on the parent, sibling and itself of the changed node, without involving too many nodes that have not changed, throughout the data update process. Therefore, by adopting the scheme, the resource occupation of the first electronic device and the second electronic device can be reduced while the data is accurately updated, the data volume required to be transmitted to the second electronic device by the first electronic device in the updating process is reduced, the time required by the updating process is shortened, and the user experience is improved.
Drawings
Fig. 1 is a system architecture diagram of an exemplary application scenario of the present application.
FIG. 2 is a diagram of a graphical representation of an exemplary data set according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating 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 according to an embodiment of the present application.
Fig. 5 is a schematic view of a range of update data of a second electronic device in a first data update method according to an embodiment of the present application.
Fig. 6 is a schematic diagram illustrating a range of update data of method 2 according to an embodiment of the present application.
Fig. 7 is a flowchart illustrating a second data updating method according to an embodiment of the present application.
Fig. 8 is a schematic view of a range of update data of a second electronic device in a second data update method according to an embodiment of the present application.
Fig. 9 is a flowchart illustrating 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, the following description will be further described with reference to the embodiments and the accompanying drawings.
The aforementioned method for updating data of all nodes by a terminal (hereinafter referred to as method 1 for ease of reference and distinction) has problems that the amount of transmitted data is large, and that the time required for synchronization is long and resources of a server and a terminal are excessively occupied.
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 of the nodes that have changed, and then transmits the data of all the nodes (child nodes, grandchild nodes, etc. up to the leaf nodes) under these parent nodes to the terminal. After receiving the data, the terminal finds out the father nodes of the changed nodes, then deletes all the data corresponding to all the original nodes under the father nodes, and updates the data received from the server under the father nodes, thereby synchronizing the data on the terminal with the server. Compared with the method 1, the method 2 needs to update all the nodes (including child nodes, grandchild nodes and the like, and up to leaf nodes) under the parent node of the changed node, so that the problems of resource occupation, data transmission amount, synchronization time and the like are relieved, but an improvement space still exists.
Therefore, the embodiment of the application provides an inventive concept that: and updating part or all nodes (including the changed nodes and possibly also including the partially unchanged nodes) in the next-level child nodes of the parent node of the changed node, so that the resource occupation of interactive equipment related to data updating is reduced, the data volume needing to be transmitted is reduced, the time required by the updating process is shortened, and the user experience is improved.
In order to realize the technical concept, the embodiment of the application provides a mode for storing the information of the node, and provides a new data updating method on the basis.
The method in the embodiment of the application can be applied to electronic equipment needing to update data. The electronic device includes an electronic device on the side where data needs 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 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. Exemplarily, in the exemplary scenario shown in fig. 1, the first electronic device may be a server, and the second electronic device may be a 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 (Personal Computer), a tablet PC (Personal Computer), a wearable device, an Augmented Reality (AR)/Virtual Reality (VR) device, a Personal Digital Assistant (PDA), and the like, and the present application is not limited to a specific product form/type of the terminal.
The server in the embodiment of the present application may be an independent physical server, a server cluster formed by a plurality of physical servers, a cloud server or a cloud computing service center, a combination of a physical server and a cloud server, and the like.
There is one data set on the first electronic device. Illustratively, in the scenario of FIG. 1, the data set may be a collection of some or all of the data stored on the server by a user. In another exemplary application scenario, multiple users may share some or all of the data collection on the server. For example, for an enterprise operation scenario, users in a company, a department, or a specific group may share a specific data set, and some or all of the users may add, modify, delete, etc. data in the specific data set. When a user uploads some new data to the data set on the server, or modifies or deletes some data in the data set, another user needs to update the data set to the terminal of the other user when necessary, so as to perform operations such as viewing. It should be understood that for this data set, if a second electronic device (e.g., a terminal) synchronizes with a first electronic device (e.g., a server) at some point in time in the past, then there is also one same data set on the second electronic device.
It should be understood 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 the embodiments of the present application. One data set may contain one or more types of data, which is not limited in this embodiment.
This data set on the first electronic device may change due to user operations, system operations, etc., and thus become different from the previously synchronized data set on the second electronic device. Illustratively, at a certain 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 it was modified. And at this time, the second electronic device is still G0, and the two devices correspond to each other, but the specific contents are different. The second electronic device may update the local G0 to synchronize with the G1 on the first electronic device when needed.
For convenience of distinction and description, in the embodiment of the present application, a certain data set to be synchronized at a certain time on a first electronic device is referred to as a first data set, and a data set corresponding to the first data set, that is, a certain data set that needs to be updated at a certain time on a second electronic device is referred to as a second data set, and they correspond to each other.
It should be understood that there may be other data or data sets on the first electronic device in addition to the first data set, and there may also be other data or data sets on the second electronic device in addition to the second data set, which is not limited in this application. For example, in the scenario shown in fig. 1, data of other users or organizations may also exist on the server, and other data of the current user or data of other users may also exist on the terminal B.
The data in the data set on the first electronic device may be organized in nodes. The nodes correspond to data. Illustratively, a folder may correspond to a node, and a file under the folder may correspond to a child of the node. It should be noted that a node may or may not include specific content of data, which is not limited in the present application, and whether the node includes the specific content of data or not does not affect the corresponding relationship between the node and the data. It should also be noted that a person skilled in the art may also refer to data using nodes, in cases where there is little 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 distinction and description, in the embodiments of the present application, a set of information of a node corresponding to a first data set is referred to as a first target set, and a set of information of a node corresponding to a second data set is referred to as a second target set.
The first target set may include information of one or more nodes, and the information of each node may include: the node identification, the parent node identification, the time when the child node has changed last time, and the time when the node has changed last time. Optionally, the information of a node may further include a node name, a node status, 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 for 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 (Malus pumila) 2 NA YY:MM:DD:AA:AA Y ……
0 Food product NA YY:MM:DD:CC:CC YY:MM:DD:EE:EE Y ……
…… …… …… …… …… …… ……
Wherein, the ID represents the node identification and is used for uniquely identifying one node in a certain range. For example, 0,1,2, and 3 … … in table 1 or fig. 4 should be noted that node identification may be more complicated in practical applications, and in the embodiment of the present application, a simplified manner is adopted for convenience of illustration and understanding.
NAME denotes the node NAME. For example, the name of a folder in a certain hierarchy may be used, or the name of a file in a certain hierarchy may be used.
The PARENT _ ID represents a PARENT node identification, i.e., a node identification of a PARENT node. For example, the part _ ID of node 2 in table 1 is "1" and the part _ ID of node 3 is "2".
It should be noted that, for the case where there is a root node, the root node (e.g., node 0 in fig. 4) has no parent node and thus has no corresponding parent node identification, or its parent node identification may be marked as "empty", "NA", or the like.
UPDATE TIME represents the TIME when the child node last changed. When data corresponding to a node changes, such as adding, deleting, renaming, modifying, etc., UPDATE _ TIME of its parent node is updated, and the TIME when the data corresponding to the node changes is recorded. For example, if the TIME when the data corresponding to the node 3 has changed last is YY: MM: DD: AA: AA, the value of UPDATE _ TIME of the parent node (node 2) is updated to YY: MM: DD: AA: 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 whose UPDATE _ TIME may be marked as "empty", "NA", etc.
MODIFY _ TIME indicates the TIME when the node last changed. When data corresponding to a node changes, such as adding, renaming, modifying, and the like, the MODIFY _ TIME of the node is updated, and the TIME when the data corresponding to the node changes is recorded. For example, the TIME when the data corresponding to the node 3 changes last TIME is YY, MM, DD, AA, and the MODIFY _ TIME of the node 3 is YY, MM, DD, AA; and the TIME for the data corresponding to the node 2 to change last is YY, MM, DD, BB, and the MODIFY _ TIME of the node 2 is YY, MM, DD, BB.
ACTIVE represents the node state. Illustratively, the node states may include an active state (active) and an inactive state (inactive). The active state and the inactive state are respectively represented 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, and the like. Illustratively, the node state may be associated with whether the corresponding data is visible to the user. Data corresponding to nodes in the active state may be configured to be viewable by a user, while data corresponding to nodes in the inactive state may be configured to be not viewable by a user. Thus, although some data that cannot be viewed actually remains on the second electronic device for the user, the second electronic device is not displayed and the user can understand that it has been deleted. It should be noted that, for a node having a child node, when the state of the node is the inactive state, data corresponding to all nodes (child nodes, grandchild nodes, and leaf nodes) below the node cannot be viewed by the user.
It should be understood that the active state active and the inactive state inactive in the embodiment 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 the present application as long as the node state can be distinguished from the other node state and corresponds to some of the above-mentioned 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 by the present application.
It should also be understood 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 the specific content of the data corresponding to the node, in which case the element (i.e., data) corresponding to the first data set is used as the element or component of the element in the first target set. Therefore, although the first data set and the first target set are conceptually distinguished in order to illustrate the scheme of the present application, in practical applications, the two sets may be merged into one entity or treated as one entity. The present application does not limit the specific content of whether the first target set contains data. Similarly, the situation is similar for the second, subsequent data set, the second target set.
It should be noted that, in general, data corresponding to a node is deleted, and information of the node is also deleted accordingly. However, for some application scenarios, when some data needs to be deleted, the server may not delete the data immediately, but may remain for a while. For example, for some applications, when a user deletes data stored on his server by mistake, the user may wish to be able to recover the deleted data, and the server may retain the data for a period of time so that the user can be provided with these functions when the user wishes to recover. For some application scenarios, when a certain data needs to be deleted, the server may directly delete the specific content of the data and the corresponding node information together, may only delete the specific content of the data and retain the corresponding node information for a period of time, or may retain all the node information for a period of time under the condition that the node information does not contain the specific content of the data; when the information of a node includes the specific content of data, the server may delete all the information of the node as it is, or may delete only a part of the information of the node. In any case, for the first target set in the embodiment of the present application, data corresponding to one node in the first target set is deleted, and the first target set will no longer contain information of the node. Of course, in practical applications, in response to the requirements in some application scenarios, for example, the node information and the specific data content of the node may be retained in other storage spaces of the server side, which does not affect the implementation 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 also be deleted accordingly, or may be retained for some purpose, which is not limited in this application. However, 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, for the deleted data, the information of the corresponding node, including the aforementioned MODIFY _ TIME, is naturally not present in the first target set.
The second target set may include information of one or more nodes, and the information of each node may include: node identification, father node identification, node status. Optionally, the information of a node may further include a node name, a time when a child node has changed last time, a time when a node has changed last time, and the like. Regarding the node identifier, the parent node identifier, the node state, the node name, the time when the child node changes last time, and the time when the node changes last time, reference may be made to the related description, which is not repeated herein.
Similar to the first target set, the second target set may also be presented in other possible forms besides in a form similar to a list, which is not limited in this application. The second target set may or may not include the specific content of the 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, the element (i.e., data) equivalent to the second data set is treated as an element or a component of an element in the second target set.
It should be noted that the information included in the first target set and the information included in the second target set may or may not be completely the same. Illustratively, a first target set may include a node identification, a parent node identification, a time when a child node has changed last, and a time when a node has changed last, while a corresponding second target set may include a node identification, a parent node identification, a node status, and the like.
Based on the aforementioned inventive concept, the 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 separately below.
In the first data updating method provided by the embodiment of the present application, part 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. By adopting the method, the second electronic equipment can only update the data corresponding to the changed nodes without updating the data of the unchanged nodes, so that the resource occupation of the interactive equipment involved in data updating can be reduced, the data quantity required to be transmitted is reduced, and the time required by the updating process is shortened.
Referring to fig. 3, fig. 3 is a schematic flow chart of a first data updating method according to an embodiment of the present application. The method may include the following steps of S101 to S108.
S101: the first electronic device determines a first set from a first target set, the first set comprising: in the first target set, the node identifiers of all nodes of which the time when the child node changes last is within a preset time period.
The preset time period may be determined by the first electronic device according to the time of last synchronization of the data set and the time of this synchronization of the data set. For example, the first electronic device may determine a time when the update is completed for the data set as a time of last synchronization as a start time of the preset time period; and taking the current time as the time of the synchronization, and determining the current time as the end 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 move forward for n hours or n days based on the current time according to different requirements of the user to determine the preset time period; for another example, the first electronic device may also determine the time period specified by the user as the preset time period according to different requirements of the user.
The main purpose of determining the first set is to find out a node having a characteristic that data corresponding to child nodes has changed within a preset time period, that is, to find out a parent node of a node corresponding to data that has changed within the preset time period.
The first set may only include node identifiers of nodes having the above characteristics, and may also include other information, such as a corresponding parent node identifier, a time when a child node has changed last time, a time when a node has changed last time, a node status, 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, including only the node identification.
It should be noted that, for a certain node indicated in the first set, at least one child node of the certain node changes within a preset time period, and the node itself may or may not change within the preset time period (for example, node 9 in fig. 4).
Illustratively, FIG. 4 is a schematic illustration of a graphical representation of an exemplary data set of the present application. The set of data 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 the node.
At a certain time T1, the folders/files may have changed relative to a certain time T0 before. For example, files/folders are renamed, the contents of files are modified, new files/folders have been added, or certain files/folders of the original have been 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. And the data corresponding to the node 0, the node 1, the node 2, the node 4, the node 7, the node 8, the node 12, the node 13, the node 14, the node 15 and other nodes not marked with ID are not changed in the time period of T0-T1.
The first target set includes information for all nodes shown in fig. 4 except for the deleted nodes (i.e., node 5, node 6). Information of the node satisfying the condition can be found out according to whether the UPDATE _ TIME of each node belongs to [ T0, T1 ]. If T1 takes the current TIME, then UPDATE _ TIME > T0 may also be used as the lookup condition. And identifying the searched nodes as elements in the first set list0, wherein the elements in the first set list0 include: 2,4,8,9.
It should be understood that in some cases, the first set may be empty, such as when there is a root node, when only data corresponding to the root node is modified within a preset time period, or when all data in the first data set has not changed within the preset time period.
S102: the first electronic device determines a second set from the first target set, the second set comprising: in the first target set, the node identifiers of all nodes of which the time when the node changes last is within a preset time period.
The main purpose of determining the second set is to find out the nodes with the characteristics that the nodes corresponding to the data changed (not including deletion) in the preset time period. It should be noted that, for data deleted within a preset time period, information of a corresponding node does not exist in the first target set at present, and therefore, information of the nodes is not included in the second set accordingly.
For the node indicated by the node identifier in the second set, the corresponding data is necessarily changed, and thus the node identifier of the parent node is necessarily in the first set. Of course, when the node identifier of the root node is included in the second set, the node identifier of its corresponding parent node is absent in the first set because the root node does not have a parent node.
The second set may only include node identifiers of nodes having the above characteristics, and may also include other information, such as a corresponding parent node identifier, a time when a child node has changed last time, a time when a node has changed last time, a node status, and the like. 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 small, including only the node identification. The second set may further include data corresponding to the node, so that a subsequent second electronic device may update the data corresponding to the node identification in the second set. When the second set does not include data corresponding to the nodes, the first electronic device may further send data corresponding to the nodes indicated by all the node identifiers in the second set to the second electronic device separately or together with the second set.
Following the example of fig. 4, information of nodes satisfying this condition can be found according to whether the modified _ TIME of each node belongs to [ T0, T1 ]. If T1 takes the current TIME, then MODIFY _ TIME > T0 may also be used as the search condition. And identifying the searched nodes as elements in the second set list1, wherein the elements in the second set list1 include: 3,9,10,11.
It will be appreciated that in some cases, the second set may be empty, for example, if all changes to the data within a predetermined time period are deleted, or if all data in the first set of data have not changed within a predetermined time period.
S103: the first electronic device determines a third set from the first target set according to the first set, the third set comprising: in the first target set, the parent node identifies the node identifications of all nodes belonging to the first set.
The main purpose of determining the third set is to find out nodes having a characteristic that a next-level child node of a parent node of a node corresponding to data that has changed within a preset time period, i.e., a node corresponding to data that has changed within the preset time period (excluding a node corresponding to deleted data) and siblings thereof.
It can be seen that, in general, node identifications in the second set are also in the third set, while node identifications 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 and the first set does not have a node identifier of its corresponding parent node, when the third set is determined according to the first set, the determined third set does not include the node identifier of the root node.
It should be noted that, for data deleted within the preset time period, information of a corresponding node does not exist in the first target set at present, and therefore, information of the nodes is not included in the third set accordingly.
It should be noted that, the data corresponding to the sibling node in the next-level child node may or may not be changed within a preset time period. If data corresponding to a certain sibling node is deleted within a preset time period, the information of the sibling node does not exist in the first target set at present, and therefore the third set correspondingly does not contain the information of the sibling node.
The third set may only include node identifiers of nodes having the above characteristics, or may further include other information, such as a corresponding parent node identifier, a time when a child node has changed last time, a time when a node has changed last time, a node status, and the like. 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.
Following the example of fig. 4, the information of the node with which the part _ ID matches, i.e. the information of node 3, node 7, node 9, node 12, node 10, node 11, is found in the first target set based on the node identifiers [2,4,8,9] in the first target set. And identifying the searched node as an element in the third set list2, wherein the element in the third set list2 includes: 3,7,9,12,10,11.
It is understood that in some cases, the second set may be empty. For example, when there is a root node and only data corresponding to the root node changes within a preset time period, or when data changes within the preset time period are all deleted and data corresponding to a sibling node of the node corresponding to the deleted data is also all deleted within the preset time period, or when the former two cases are combined, or when all data in the first data set does not change 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, and the third set to the second electronic device in a direct or indirect manner. The first electronic device may transmit the first set, the second set, and the third set to the second electronic device, respectively, or may transmit them together, for example, the three sets are packed into a whole and transmitted to the second electronic device. When the first electronic device transmits the sets at least twice, the transmission mode may be the same or different. This is not a limitation of the present application.
After the second electronic device receives the three sets, the data local to the second electronic device can be updated using the three sets.
It should be understood that in most cases, none of the first, second, and third sets are empty sets, but in few cases, some or all of the sets may be empty sets.
For example, when a root node exists in the nodes indicated by the first target set, only data corresponding to the root node changes, and the change is not deletion, both the first set and the third set are empty sets, and the second set is not an empty set.
For another example, when the data corresponding to the node indicated by the first target set is only 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 generally not an empty set as long as it is not the root node that is deleted. For the deleted nodes, if the data corresponding to any node is deleted and the data corresponding to the sibling nodes are also all deleted, the third set is an empty set; and if the data corresponding to a certain node is deleted and the data corresponding to the brother node is not completely deleted, the third set is not an empty set. If the deleted node is the root node, it may be considered that the entire first target set does not contain any node information, that is, the first data set is deleted, and at this time, the first electronic device does not need to synchronize the data to the second electronic device, and it may notify the second electronic device that all the data have been deleted.
Of course, if no data changes within a preset time period, the first set, the second set, and the third set are all empty sets, respectively.
It should also be understood that the various sets in the embodiments of the present application may be represented in different specific forms, such as lists, arrays, linked lists, etc., when in actual use. The specific form thereof does not substantially affect the achievement of the main advantageous effects of the embodiments of the present application, and therefore the present application is not limited to the specific form thereof. The schematic diagrams of the graphical representations of fig. 2 and 4 are presented as tree structures, which are only used as an example to illustrate the present application and do not constitute a limitation to the present application.
Optionally, when 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 is deleted, and accordingly, update the data on the second electronic device with a different policy.
For convenience of description, a node corresponding to deleted data in the first data set is hereinafter referred to as a second node, and a parent node of the second node is hereinafter referred to as a first node. When the data is deleted, the information of the second node is correspondingly deleted, and the 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, similar to the case where the data corresponding to the second node is deleted, if the data corresponding to the first node is also deleted within the preset time period, but the data corresponding to the parent node of the first node is not deleted, when the first set is determined from the first target set, the first set naturally 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, wherein the second target set comprises information of at least one node, and the information of each node comprises: node identification, parent node identification, and node status.
The second set of targets is local to the second electronic device and includes information for nodes corresponding to data local to the second electronic device. The information included therein can refer to the related description above, and is not described herein again.
The second electronic device may determine the second set of targets by itself or in response to some operation. For example, in a scenario where the user wishes to synchronize their own data periodically or at a specific time, the second electronic device may determine the data set targeted by the update and determine the corresponding second target set when the periodically synchronized time or the specific time is reached. For another example, when the user logs in an app such as a cloud disk on the second electronic device, the second electronic device may automatically determine, as a data set for which the update is performed, data belonging to the user or data that the user has authority to operate (for example, view, edit, and the like) in response to the login of the user, 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 an instruction from the first electronic device, or may determine the second target set and notify the second target set to the first electronic device, so that the first electronic device can determine the corresponding first target set according to the second target set. That is, the present application does not limit the determined order of the first target set and the second target set as long as the two target sets are corresponding to each other. For example, the second electronic device may determine a second set of targets in response to an indication from the user, and then send a request to the first electronic device that the data needs to be updated. The first electronic device determines a first target set corresponding to the second target set, and then determines a first set, a second set, a third set and the like based on the first target set.
Since the data set on the second electronic device corresponds to the data set on the first electronic device, the two should be identical after the last synchronization, and thus the example of fig. 4 is still followed. The second target set includes information for nodes 0-15 shown in FIG. 4 as well as 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 respectively corresponding to the second target set.
For the first set, the second set, and the third set, reference may be made to the related description above, and details are not repeated here. Since the second target set corresponds to the first target set, and the first set, the second set, and the third set are determined based on the first target set, the first set, the second set, and the third set also correspond to the second target set.
S107: and the second electronic equipment updates the node state of the deleted node in the second target set by using the parent node identification and the node identification 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 present update is intended. For the preset time period, reference is made to the related description above, and details are not repeated here.
As described above, for data that has been deleted on the first electronic device within the preset time period (i.e., deleted data), the information of the corresponding node does not exist in the first target set, and therefore the information of the node is not included in the second set accordingly. 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 has been deleted on the first electronic device but has not been deleted on the second electronic device.
The deleted node may be determined using the parent node identification and the node identification in the first set, the third set, and the second target set. And the data corresponding to the deleted node is deleted on the first electronic equipment, and is not deleted on the second electronic equipment. The second electronic device updates the node status of the deleted nodes, and synchronizes the deleted data with the first electronic device. The node status of the deleted node is different before and after the update, for example, the node status may be active before the update and inactive after the update. That is, the updated node status 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, the parent node identification of the deleted node is the same as at least one parent node identification in the second target set; its parent node identity is also the same as one of the node identities in the first set. Meanwhile, for the deleted node, the node identifier of the deleted node is the same as that of one node in the second target set, but is different from that of any node in the third set. That is, the parent node identification of the deleted node exists in both the first set and the second target set, and the node identification of the deleted node also exists in the second target set but does not exist in the third set.
Based on the characteristics of the deleted node, there may be many different implementations to determine the deleted node and update its node status. 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 in an inactive state;
s1072: and updating the node state of the third class node in the second target set into an activated state.
The first type of node refers to a node having the following characteristics: its parent node identification is in the second target set and is the same as one node identification in the first set. And updating the node states of the first type nodes to be in an inactive state.
The third type of node refers to a node having the following characteristics: its node identity is in the second target set and is the same as one node identity in the third set. And updating the node states of the third-class nodes to be activated states.
To illustrate along the example of fig. 4, it is assumed that the original node states of the nodes marked with the node IDs on the second electronic device are all active states (active).
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. And respectively updating the node states of the first-class nodes in the second target set 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. And respectively updating the node states of the third type nodes in the second target set to be activated states (active).
Through the above steps, the states of the nodes are as follows:
the active of the node 3 is set to,
the node 5 is a node that is active,
the active of the node 7 is the node,
the active of the node 9 is set to,
the active of the node 12 is the node,
the active of the node 10 is set to,
node 11 active.
Therefore, the second electronic device can determine that the node 5 is a deleted node, and the data corresponding to the node 5 and all nodes (nodes 6) therebelow are deleted on the first electronic device within the preset time period.
It should be noted that the second electronic device may uniformly update the node state of the first type node first and then update the node state of the third type node, or may update the node states of the first type node one by one with a single node as a target, which is not limited in this application.
In other implementation manners, in a case that the first electronic device marks a specific mark (for example, the foregoing first mark) for a node corresponding to the deleted data, the second electronic device may correspondingly update the node according to a condition that whether the node mark has the corresponding specific mark, so as to further shorten time required for synchronization and reduce occupation of resources of the second electronic device.
For a certain node identifier in the first set, if it has a corresponding specific mark, it indicates that, on the first electronic device, at least one of all child nodes of the node indicated by the node identifier is deleted within a preset time period. In this case, the second electronic device may determine the deleted node by using a method similar to that in the previous implementation, and then update the deleted node by using the data corresponding to the corresponding node in the second set. The following description will take an identifier of a node in the first set (hereinafter referred to as a node identifier of the third node) as an example.
Illustratively, the step of S107 may include:
s1073: under the condition that the node identification of the third node has the corresponding first mark, the node state of the fourth node in the second target set is updated to be in an inactive state;
s1074: and under the condition that the node identification of the fourth node is the same as one node identification in the third set, updating the node state of the fourth node in the second target set to be an activated state.
It will be appreciated that in the case where the node identity of the third node has a corresponding first label, it may be the node identity of the first node as described above.
The fourth node here refers to a node having the following characteristics: the parent node identification of the node is the same as the node identification of the third node. That is, the fourth node is a child node of a 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. And updating the state of the point nodes to be in an inactive state.
Following the example of fig. 4, for node 4 in the first set list0, it is assumed to carry a first identity.
First, the second electronic device marks the node status of all next-level child nodes (i.e., fourth nodes) of the node 4 as inactive. At this time, the states of the node 5 and the node 7 are inactive.
Then, the second electronic device determines that the parent node is the node of the node 4 from the third set list2 (in this case, the list2 also needs to include information of the parent node ID corresponding to the node ID), and updates the node status of these nodes to active. Alternatively, the second electronic device searches for a node ID that is the same as the ID of the node 5 or 7 from the third set list2 (in this case, the list2 may not include information of the parent node ID), and updates the node status of these nodes to active. With any operation, the node states of the next-level child nodes of the node 4 in the final second target set are all as follows:
the node 5 is a node that is active,
node 7 active.
It can be seen that the data corresponding to the node 5 and all the nodes below it (node 6) have been deleted on the first electronic device within the preset time period.
And if one node identifier in the third set is the same as the node identifier of a certain fourth node, which indicates that the fourth node is not deleted, updating the node state of the fourth node to be the activated state. If none of the node identifiers in the third set is the same as the node identifier of the fourth node, which indicates that the fourth node has been deleted, the node status of the fourth node remains in the previous state, i.e., the inactive state.
For a certain node identifier in the first set, if it 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 the data corresponding to the corresponding node in the second set without updating the node state. Namely, the method may further comprise:
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: and the second electronic equipment updates the data corresponding to the second type of node.
The second type of node refers to a node having the following characteristics: its node identity is in the second target set and is the same as one of the node identities in the second set.
As mentioned above, the second set may only include node identifiers of the nodes with the above characteristics, or may further include other information, such as data corresponding to the nodes. When the second set does not include data corresponding to the node, the first electronic device may further send data corresponding to the nodes indicated by all the node identifiers in the second set to the second electronic device separately or together with the second set, so that the second electronic device may update the data corresponding to the second type of node.
Following the example of fig. 4, the second set list1 includes: 3,9,10,11.
The second electronic device may determine that the second type of node 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.
The method 1 needs to transmit and update data of all nodes under the root node; with method 2, it is necessary to transmit and update data of all nodes under node 2 and node 4, as shown in fig. 6. In contrast, with 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 type of node to the second electronic device, and only the second type of node that actually needs to update the data is needed. This not only reduces the amount of data that needs to be transmitted during data synchronization, but also occupies relatively less resources for the first electronic device and the second electronic device, and overall, the time required for synchronization is relatively shorter.
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 equipment updates the following information of the second type of nodes in the second target set: the time when the node last changed. In another implementation, the method may further include: the second electronic device updates the following information of the parent node of the second class node in the second target set: the time when the child node last changed.
It should be understood that, for the information of the second type node and the information of the parent node of the second type node, only one of the two types of nodes may be updated, or both of the two types of nodes may be updated, and the application is not limited thereto.
Optionally, the second electronic device may also clean up data corresponding to those nodes of the second electronic device that have been deleted on the first electronic device. For example, in one implementation, the second electronic device deletes data corresponding to the nodes and their child nodes in the second target set, where the node status is inactive.
It should be noted that, in some implementations, when the second electronic device updates data, it does not clean data that should be deleted; when the second electronic equipment cleans the data which should be deleted, the second electronic equipment does not perform the data updating operation; namely, the two processes are not performed simultaneously, so that the occupation of the local resource of the second electronic equipment in the same or almost the same time period is reduced, and the use experience of the user is prevented from being influenced as much as possible.
Optionally, the second electronic device may clean the data periodically or at idle time, so as to reduce occupation of local resources of the second electronic device. The idle time mainly refers to the operating state of the second electronic device. When some preset conditions are met, whether the second electronic device is idle can be judged. For example, the determination may be made according to the occupation amount of a CPU, a memory, a disk, or the like, or the number of running processes, or the like, of the second electronic device at a certain time or in a certain time period.
The embodiment of the application also provides a second data updating method. The method is mainly different from the first method in that the first method only updates the information or data of the nodes which are changed, and the method may update a part of the nodes which are not changed besides the information or data of the nodes which are changed. However, the method does not need to be updated for nodes that have no change in another part. Therefore, compared with the method of the mode 2 that all the child nodes below the parent node need to be updated, the method can still update less nodes with unchanged parts, thereby reducing the occupation of server and terminal resources, reducing the data transmission amount and shortening the synchronization time.
Referring to fig. 7, fig. 7 is a flowchart illustrating a second data updating method according to an embodiment of the present application. The data updating method may include the following steps of S201 to S207. Some steps of the method may be implemented by a first electronic device, and other steps may be implemented by a second electronic device.
S201: the first electronic device determines a first set from a first target set.
S202: the first electronic device determines a third set from the first target set 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 above 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 foregoing steps S101, S103, and S104, which are not described herein again.
Compared with the first method, by adopting the scheme, the first electronic device does not need to determine the second set, 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 only include the node identifier, or may also 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 in the following, which is not limited in this application. When the third set does not include 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 separately or together with the third set.
S204: the second electronic device determines a second target set, wherein the second target set comprises information of at least one node, and the information of each node comprises: 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, the first set and the third set respectively corresponding 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 parent node identification and the node identification in the first set, the third set and the second target set.
Regarding the above steps, including the second target set, the information of the node, the deleted node, the updated node state, and the implementation manner of each step, reference may be made to the related descriptions of the foregoing steps S105 to S107, which are not described herein again.
S207: and the second electronic equipment updates the data corresponding to the third type node.
And the node identification of the third type node in the second target set is the same as one node identification in the third set.
The third kind of nodes in this step may refer to the related description in the foregoing step S107. And updating the data corresponding to the third class of nodes, which is similar to the data corresponding to the second class of nodes.
It should be noted that, the step S206 and the step S207 may be executed together, sequentially, or alternately, and this is not limited in this application. For example, the second electronic device may update all node states of the first type of node to the inactive state, and then update data corresponding to the third type of node and update a node state corresponding to the third type of node to the active state.
Still referring to fig. 4 as an example, the first set, the third set, and the like are the same as those of the previous embodiment. The original node states of the nodes marked with the node IDs on the second electronic equipment are assumed to be active states (active).
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. And respectively updating the node states of the first-class nodes in the second target set 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 to be activated states (active).
Through the above steps, the states of the nodes are as follows:
the active of the node 3 is set to,
the node 5 is a node that is active,
the active of the node 7 is the node,
the active of the node 9 is set to,
the active of the node 12 is the node,
the active of the node 10 is set to,
node 11 active.
The final state of the node is the same as in the previous example. The difference is that nodes 7, 12 are unchanged nodes, and do not need to be updated in the first method, but are updated in the present scheme. Compared with the foregoing method 2, with this scheme, it is not necessary to update the node 13, the node 14, and the node 15, as shown in fig. 8. Therefore, the number of the nodes needing to be updated can be reduced to a certain extent by adopting the scheme, the occupation of the first electronic equipment and the second electronic equipment is reduced, the data transmission quantity is reduced, and the time for updating the synchronous vehicle is shortened.
By using the updating method provided by the application, on one hand, the information of the node stored in the first electronic device includes several parameters, such as UPDATE _ TIME, MODIFY _ TIME, and the like, and is used for respectively recording the last TIME when the data corresponding to the child node changes and the last TIME when the data corresponding to the node changes. In this way, when data synchronization is required between the first electronic device and the second electronic device, the first electronic device may set a search condition by using UPDATE _ TIME and MODIFY _ TIME, and search for a corresponding set (the first set list0, the third set list2, and possibly the second set list1), so as to screen out a parent node and a sibling node of a node that has a change, and transmit the screened parent node and sibling node to the second electronic device. After receiving the sets, the second electronic device may determine the deleted node by using the parameters of the sets and the node states, and update other nodes which generate changes, so as to accurately synchronize the changed data 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 changed node and its parent, the nodes involved in the set screened by the first electronic device also relate only to the parent, sibling and itself of the changed node. This allows the second electronic device to be updated with a major focus on the parent, sibling and itself of the changed node, without involving too many nodes that have not changed, throughout the data update process. Therefore, by adopting the scheme, the resource occupation of the first electronic device and the second electronic device can be reduced while the data is accurately updated, the data volume required to be transmitted to the second electronic device by the first electronic device in the updating process is reduced, the time required by 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, a 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 method is mainly different from the first two methods in that the first electronic device can screen information of nodes meeting conditions of UPDATE _ TIME, MODIFY _ TIME and the like, send the information to the second electronic device as a whole, determine the first set and the third set (including the second set in some cases) by the second electronic device, and UPDATE data on the second electronic device. In some application scenarios, the method may relieve the first electronic device (e.g., the server) to some extent.
Referring to fig. 9, fig. 9 is a schematic flowchart of a third data updating method according to the embodiment of the present application. The method may include all or part of the following steps S501 to S508.
S501: the first electronic device determines a fourth set from the first target set, the fourth set comprising: the node identification of the fourth type node, the corresponding time and the node identification of the sixth type node.
The fourth type of nodes are all nodes in a preset time period when the time of the last change of the child nodes in the first target set is within the preset time period, and the sixth type of nodes are all nodes of which the father node identifications belong to the fourth type of nodes in the first target set.
With respect to all nodes in the first target set, which have a time when the child node changes last time within a preset time period, reference may be made to the related or similar description in the foregoing step S101; the parent node identifies all nodes belonging to the fourth class of nodes in the first target set, and reference may be made to the related or similar description in the foregoing step S103; and will not be described in detail herein.
Illustratively, still taking fig. 4 as an example, in one implementation, the determined fourth set 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 MODIFY _ TIME. Which parameter is used in the screening, the parameter value corresponding to the ID is placed at the corresponding position, so that after the second electronic device receives such a fourth set, the first set and the third set similar to those in the first method can be re-analyzed.
It should be understood that for the parameters that are not involved, the parameter values at the corresponding positions may be null, such as the second and fourth parts of the first 4 elements being null, and the third and fourth parts of the last 5 elements being null in the previous example. It should also be understood that some of the elements in the fourth set may only contain node identifications, as long as they are resolvable by the second electronic device, and need not contain corresponding parameter values. E.g. the last 5 elements in the previous example, which may carry only the node identity. Even if the second electronic device does not carry the corresponding PARENT node identifier part _ ID, the second electronic device can distinguish which type the screened node identifier belongs to according to whether the parameter values at different positions are null.
It should be further understood that, for the same point node ID screened by using different screening conditions, the parameter values of the corresponding parameters may be represented together in one element, or may be represented as multiple 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 as the aforementioned second method. Optionally, when the data is updated by using a similar idea of the foregoing first method, the fourth set may further include: and the node identification of the fifth type node and the corresponding time. And the fifth type of nodes are all nodes in the first target set, wherein the time of the last change of the nodes is within a preset time period.
Illustratively, still taking fig. 4 as an example, in one implementation, the determined fourth set 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 manner, the UPDATE _ TIME, the MODIFY _ TIME, and the conditions such as determining child nodes according to the nodes screened by the UPDATE _ TIME may be 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 in a direct or indirect manner. After receiving the fourth set, the second electronic device may determine the first set and the third set similar to the foregoing method, and if necessary, the second set, and update data local to the second electronic device using these sets.
S503: the second electronic device determines a second target set, wherein the second target set comprises information of at least one node, and the information of each node comprises: node identification, parent node identification, and node status.
For this step, reference may be made to the related description of step S105 in the foregoing embodiment, which is not described herein again.
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 objects corresponds to the first set of objects and the fourth set is determined based on the first set of objects, the fourth set also corresponds to the second set of objects.
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 agree in advance on the parameters represented by the components in each element of the fourth set. Thus, the second electronic device may query whether there is a qualified element from the corresponding position 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 the foregoing step S401,
each element in the pre-agreed fourth set comprises four parts, respectively node ID, part _ ID, UPDATE _ TIME, MODIFY _ TIME, each part being comma-separated. After receiving the fourth set in the foregoing example, the second electronic device may filter out the node IDs in the eligible elements to form a first set, on condition that whether the time point of the third portion is within a preset time period; if the time point of the fourth part is within the preset time period, screening out the node IDs in the elements meeting the condition to form a second set; the third set may be formed by filtering out the content of the second part of the elements that is not empty and belongs to the first set, conditioned on 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 related description above, and details are not repeated here.
The second electronic device may update the local data with the first set and the third set when there is no second set, and with the three sets when there is a second set. These two types of implementations can be referred to the related description of the first and second embodiments described above.
In one implementation, the method further includes:
s506: and the second electronic equipment updates the node state of the deleted node in the second target set by using the parent node identification and the node identification in the first set, the third set and the second target set.
S507: and the second electronic equipment updates the data corresponding to the second type of node. The second type of node refers to a node having the following characteristics: its node identity is in the second target set and is the same as one of the node identities in the second set. Or, S508: and the second electronic equipment updates the data corresponding to the third type node. The third type of node refers to a node having the following characteristics: its node identity 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 related descriptions in steps S107 to S108 and S206 to S207, and are not described herein again.
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 therein. The method may include the following steps of S301 to S304.
S301: storing information of at least one node corresponding to each of the at least one data, the information of each node including: the node identification, the parent node identification, the time when the child node has changed last time, and the time when the node has changed last time.
With respect to the relationship between data and nodes, the relationship between data and information of nodes, various information of nodes, and exemplary implementation manners, reference may be made to the related description above. It should be understood that the information of a node may also include the node status, the node name, the corresponding data, etc.
S302: when data corresponding to a fifth node changes except for being deleted, updating the following information of the fifth node based on the time of the change: the time when 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 data corresponding to a node changes, such as adding, renaming, modifying, and the like, the MODIFY _ TIME of the node is updated, and the TIME when the data corresponding to the node changes is recorded. When the data corresponding to a node is deleted, the information of the node is correspondingly deleted.
S304: under the condition that data corresponding to the fifth node changes, updating the following information of a parent node of the fifth node based on the time of the change: the time when the child node last changed.
When data corresponding to a node changes, whether the data is deleted, such as addition, deletion, renaming, modification, etc., the UPDATE _ TIME of the parent node is updated, and the TIME when the data corresponding to the node changes is recorded.
The steps and the descriptions related to the storage, update, etc. of the information about the nodes can be referred to and combined with each other as long as they are not contradictory, and are not described herein again.
By adopting the scheme, the first electronic equipment introduces several parameters such as UPDATE _ TIME, MODIFY _ TIME and the like when storing the information of the node, thereby providing a basis for implementing the data updating method.
Optionally, the method may further include:
s305: and in the case that the data corresponding to the fifth node is deleted, adding the following information of the parent node of the fifth node: a first identification.
When the data corresponding to the fifth node is deleted, the information of the fifth node is correspondingly deleted, and at this TIME, in addition to updating UPDATE _ TIME of the parent node of the fifth node, the first identifier may be added to the parent node. It is to be understood that the first identifier may be added as information of the node of the parent node, or may be marked in other possible ways.
Referring to fig. 10, an embodiment of the present application further provides an electronic device, where the electronic device 400 may 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 foregoing implementations.
An embodiment of the present application further provides an electronic device, where the electronic device may include:
a memory configured to store predetermined computer instructions;
and the processor is configured to execute the predetermined computer instructions to implement part or all of the steps implemented by the first electronic device in any one of the foregoing implementation modes. 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 storage method.
As will be appreciated by one skilled in the art, 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 in the medium. That is, in an embodiment of the present application, a computer-readable storage medium is further provided, where a computer program is stored, and when the computer program is executed by a processor, the processor is caused to perform some or all of the steps implemented by the first electronic device or the second electronic device in any of the foregoing implementation manners. Of course, in some cases, the storage medium may also store computer programs executed by two electronic devices.
When implemented in software, the 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 implementation. 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, a division of elements into only one logical division may be implemented in practice in another manner, such as multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not implemented.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. A person skilled in the art can select some or all of the units according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into 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 portions of the technical solutions of the present application that contribute to the prior art, or the portions of the technical solutions, may be embodied in the form of software products. 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) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In addition, the embodiment of the application also discloses another data updating method aiming at other possible application scenes.
As mentioned above, for some application scenarios, when some data needs to be deleted, the first electronic device (e.g. the server) may not be deleted immediately but may remain for a while. For example, when a certain data needs to be deleted, in a case that the information of the node does not include the 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. Further illustratively, in a case where the information of the node includes the specific content of the data, the first electronic device may delete only a part of the content in the information of the node, for example, delete only the part including the specific content of the data, and leave the other information of the node for a while. Of course, the first electronic device may also retain all information of the node for a period of time.
In addition, the first electronic device may mark the deleted data for resolution. Illustratively, the first electronic device may add a flag to the node information to indicate whether the node information has been deleted. For another example, the first electronic device may also mark, with the node state in the node information, whether data corresponding to the node is deleted, such as modifying the node state that is originally in the active state into 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 changes last, and the time when the child node changes last.
Then, since all the node information is temporarily retained on the first electronic device, when the second electronic device synchronizes data, the first electronic device may determine the node IDs corresponding to the data that have been deleted within the preset time period and the node IDs corresponding to the data that have been changed except for deletion, directly according to the time when the node/child node has been changed last time and whether the node status of the node indicates that the corresponding data have been deleted (for example, whether the node status is in an inactive state). And then the node IDs are sent to the second electronic equipment so that the second electronic equipment can update data to synchronize with the first electronic equipment.
For example, the first electronic device may determine the node IDs corresponding to the data that have been deleted within the preset time period directly according to whether the time when the node has changed last is within the preset time period and whether the node state of the node is in an inactive state.
For another example, the first electronic device may also find all the child nodes of the child nodes according to whether the time when the child nodes have changed last is within a preset time period, and then screen out the part of the child nodes of all the child nodes whose node states indicate that the corresponding data has been deleted.
Therefore, the second electronic device can directly mark the node states corresponding to the node IDs in the second target set as the inactive states locally.
The first electronic device further needs to send the node ID corresponding to the data that has changed in the preset time period except for deletion, and the changed data to the second electronic device together, 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 transmit the information to the second electronic device, and the information may be transmitted together as a whole or separately.
Compared with the method 1 or the method 2, the method can also reduce the resource occupation of the interactive equipment involved in the data updating, reduce the data volume to be transmitted, shorten the time required by the updating process and improve the user experience.
It should be understood that, in the various embodiments of the present application, the execution sequence of each step should be determined by its function and inherent logic, and the size of the sequence number of each step does not mean the execution sequence, and does not set any limit to the implementation process of the embodiments. For example, the step S101 and the step S102 may be performed simultaneously or 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 also be understood that, for the convenience of clearly describing the technical solutions of the embodiments of the present application, the words "first", "second", and the like are used in the embodiments of the present application to distinguish the same or similar items with basically the same functions and actions or the concepts with certain differences. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
The same and similar parts in the various embodiments of the present specification may be referred to each other. Different embodiments may be combined with each other as long as there is no logical contradiction.

Claims (14)

1. A data updating method applied to a second electronic device is characterized by comprising the following steps:
determining a second target set, wherein the second target set comprises information of at least one node, and the information of each node comprises: 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 and the third set respectively corresponding to the second target set;
updating the node state of the deleted node in the second target set by using the parent node identifier and the node identifier in the first set, the third set and the second target set, wherein data corresponding to the deleted node is deleted on the first electronic device;
and updating data corresponding to a second class of nodes, wherein the node identification of the second class of nodes in the second target set is the same as one node identification in the second set.
2. The method of claim 1, wherein the parent node identity of the deleted node is the same as at least one parent node identity in the second target set, and is the same as one node identity in the first set; and the node identifier of the deleted node is the same as one node identifier in the second target set and is different from any node identifier in the third set.
3. The method of claim 1 or 2, wherein updating the node status of the deleted node in the second target set using the parent node identifiers and the node identifiers 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 in an inactive state; wherein, the parent node identification of the first kind of node in the second target set is the same as one node identification in the first set;
updating the node state of a third type node in the second target set into an activated state; and the node identification of the third type node in the second target set is the same as one node identification in the third set.
4. The method of any of claims 1-3, wherein updating the node state of the deleted node in the second target set using the parent node identifiers and the node identifiers in the first set, the third set, and the second target set comprises:
under the condition that the node identification of the third node has the corresponding first mark, the node state of the fourth node in the second target set is updated to be in an inactive state; wherein the node identification of the third node is a node identification in the first set; the parent node identification of the fourth node is the same as the node identification of the third node;
and under the condition that the node identification of the fourth node is the same as one node identification in the third set, updating the node state of the fourth node in the second target set to be an activated state.
5. A data updating method applied to a first electronic device is characterized by comprising the following steps:
determining a first set from the first target set; wherein the first target set comprises information of at least one node, and the information of each node comprises: the node identification, the father node identification, the time when the child node changes last time, and the time when the node changes last time; the first set includes: node identifiers of all nodes of which the time when the child node changes last is within a preset time period;
determining a second set from the first target set; wherein the second set comprises: node identifiers of all nodes of which the time when the node changes last is within 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 identifying node identifications of all nodes belonging to the first set;
sending the first set, the second set, and the third set to a second electronic device to enable the second electronic device to update data with the first set, the second set, and the third set.
6. The method of claim 5, wherein the first set further comprises: the data processing method comprises a first identification, wherein the first identification corresponds to a node identification of a first node, and data corresponding to at least one child node of the first node are deleted within a preset time period.
7. A data updating method applied to a second electronic device is characterized by comprising the following steps:
determining a second target set, wherein the second target set comprises information of at least one node, and the information of each node comprises: node identification, father node identification and node status;
receiving a first set and a third set from a first electronic device, the first set and the third set respectively corresponding to the second target set;
updating the node state of the deleted node in the second target set by using the parent node identifier and the node identifier in the first set, the third set and the second target set, wherein data corresponding to the deleted node is deleted on the first electronic device;
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 is characterized by comprising the following steps:
determining a first set from the first target set; wherein the first target set comprises information of at least one node, and the information of each node comprises: the node identification, the father node identification, the time when the child node changes last time, and the time when the node changes last time; the first set includes: node identifiers of all nodes of which the time when the child node changes last 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 identifying node identifications of all nodes belonging to the first set;
sending the first set and the third set to a second electronic device to enable the second electronic device to update data with the first set and the third set.
9. A method for storing information of a node is applied to a first electronic device, and is characterized by comprising the following steps:
storing information of at least one node corresponding to each of the at least one data, the information of each node including: the node identification, the father node identification, the time when the child node changes last time, and the time when the node changes last time;
when data corresponding to a fifth node changes except for being deleted, updating the following information of the fifth node based on the time of the change: the time when the node changes the last time;
deleting the information of the fifth node under the condition that the data corresponding to the fifth node is deleted;
under the condition that data corresponding to the fifth node changes, updating the following information of a parent node of the fifth node based on the time of the change: the time when the child node has changed the last time;
wherein the fifth node is any one of the at least one node.
10. The method of claim 9, further comprising:
adding the following information of a parent node of the fifth node when the data corresponding to the fifth node is deleted: a first identification.
11. A data updating method applied to a second electronic device is characterized by comprising the following steps:
determining a second target set, wherein the second target set comprises information of at least one node, and the information of each node comprises: 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 when the child node changes last is within a preset time period; the third set includes: a parent node identifying node identifications of all nodes belonging to the first set;
updating the node state of the deleted node in the second target set by using the parent node identification and the node identification in the first set, the third set and the second target set;
updating data corresponding to the third class node; wherein the node identifier of the third type node in the second target set is the same as one node identifier in the third set; alternatively, the first and second electrodes may be,
under the condition that a second set is determined from the fourth set, updating data corresponding to a second type of node; wherein the second set comprises: node identifiers of all nodes of which the time when the node changes last is within the preset time period; the node identifier of the second type node in the second target set is the same as one node identifier in the second set.
12. A data updating method applied to a first electronic device is characterized by comprising the following steps:
determining a fourth set from the first target set; wherein the fourth set comprises: node identification of the fourth type node, corresponding time and node identification of the sixth type node; alternatively, the fourth set comprises: the node identification and the corresponding time of the fourth type node, the node identification and the corresponding time of the fifth type node and the node identification of the sixth type node; the fourth type of nodes are all nodes in a preset time period when the time of the last change of the sub-nodes in the first target set is within the preset time period; the sixth class of nodes are all nodes of which the father nodes are fourth class nodes in the first target set; the fifth type of nodes are all nodes in the first target set, wherein the time of the last change of the nodes 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, wherein the computer program, when executed by a processor, causes the processor to perform the method of any one of claims 1 to 4, 7 and 11 or to implement the method of any one of claims 5 to 6, 8,9 to 10 and 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 true CN113934742A (en) 2022-01-14
CN113934742B 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)

Cited By (1)

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

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657170A (en) * 2015-10-28 2017-05-10 阿里巴巴集团控股有限公司 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
CN108737487A (en) * 2018-03-21 2018-11-02 腾讯科技(深圳)有限公司 Method of data synchronization and device, storage medium and electronic device
US20200341674A1 (en) * 2019-04-26 2020-10-29 EMC IP Holding Company LLC Method, device and computer program product for restoring data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657170A (en) * 2015-10-28 2017-05-10 阿里巴巴集团控股有限公司 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
CN108737487A (en) * 2018-03-21 2018-11-02 腾讯科技(深圳)有限公司 Method of data synchronization and device, storage medium and electronic device
US20200341674A1 (en) * 2019-04-26 2020-10-29 EMC IP Holding Company LLC Method, device and computer program product for restoring data

Cited By (2)

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

Also Published As

Publication number Publication date
CN113934742B (en) 2023-07-04

Similar Documents

Publication Publication Date Title
CN107077483B (en) Synchronization of shared folders and files
US7739246B2 (en) System and method of merging contacts
US9400800B2 (en) Data transport by named content synchronization
US9678835B2 (en) Plural architecture master data management
CN108460041B (en) Data processing method and device
US9384246B2 (en) Plural architecture master data management with supplemental attributes
AU2020357554C1 (en) Content item sharing with context
US10855637B2 (en) Architecture for large data management in communication applications through multiple mailboxes
US11265182B2 (en) Messaging to enforce operation serialization for consistency of a distributed data structure
US11663192B2 (en) Identifying and resolving differences between datastores
CN111008521A (en) Method and device for generating wide table and computer storage medium
CN110807028B (en) Method, apparatus and computer program product for managing a storage system
CN111400334A (en) Data processing method, data processing device, storage medium and electronic device
US11868328B2 (en) Multi-record index structure for key-value stores
JP2023539945A (en) External location synchronization
CN113360456A (en) Data archiving method, device, equipment and storage medium
JP2005025362A (en) Device, method and program for controlling data synchronization
CN113934742A (en) Data updating method, node information storage method, electronic device, and medium
US7962453B2 (en) Dynamic redistribution of a distributed memory index when individual nodes have different lookup indexes
US20180293317A1 (en) Prefix matching using distributed tables for storage services compatibility
US10853316B1 (en) File versioning for content stored in a cloud computing environment
CN111767282A (en) MongoDB-based storage system, data insertion method and storage medium
US11960529B2 (en) Restoring integrity of a social media thread from a social network export
CN109508324B (en) Oversized file management method and system based on object storage component
US20050038882A1 (en) Automated eRoom archive tool and method

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