A data processing method and device, electronic equipment and storage medium
By using a hierarchical tree to manage data version numbers between the server and the client, the client only detects the data updates that are actually needed, which solves the problems of high network resource consumption and low detection efficiency in the existing technology and achieves efficient data update detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING 58 INFORMATION TTECH CO LTD
- Filing Date
- 2022-05-26
- Publication Date
- 2026-05-15
AI Technical Summary
When updating parameter information cached on the client side, the existing detection method needs to pull all parameter information from the server, resulting in high network resource consumption and low detection efficiency, especially when the data volume is large, which affects normal business.
A hierarchical tree structure is used to manage data version numbers. The client only obtains the version number of a portion of the data and its cascading relationship. The client detects whether the data has been updated by checking the version number cascading relationship, thereby reducing network interactions and the number of checks.
It improves detection efficiency, saves network resources, is suitable for large data volume scenarios, does not rely on external storage, does not intrude on the client, and has strong dynamic scalability.
Smart Images

Figure CN115113915B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] In actual business operations, clients sometimes need to process online data. When processing online data, they sometimes need to use parameter information from the server. Therefore, clients can retrieve parameter information from the server and then use the parameter information to process the online data.
[0003] Furthermore, the client can cache the retrieved parameter information locally, so that when the parameter information is needed again, the client can directly retrieve the cached parameter information locally instead of retrieving it from the server, thereby improving retrieval efficiency and saving network resources.
[0004] However, sometimes the server updates the parameter information. In such cases, when the client needs to retrieve the parameter information to meet business requirements, it often needs to retrieve the updated parameter information. To improve the efficiency of retrieving parameter information while ensuring that the retrieved parameter information is the updated one as much as possible, the client can cache the updated parameter information on the client side.
[0005] To enable the client to cache updated parameter information, it can detect whether the cached parameter information has been updated on the server. If it has been updated, the client can update the locally cached parameter information to the updated parameter information on the server.
[0006] In one approach to detect whether the parameter information cached on the client has been updated on the server, the client can retrieve all parameter information from the server and then use the retrieved parameter information to check whether the parameter information cached on the client has been updated on the server.
[0007] However, in the above detection method, the client needs to pull all parameter information from the server, which consumes network resources, reduces detection efficiency, and affects normal business operations. It is not suitable for scenarios with large data volumes. Summary of the Invention
[0008] This application discloses a data processing method, apparatus, electronic device, and storage medium to save network resources, improve detection efficiency, reduce the impact on normal business operations, and is applicable to scenarios with large data volumes.
[0009] In a first aspect, this application discloses a data processing method applied to a server. The method includes: obtaining the version number of each data in a dataset containing multiple data in the server; generating a hierarchical tree based on the version number of each data; wherein the hierarchical tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version number of each data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number in the non-bottom-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes, and different version numbers in the non-bottom-level nodes are concatenated with different version numbers in their adjacent lower-level nodes.
[0010] Secondly, this application discloses a data processing method applied to a client, the method comprising: upon obtaining at least a portion of data from a dataset containing multiple data points on a server, sending an acquisition request to the server, the acquisition request being used to request the version number of the at least a portion of the data and the version numbers corresponding to all cascading parent nodes of the at least a portion of the data in a hierarchical tree; receiving the version number of the at least a portion of the data and the version numbers corresponding to all cascading parent nodes of the at least a portion of the data in the hierarchical tree, returned by the server according to the acquisition request; and storing the at least a portion of the data. The hierarchical relationship between the version number of a portion of the data and the version numbers of all parent nodes in the hierarchy tree where the version numbers of the at least portion of the data are concatenated; wherein the hierarchy tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version numbers of each data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number of the non-bottom-level node is concatenated with at least two version numbers of a plurality of version numbers in its adjacent lower-level nodes, and different version numbers of the non-bottom-level nodes are concatenated with different version numbers of its adjacent lower-level nodes.
[0011] Thirdly, this application discloses a data processing method applied to a server. The method includes: receiving a request sent by a client, the request requesting to obtain the version number of at least a portion of data and the version numbers of all parent nodes corresponding to the version numbers of the at least a portion of data in a hierarchical tree, the request being sent by the client after obtaining at least a portion of the data from a dataset containing multiple data points on the server; obtaining the version number of the at least a portion of data and the version numbers of all parent nodes corresponding to the version numbers of the at least a portion of data in the hierarchical tree according to the request; and sending the version number of the at least a portion of data and the version numbers of all parent nodes corresponding to the version numbers of the at least a portion of data in the hierarchical tree to the client. The version numbers of the data are cascaded with the version numbers of all the parent nodes, so that the client can store the hierarchical cascading relationship between the version numbers of at least a portion of the data and the version numbers of all the parent nodes in the hierarchical tree where the version numbers of at least a portion of the data are cascaded; wherein, the hierarchical tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version numbers of each data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number of the non-bottom-level node is cascaded with at least two of the multiple version numbers of its adjacent lower-level nodes, and different version numbers of the non-bottom-level nodes are cascaded with different version numbers of its adjacent lower-level nodes.
[0012] Fourthly, this application discloses a data processing method applied to a client. The method includes: when the client caches at least a portion of data from a dataset containing multiple data on a server, obtaining the hierarchical cascading relationship between the version number of the cached at least a portion of data and the version numbers corresponding to all parent nodes in a hierarchical tree where the version numbers of the at least a portion of data are cascaded; based on the detection order from the version number in the parent node to the version number in the child node in the hierarchical cascading relationship and the hierarchical tree on the server, detecting whether at least one piece of data in the at least a portion of data has been updated on the server; wherein the hierarchical tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version numbers of each piece of data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number in the non-bottom-level nodes is cascaded with at least two of the multiple version numbers in its adjacent child nodes, and different version numbers in the non-bottom-level nodes are cascaded with different version numbers in their adjacent child nodes.
[0013] Fifthly, this application discloses a data processing apparatus applied to a server. The apparatus includes: a first acquisition module for acquiring version numbers of each data item in a dataset containing multiple data items on the server; and a generation module for generating a hierarchical tree based on the version numbers of each data item. The hierarchical tree includes at least two levels of nodes. The lowest-level node in the at least two-level nodes includes the version numbers of each data item in the dataset. The non-lowest-level nodes in the at least two-level nodes include at least one version number. Each version number in a non-lowest-level node is concatenated with at least two version numbers from a plurality of version numbers in its adjacent lower-level nodes, and different version numbers in a non-lowest-level node are concatenated with different version numbers in its adjacent lower-level nodes.
[0014] Sixthly, this application discloses a data processing apparatus applied to a client, the apparatus comprising: a first sending module, configured to send an acquisition request to a server upon acquiring at least a portion of data from a dataset containing multiple data points, the acquisition request being used to request the version number of the at least a portion of the data and the version numbers corresponding to all cascading parent nodes of the at least a portion of the data in a hierarchical tree; a first receiving module, configured to receive, returned by the server according to the acquisition request, the version number of the at least a portion of the data and the version numbers corresponding to all cascading parent nodes of the at least a portion of the data in the hierarchical tree; and storage. A storage module is used to store the hierarchical cascading relationship between the version numbers of the at least part of the data and the version numbers of all the parent nodes in the hierarchical tree that are cascaded with the version numbers of the at least part of the data; wherein the hierarchical tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version numbers of each data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number of the non-bottom-level node is cascaded with at least two version numbers of the multiple version numbers of its adjacent lower-level nodes, and different version numbers of the non-bottom-level nodes are cascaded with different version numbers of its adjacent lower-level nodes.
[0015] Seventhly, this application discloses a data processing apparatus applied to a server, the apparatus comprising: a second receiving module, configured to receive an acquisition request sent by a client, the acquisition request being for requesting the version number of at least a portion of data and the version numbers corresponding to all parent nodes cascading the version numbers of the at least a portion of data in a hierarchical tree, the acquisition request being sent by the client after acquiring the at least a portion of data from a dataset containing multiple data items on the server; a fifth acquisition module, configured to acquire the version number of the at least a portion of data and the version numbers corresponding to all parent nodes cascading the version numbers of the at least a portion of data in the hierarchical tree according to the acquisition request; and a second sending module, configured to send the version number of the at least a portion of data and the version numbers corresponding to all parent nodes cascading the version numbers of the at least a portion of data to the client. The version numbers of all parent nodes of the at least partial data in the hierarchical tree are concatenated, so that the client can store the hierarchical relationship between the version numbers of the at least partial data and the version numbers of all parent nodes of the at least partial data in the hierarchical tree; wherein, the hierarchical tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version numbers of each data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number of the non-bottom-level node is concatenated with at least two version numbers of a plurality of version numbers in its adjacent lower-level nodes, and different version numbers of the non-bottom-level nodes are concatenated with different version numbers of its adjacent lower-level nodes.
[0016] Eighthly, this application discloses a data processing apparatus applied to a client, the apparatus comprising: a sixth acquisition module, configured to, when the client caches at least a portion of data from a dataset containing multiple data on a server, acquire a hierarchical cascading relationship between the version number of the cached at least a portion of the data and the version numbers corresponding to all parent nodes in a hierarchical tree where the version numbers of the at least a portion of the data are cascaded; and a detection module, configured to, based on the detection order from the version number in the parent node to the version number in the child node in the hierarchical cascading relationship and the hierarchical tree on the server, detect whether at least one piece of data in the at least a portion of the data has been updated on the server; wherein the hierarchical tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version numbers of each piece of data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number in the non-bottom-level nodes is cascaded with at least two of the multiple version numbers in its adjacent child nodes, and different version numbers in the non-bottom-level nodes are cascaded with different version numbers in their adjacent child nodes.
[0017] Ninthly, this application discloses an electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform a data processing method as described in any of the preceding aspects.
[0018] In a tenth aspect, this application discloses a non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the data processing method as described in any of the preceding aspects.
[0019] Eleventhly, this application discloses a computer program product in which, when the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to perform the data processing method as described in any of the preceding aspects.
[0020] The technical solution provided in this application may include the following beneficial effects:
[0021] In this application, when the client caches at least a portion of data from a dataset containing multiple data points on the server, the application obtains the hierarchical relationship between the version number of the cached data and the version numbers of all parent nodes in the hierarchical tree that cascade the version numbers of the cached data. Based on the detection order from the version number in the parent node to the version number in the child node within this hierarchical relationship and the hierarchical tree on the server, the application detects whether at least one piece of data in the cached data has been updated on the server.
[0022] This application enables clients to detect whether at least a portion of the data in their cached dataset (data that the client may actually need to use) has been updated on the server, without needing to detect whether other data in the dataset has been updated on the server. In other words, clients can only detect whether the data that the client may actually need to use has been updated on the server, while not needing to detect whether the data that the client may not actually use has been updated on the server. This reduces the amount of data to be detected (reducing the number of times version numbers need to be compared), thereby improving detection efficiency.
[0023] Furthermore, in the process of "detecting whether at least one piece of data of at least some data has been updated in the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship between the version number of at least some data and the version number of all the upper-level nodes corresponding to the version number of at least some data in the hierarchical tree, and the hierarchical tree in the server", the updated lower-level version number of the cascaded data can be determined in each level of the node.
[0024] The updated version number in a cascaded configuration may have its data updated on the server side, while the unupdated version number in a cascaded configuration often does not have its data updated on the server side.
[0025] Therefore, instead of detecting updated data on the server based on the cascading, unupdated lower-level version numbers, we can detect updated data on the server based solely on the cascading, updated lower-level version numbers. This further reduces the amount of data to be detected (reducing the number of version number comparisons required), thereby further improving detection efficiency.
[0026] Secondly, in the process of detecting whether at least some of the data in the client-cached dataset has been updated on the server, the client and server interact with the data version number, not the data itself. The space occupied by the data version number is smaller than that occupied by the data itself, and the time required for the data version number to be transmitted is smaller than that required for the data itself to be transmitted, thereby saving network resources and improving detection efficiency.
[0027] It should be noted that the more data in the dataset of this application, the more significant the effect of this application in saving network resources and improving detection efficiency will be.
[0028] The hierarchical tree approach can support larger data volumes in the server-side dataset and can dynamically expand the hierarchical tree. Each additional level of node in the hierarchical tree can increase the number of version numbers that can be accommodated in the hierarchical tree by a factor of several. The specific factor of several can be increased depends on the number of adjacent lower-level nodes that a node in the hierarchical tree can cascade with.
[0029] The method described in this application does not rely on external storage and can be integrated into the client in a non-intrusive manner without affecting the client. Attached Figure Description
[0030] Figure 1 This is a structural block diagram of a data processing system according to this application.
[0031] Figure 2 This is a flowchart of the steps of a data processing method according to this application.
[0032] Figure 3 This is a schematic diagram of a hierarchical tree in this application.
[0033] Figure 4 This is a flowchart of the steps of a data processing method according to this application.
[0034] Figure 5 This is a flowchart of the steps of a data processing method according to this application.
[0035] Figure 6 This is a schematic diagram of a hierarchical tree in this application.
[0036] Figure 7 This is a structural block diagram of a data processing device according to this application.
[0037] Figure 8 This is a structural block diagram of a data processing device according to this application.
[0038] Figure 9 This is a structural block diagram of a data processing device according to this application.
[0039] Figure 10 This is a structural block diagram of a data processing device according to this application.
[0040] Figure 11 This is a block diagram of an electronic device shown in this application.
[0041] Figure 12 This is a block diagram of an electronic device shown in this application. Detailed Implementation
[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0043] Reference Figure 1 The diagram shows a schematic of the structure of a data processing system according to this application. The system includes a server 01 and at least one client 02. Figure 1 The example given is of a system comprising a server 01 and a client 02, but this is not intended to limit the scope of protection of this application.
[0044] Communication connection between the client and the server.
[0045] The server contains a dataset, which includes multiple data points that can be accessed by the client.
[0046] For example, a client can call at least a portion of the data in the dataset on the server and apply at least a portion of the data to meet the actual business needs.
[0047] Reference Figure 2 The diagram illustrates a flowchart of a data processing method according to this application. This method can construct a hierarchical tree of version numbers for each piece of data in a dataset. This method is applied to… Figure 1The server-side method shown may specifically include the following steps:
[0048] In step S101, the version number of each piece of data in the dataset containing multiple pieces of data in the server is obtained.
[0049] In this application, the server has a dataset, which includes multiple data points that can be accessed by the client.
[0050] Sometimes, the server may update the dataset, for example, by adding new data to the dataset, or by updating existing data in the dataset (e.g., replacing an old version of data with a new version of data).
[0051] Each piece of data in the dataset on the server has its own version number, and whenever a piece of data is updated, its version number is also updated. Initially, if it's necessary to generate version numbers for multiple pieces of data in the dataset in batches, the version numbers for each piece of data can be generated in parallel, reducing the time required for version number generation and improving the efficiency of batch generation of version numbers for multiple pieces of data in the dataset.
[0052] Each piece of data in the dataset on the server has its own data identifier, and the data identifier of a piece of data may remain unchanged after it is updated.
[0053] For example, for any data in the dataset, the data identifier and the data version number are stored in the correspondence between data identifiers and version numbers. When the server replaces the old version of the dataset with the new version of the data, the data identifier of the new version of the data is the same as that of the old version of the data. That is, the data identifier does not change, but the data version number will change. For example, the version number of the new version of the data is different from that of the old version of the data. In this way, the version number of the new version of the data can be used to replace the version number corresponding to the data identifier of the new version of the data (or the old version of the data) in the correspondence between data identifiers and version numbers.
[0054] Thus, in this step, when obtaining the version number of each data in the dataset on the server, the version number of each data in the dataset can be obtained from the correspondence between data identifiers and version numbers.
[0055] In step S102, a hierarchical tree is generated based on the version number of each piece of data.
[0056] The hierarchical tree includes at least two levels of nodes. The lowest-level nodes in the at least two-level tree include version numbers of each data item in the dataset. The non-lowest-level nodes in the at least two-level tree include at least one version number. Each version number in a non-lowest-level node is concatenated with at least two version numbers from its neighboring lower-level nodes, and different version numbers in a non-lowest-level node are concatenated with different version numbers in its neighboring lower-level nodes.
[0057] In one example, each version number in a non-bottom-level node can be generated based on at least two of a plurality of version numbers in its adjacent lower-level nodes, and different version numbers in a non-bottom-level node can be generated based on different version numbers in its adjacent lower-level nodes.
[0058] In this application, the hierarchy tree can exist in the form of a skip list.
[0059] In another embodiment, the server can synchronize the hierarchy tree to other servers in its cluster, and the servers in the cluster can use the Raft (consensus algorithm) mechanism to manage the hierarchy tree (e.g., update it), which ensures the consistency of the hierarchy tree in each server in the cluster. Even if some servers in the cluster lose the hierarchy tree, the other servers in the cluster will retain the hierarchy tree, thus avoiding the loss of the hierarchy tree.
[0060] In one example, the version number of each piece of data in the dataset can be used as the lowest-level node.
[0061] Divide the version numbers of each data point in the dataset into at least two version number groups, ensuring that the version numbers in different version number groups do not overlap. Then, for any version number group, generate the version number corresponding to that version number group and use it as the adjacent parent node of that version number group. Associate the version numbers in that version number group with the generated adjacent parent node of that version number group.
[0062] The same applies to each other version number group, thus obtaining the adjacent parent nodes of each version number group, and pre-associating the version number in each version number group with its respective adjacent parent node.
[0063] If the number of version numbers corresponding to the adjacent parent nodes of the version number group is 1, then the creation of the hierarchy tree is complete.
[0064] Alternatively, if the number of version numbers corresponding to the adjacent parent nodes of the version number group is greater than or equal to 2, the version numbers corresponding to the adjacent parent nodes of the version number group are processed in the above manner until the number of version numbers corresponding to the generated node is 1, thereby completing the creation work in the hierarchy tree.
[0065] In one example, suppose the dataset contains 10 data points, including data 1, data 2, ... and data 10. The generated hierarchical tree can include two levels of nodes.
[0066] For example, the version numbers of data 1, data 2, ... and data 10 can be used as the 10 lowest-level nodes.
[0067] A version number X1 is generated based on the version numbers of data 1, data 2, ..., and data 5 in the lowest-level node, and is used as the parent node.
[0068] Furthermore, based on the version numbers of data 6, 7, ..., and 10 in the bottom-level node, a version number X2 is generated as the parent node. Then, based on the version numbers X1 and X2 in the parent node, a version number Y1 is generated as the next-next-next node. The hierarchy tree can then be... Figure 3 As shown.
[0069] visible, Figure 3 The bottom-level node in the hierarchy tree shown has 10 version numbers, the adjacent parent node of the bottom-level node has 2 version numbers, and the adjacent next-parent node of the parent node has 1 version number.
[0070] In this application, the version numbers of each data item in a dataset containing multiple data items on the server are obtained. A hierarchical tree is generated based on the version numbers of each data item. The hierarchical tree includes at least two levels of nodes. The bottom-level nodes in the at least two-level nodes contain the version numbers of each data item in the dataset. The non-bottom-level nodes in the at least two-level nodes contain at least one version number. Each version number in a non-bottom-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes, and different version numbers in a non-bottom-level node are concatenated with different version numbers in its adjacent lower-level nodes.
[0071] Through this application, the server can generate a hierarchical tree, and then the client can obtain the version number of at least some data in the dataset and the version number of all the parent nodes corresponding to the version number of at least some data in the hierarchical tree based on the server's hierarchical tree, and store the hierarchical relationship between the version number of at least some data and the version number of all the parent nodes corresponding to the version number of at least some data in the hierarchical tree.
[0072] This allows the system to support the following scenario: when the client caches at least a portion of a dataset containing multiple data points from the server, the client can retrieve the version number of the cached data and the corresponding version numbers of all parent nodes in the hierarchical tree that are linked to the version number of the cached data. Based on the detection order from the version number in the parent node to the version number in the child node within this hierarchical relationship, and the hierarchical tree on the server, it can be determined whether at least one piece of data in the cached data has been updated on the server.
[0073] In this way, the client can detect whether at least a portion of the data in the client-cached dataset (the data that the client may actually need to use) has been updated on the server, without needing to detect whether other data in the dataset has been updated on the server. That is, the client only needs to detect whether the data that the client may actually need to use has been updated on the server, but does not need to detect whether the data that the client may not actually use has been updated on the server. This reduces the amount of data to be detected (reduces the number of times version numbers need to be compared), thereby improving detection efficiency.
[0074] Furthermore, in the process of "detecting whether at least one piece of data of at least some data has been updated in the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship between the version number of at least some data and the version number of all the upper-level nodes corresponding to the version number of at least some data in the hierarchical tree, and the hierarchical tree in the server", the updated lower-level version number of the cascaded data can be determined in each level of the node.
[0075] The updated version number in a cascaded configuration may have its data updated on the server side, while the unupdated version number in a cascaded configuration often does not have its data updated on the server side.
[0076] Therefore, instead of detecting updated data on the server based on the cascading, unupdated lower-level version numbers, we can detect updated data on the server based solely on the cascading, updated lower-level version numbers. This further reduces the amount of data to be detected (reducing the number of version number comparisons required), thereby further improving detection efficiency.
[0077] Secondly, in the process of detecting whether at least some of the data in the client-cached dataset has been updated on the server, the client and server interact with the data version number, not the data itself. The space occupied by the data version number is smaller than that occupied by the data itself, and the time required for the data version number to be transmitted is smaller than that required for the data itself to be transmitted, thereby saving network resources and improving detection efficiency.
[0078] It should be noted that the more data in the dataset of this application, the more significant the effect of this application in saving network resources and improving detection efficiency will be.
[0079] The hierarchical tree approach can support larger data volumes in the server-side dataset and can dynamically expand the hierarchical tree. Each additional level of node in the hierarchical tree can increase the number of version numbers that can be accommodated in the hierarchical tree by a factor of several. The specific factor of several can be increased depends on the number of adjacent lower-level nodes that a node in the hierarchical tree can cascade with.
[0080] The method described in this application does not rely on external storage and can be integrated into the client in a non-intrusive manner without affecting the client.
[0081] Sometimes, the server may modify data in the dataset. For example, it may modify existing data in the dataset. For instance, if one of the data in the dataset is an employee's salary, after the employee's salary is increased, the employee's salary can be modified in the dataset.
[0082] The version number of the modified data will change. Therefore, after modifying the existing data in the dataset, in order to maintain the consistency of the version number of the data in the dataset and the data in the hierarchy tree, it is necessary to synchronously modify the version number related to the data in the hierarchy tree. For example, the version number of the data can be modified in the hierarchy tree, and the version numbers of all the parent nodes cascaded with the version number of the data can also be modified in the hierarchy tree.
[0083] For example, suppose the server modifies data 2 in the dataset; the version number of data 2 will then change. Figure 3 In the hierarchy tree shown, the old version number of data 2 before modification can be replaced with the new version number of the modified data 2. Also, the version numbers of all parent nodes cascaded with the version number of data 2 include version number X1. Therefore, version number X1 also needs to be modified.
[0084] Specifically, for the server, it can detect in real time or periodically whether each piece of data in the dataset has been modified. If data in the dataset has been modified, it obtains the new version number of the modified data. The new version number of the target data is different from the current version number of the target data in the hierarchical tree. Specifically, a version number different from the current version number of the target data in the hierarchical tree can be generated and used as the new version number of the target data. This application does not limit the specific method of generating the version number. Then, the new version number of the modified data is used to replace the old version number of the modified data in the hierarchical tree. In addition, the version numbers of all parent nodes cascaded with the new version number of the modified data in the hierarchical tree are modified.
[0085] Sometimes, the server may update the data in the dataset, such as adding new data to the dataset, like adding a new employee's salary and benefits.
[0086] New data has its own version number. Therefore, after adding new data to the dataset, in order to maintain the consistency of the version numbers of the data in the dataset and the data in the hierarchical tree, the version numbers of the new data can be added synchronously to the hierarchical tree. For example, the version number of the new data can be added to the hierarchical tree, and the version numbers of all the parent nodes of the new data's version number can be determined in the hierarchical tree. The association relationship between the version numbers of all the parent nodes of the new data's version number can be set, and the version numbers of all the parent nodes of the new data's version number can be updated.
[0087] For example, suppose the server adds data 11 to the dataset, and data 11 has its own version number, then in Figure 3 In the hierarchy tree shown, a version number of data 11 can be added, and the version number of data 11 can be used as the bottom-level node. Assuming that the version number of all the parent nodes of the new data version number is determined to be version number X1 in the hierarchy tree, the association relationship between the version number X1 of all the parent nodes of the new data version number can be set, and the version number X1 of all the parent nodes of the new data version number can be updated.
[0088] Specifically, the server can detect whether new data has been added to the dataset in real time or periodically. If data is added, it obtains the version number of the added data. Specifically, it can generate version numbers for new data, etc. This application does not limit the specific method of version number generation. Then, the version number of the added data can be added to the lowest-level node in the hierarchical tree, and the version numbers of all cascading parent nodes of the added data's version number can be updated in the hierarchical tree.
[0089] Sometimes, the server may update the data in the dataset, such as deleting old data from the dataset, for example, deleting an employee's salary information from the dataset.
[0090] In this context, older data has its own version number. Therefore, after deleting older data in the dataset, in order to maintain the consistency of the version numbers of the data in the dataset and the data in the hierarchy tree, the version numbers related to the older data can be deleted synchronously in the hierarchy tree. For example, the version number of the older data can be deleted in the hierarchy tree, and the version numbers of all cascading parent nodes of the older data's version number can be updated in the hierarchy tree.
[0091] For example, suppose the server deletes data 10 from the dataset. Data 10 has its own version number. Figure 3 In the hierarchy tree shown, the version number of data 10 can be deleted. Assuming that the version number of all the parent nodes of the old data in the hierarchy tree is version number X2, then the version number of all the parent nodes of the old data can be updated to version number X2.
[0092] Specifically, the server can detect in real-time or periodically whether old data has been deleted from the dataset. If data is deleted, it retrieves the version number of the deleted data. Then, it can delete the version number of the deleted data at the bottom-level node in the hierarchy tree, and update the version numbers of all cascading parent nodes of the deleted data in the hierarchy tree.
[0093] Reference Figure 4 The flowchart illustrates the steps of a data processing method according to this application, which is applied to... Figure 1 In the system shown, the method may specifically include the following steps:
[0094] In step S201, when the client obtains at least a portion of the data in the dataset containing multiple data in the server, it sends an acquisition request to the server. The acquisition request is used to request the version number of the at least a portion of the data and the version numbers of all the parent nodes corresponding to the version numbers of the at least a portion of the data in the hierarchical tree.
[0095] The hierarchical tree includes at least two levels of nodes. The lowest-level nodes in the at least two-level tree include version numbers of each data item in the dataset. The non-lowest-level nodes in the at least two-level tree include at least one version number. Each version number in a non-lowest-level node is generated based on at least two version numbers from multiple version numbers in its adjacent lower-level nodes, and different version numbers in non-lowest-level nodes are cascaded with different version numbers in their adjacent lower-level nodes.
[0096] The data obtained by the client from the server has an expiration time. If the expiration time is exceeded, the data is invalid. When the client applies the data according to actual business needs, it can choose not to apply the expired data, but can retrieve the data from the server again and apply it.
[0097] Therefore, if the data obtained by the client from the server is outdated, there is no need to check whether the data has been updated on the server based on the data version number, which can avoid invalid checks and save network resources.
[0098] Thus, at least some of the aforementioned data may include data that the client obtains from the server and that has not expired.
[0099] In step S202, the server receives the retrieval request, which requests the version numbers of at least a portion of the data, as well as the version numbers of all parent nodes cascading with the version numbers of at least a portion of the data in the hierarchical tree. This retrieval request is sent by the client after it has retrieved at least a portion of the data from a dataset containing multiple data items on the server.
[0100] In step S203, the server obtains the version number of at least some data and the version number of all parent nodes corresponding to the version number of at least some data cascaded in the hierarchical tree according to the acquisition request.
[0101] In step S204, the server sends the client the version number of at least a portion of the data, as well as the version numbers of all cascading parent nodes in the hierarchical tree. This allows the client to store the hierarchical relationship between the version numbers of at least a portion of the data and the version numbers of all cascading parent nodes.
[0102] In step S205, the client receives the version number of at least a portion of the data, as well as the version numbers of all parent nodes cascaded with the version numbers of at least a portion of the data in the hierarchical tree.
[0103] In step S206, the client stores the hierarchical relationship between the version number of at least a portion of the data and the version numbers of all the parent nodes that are cascaded with the version number of at least a portion of the data in the hierarchical tree.
[0104] The client can store the hierarchical relationship between the version number of at least some data and the version number of all the parent nodes that are cascaded with the version number of at least some data in the hierarchical tree, based on various storage methods. Storage methods include: Redis (Remote Dictionary Server), Memcached (distributed high-speed caching system), Filecache (file cache), and Guava, etc.
[0105] Through this application, the client can obtain the version numbers of at least some data in the dataset and the version numbers of all parent nodes cascaded with the version numbers of at least some data in the hierarchical tree of the server, and store the hierarchical cascading relationship between the version numbers of at least some data and the version numbers of all parent nodes cascading with the version numbers of at least some data in the hierarchical tree.
[0106] This allows the system to support the following scenario: when the client caches at least a portion of a dataset containing multiple data points from the server, the client can retrieve the version number of the cached data and the corresponding version numbers of all parent nodes in the hierarchical tree that are linked to the version number of the cached data. Based on the detection order from the version number in the parent node to the version number in the child node within this hierarchical relationship, and the hierarchical tree on the server, it can be determined whether at least one piece of data in the cached data has been updated on the server.
[0107] In this way, the client can detect whether at least a portion of the data in the client-cached dataset (the data that the client may actually need to use) has been updated on the server, without needing to detect whether other data in the dataset has been updated on the server. That is, the client only needs to detect whether the data that the client may actually need to use has been updated on the server, but does not need to detect whether the data that the client may not actually use has been updated on the server. This reduces the amount of data to be detected (reduces the number of times version numbers need to be compared), thereby improving detection efficiency.
[0108] Furthermore, in the process of "detecting whether at least one piece of data of at least some data has been updated in the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship between the version number of at least some data and the version number of all the upper-level nodes corresponding to the version number of at least some data in the hierarchical tree, and the hierarchical tree in the server", the updated lower-level version number of the cascaded data can be determined in each level of the node.
[0109] The updated version number in a cascaded configuration may have its data updated on the server side, while the unupdated version number in a cascaded configuration often does not have its data updated on the server side.
[0110] Therefore, instead of detecting updated data on the server based on the cascading, unupdated lower-level version numbers, we can detect updated data on the server based solely on the cascading, updated lower-level version numbers. This further reduces the amount of data to be detected (reducing the number of version number comparisons required), thereby further improving detection efficiency.
[0111] Secondly, in the process of detecting whether at least some of the data in the client-cached dataset has been updated on the server, the client and server interact with the data version number, not the data itself. The space occupied by the data version number is smaller than that occupied by the data itself, and the time required for the data version number to be transmitted is smaller than that required for the data itself to be transmitted, thereby saving network resources and improving detection efficiency.
[0112] It should be noted that the more data in the dataset of this application, the more significant the effect of this application in saving network resources and improving detection efficiency will be.
[0113] The hierarchical tree approach can support larger data volumes in the server-side dataset and can dynamically expand the hierarchical tree. Each additional level of node in the hierarchical tree can increase the number of version numbers that can be accommodated in the hierarchical tree by a factor of several. The specific factor of several can be increased depends on the number of adjacent lower-level nodes that a node in the hierarchical tree can cascade with.
[0114] The method described in this application does not rely on external storage and can be integrated into the client in a non-intrusive manner without affecting the client.
[0115] Reference Figure 5 The flowchart illustrates the steps of a data processing method according to this application, which is applied to... Figure 1 In the client shown, the method may specifically include the following steps:
[0116] In step S301, if the client caches at least a portion of the data in the dataset containing multiple data on the server, the hierarchical relationship between the version number of the cached data and the version numbers of all parent nodes that are cascaded with the version numbers of the cached data in the hierarchical tree is obtained.
[0117] The hierarchical tree includes at least two levels of nodes. The lowest-level nodes in the at least two-level tree include version numbers of each data item in the dataset. The non-lowest-level nodes in the at least two-level tree include at least one version number. Each version number in a non-lowest-level node is generated based on at least two version numbers from multiple version numbers in its adjacent lower-level nodes, and different version numbers in non-lowest-level nodes are cascaded with different version numbers in their adjacent lower-level nodes.
[0118] In this application, the client can cache at least a portion of the data in the dataset on the server that it needs to apply in advance. In this way, when the client needs to call at least a portion of the data according to the actual business requirements, it can directly call the pre-cached at least a portion of the data locally on the client, which can improve the efficiency of calling at least a portion of the data.
[0119] However, sometimes the server updates some data in the dataset. If at least some of the data mentioned above is updated in the dataset, the client often needs to apply the updated data from the server when applying at least some of the data to meet business requirements.
[0120] To improve the efficiency of retrieving at least some data while ensuring that the retrieved data is updated (the latest version), the client can cache the updated data on the client side.
[0121] In order to enable the client to cache at least a portion of the updated data on the client, in an optional embodiment, it can be detected in real time or periodically whether at least a portion of the data in the client-cached dataset has been updated on the server. If at least a portion of the data in the client-cached dataset has been updated on the server, the client can update the locally cached at least a portion of the data with the updated at least a portion of the data in the dataset on the server.
[0122] Among them, through Figure 4 The illustrated embodiment allows the client to store the hierarchical relationship between the version numbers of at least a portion of the data in the dataset and the version numbers of all the parent nodes corresponding to the version numbers of at least a portion of the data in the hierarchical tree. Therefore, in this application, when detecting whether at least a portion of the data in the client-cached dataset has been updated on the server, this hierarchical relationship can be obtained, and then the hierarchical relationship can be used to detect whether at least a portion of the data in the client-cached dataset has been updated on the server. For details, please refer to step 302, which will not be elaborated here.
[0123] In step S302, based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship and the hierarchical tree in the server, it is detected whether at least one piece of data of at least part of the data has been updated in the server.
[0124] In one embodiment, the version number of the top-level hierarchy in the hierarchical relationship is obtained.
[0125] Then, retrieve the version number of the top-level node in the hierarchy tree from the server and determine whether the version number of the top-level node in the hierarchical relationship is the same as the version number of the top-level node retrieved from the server.
[0126] If the version number of the top-level node in this hierarchical relationship is the same as the version number of the top-level node retrieved from the server, it means that at least some of the data has not been updated on the server, and the process can be terminated.
[0127] If the version number of the top-level data in the hierarchical relationship is different from the version number of the top-level data retrieved from the server, it indicates that at least one piece of data in the at least partial data has been updated on the server, and it is necessary to determine which pieces of data in the at least partial data have been updated on the server.
[0128] To determine which data in at least some of the data was updated on the server, one approach is to retrieve all adjacent lower-level version numbers associated with the version number of the top-level version in the hierarchical relationship.
[0129] Then, retrieve all adjacent lower-level version numbers associated with the top-level version number in the hierarchy tree from the server.
[0130] For any one of the adjacent lower-level version numbers associated with the top-level version number in the hierarchical relationship, determine whether "this version number" is the same as "the corresponding version number" among all the adjacent lower-level version numbers associated with the top-level version number retrieved from the server.
[0131] If the "version number" is the same as the "corresponding version number" among all adjacent lower-level version numbers associated with the highest-level version number retrieved from the server, the detection process ends for the "version number".
[0132] Alternatively, if the "version number" is different from the "corresponding version number" among all adjacent lower-level version numbers associated with the top-level version number retrieved from the server, retrieve all adjacent lower-level version numbers associated with the "version number" in the hierarchical relationship.
[0133] Then, retrieve all adjacent lower-level version numbers associated with "this version number" from the server-side hierarchy tree.
[0134] For any one of the adjacent lower-level version numbers associated with "this version number" in the hierarchical relationship, determine whether "this lower-level version number" is the same as the "corresponding version number" among all the adjacent lower-level version numbers associated with "this version number" in the hierarchy tree retrieved from the server.
[0135] If the "subordinate version number" is the same as the "corresponding version number" among all adjacent subordinate version numbers associated with the "subordinate version number" in the hierarchy tree retrieved from the server, the detection process ends for the "subordinate version number".
[0136] Alternatively, if the "subordinate version number" is different from the "corresponding version number" among all the adjacent subordinate version numbers associated with the "subordinate version number" in the hierarchy tree retrieved from the server, continue to process the "subordinate version number" in the above manner until the lowest-level version number in the hierarchical relationship is obtained.
[0137] For any one of the lowest-level version numbers in the obtained hierarchical relationship, it can be determined whether the "lowest-level version number" is the same as the "corresponding version number" in the hierarchy tree on the server side.
[0138] If the "lowest-level version number" is the same as the "corresponding version number" in the hierarchy tree on the server, it can be determined that the data corresponding to the "lowest-level version number" in the dataset has not been updated by the server.
[0139] If the "lowest-level version number" is the same as the "corresponding version number" in the hierarchy tree on the server, it can be determined that the data corresponding to the "lowest-level version number" in the dataset has been updated by the server.
[0140] For example, in one instance, suppose the server will Figure 3 If data 2 in the hierarchy tree is updated to data 2', then the version number of data 2 also needs to be updated to the version number of data 2' in the hierarchy tree. Furthermore, the version number X1 in the intermediate node cascading the version number of data 2' needs to be updated to X1', and the version number Y1 in the top-level node needs to be updated to Y1', thus obtaining... Figure 6 The hierarchy tree shown.
[0141] Suppose that the client caches data 1, data 2, and data 3, and stores the association between data 1, data 2, and data 3 and version number X1 in the intermediate node, as well as the association between version number X1 in the intermediate node and version number Y1 in the top-level node.
[0142] The client can retrieve data from the server. Figure 6 The version number Y1' in the top-level node of the hierarchy tree shown can then be used to determine the version number Y1 in the top-level node of the cache and the version retrieved from the server. Figure 6 The version number Y1' in the top-level node of the hierarchy tree shown is different.
[0143] It can then be retrieved from the server. Figure 6 The version number Y1' of the top-level node in the hierarchy tree shown does not need to be retrieved from the server. Figure 6 The version number Y1' in the top-level node of the hierarchical tree shown is adjacent to the version number X2 in the lower-level node. This reduces the amount of data called, thereby improving detection efficiency and saving network resources.
[0144] Then we can determine the version number X1 in the cache intermediate node and the version retrieved from the server. Figure 6 The version number Y1' of the top-level node in the hierarchy tree shown is different from the version number X1' of the adjacent lower-level nodes.
[0145] It can then be retrieved from the server. Figure 6 In the hierarchical tree shown, the version numbers of data 1, data 2', and data 3 in the adjacent lower-level nodes of version number X1' do not need to be retrieved from the server. This reduces the amount of data called, thereby improving detection efficiency and saving network resources.
[0146] Then we can compare the version number of cached data 1 with the version number retrieved from the server. Figure 6 The version number of data 1 in the shown hierarchy tree is the same. Compare the version number of cached data 2 with the version number retrieved from the server. Figure 6 The version number of data 2' in the shown hierarchy tree is different, and the version number of cached data 3 is compared with that retrieved from the server. Figure 6 The version number of data 3 in the hierarchy tree shown is the same.
[0147] Therefore, it can be determined that the data 2 cached on the client side has been updated on the server side. That is, the data 2 no longer exists in the server's dataset, but rather data 2' exists.
[0148] Furthermore, if at least one piece of data is updated on the server, the client can also retrieve the updated at least one piece of data from the server and replace the cached at least one piece of data with the updated at least one piece of data.
[0149] Furthermore, if at least one piece of data is updated (e.g., deleted or modified) on the server, the client can also obtain the updated version number corresponding to the hierarchical relationship in the hierarchy tree from the server; and replace the corresponding version number in the client's cached hierarchical relationship with the obtained version number.
[0150] In this application, when the client caches at least a portion of data from a dataset containing multiple data points on the server, the application obtains the hierarchical relationship between the version number of the cached data and the version numbers of all parent nodes in the hierarchical tree that cascade the version numbers of the cached data. Based on the detection order from the version number in the parent node to the version number in the child node within this hierarchical relationship and the hierarchical tree on the server, the application detects whether at least one piece of data in the cached data has been updated on the server.
[0151] This application enables clients to detect whether at least a portion of the data in their cached dataset (data that the client may actually need to use) has been updated on the server, without needing to detect whether other data in the dataset has been updated on the server. In other words, clients can only detect whether the data that the client may actually need to use has been updated on the server, while not needing to detect whether the data that the client may not actually use has been updated on the server. This reduces the amount of data to be detected (reducing the number of times version numbers need to be compared), thereby improving detection efficiency.
[0152] Furthermore, in the process of "detecting whether at least one piece of data of at least some data has been updated in the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship between the version number of at least some data and the version number of all the upper-level nodes corresponding to the version number of at least some data in the hierarchical tree, and the hierarchical tree in the server", the updated lower-level version number of the cascaded data can be determined in each level of the node.
[0153] The updated version number in a cascaded configuration may have its data updated on the server side, while the unupdated version number in a cascaded configuration often does not have its data updated on the server side.
[0154] Therefore, instead of detecting updated data on the server based on the cascading, unupdated lower-level version numbers, we can detect updated data on the server based solely on the cascading, updated lower-level version numbers. This further reduces the amount of data to be detected (reducing the number of version number comparisons required), thereby further improving detection efficiency.
[0155] Secondly, in the process of detecting whether at least some of the data in the client-cached dataset has been updated on the server, the client and server interact with the data version number, not the data itself. The space occupied by the data version number is smaller than that occupied by the data itself, and the time required for the data version number to be transmitted is smaller than that required for the data itself to be transmitted, thereby saving network resources and improving detection efficiency.
[0156] It should be noted that the more data in the dataset of this application, the more significant the effect of this application in saving network resources and improving detection efficiency will be.
[0157] The hierarchical tree approach can support larger data volumes in the server-side dataset and can dynamically expand the hierarchical tree. Each additional level of node in the hierarchical tree can increase the number of version numbers that can be accommodated in the hierarchical tree by a factor of several. The specific factor of several can be increased depends on the number of adjacent lower-level nodes that a node in the hierarchical tree can cascade with.
[0158] The method described in this application does not rely on external storage and can be integrated into the client in a non-intrusive manner without affecting the client.
[0159] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by this application.
[0160] Reference Figure 7 This diagram illustrates a structural block diagram of a data processing apparatus according to this application, applied to a server. The apparatus may specifically include the following modules: a first acquisition module 11, used to acquire the version number of each data item in a dataset containing multiple data items on the server; and a generation module 12, used to generate a hierarchical tree based on the version numbers of each data item; wherein the hierarchical tree includes at least two levels of nodes, the lowest level node of the at least two levels includes the version number of each data item in the dataset, and the non-lowest level nodes of the at least two levels include at least one version number, each version number in the non-lowest level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes, and different version numbers in the non-lowest level node are concatenated with different version numbers in its adjacent lower-level nodes.
[0161] In an optional implementation, the apparatus further includes: a second acquisition module, configured to acquire a new version number of the modified data when the data in the dataset is modified; a first replacement module, configured to replace the old version number of the modified data with the new version number of the modified data in the hierarchical tree; and a first modification module, configured to modify the version numbers of all parent nodes cascaded with the new version number of the updated data in the hierarchical tree.
[0162] In an optional implementation, the apparatus further includes: a third acquisition module, configured to acquire the version number of the added data when data is added to the dataset; a second replacement module, configured to add the version number of the added data to the lowest-level node in the hierarchical tree; and a second update module, configured to update the version numbers of all parent nodes cascaded with the version number of the added data in the hierarchical tree.
[0163] In an optional implementation, the apparatus further includes: a fourth acquisition module, configured to acquire the version number of deleted data when data is deleted from the dataset; a third replacement module, configured to delete the version number of the deleted data from the lowest-level node in the hierarchical tree; and a third update module, configured to update the version numbers of all parent nodes cascaded with the version number of the deleted data in the hierarchical tree.
[0164] In this application, the version numbers of each data item in a dataset containing multiple data items on the server are obtained. A hierarchical tree is generated based on the version numbers of each data item. The hierarchical tree includes at least two levels of nodes. The bottom-level nodes in the at least two-level nodes contain the version numbers of each data item in the dataset. The non-bottom-level nodes in the at least two-level nodes contain at least one version number. Each version number in a non-bottom-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes, and different version numbers in a non-bottom-level node are concatenated with different version numbers in its adjacent lower-level nodes.
[0165] Through this application, the server can generate a hierarchical tree, and then the client can obtain the version number of at least some data in the dataset and the version number of all the parent nodes corresponding to the version number of at least some data in the hierarchical tree based on the server's hierarchical tree, and store the hierarchical relationship between the version number of at least some data and the version number of all the parent nodes corresponding to the version number of at least some data in the hierarchical tree.
[0166] This allows the system to support the following scenario: when the client caches at least a portion of a dataset containing multiple data points from the server, the client can retrieve the version number of the cached data and the corresponding version numbers of all parent nodes in the hierarchical tree that are linked to the version number of the cached data. Based on the detection order from the version number in the parent node to the version number in the child node within this hierarchical relationship, and the hierarchical tree on the server, it can be determined whether at least one piece of data in the cached data has been updated on the server.
[0167] In this way, the client can detect whether at least a portion of the data in the client-cached dataset (the data that the client may actually need to use) has been updated on the server, without needing to detect whether other data in the dataset has been updated on the server. That is, the client only needs to detect whether the data that the client may actually need to use has been updated on the server, but does not need to detect whether the data that the client may not actually use has been updated on the server. This reduces the amount of data to be detected (reduces the number of times version numbers need to be compared), thereby improving detection efficiency.
[0168] Furthermore, in the process of "detecting whether at least one piece of data of at least some data has been updated in the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship between the version number of at least some data and the version number of all the upper-level nodes corresponding to the version number of at least some data in the hierarchical tree, and the hierarchical tree in the server", the updated lower-level version number of the cascaded data can be determined in each level of the node.
[0169] The updated version number in a cascaded configuration may have its data updated on the server side, while the unupdated version number in a cascaded configuration often does not have its data updated on the server side.
[0170] Therefore, instead of detecting updated data on the server based on the cascading, unupdated lower-level version numbers, we can detect updated data on the server based solely on the cascading, updated lower-level version numbers. This further reduces the amount of data to be detected (reducing the number of version number comparisons required), thereby further improving detection efficiency.
[0171] Secondly, in the process of detecting whether at least some of the data in the client-cached dataset has been updated on the server, the client and server interact with the data version number, not the data itself. The space occupied by the data version number is smaller than that occupied by the data itself, and the time required for the data version number to be transmitted is smaller than that required for the data itself to be transmitted, thereby saving network resources and improving detection efficiency.
[0172] It should be noted that the more data in the dataset of this application, the more significant the effect of this application in saving network resources and improving detection efficiency will be.
[0173] The hierarchical tree approach can support larger data volumes in the server-side dataset and can dynamically expand the hierarchical tree. Each additional level of node in the hierarchical tree can increase the number of version numbers that can be accommodated in the hierarchical tree by a factor of several. The specific factor of several can be increased depends on the number of adjacent lower-level nodes that a node in the hierarchical tree can cascade with.
[0174] The method described in this application does not rely on external storage and can be integrated into the client in a non-intrusive manner without affecting the client.
[0175] Reference Figure 8 This diagram illustrates a structural block diagram of a data processing apparatus according to this application, applied to a client. Specifically, the apparatus may include the following modules: a first sending module 21, configured to send an acquisition request to the server when at least a portion of data from a dataset containing multiple data sets is acquired; the acquisition request requests the version number of the at least a portion of the data and the version numbers corresponding to all parent nodes cascading with the version number of the at least a portion of the data in a hierarchical tree; and a first receiving module 22, configured to receive the version number of the at least a portion of the data and the version numbers corresponding to all parent nodes cascading with the version number of the at least a portion of the data in the hierarchical tree, returned by the server according to the acquisition request. The version number; storage module 23, used to store the hierarchical cascading relationship between the version number of the at least part of the data and the version numbers of all the parent nodes corresponding to the version numbers of the at least part of the data in the hierarchical tree; wherein, the hierarchical tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version number of each data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number of the non-bottom-level node is cascaded with at least two version numbers of the multiple version numbers of its adjacent lower-level nodes, and different version numbers of the non-bottom-level nodes are cascaded with different version numbers of its adjacent lower-level nodes.
[0176] Through this application, the client can obtain the version numbers of at least some data in the dataset and the version numbers of all parent nodes cascaded with the version numbers of at least some data in the hierarchical tree of the server, and store the hierarchical cascading relationship between the version numbers of at least some data and the version numbers of all parent nodes cascading with the version numbers of at least some data in the hierarchical tree.
[0177] This allows the system to support the following scenario: when the client caches at least a portion of a dataset containing multiple data points from the server, the client can retrieve the version number of the cached data and the corresponding version numbers of all parent nodes in the hierarchical tree that are linked to the version number of the cached data. Based on the detection order from the version number in the parent node to the version number in the child node within this hierarchical relationship, and the hierarchical tree on the server, it can be determined whether at least one piece of data in the cached data has been updated on the server.
[0178] In this way, the client can detect whether at least a portion of the data in the client-cached dataset (the data that the client may actually need to use) has been updated on the server, without needing to detect whether other data in the dataset has been updated on the server. That is, the client only needs to detect whether the data that the client may actually need to use has been updated on the server, but does not need to detect whether the data that the client may not actually use has been updated on the server. This reduces the amount of data to be detected (reduces the number of times version numbers need to be compared), thereby improving detection efficiency.
[0179] Furthermore, in the process of "detecting whether at least one piece of data of at least some data has been updated in the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship between the version number of at least some data and the version number of all the upper-level nodes corresponding to the version number of at least some data in the hierarchical tree, and the hierarchical tree in the server", the updated lower-level version number of the cascaded data can be determined in each level of the node.
[0180] The updated version number in a cascaded configuration may have its data updated on the server side, while the unupdated version number in a cascaded configuration often does not have its data updated on the server side.
[0181] Therefore, instead of detecting updated data on the server based on the cascading, unupdated lower-level version numbers, we can detect updated data on the server based solely on the cascading, updated lower-level version numbers. This further reduces the amount of data to be detected (reducing the number of version number comparisons required), thereby further improving detection efficiency.
[0182] Secondly, in the process of detecting whether at least some of the data in the client-cached dataset has been updated on the server, the client and server interact with the data version number, not the data itself. The space occupied by the data version number is smaller than that occupied by the data itself, and the time required for the data version number to be transmitted is smaller than that required for the data itself to be transmitted, thereby saving network resources and improving detection efficiency.
[0183] It should be noted that the more data in the dataset of this application, the more significant the effect of this application in saving network resources and improving detection efficiency will be.
[0184] The hierarchical tree approach can support larger data volumes in the server-side dataset and can dynamically expand the hierarchical tree. Each additional level of node in the hierarchical tree can increase the number of version numbers that can be accommodated in the hierarchical tree by a factor of several. The specific factor of several can be increased depends on the number of adjacent lower-level nodes that a node in the hierarchical tree can cascade with.
[0185] The method described in this application does not rely on external storage and can be integrated into the client in a non-intrusive manner without affecting the client.
[0186] Reference Figure 9This diagram illustrates a structural block diagram of a data processing apparatus according to this application, applied to a server. The apparatus specifically includes the following modules: a second receiving module 31, configured to receive an acquisition request sent by a client, the acquisition request requesting the version number of at least a portion of data and the version numbers corresponding to all cascading parent nodes of the version number of the at least a portion of data in a hierarchical tree; the acquisition request being sent by the client after acquiring at least a portion of the data from a dataset containing multiple data sets on the server; a fifth acquisition module 32, configured to acquire the version number of the at least a portion of data and the version numbers corresponding to all cascading parent nodes of the version number of the at least a portion of data in the hierarchical tree according to the acquisition request; and a second sending module 33, configured to send the at least a portion of the data to the client. The client stores the version numbers of the data and the version numbers of all parent nodes in the hierarchical tree to which the version numbers of the at least part of the data are concatenated, for storing the hierarchical relationship between the version numbers of the at least part of the data and the version numbers of all parent nodes in the hierarchical tree to which the version numbers of the at least part of the data are concatenated; wherein the hierarchical tree includes at least two levels of nodes, the bottom-level node of the at least two levels of nodes includes the version numbers of each data in the dataset, the non-bottom-level nodes of the at least two levels of nodes include at least one version number, each version number of the non-bottom-level node is concatenated with at least two of the multiple version numbers of its adjacent lower-level nodes, and different version numbers of the non-bottom-level nodes are concatenated with different version numbers of its adjacent lower-level nodes.
[0187] Through this application, the client can obtain the version numbers of at least some data in the dataset and the version numbers of all parent nodes cascaded with the version numbers of at least some data in the hierarchical tree of the server, and store the hierarchical cascading relationship between the version numbers of at least some data and the version numbers of all parent nodes cascading with the version numbers of at least some data in the hierarchical tree.
[0188] This allows the system to support the following scenario: when the client caches at least a portion of a dataset containing multiple data points from the server, the client can retrieve the version number of the cached data and the corresponding version numbers of all parent nodes in the hierarchical tree that are linked to the version number of the cached data. Based on the detection order from the version number in the parent node to the version number in the child node within this hierarchical relationship, and the hierarchical tree on the server, it can be determined whether at least one piece of data in the cached data has been updated on the server.
[0189] In this way, the client can detect whether at least a portion of the data in the client-cached dataset (the data that the client may actually need to use) has been updated on the server, without needing to detect whether other data in the dataset has been updated on the server. That is, the client only needs to detect whether the data that the client may actually need to use has been updated on the server, but does not need to detect whether the data that the client may not actually use has been updated on the server. This reduces the amount of data to be detected (reduces the number of times version numbers need to be compared), thereby improving detection efficiency.
[0190] Furthermore, in the process of "detecting whether at least one piece of data of at least some data has been updated in the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship between the version number of at least some data and the version number of all the upper-level nodes corresponding to the version number of at least some data in the hierarchical tree, and the hierarchical tree in the server", the updated lower-level version number of the cascaded data can be determined in each level of the node.
[0191] The updated version number in a cascaded configuration may have its data updated on the server side, while the unupdated version number in a cascaded configuration often does not have its data updated on the server side.
[0192] Therefore, instead of detecting updated data on the server based on the cascading, unupdated lower-level version numbers, we can detect updated data on the server based solely on the cascading, updated lower-level version numbers. This further reduces the amount of data to be detected (reducing the number of version number comparisons required), thereby further improving detection efficiency.
[0193] Secondly, in the process of detecting whether at least some of the data in the client-cached dataset has been updated on the server, the client and server interact with the data version number, not the data itself. The space occupied by the data version number is smaller than that occupied by the data itself, and the time required for the data version number to be transmitted is smaller than that required for the data itself to be transmitted, thereby saving network resources and improving detection efficiency.
[0194] It should be noted that the more data in the dataset of this application, the more significant the effect of this application in saving network resources and improving detection efficiency will be.
[0195] The hierarchical tree approach can support larger data volumes in the server-side dataset and can dynamically expand the hierarchical tree. Each additional level of node in the hierarchical tree can increase the number of version numbers that can be accommodated in the hierarchical tree by a factor of several. The specific factor of several can be increased depends on the number of adjacent lower-level nodes that a node in the hierarchical tree can cascade with.
[0196] The method described in this application does not rely on external storage and can be integrated into the client in a non-intrusive manner without affecting the client.
[0197] Reference Figure 10 This diagram illustrates a structural block diagram of a data processing apparatus according to this application, applied to a client. Specifically, the apparatus may include the following modules: a sixth acquisition module 41, configured to acquire, when the client caches at least a portion of data from a dataset containing multiple data points on the server, the hierarchical relationship between the version numbers of the cached at least a portion of the data and the version numbers of all parent nodes in a hierarchical tree where the version numbers of the at least a portion of the data are cascaded; and a detection module 43, configured to detect, based on the detection order from the version numbers in the parent nodes to the version numbers in the child nodes in the hierarchical relationship and the hierarchical tree on the server, whether at least one piece of data in the at least a portion of the data has been updated on the server; wherein the hierarchical tree includes at least two levels of nodes, the bottom-level nodes of the at least two levels include the version numbers of each piece of data in the dataset, the non-bottom-level nodes of the at least two levels include at least one version number, each version number in the non-bottom-level nodes is cascaded with at least two of the multiple version numbers in its adjacent child nodes, and different version numbers in the non-bottom-level nodes are cascaded with different version numbers in their adjacent child nodes.
[0198] In an optional implementation, the apparatus further includes: a seventh acquisition module, configured to acquire updated at least one piece of data from the server when at least one piece of data is updated in the server; and a fourth replacement module, configured to replace at least one piece of cached data with the updated at least one piece of data.
[0199] In an optional implementation, the apparatus further includes: an eighth acquisition module, configured to acquire, from the server, the updated version number corresponding to the hierarchical tree in the hierarchical relationship in the upper-lower cascading relationship when at least one piece of data of the at least partial data is updated in the server; and a fifth replacement module, configured to replace the version number corresponding to the upper-lower cascading relationship cached by the client with the acquired version number.
[0200] In this application, when the client caches at least a portion of data from a dataset containing multiple data points on the server, the application obtains the hierarchical relationship between the version number of the cached data and the version numbers of all parent nodes in the hierarchical tree that cascade the version numbers of the cached data. Based on the detection order from the version number in the parent node to the version number in the child node within this hierarchical relationship and the hierarchical tree on the server, the application detects whether at least one piece of data in the cached data has been updated on the server.
[0201] This application enables clients to detect whether at least a portion of the data in their cached dataset (data that the client may actually need to use) has been updated on the server, without needing to detect whether other data in the dataset has been updated on the server. In other words, clients can only detect whether the data that the client may actually need to use has been updated on the server, while not needing to detect whether the data that the client may not actually use has been updated on the server. This reduces the amount of data to be detected (reducing the number of times version numbers need to be compared), thereby improving detection efficiency.
[0202] Furthermore, in the process of "detecting whether at least one piece of data of at least some data has been updated in the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship between the version number of at least some data and the version number of all the upper-level nodes corresponding to the version number of at least some data in the hierarchical tree, and the hierarchical tree in the server", the updated lower-level version number of the cascaded data can be determined in each level of the node.
[0203] The updated version number in a cascaded configuration may have its data updated on the server side, while the unupdated version number in a cascaded configuration often does not have its data updated on the server side.
[0204] Therefore, instead of detecting updated data on the server based on the cascading, unupdated lower-level version numbers, we can detect updated data on the server based solely on the cascading, updated lower-level version numbers. This further reduces the amount of data to be detected (reducing the number of version number comparisons required), thereby further improving detection efficiency.
[0205] Secondly, in the process of detecting whether at least some of the data in the client-cached dataset has been updated on the server, the client and server interact with the data version number, not the data itself. The space occupied by the data version number is smaller than that occupied by the data itself, and the time required for the data version number to be transmitted is smaller than that required for the data itself to be transmitted, thereby saving network resources and improving detection efficiency.
[0206] It should be noted that the more data in the dataset of this application, the more significant the effect of this application in saving network resources and improving detection efficiency will be.
[0207] The hierarchical tree approach can support larger data volumes in the server-side dataset and can dynamically expand the hierarchical tree. Each additional level of node in the hierarchical tree can increase the number of version numbers that can be accommodated in the hierarchical tree by a factor of several. The specific factor of several can be increased depends on the number of adjacent lower-level nodes that a node in the hierarchical tree can cascade with.
[0208] The method described in this application does not rely on external storage and can be integrated into the client in a non-intrusive manner without affecting the client.
[0209] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0210] Optionally, embodiments of the present invention also provide an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described data processing method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0211] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described data processing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0212] Figure 11 This is a block diagram illustrating an electronic device 800. For example, the electronic device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0213] Reference Figure 11 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0214] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0215] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, images, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0216] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0217] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0218] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0219] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0220] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0221] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast operation information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0222] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0223] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0224] Figure 12 This is a block diagram of an electronic device 1900 shown in this application. For example, the electronic device 1900 can be provided as a server.
[0225] Reference Figure 12 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.
[0226] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output (I / O) interface 1958. Electronic device 1900 can operate on an operating system stored in memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0227] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0228] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0229] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
[0230] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art will use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0231] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0232] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0233] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0234] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0235] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0236] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A data processing method, characterized in that, Applied to the server side, the method includes: Obtain the version number of each data item in the dataset containing multiple data items in the server; Generating a hierarchical tree based on the version numbers of each data point includes: using the version numbers of each data point in the dataset as the bottom-level nodes; dividing the version numbers of each data point in the dataset into at least two version number groups, where version numbers in different version number groups do not overlap; for any version number group, generating the version number corresponding to that version number group and using it as the adjacent parent node of that version number group, and associating the version numbers in that version number group with the generated adjacent parent nodes of that version number group; if the number of version numbers corresponding to the adjacent parent nodes of that version number group is 1, then the creation of the hierarchical tree is complete. If data is modified in the dataset, obtain the new version number of the modified data; The old version number of the modified data is replaced with the new version number of the modified data in the hierarchical tree; and the version numbers of all parent nodes cascaded with the new version number of the modified data in the hierarchical tree are updated. The hierarchical tree includes at least two levels of nodes. The bottom-level node of the at least two levels includes the version number of each data in the dataset. The non-bottom-level nodes of the at least two levels include at least one version number. Each version number in the non-bottom-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes. Furthermore, different version numbers in the non-bottom-level nodes are concatenated with different version numbers in their adjacent lower-level nodes. The hierarchical tree is used to detect, based on the hierarchical tree, whether at least one piece of data in the at least part of the data has been updated on the server when the client caches at least part of the data in the dataset containing multiple pieces of data. The client stores the hierarchical relationship between the version number of the at least part of the data and the version numbers of all the parent nodes that are concatenated with the version number of the at least part of the data in the hierarchical tree. The client detects whether at least one piece of data has been updated on the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship and the hierarchical tree in the server.
2. The method according to claim 1, characterized in that, The method further includes: When data is added to the dataset, obtain the version number of the added data; Add the version number of the added data to the bottom-most node in the hierarchy tree, and update the version numbers of all cascading parent nodes of the added data in the hierarchy tree.
3. The method according to claim 1, characterized in that, The method further includes: In the case of deleting data from the dataset, obtain the version number of the deleted data; Delete the version number of the deleted data from the bottom-most node in the hierarchy tree, and update the version numbers of all cascading parent nodes of the deleted data in the hierarchy tree.
4. A data processing method, characterized in that, Applied to the client side, the methods include: If at least a portion of the data in a dataset containing multiple data is obtained from the server, a request is sent to the server. The request is used to request the version number of the at least a portion of the data and the version numbers of all parent nodes that are cascaded with the version number of the at least a portion of the data in the hierarchy tree. Receive the version number of at least a portion of the data returned by the server according to the acquisition request, as well as the version numbers of all the parent nodes corresponding to the version numbers of at least a portion of the data cascaded in the hierarchical tree; The hierarchical relationship between the version number of the at least part of the data and the version numbers of all the parent nodes that are concatenated with the version number of the at least part of the data in the hierarchical tree; The hierarchical tree includes at least two levels of nodes. The lowest-level node in the at least two-level nodes includes version numbers of each data item in the dataset. Each non-lowest-level node in the at least two-level nodes includes at least one version number. Each version number in a non-lowest-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes. Furthermore, different version numbers in a non-lowest-level node are concatenated with different version numbers in its adjacent lower-level nodes. The hierarchical tree is used to detect, when the client caches at least a portion of the data in a dataset containing multiple data items on the server, whether at least one data item in the at least a portion of the data has been updated on the server. The client detects whether at least one data item in the at least a portion of the data has been updated on the server based on the detection order from version numbers in the upper-level nodes to version numbers in the lower-level nodes in the hierarchical relationship and the hierarchical tree on the server. The server is configured to: obtain a new version number of the modified data when data is modified in the dataset; replace the old version number of the modified data with the new version number of the modified data in the hierarchical tree; and update the version numbers of all cascaded parent nodes of the modified data in the hierarchical tree with the new version number of the modified data.
5. A data processing method, characterized in that, Applied to the server side, the methods include: The client receives an acquisition request, which is used to request the version number of at least a portion of the data and the version numbers of all parent nodes cascaded with the version number of the at least a portion of the data in the hierarchical tree. The acquisition request is sent by the client after it has acquired the at least a portion of the data in the dataset containing multiple data in the server. According to the acquisition request, obtain the version number of the at least part of the data and the version numbers of all the parent nodes corresponding to the version number of the at least part of the data in the hierarchical tree; Send the version number of the at least part of the data and the version numbers of all the parent nodes that are concatenated with the version number of the at least part of the data in the hierarchical tree to the client, so that the client can store the hierarchical relationship between the version number of the at least part of the data and the version numbers of all the parent nodes that are concatenated with the version number of the at least part of the data in the hierarchical tree; If data is modified in the dataset, obtain the new version number of the modified data; The old version number of the modified data is replaced with the new version number of the modified data in the hierarchical tree; and the version numbers of all parent nodes cascaded with the new version number of the modified data in the hierarchical tree are updated. The hierarchical tree includes at least two levels of nodes. The bottom-level nodes of the at least two levels include version numbers of each data item in the dataset. The non-bottom-level nodes of the at least two levels include at least one version number. Each version number in a non-bottom-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes. Different version numbers in a non-bottom-level node are concatenated with different version numbers in its adjacent lower-level nodes. The hierarchical tree is used to detect, when the client caches at least a portion of the data in a dataset containing multiple data items on the server, whether at least one data item in the at least a portion of the data has been updated on the server. The client detects whether at least one data item in the at least a portion of the data has been updated on the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship and the hierarchical tree on the server.
6. A data processing method, characterized in that, Applied to a client, the method includes: When the client caches at least a portion of the data in the dataset containing multiple data on the server, the hierarchical relationship between the version number of the at least a portion of the cached data and the version numbers of all the parent nodes corresponding to the version numbers of the at least a portion of the data in the hierarchy tree is obtained. Based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship and the hierarchical tree in the server, it is detected whether at least one piece of data of the at least part of the data has been updated in the server. The hierarchical tree includes at least two levels of nodes. The lowest-level node in the at least two-level nodes includes version numbers of each data item in the dataset. The non-lowest-level nodes in the at least two-level nodes include at least one version number. Each version number in a non-lowest-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes. Different version numbers in a non-lowest-level node are concatenated with different version numbers in its adjacent lower-level nodes. The hierarchical tree is used to detect, when the client caches at least a portion of the data in a dataset containing multiple data items on the server, whether at least one data item in the at least a portion of the data has been updated on the server. The server is configured to: obtain a new version number of the modified data when data is modified in the dataset; replace the old version number of the modified data with the new version number of the modified data in the hierarchical tree; and update the version numbers of all cascaded parent nodes of the modified data in the hierarchical tree with the new version number of the modified data.
7. The method according to claim 6, characterized in that, The method further includes; If at least one piece of data is updated on the server, the updated at least one piece of data is retrieved from the server, and the updated at least one piece of data is used to replace the cached at least one piece of data.
8. The method according to claim 6 or 7, characterized in that, The method further includes: If at least one piece of data in the at least partial data is updated on the server, the updated version number corresponding to the hierarchical tree in the hierarchical relationship is obtained from the server. Replace the corresponding version number in the hierarchical relationship of the client cache with the obtained version number.
9. A data processing apparatus, characterized in that, Applied to the server side, the device includes: The first acquisition module is used to acquire the version number of each piece of data in the dataset containing multiple pieces of data in the server. The generation module is used to generate a hierarchical tree based on the version numbers of each piece of data. Specifically, it uses the version numbers of each piece of data in the dataset as the bottom-level nodes; it divides the version numbers of each piece of data in the dataset into at least two version number groups, with no overlap between version numbers in different groups; for any version number group, it generates the version number corresponding to that group and uses it as the adjacent parent node of that group, and associates the version numbers in that group with the generated adjacent parent nodes; if the number of version numbers corresponding to the adjacent parent nodes of that group is 1, then the creation of the hierarchical tree is complete. Specifically, when data is modified in the dataset, the new version number of the modified data is obtained; the old version number of the modified data is replaced with the new version number of the modified data in the hierarchical tree; and the version numbers of all parent nodes cascaded with the new version number of the modified data are updated in the hierarchical tree. The hierarchical tree includes at least two levels of nodes. The bottom-level nodes of the at least two levels include version numbers of each data item in the dataset. The non-bottom-level nodes of the at least two levels include at least one version number. Each version number in a non-bottom-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes. Different version numbers in a non-bottom-level node are concatenated with different version numbers in its adjacent lower-level nodes. The hierarchical tree is used to detect, when the client caches at least a portion of the data in a dataset containing multiple data items on the server, whether at least one data item in the at least a portion of the data has been updated on the server. The client stores the hierarchical concatenation relationship between the version numbers of the at least a portion of the data and the version numbers of all the parent nodes corresponding to the version numbers of the at least a portion of the data in the hierarchical tree. The client detects whether at least one data item in the at least a portion of the data has been updated on the server based on the detection order from the version numbers in the parent nodes to the version numbers in the lower nodes in the hierarchical concatenation relationship and the hierarchical tree on the server.
10. A data processing apparatus, characterized in that, Applied to a client, the device includes: The first sending module is used to send an acquisition request to the server when at least a portion of the data in the dataset containing multiple data is obtained from the server. The acquisition request is used to request the version number of the at least a portion of the data and the version numbers of all the parent nodes corresponding to the version numbers of the at least a portion of the data in the hierarchical tree. The first receiving module is used to receive the version number of the at least part of the data returned by the server according to the acquisition request, as well as the version numbers of all the parent nodes corresponding to the version numbers of the at least part of the data cascaded in the hierarchical tree; The storage module is used to store the hierarchical relationship between the version number of the at least part of the data and the version numbers of all the parent nodes that are concatenated with the version number of the at least part of the data in the hierarchical tree; The hierarchical tree includes at least two levels of nodes. The lowest-level node in the at least two-level nodes includes version numbers of each data item in the dataset. Each non-lowest-level node in the at least two-level nodes includes at least one version number. Each version number in a non-lowest-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes. Furthermore, different version numbers in a non-lowest-level node are concatenated with different version numbers in its adjacent lower-level nodes. The hierarchical tree is used to detect, when the client caches at least a portion of the data in a dataset containing multiple data items on the server, whether at least one data item in the at least a portion of the data has been updated on the server. The client detects whether at least one data item in the at least a portion of the data has been updated on the server based on the detection order from version numbers in the upper-level nodes to version numbers in the lower-level nodes in the hierarchical relationship and the hierarchical tree on the server. The server is configured to: obtain a new version number of the modified data when the data in the dataset is modified; replace the old version number of the modified data with the new version number of the modified data in the hierarchical tree; and update the version numbers of all cascaded parent nodes of the modified data in the hierarchical tree with the new version number of the modified data.
11. A data processing apparatus, characterized in that, Applied to the server side, the device includes: The second receiving module is used to receive an acquisition request sent by the client. The acquisition request is used to request the version number of at least a portion of the data and the version numbers of all the parent nodes corresponding to the version numbers of the at least a portion of the data in the hierarchical tree. The acquisition request is sent by the client after it has acquired the at least a portion of the data in the dataset containing multiple data in the server. The fifth acquisition module is used to acquire, according to the acquisition request, the version number of the at least part of the data and the version numbers of all the parent nodes corresponding to the version numbers of the at least part of the data in the hierarchical tree; The second sending module is used to send the version number of the at least part of the data and the version numbers of all the parent nodes that are concatenated with the version number of the at least part of the data in the hierarchical tree to the client, so that the client can store the hierarchical relationship between the version number of the at least part of the data and the version numbers of all the parent nodes that are concatenated with the version number of the at least part of the data in the hierarchical tree. Specifically, when data is modified in the dataset, the new version number of the modified data is obtained; the old version number of the modified data is replaced with the new version number of the modified data in the hierarchical tree; and the version numbers of all parent nodes cascaded with the new version number of the modified data are updated in the hierarchical tree. The hierarchical tree includes at least two levels of nodes. The bottom-level nodes of the at least two levels include version numbers of each data item in the dataset. The non-bottom-level nodes of the at least two levels include at least one version number. Each version number in a non-bottom-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes. Different version numbers in a non-bottom-level node are concatenated with different version numbers in its adjacent lower-level nodes. The hierarchical tree is used to detect, when the client caches at least a portion of the data in a dataset containing multiple data items on the server, whether at least one data item in the at least a portion of the data has been updated on the server. The client detects whether at least one data item in the at least a portion of the data has been updated on the server based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship and the hierarchical tree on the server.
12. A data processing apparatus, characterized in that, Applied to a client, the device includes: The sixth acquisition module is used to acquire, when the client caches at least a portion of the data in the dataset containing multiple data from the server, the hierarchical relationship between the version number of the at least a portion of the data cached by the client and the version numbers of all the parent nodes corresponding to the version numbers of the at least a portion of the data in the hierarchy tree. The detection module is used to detect, based on the detection order from the version number in the upper-level node to the version number in the lower-level node in the hierarchical relationship and the hierarchical tree in the server, whether at least one piece of data of the at least part of the data has been updated in the server. The hierarchical tree includes at least two levels of nodes. The lowest-level node in the at least two-level nodes includes version numbers of each data item in the dataset. The non-lowest-level nodes in the at least two-level nodes include at least one version number. Each version number in a non-lowest-level node is concatenated with at least two version numbers from multiple version numbers in its adjacent lower-level nodes. Different version numbers in a non-lowest-level node are concatenated with different version numbers in its adjacent lower-level nodes. The hierarchical tree is used to detect, when the client caches at least a portion of the data in a dataset containing multiple data items on the server, whether at least one data item in the at least a portion of the data has been updated on the server. The server is configured to: obtain a new version number of the modified data when the data in the dataset is modified; replace the old version number of the modified data with the new version number of the modified data in the hierarchical tree; and update the version numbers of all cascaded parent nodes of the modified data in the hierarchical tree with the new version number of the modified data.
13. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the data processing method as described in any one of claims 1 to 8.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data processing method as described in any one of claims 1 to 8.