Data processing method and device, storage medium and electronic equipment

By using hash table technology in the master device to generate and synchronize the initial keys of objects, the problems of low efficiency and bandwidth consumption caused by too much information during configuration object synchronization are solved, and efficient configuration synchronization is achieved.

CN116418823BActive Publication Date: 2026-03-17HILLSTONE NETWORKS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-17
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

When configuring object synchronization, the large amount of information carried leads to low synchronization efficiency and consumes network bandwidth, and existing technologies have not been able to effectively solve this problem.

Method used

Hash table technology is used to generate the initial key of the object in the master device and store it in the hash table through the hash address. The updated hash table is synchronized to the slave device, which reduces the amount of name data carried, improves transmission efficiency and reduces network bandwidth consumption.

Benefits of technology

When synchronizing configuration objects between devices using hash table technology, the amount of name data carried is reduced, synchronization efficiency is improved, and network bandwidth usage is reduced. In particular, when there is dynamic data synchronization of a large number of associated configuration object name indexes between devices, configuration synchronization efficiency is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116418823B_ABST
    Figure CN116418823B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method, apparatus, storage medium, and electronic device. The method includes: obtaining the initial name of a first object added to a master device, generating a first value based on the initial name, and determining the first value as an initial key; calculating the hash address of the initial key to obtain a first hash address, and determining whether a third object is stored in the first hash address; if no third object is stored in the first hash address, associating the initial key with the initial name and storing it in the first hash address; if a third object is stored in the first hash address, changing the initial key based on the initial name to obtain a target key; calculating the second hash address of the target key, and storing the target key and the initial name in the second hash address. This application solves the problem in related technologies where synchronizing configuration objects involves carrying a large amount of information, resulting in low synchronization efficiency and high network bandwidth consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and more specifically, to a data processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] High availability (HA) of network devices is typically achieved by combining multiple devices with identical hardware and software. When one device fails and cannot handle network traffic, the traffic can be switched to other available devices in a timely manner, thus ensuring uninterrupted network communication and greatly improving communication reliability.

[0003] Synchronizing configuration data across multiple devices is a fundamental function of High Availability (HA). Figure 1 This is a schematic diagram of data synchronization methods used in existing technologies, such as... Figure 1 As shown, in network devices, there are some configuration objects (hereinafter referred to as first-level configuration objects) indexed by name, and multiple second-level configuration objects exist under each first-level configuration object. When second-level configuration objects perform HA synchronization, they need to carry the name of the first-level configuration objects so that the receiving device can correctly process and store the synchronized configuration, ensuring configuration consistency among HA devices.

[0004] Since the name of a configuration object is usually a long string, which may be tens of bytes or even hundreds of bytes, when a secondary configuration object needs to carry the name of its primary configuration object during HA synchronization, it will lead to unnecessary network bandwidth consumption and a decrease in HA configuration synchronization efficiency.

[0005] In addition to configuration synchronization, when there is a large amount of dynamic data (such as sessions) that needs to be synchronized between HA devices and requires carrying the index of associated configuration object names, the impact on network bandwidth usage and HA configuration synchronization efficiency will be more obvious.

[0006] There is currently no effective solution to the problem that the synchronization of configuration objects involves a lot of information, resulting in low synchronization efficiency and high network bandwidth consumption. Summary of the Invention

[0007] This application provides a data processing method, apparatus, storage medium, and electronic device to solve the problem in the related art that when synchronizing configuration objects, a large amount of information is carried, resulting in low synchronization efficiency and high network bandwidth consumption.

[0008] According to one aspect of this application, a data processing method is provided. The method includes: obtaining a first object added to the master device, obtaining the initial name of the first object, generating a first value based on the initial name, and determining the first value as the initial key of the first object; calculating the hash address of the initial key in the hash table of the master device to obtain a first hash address, and determining whether a third object is stored in the first storage node indicated by the first hash address, wherein the third object refers to an object with the same key as the initial key; if the third object is not stored in the first storage node, associating the initial key with the initial name and storing it in the first storage node to obtain an updated hash table; if the third object is stored in the first storage node, changing the initial key based on the initial name to obtain a target key; calculating the second hash address of the target key in the hash table, associating the target key with the initial name and storing it in the second storage node indicated by the second hash address to obtain an updated hash table; sending the updated hash table to the slave device, receiving a synchronization command, parsing the synchronization command to obtain a second object, determining the key of the first object corresponding to the second object in the hash table to obtain the current key, and sending the second object and the current key to the slave device, wherein the synchronization command is used to synchronize the second object to the slave device, and the second object is a child object of the first object.

[0009] Optionally, if a third object is stored in the first storage node, changing the initial keyword based on the initial name to obtain the target keyword includes: obtaining the first preset name of the third object and determining whether the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name; if the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name, setting the initial keyword as the target keyword; if the preset value corresponding to the first preset name is less than the preset value corresponding to the initial name, incrementing the initial keyword by 1 to obtain the updated initial keyword, and re-executing the step of calculating the hash address of the initial keyword in the hash table in the main device to obtain the first hash address, until the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name, and determining the updated initial keyword as the target keyword.

[0010] Optionally, before associating the target key with the initial name and storing it in the second storage node indicated by the second hash address to obtain the updated hash table, the method further includes: obtaining a fourth object in the second hash address whose key is the same as the target key, and deleting the fourth object from the second storage node indicated by the second hash address; incrementing the key of the fourth object by 1, and adding the adjusted fourth object to the next address of the second hash address to obtain the updated hash table.

[0011] Optionally, after associating the target key with the initial name and storing it in the second storage node indicated by the second hash address to obtain the updated hash table, the method further includes: the master device receiving a deletion instruction, determining the third hash address of the fifth object based on the first key in the deletion instruction, determining the storage node where the fifth object is located based on the third hash address, and deleting the fifth object from the storage node where the fifth object is located based on the first key, wherein the deletion instruction includes the first key of the fifth object; incrementing the first key by 1 to obtain the second key, and incrementing the third hash address by 1 to obtain the fourth hash address, and determining the current hash table change status based on the object storage status in the fourth storage node indicated by the fourth hash address.

[0012] Optionally, determining the current hash table change based on the object storage status in the fourth storage node indicated by the fourth hash address includes: determining whether the sixth object associated with the second key is stored in the fourth storage node; if the sixth object associated with the second key is not stored in the fourth storage node, determining the current hash table as the updated hash table; if the sixth object associated with the second key is stored in the fourth storage node, obtaining the second preset name of the sixth object and generating a second value based on the second preset name; determining whether the second value is less than or equal to the first key; if the second value is greater than the first key, determining the current hash table as the updated hash table; if the second value is less than or equal to the first key, moving the sixth object from the fourth storage node to the third storage node and modifying the second key of the sixth object to the first key, wherein the hash address of the third storage node is the third hash address.

[0013] Optionally, after sending the second object and the current keyword to the slave device, the method further includes: the slave device retrieving the initial name of the first object of the second object from a hash table in the slave device based on the current keyword.

[0014] Optionally, calculating the hash address of the initial key in the hash table in the master device to obtain the first hash address includes: obtaining the length of the hash table to obtain the initial length; dividing the initial key by the initial length to obtain the remainder; and determining the remainder as the first hash address.

[0015] According to another aspect of this application, a data processing apparatus is provided. The apparatus includes: a first acquisition unit, configured to acquire a first object added to a master device, acquire the initial name of the first object, generate a first value based on the initial name, and determine the first value as the initial key of the first object; a first calculation unit, configured to calculate the hash address of the initial key in a hash table in the master device, obtain a first hash address, and determine whether a third object is stored in a first storage node indicated by the first hash address, wherein the third object refers to an object with the same key as the initial key; a storage unit, configured to, if no third object is stored in the first storage node, associate the initial key with the initial name and store it in the first storage node to obtain an updated hash table; and a first modification unit, configured to, in the first... If a third object is stored in the storage node, the initial key is changed according to the initial name to obtain the target key; the second calculation unit is used to calculate the second hash address of the target key in the hash table, and associate the target key with the initial name and store it in the second storage node indicated by the second hash address to obtain the updated hash table; the synchronization unit is used to send the updated hash table to the slave device, receive the synchronization instruction, parse the synchronization instruction to obtain the second object, determine the key of the first object corresponding to the second object in the hash table to obtain the current key, and send the second object and the current key to the slave device. The synchronization instruction is used to synchronize the second object to the slave device, and the second object is a child object of the first object.

[0016] According to another aspect of the present invention, a computer storage medium is also provided for storing a program, wherein the program, when running, controls the device where the computer storage medium is located to execute a data processing method.

[0017] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions execute a data processing method when executed.

[0018] This application employs the following steps: First, an object is added to the master device. The initial name of the first object is obtained, and a first value is generated based on the initial name. This first value is then used as the initial key of the first object. The hash address of the initial key in the hash table of the master device is calculated to obtain a first hash address. It is then determined whether a third object is stored in the first storage node indicated by the first hash address. The third object refers to an object whose key is the same as the initial key. If no third object is stored in the first storage node, the initial key is associated with the initial name and stored in the first storage node to obtain an updated hash table. If a third object is stored in the first storage node, the initial key is changed based on the initial name to obtain a target key. The second hash address of the target key in the hash table is calculated, and the target key is associated with the initial name and stored in the second storage node indicated by the second hash address to obtain an updated hash table. The updated hash table is sent to the slave device, and a synchronization command is received. The synchronization command is parsed to obtain a second object. The key of the first object corresponding to the second object is determined in the hash table to obtain the current key. The second object and the current key are then sent to the slave device. The synchronization command is used to synchronize the second object to the slave device, and the second object is a child object of the first object. This solution addresses the problem in related technologies where synchronizing configuration objects involves carrying a large amount of information, leading to low synchronization efficiency and high network bandwidth consumption. By setting up a hash table in the master device and storing the information of the first object to which the second object belongs in the hash table before synchronizing the second object, and then synchronizing the hash table to the slave device, the second object can be synchronized to the slave device using the key corresponding to the first object. At this point, the name of the first object can be determined from the hash table in the slave device using the key. This achieves the effect of not needing to carry a large amount of name data during object synchronization, improving transmission efficiency. Furthermore, when there is a large amount of dynamic data that needs to be carried between devices, including the index of associated configuration object names, this method can also reduce the impact on network bandwidth consumption and configuration synchronization efficiency. Attached Figure Description

[0019] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0020] Figure 1 This is a schematic diagram of the data synchronization method used in existing technology;

[0021] Figure 2 This is a flowchart of a data processing method provided according to an embodiment of this application;

[0022] Figure 3This is a flowchart of the object storage process provided according to an embodiment of this application;

[0023] Figure 4 This is a schematic diagram of an optional hash table provided according to an embodiment of this application;

[0024] Figure 5 This is a flowchart of the object deletion process provided in the embodiments of this application;

[0025] Figure 6 This is a schematic diagram of a data processing apparatus provided according to an embodiment of this application. Detailed Implementation

[0026] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.

[0030] According to an embodiment of this application, a data processing method is provided.

[0031] Figure 2 This is a flowchart of a data processing method provided according to an embodiment of this application. For example... Figure 2 As shown, the method includes the following steps:

[0032] Step S201: Obtain the first object added to the main device, obtain the initial name of the first object, generate a first value based on the initial name, and determine the first value as the initial keyword of the first object.

[0033] Specifically, this application addresses Figure 1 The synchronization method for the second-level configuration object has been changed; the first object can be... Figure 1 Before backing up the first object from the master device to the slave device, the name of the first object, i.e. the initial name, needs to be determined. The initial name is then hashed to generate a value, which is then used as the initial key of the first object.

[0034] Step S202: Calculate the hash address of the initial key in the hash table of the master device to obtain the first hash address, and determine whether the first storage node indicated by the first hash address stores a third object, wherein the third object refers to an object with the same key as the initial key.

[0035] Specifically, after obtaining the initial key, the hash address of the first object in the hash table of the main device can be calculated using the initial key, so that the first object and the initial key can be associated and stored in the corresponding hash address.

[0036] It should be noted that if a third object with the same key as the initial key exists in the first storage node indicated by the first hash address, it is necessary to determine whether the third object is the same as the first object. If the names of the third object and the first object are exactly the same, the key and hash address of the third object can be directly used as the carrying information of the second object and sent to the slave device. If the third object and the first object are different, it indicates that the initial key generated by the names of the third object and the first object is exactly the same. In this case, the first object needs to be stored in the storage nodes indicated by the remaining hash addresses to ensure the accuracy of the object name determined based on the key.

[0037] Step S203: If the third object is not stored in the first storage node, the initial key and the initial name are associated and stored in the first storage node to obtain the updated hash table.

[0038] Specifically, if there is no third object in the first storage node, the initial key and initial name can be directly associated and stored in the first storage node, and two objects with the same key will not be generated in the first storage node.

[0039] Figure 3 This is a flowchart of the object storage process provided according to an embodiment of this application, such as... Figure 3 As shown in step 1, the key is the object's keyword. The keyword for object 1 is 22, so the hash address for storage can be calculated from the keyword as 2. Therefore, it is stored in the storage node with hash address 2. Similarly, objects 2 and 3 can be stored in the storage nodes with hash addresses 3 and 4, respectively.

[0040] Step S204: If a third object is stored in the first storage node, change the initial keyword according to the initial name to obtain the target keyword.

[0041] Specifically, if a third object is stored in the first storage node, it indicates that the first object cannot be stored in the first storage node. In this case, it is necessary to determine whether to store the first object in another storage node, or to store the first object in the first storage node and store the third object in another node.

[0042] It should be noted that the type of object to be moved can be determined by examining the names of the first and third objects. The name content can be determined by the order of the letters in the name to determine whether a keyword change is needed. For example, if the first object's name is "bcd" and the third object's name is "abc", then the first letter of the first object's name is "b", and the first letter of the third object's name is "a". Since the ASCII code of "b" is greater than that of "a", the value of the first object's name is greater than the value of the third object's name. In this case, the first object is stored in another storage node. If the value corresponding to the first object's name is less than that of the third object, the first object is stored in the first storage node, and the third object is stored in another storage node.

[0043] Step S205: Calculate the second hash address of the target key in the hash table, and associate the target key with the initial name and store it in the second storage node indicated by the second hash address to obtain the updated hash table.

[0044] Specifically, if the value of the name of the first object is greater than that of the third object, the initial key can be updated to the target key, and the second hash address corresponding to the target key can be calculated. Then, the process described above is used to determine whether the first object can be stored in the second storage node indicated by the second hash address. If it can be stored in the second storage node, the first object is associated with the target key and stored in the second storage node, thereby completing the update of the hash table.

[0045] Step S206: Send the updated hash table to the slave device, receive the synchronization instruction, parse the synchronization instruction to obtain the second object, determine the key of the first object corresponding to the second object in the hash table, obtain the current key, and send the second object and the current key to the slave device. The synchronization instruction is used to synchronize the second object to the slave device, and the second object is a child object of the first object.

[0046] It should be noted that the second object can be Figure 1 One of the multiple secondary configuration objects under the first object can update its hash table by sending the hash table to the slave device after the hash table update is completed. Since the slave device has the same hash table as the master device, when the master device synchronizes the secondary configuration object to the slave device, it can directly carry the current key of the first object in the hash table. The slave device can then determine the initial name of the first object using the current key. This achieves the effect that when synchronizing the second object, it is not necessary to carry the initial name of the first object, which has a large amount of data, but can directly determine the initial name of the first object in the hash table using the initial key.

[0047] Specifically, after the master device receives the synchronization command, it retrieves the second object from the synchronization command, determines the initial name of the first object through the association between the second object and the first object, determines the current key in the hash table based on the initial name, and sends the current key along with the second object to the slave device. Thus, the name of the first object can be retrieved from the hash table in the slave device based on the current key.

[0048] Furthermore, when the hash table in the master device changes, the entire changed hash table can be synchronously sent to the slave device to complete the hash table change in the slave device. Alternatively, the first object added to the master device can be sent to the slave device, and the above steps can be performed in the slave device to make the hash table in the slave device undergo the same change as the hash table in the master device.

[0049] The data processing method provided in this application embodiment obtains a first object added to a master device, obtains the initial name of the first object, generates a first value based on the initial name, and determines the first value as the initial key of the first object; calculates the hash address of the initial key in the hash table in the master device to obtain a first hash address, and determines whether a third object is stored in the first storage node indicated by the first hash address, wherein the third object refers to an object with the same key as the initial key; if the third object is not stored in the first storage node, the initial key is associated with the initial name and stored in the first storage node to obtain an updated hash table; if the third object is stored in the first storage node, the initial key is changed according to the initial name to obtain a target key; calculates the second hash address of the target key in the hash table, and associates the target key with the initial name and stores it in the second storage node indicated by the second hash address to obtain an updated hash table; sends the updated hash table to a slave device, receives a synchronization instruction, parses the synchronization instruction to obtain a second object, determines the key of the first object corresponding to the second object in the hash table to obtain the current key, and sends the second object and the current key to the slave device, wherein the synchronization instruction is used to synchronize the second object to the slave device, and the second object is a child object of the first object. This solution addresses the problem in related technologies where synchronizing configuration objects involves carrying a large amount of information, leading to low synchronization efficiency and high network bandwidth consumption. By setting up a hash table in the master device and storing the information of the first object to which the second object belongs in the hash table before synchronizing the second object, and then synchronizing the hash table to the slave device, the second object can be synchronized to the slave device using the key corresponding to the first object. At this point, the name of the first object can be determined from the hash table in the slave device using the key. This achieves the effect of not needing to carry a large amount of name data during object synchronization, improving transmission efficiency. Furthermore, when there is a large amount of dynamic data that needs to be carried between devices, including the index of associated configuration object names, this method can also reduce the impact on network bandwidth consumption and configuration synchronization efficiency.

[0050] Optionally, in the data processing method provided in the embodiments of this application, when a third object is stored in the first storage node, changing the initial keyword according to the initial name to obtain a target keyword includes: obtaining a first preset name of the third object and determining whether a preset value corresponding to the first preset name is greater than a preset value corresponding to the initial name; when the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name, setting the initial keyword as the target keyword; when the preset value corresponding to the first preset name is less than the preset value corresponding to the initial name, adding 1 to the initial keyword to obtain an updated initial keyword, and re-executing the step of calculating a hash address of the initial keyword in a hash table of the master device to obtain a first hash address until the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name, and determining the updated initial keyword as the target keyword.

[0051] It should be noted that the value corresponding to the name can be the ASCII code corresponding to the name. For example, if the name of the first object is bcd and the name of the third object is abc, then the first character of the name of the first object is b, and the first character of the name of the third object is a. At this time, since the ASCII code of b is greater than that of a, the value of the name of the first object is greater than the value of the name of the third object.

[0052] Specifically, as Figure 3 shown, where the value of str_1 < the value of str_4 < the value of str_2.

[0053] Name of object 1: str_1, string Hash value calculated by name: 22;

[0054] Name of object 2: str_2, string Hash value calculated by name: 23;

[0055] Name of object 3: str_3, string Hash value calculated by name: 24;

[0056] Name of object 4: str_4, string Hash value calculated by name: 22;

[0057] In step 2 after storing objects 1-3, since the initial key of object 4 is 22, the same as that of object 1, in the current scenario, object 4 in the diagram is the first object, and object 1 in the diagram is the third object. At this time, it is necessary to determine and compare the length of the name str_4 of object 4 with the name str_1 of object 1. Since the name str_4 of object 4 is greater than the name str_1 of object 1, the initial key 22 of object 4 is incremented by 1 to obtain the updated initial key 23. The hash address is then recalculated to 3 based on the updated initial key. At this time, it is necessary to compare object 4 with object 2. Since the updated initial key of object 4 is still the same as the key of object 2, which is 23, it is necessary to compare the length of the name str_4 of object 4 with the name str_2 of object 2. Since the name str_4 of object 4 is less than the name str_2 of object 2, object 4 is stored in the storage node with hash address 3.

[0058] Because of Figure 3 When storing object 4, it is necessary to move objects in the storage node that have the same key as object 4. Therefore, optionally, in the data processing method provided in this application embodiment, before associating the target key with the initial name and storing it in the second storage node indicated by the second hash address to obtain the updated hash table, the method further includes: obtaining a fourth object in the second hash address whose key is the same as the target key, and deleting the fourth object from the second storage node indicated by the second hash address; incrementing the key of the fourth object by 1, and adding the adjusted fourth object to the next address of the second hash address to obtain the updated hash table.

[0059] It should be noted that, Figure 4 This is a schematic diagram of an optional hash table provided in an embodiment of this application. When the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name (i.e., the name str_4 of object 4 is less than the name str_1 of object 1), object 4 is stored in the storage unit with hash address 2. At this time, object 1 needs to be re-stored. Object 1 becomes the fourth object, and the key of object 1 is incremented by 1, and the hash address of object 1 is also incremented by 1, changing from 22 and 2 to 23 and 3. During storage, object 1 is compared with object 2, which has the same hash address. Since the length of the name of object 1 is less than that of object 2, object 1 is added to the storage unit with hash address 3, and object 2 is moved. This process is repeated, moving object 2 to the storage node with hash address 4 and object 3 to the storage node with hash address 5, thus obtaining the following... Figure 4 The hash table shown.

[0060] Optionally, in the data processing method provided in this application embodiment, after associating the target keyword with the initial name and storing it in the second storage node indicated by the second hash address to obtain the updated hash table, the method further includes: the master device receiving a deletion instruction, determining the third hash address of the fifth object according to the first keyword in the deletion instruction, determining the storage node where the fifth object is located according to the third hash address, and deleting the fifth object from the storage node where the fifth object is located according to the first keyword, wherein the deletion instruction includes the first keyword of the fifth object; incrementing the first keyword by 1 to obtain the second keyword, and incrementing the third hash address by 1 to obtain the fourth hash address, and determining the current hash table change status according to the object storage status in the fourth storage node indicated by the fourth hash address.

[0061] Specifically, after updating the hash table, the objects stored in the hash table and their information can also be deleted. For example, upon receiving a deletion command, the object to be deleted can be determined based on the first key in the deletion command. Figure 5 This is a flowchart of the object deletion process provided in the embodiments of this application. Figure 5 In the given information, object 4 has a key of 22 and a hash address of 2; object 1 has a key of 23 and a hash address of 3; object 2 has a key of 24 and a hash address of 4; and object 3 has a key of 25 and a hash address of 5. Given that the first key is 22, object 4 should be deleted. The third hash address of the first key is determined to be 2. The first key is then incremented by 1 to obtain the second key. The third hash address is then incremented by 1 to obtain the second key, which is 23. The fourth hash address is 3. This allows us to find the corresponding object, object 1, and determine whether object 1 needs to be moved based on its name.

[0062] Furthermore, to determine whether object 1 needs to be moved, optionally, in the data processing method provided in this application embodiment, determining the change status of the current hash table based on the object storage status in the fourth storage node indicated by the fourth hash address includes: determining whether the sixth object associated with the second key is stored in the fourth storage node; if the sixth object associated with the second key is not stored in the fourth storage node, determining the current hash table as the updated hash table; if the sixth object associated with the second key is stored in the fourth storage node, obtaining the second preset name of the sixth object and generating a second value based on the second preset name; determining whether the second value is less than or equal to the first key; if the second value is greater than the first key, determining the current hash table as the updated hash table; if the second value is less than or equal to the first key, moving the sixth object from the fourth storage node to the third storage node, and modifying the second key of the sixth object to the first key, wherein the hash address of the third storage node is the third hash address.

[0063] Specifically, first, after determining the fourth hash address, it is necessary to determine whether the sixth object associated with the second key is stored in the fourth storage node indicated by the fourth hash address. If the sixth object is not stored, it means that the objects currently stored in the hash table do not need to be moved to a storage node, and the hash table update is completed. If the sixth object is stored, it is necessary to determine whether the second value obtained by calculating the name of the sixth object is the same as the first key. If the second value is greater than the first key, it means that when the sixth object is added to the hash table, the position added is the current fourth hash address, that is, the sixth object has not been moved, and no adjustment is needed. If the second value is less than or equal to the first key, it means that the sixth object should have been stored in the hash address before the fourth hash address, but since the previous hash address stores an object with the same value as the second key, the sixth object is moved to the current fourth hash address for storage. Therefore, the sixth object needs to be moved forward, that is, the sixth object is moved from the fourth storage node to the third storage node, and the second key of the sixth object is changed to the first key, so that the sixth object is moved to a more accurate storage node.

[0064] For example, such as Figure 5 As shown:

[0065] The string hash value of object 4 calculated by name is 22, and the current key is 22;

[0066] The string hash value of object 1 calculated by name is 22, and the current key is 23;

[0067] The string hash value of object 2 calculated by name is 23, and the current key is 24;

[0068] The string hash value of object 3 calculated by name is 25, and the current key is 25;

[0069] After deleting object 4, since object 4's address is 2 and its key is 22, we first determine if an object with key 23 exists in the storage node at hash address 3. Since object 1 exists and meets the above conditions, we need to determine that object 1's string hash value calculated by its name is 22, which is equal to the first key, i.e., object 4's key 22. Therefore, we need to move it forward, i.e., move object 1 to the storage unit at address 2 and adjust the key from 23 to 22. Thus, the updated information is: object 1's string hash value calculated by its name: 22, current key 22. Similarly, after moving object 1, we need to continue checking the next hash address. Using the same method, we move object 2 to the storage unit at address 3. When determining whether object 3 needs to be moved, it's equivalent to deleting object 2. The first key is then object 2's key, i.e., 24. Since object 3's string hash value calculated by its name: 25 is greater than 24, no movement is needed. Thus, we obtain... Figure 5 The hash table in step 4 is the final hash table obtained after updating the positions of all objects.

[0070] Optionally, in the data processing method provided in the embodiments of this application, after sending the second object and the current keyword to the slave device, the method further includes: the slave device obtaining the initial name of the first object of the second object from the hash table in the slave device according to the current keyword.

[0071] Specifically, when the master device synchronizes the secondary configuration object, since the name of the primary configuration object exists in the hash table in the master device, the secondary object and the current key can be sent to the slave device. Thus, the initial name corresponding to the current key can be determined in the hash table in the slave device, and the initial name of the primary object corresponding to the secondary object can be obtained from the slave device without transmitting the initial name.

[0072] Optionally, in the data processing method provided in this application embodiment, calculating the hash address of the initial key in the hash table in the master device to obtain the first hash address includes: obtaining the length of the hash table to obtain the initial length; dividing the initial key by the initial length to obtain the remainder; and determining the remainder as the first hash address.

[0073] It should be noted that a hash table can be a hash chain. Each hash address in the hash chain indicates a storage node that includes multiple storage spaces. The objects stored in each storage space are different, but the hash addresses of each storage space are the same.

[0074] Specifically, when calculating the hash address, the division and remainder method can be used. For example, if the hash table length is 10 and the initial key of the first object is 22, dividing the initial key by the table length and obtaining a remainder of 2, then the first hash address corresponding to the first object is the storage node with address 2.

[0075] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0076] This application also provides a data processing apparatus. It should be noted that the data processing apparatus of this application can be used to execute the data processing method provided in this application. The data processing apparatus provided in this application will be described below.

[0077] Figure 6 This is a schematic diagram of a data processing apparatus provided according to an embodiment of this application. For example... Figure 6 As shown, the device includes: a first acquisition unit 61, a first calculation unit 62, a storage unit 63, a first modification unit 64, a second calculation unit 65, and a synchronization unit 66.

[0078] The first acquisition unit 61 is used to acquire the first object added to the main device, acquire the initial name of the first object, generate a first value based on the initial name, and determine the first value as the initial keyword of the first object.

[0079] Specifically, the first object can be Figure 1 Before backing up the first object from the master device to the slave device, the name of the first object, i.e. the initial name, needs to be determined. The initial name is then hashed to generate a value, which is then used as the initial key of the first object.

[0080] The first calculation unit 62 is used to calculate the hash address of the initial key in the hash table in the master device, obtain the first hash address, and determine whether the first storage node indicated by the first hash address stores a third object, wherein the third object refers to an object whose key is the same as the initial key.

[0081] Specifically, after obtaining the initial key, the hash address of the first object in the hash table of the main device can be calculated using the initial key, so that the first object and the initial key can be associated and stored in the corresponding hash address.

[0082] It should be noted that if a third object with the same key as the initial key exists in the first storage node indicated by the first hash address, it is necessary to determine whether the third object is the same as the first object. If the names of the third object and the first object are exactly the same, the key and hash address of the third object can be directly used as the carrying information of the second object and sent to the slave device. If the third object and the first object are different, it indicates that the initial key generated by the names of the third object and the first object is exactly the same. In this case, the first object needs to be stored in the storage nodes indicated by the remaining hash addresses to ensure the accuracy of the object name determined based on the key.

[0083] Storage unit 63 is used to associate the initial key with the initial name and store it in the first storage node when no third object is stored in the first storage node, so as to obtain an updated hash table.

[0084] Specifically, if there is no third object in the first storage node, the initial key and initial name can be directly associated and stored in the first storage node, and two objects with the same key will not be generated in the first storage node.

[0085] Figure 3 This is a flowchart of the object storage process provided according to an embodiment of this application, such as... Figure 3 As shown in step 1, the key is the object's keyword. The keyword for object 1 is 22, so the hash address for storage can be calculated from the keyword as 2. Therefore, it is stored in the storage node with hash address 2. Similarly, objects 2 and 3 can be stored in the storage nodes with hash addresses 3 and 4, respectively.

[0086] The first modification unit 64 is used to modify the initial keyword according to the initial name to obtain the target keyword when a third object is stored in the first storage node.

[0087] Specifically, if a third object is stored in the first storage node, it indicates that the first object cannot be stored in the first storage node. In this case, it is necessary to determine whether to store the first object in another storage node, or to store the first object in the first storage node and store the third object in another node.

[0088] It should be noted that the type of object to be moved can be determined by examining the names of the first and third objects. The name content can be determined by the order of the letters in the name to determine whether a keyword change is needed. For example, if the first object's name is "bcd" and the third object's name is "abc", then the first letter of the first object's name is "b", and the first letter of the third object's name is "a". Since the ASCII code of "b" is greater than "a", the name of the first object is considered greater than that of the third object. In this case, the first object is stored in a different storage node. If the value corresponding to the name of the first object is less than that of the third object, the first object is stored in the first storage node, and the third object is stored in a different storage node.

[0089] The second calculation unit 65 is used to calculate the second hash address of the target key in the hash table, and associate the target key with the initial name and store it in the second storage node indicated by the second hash address to obtain the updated hash table.

[0090] Specifically, if the value of the name of the first object is greater than that of the third object, the initial key can be updated to the target key, and the second hash address corresponding to the target key can be calculated. Then, the process described above is used to determine whether the first object can be stored in the second storage node indicated by the second hash address. If it can be stored in the second storage node, the first object is associated with the target key and stored in the second storage node, thereby completing the update of the hash table.

[0091] Synchronization unit 66 is used to send the updated hash table to the slave device, receive synchronization instructions, parse the synchronization instructions, obtain the second object, determine the key of the first object corresponding to the second object in the hash table, obtain the current key, and send the second object and the current key to the slave device. The synchronization instructions are used to synchronize the second object to the slave device, and the second object is a child object of the first object.

[0092] It should be noted that the second object can be Figure 1 One of the multiple secondary configuration objects under the first object can update its hash table by sending the hash table to the slave device after the hash table update is completed. Since the slave device has the same hash table as the master device, when the master device synchronizes the secondary configuration object to the slave device, it can directly carry the current key of the first object in the hash table. The slave device can then determine the initial name of the first object using the current key. This achieves the effect that when synchronizing the second object, it is not necessary to carry the initial name of the first object, which has a large amount of data, but can directly determine the initial name of the first object in the hash table using the initial key.

[0093] Specifically, after the master device receives the synchronization command, it retrieves the second object from the synchronization command, determines the initial name of the first object through the association between the second object and the first object, determines the current key in the hash table based on the initial name, and sends the current key along with the second object to the slave device. Thus, the name of the first object can be retrieved from the hash table in the slave device based on the current key.

[0094] Furthermore, when the hash table in the master device changes, the entire changed hash table can be synchronously sent to the slave device to complete the hash table change in the slave device. Alternatively, the first object added to the master device can be sent to the slave device, and the above steps can be performed in the slave device to make the hash table in the slave device undergo the same change as the hash table in the master device.

[0095] The data processing apparatus provided in this application embodiment includes a first acquisition unit 61, used to acquire a first object added to the main device, acquire the initial name of the first object, generate a first value based on the initial name, and determine the first value as the initial key of the first object; a first calculation unit 62, used to calculate the hash address of the initial key in the hash table in the main device, obtain the first hash address, and determine whether the first storage node indicated by the first hash address stores a third object, wherein the third object refers to an object with the same key as the initial key; a storage unit 63, used to, if the first storage node does not store a third object, associate the initial key with the initial name and store it in the first storage node to obtain an updated hash table; and a first modification unit. 64 is used to change the initial key according to the initial name to obtain the target key when a third object is stored in the first storage node; the second calculation unit 65 is used to calculate the second hash address of the target key in the hash table, associate the target key with the initial name and store it in the second storage node indicated by the second hash address, to obtain the updated hash table; the synchronization unit 66 is used to send the updated hash table to the slave device, receive the synchronization instruction, parse the synchronization instruction to obtain the second object, determine the key of the first object corresponding to the second object in the hash table, obtain the current key, and send the second object and the current key to the slave device. The synchronization instruction is used to synchronize the second object to the slave device, and the second object is a child object of the first object. This solves the problem in related technologies where the synchronization of configuration objects involves a large amount of information, resulting in low synchronization efficiency and high network bandwidth consumption. By setting up a hash table in the master device and storing the information of the first object to which the second object belongs in the hash table before synchronizing the second object, and synchronizing the hash table to the slave device, the second object can be synchronized to the slave device using the key corresponding to the first object. At this time, the name of the first object can be determined by the key in the hash table in the slave device. This achieves the effect of not needing to carry a large amount of name data when synchronizing objects, thus improving transmission efficiency. Furthermore, when there is a large amount of dynamic data that needs to carry the associated configuration object name index between devices, the above method can also reduce the impact on network bandwidth consumption and configuration synchronization efficiency.

[0096] Optionally, in the data processing device provided in the embodiments of the present application, the first change unit 64 includes: a second acquisition module, configured to acquire a first preset name of a third object and determine whether a preset value corresponding to the first preset name is greater than a preset value corresponding to an initial name; a setting module, configured to set an initial keyword as a target keyword when the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name; a second determination module, configured to add 1 to the initial keyword to obtain an updated initial keyword when the preset value corresponding to the first preset name is less than the preset value corresponding to the initial name, and re-execute the step of calculating a hash address of the initial keyword in a hash table of a master device to obtain a first hash address until the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name, and determine the updated initial keyword as the target keyword.

[0097] It should be noted that the value corresponding to the name may be the ASCII code corresponding to the name. For example, if the name of the first object is bcd and the name of the third object is abc, then the first character of the name of the first object is b, and the first character of the name of the third object is a. At this time, since the ASCII code of b is greater than that of a, the value of the name of the first object is greater than the value of the name of the third object.

[0098] Specifically, as Figure 3 shown, where the value of str_1 < the value of str_4 < the value of str_2.

[0099] Name of object 1: str_1, string Hash value calculated by name: 22;

[0100] Name of object 2: str_2, string Hash value calculated by name: 23;

[0101] Name of object 3: str_3, string Hash value calculated by name: 24;

[0102] Name of object 4: str_4, string Hash value calculated by name: 22;

[0103] In step 2 after storing objects 1-3, since the initial key of object 4 is 22, the same as that of object 1, in the current scenario, object 4 in the diagram is the first object, and object 1 in the diagram is the third object. At this time, it is necessary to determine and compare the length of the name str_4 of object 4 with the name str_1 of object 1. Since the name str_4 of object 4 is greater than the name str_1 of object 1, the initial key 22 of object 4 is incremented by 1 to obtain the updated initial key 23. The hash address is then recalculated to 3 based on the updated initial key. At this time, it is necessary to compare object 4 with object 2. Since the updated initial key of object 4 is still the same as the key of object 2, which is 23, it is necessary to compare the length of the name str_4 of object 4 with the name str_2 of object 2. Since the name str_4 of object 4 is less than the name str_2 of object 2, object 4 is stored in the storage node with hash address 3.

[0104] Because of Figure 3 When storing object 4, it is necessary to move objects in the storage node that have the same key as object 4. Therefore, optionally, in the data processing method provided in this application embodiment, before associating the target key with the initial name and storing it in the second storage node indicated by the second hash address to obtain the updated hash table, the method further includes: obtaining a fourth object in the second hash address whose key is the same as the target key, and deleting the fourth object from the second storage node indicated by the second hash address; incrementing the key of the fourth object by 1, and adding the adjusted fourth object to the next address of the second hash address to obtain the updated hash table.

[0105] It should be noted that, Figure 4 This is a schematic diagram of an optional hash table provided in an embodiment of this application. When the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name (i.e., the name str_4 of object 4 is less than the name str_1 of object 1), object 4 is stored in the storage unit with hash address 2. At this time, object 1 needs to be re-stored. Object 1 becomes the fourth object, and the key of object 1 is incremented by 1, and the hash address of object 1 is also incremented by 1, changing from 22 and 2 to 23 and 3. During storage, object 1 is compared with object 2, which has the same hash address. Since the length of the name of object 1 is less than that of object 2, object 1 is added to the storage unit with hash address 3, and object 2 is moved. This process is repeated, moving object 2 to the storage node with hash address 4 and object 3 to the storage node with hash address 5, thus obtaining the following... Figure 4 The hash table shown.

[0106] Optionally, in the data processing apparatus provided in the embodiments of this application, the apparatus further includes: a deletion unit, configured to receive a deletion instruction from the master device, determine the third hash address of the fifth object according to the first key in the deletion instruction, determine the storage node where the fifth object is located according to the third hash address, and delete the fifth object from the storage node where the fifth object is located according to the first key, wherein the deletion instruction includes the first key of the fifth object; and a first determination unit, configured to add 1 to the first key to obtain the second key, add 1 to the third hash address to obtain the fourth hash address, and determine the current hash table change status according to the object storage status in the fourth storage node indicated by the fourth hash address.

[0107] Specifically, after updating the hash table, the objects stored in the hash table and their information can also be deleted. For example, upon receiving a deletion command, the object to be deleted can be determined based on the first key in the deletion command. Figure 5 This is a flowchart of the object deletion process provided in the embodiments of this application. Figure 5 In the given information, object 4 has a key of 22 and a hash address of 2; object 1 has a key of 23 and a hash address of 3; object 2 has a key of 24 and a hash address of 4; and object 3 has a key of 25 and a hash address of 5. Given that the first key is 22, object 4 should be deleted. The third hash address of the first key is determined to be 2. The first key is then incremented by 1 to obtain the second key. The third hash address is then incremented by 1 to obtain the second key, which is 23. The fourth hash address is 3. This allows us to find the corresponding object, object 1, and determine whether object 1 needs to be moved based on its name.

[0108] Furthermore, to determine whether object 1 needs to be moved, optionally, in the data processing apparatus provided in this application embodiment, the first determining unit includes: a first determining module, used to determine whether the sixth object associated with the second key is stored in the fourth storage node; a third determining module, used to determine the current hash table as the updated hash table when the sixth object associated with the second key is not stored in the fourth storage node; a generating module, used to obtain the second preset name of the sixth object and generate a second value based on the second preset name when the sixth object associated with the second key is already stored in the fourth storage node; a second determining module, used to determine whether the second value is less than or equal to the first key; a fourth determining module, used to determine the current hash table as the updated hash table when the second value is greater than the first key; and a modifying module, used to move the sixth object from the fourth storage node to the third storage node and modify the second key of the sixth object to the first key when the second value is less than or equal to the first key, wherein the hash address of the third storage node is the third hash address.

[0109] Specifically, first, after determining the fourth hash address, it is necessary to determine whether the sixth object associated with the second key is stored in the fourth storage node indicated by the fourth hash address. If the sixth object is not stored, it means that the objects currently stored in the hash table do not need to be moved to a storage node, and the hash table update is completed. If the sixth object is stored, it is necessary to determine whether the second value obtained by calculating the name of the sixth object is the same as the first key. If the second value is greater than the first key, it means that when the sixth object is added to the hash table, the position added is the current fourth hash address, that is, the sixth object has not been moved, and no adjustment is needed. If the second value is less than or equal to the first key, it means that the sixth object should have been stored in the hash address before the fourth hash address, but since the previous hash address stores an object with the same value as the second key, the sixth object is moved to the current fourth hash address for storage. Therefore, the sixth object needs to be moved forward, that is, the sixth object is moved from the fourth storage node to the third storage node, and the second key of the sixth object is changed to the first key, so that the sixth object is moved to a more accurate storage node.

[0110] For example, such as Figure 5 As shown:

[0111] The string hash value of object 4 calculated by name is 22, and the current key is 22;

[0112] The string hash value of object 1 calculated by name is 22, and the current key is 23;

[0113] The string hash value of object 2 calculated by name is 23, and the current key is 24;

[0114] The string hash value of object 3 calculated by name is 25, and the current key is 25;

[0115] After deleting object 4, since object 4's address is 2 and its key is 22, we first determine if an object with key 23 exists in the storage node at hash address 3. Since object 1 exists and meets the above conditions, we need to determine that object 1's string hash value calculated by its name is 22, which is equal to the first key, i.e., object 4's key 22. Therefore, we need to move it forward, i.e., move object 1 to the storage unit at address 2 and adjust the key from 23 to 22. Thus, the updated information is: object 1's string hash value calculated by its name: 22, current key 22. Similarly, after moving object 1, we need to continue checking the next hash address. Using the same method, we move object 2 to the storage unit at address 3. When determining whether object 3 needs to be moved, it's equivalent to deleting object 2. The first key is then object 2's key, i.e., 24. Since object 3's string hash value calculated by its name: 25 is greater than 24, no movement is needed. Thus, we obtain... Figure 5 The hash table in step 4 is the final hash table obtained after updating the positions of all objects.

[0116] Optionally, in the data processing apparatus provided in the embodiments of this application, the apparatus further includes: a fourth acquisition unit, used to acquire the initial name of the first object of the second object from the hash table in the slave device according to the current keyword.

[0117] Specifically, when the master device synchronizes the secondary configuration object, since the name of the primary configuration object exists in the hash table in the master device, the secondary object and the current key can be sent to the slave device. Thus, the initial name corresponding to the current key can be determined in the hash table in the slave device, and the initial name of the primary object corresponding to the secondary object can be obtained from the slave device without transmitting the initial name.

[0118] Optionally, in the data processing apparatus provided in the embodiments of this application, the first calculation unit 62 includes: a first acquisition module, used to acquire the length of the hash table to obtain an initial length; a calculation module, used to divide the initial key by the initial length to obtain a remainder; and a first determination module, used to determine the remainder as a first hash address.

[0119] It should be noted that a hash table can be a hash chain. Each hash address in the hash chain indicates a storage node that includes multiple storage spaces. The objects stored in each storage space are different, but the hash addresses of each storage space are the same.

[0120] Specifically, when calculating the hash address, the division and remainder method can be used. For example, if the hash table length is 10 and the initial key of the first object is 22, dividing the initial key by the table length and obtaining a remainder of 2, then the first hash address corresponding to the first object is the storage node with address 2.

[0121] The aforementioned data processing device includes a processor and a memory. The first acquisition unit 61, the first calculation unit 62, the storage unit 63, the first modification unit 64, the second calculation unit 65, the synchronization unit 66, etc., are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0122] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, the problem of low synchronization efficiency and excessive network bandwidth consumption caused by carrying too much information when synchronizing configuration objects in related technologies can be solved.

[0123] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0124] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the data processing method.

[0125] This invention provides a processor for running a program, wherein the program executes the data processing method during runtime.

[0126] This invention provides an electronic device, including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the aforementioned data processing steps. The device described herein can be a server, PC, tablet, mobile phone, etc.

[0127] This application also provides a computer program product that, when executed on a data processing device, is suitable for executing a program that initializes the above-described data processing method steps.

[0128] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0130] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0131] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0133] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0134] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0135] It should also be noted that 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 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.

[0136] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A data processing method, characterized by, The method comprises the following steps: acquiring a first object added in a master device, acquiring an initial name of the first object, generating a first numerical value according to the initial name, and determining the first numerical value as an initial keyword of the first object; calculating a hash address of the initial keyword in a hash table in the master device to obtain a first hash address, and judging whether a third object is stored in a first storage node indicated by the first hash address, wherein the third object refers to an object with the same keyword as the initial keyword; in the case that the third object is not stored in the first storage node, storing the initial keyword and the initial name in the first storage node in association to obtain an updated hash table; in the case that the third object is stored in the first storage node, changing the initial keyword according to the initial name to obtain a target keyword, comprising: acquiring a first preset name of the third object, and judging whether a preset value corresponding to the first preset name is greater than a preset value corresponding to the initial name; in the case that the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name, setting the initial keyword as the target keyword; in the case that the preset value corresponding to the first preset name is less than the preset value corresponding to the initial name, adding 1 to the initial keyword to obtain an updated initial keyword, and re-executing the step of calculating the hash address of the initial keyword in the hash table in the master device to obtain the first hash address until the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name, and determining the updated initial keyword as the target keyword; calculating a second hash address of the target keyword in the hash table, and storing the target keyword and the initial name in a second storage node indicated by the second hash address in association to obtain an updated hash table; sending the updated hash table to a slave device, receiving a synchronization instruction, parsing the synchronization instruction to obtain a second object, determining a keyword of a first object corresponding to the second object in the hash table to obtain a current keyword, and sending the second object and the current keyword to the slave device, wherein the synchronization instruction is used to synchronize the second object to the slave device, and the second object is a child object of the first object.

2. The method of claim 1, wherein, Before storing the target keyword and the initial name in the second storage node indicated by the second hash address to obtain the updated hash table, the method further comprises: acquiring a fourth object with the same keyword as the target keyword in the second hash address, and deleting the fourth object from the second storage node indicated by the second hash address; adding 1 to the keyword of the fourth object, and adding the adjusted fourth object to a next address of the second hash address to obtain an updated hash table.

3. The method of claim 1, wherein, After storing the target keyword and the initial name in the second storage node indicated by the second hash address to obtain the updated hash table, the method further comprises: The master device receives a deletion instruction, determines a third hash address of a fifth object according to a first key in the deletion instruction, determines a storage node where the fifth object is located according to the third hash address, and deletes the fifth object from the storage node according to the first key, wherein the first key of the fifth object is included in the deletion instruction; The first key is increased by 1 to obtain a second key, and the third hash address is increased by 1 to obtain a fourth hash address, and the change of the current hash table is determined according to the object storage in the fourth storage node indicated by the fourth hash address.

4. The method of claim 3, wherein, The change of the current hash table according to the object storage in the fourth storage node indicated by the fourth hash address includes: determining whether the fourth storage node stores a sixth object associated with the second key; in the case that the fourth storage node does not store the sixth object associated with the second key, determining the current hash table as an updated hash table; in the case that the fourth storage node has stored the sixth object associated with the second key, obtaining a second preset name of the sixth object, and generating a second value according to the second preset name; determining whether the second value is less than or equal to the first key; in the case that the second value is greater than the first key, determining the current hash table as an updated hash table; in the case that the second value is less than or equal to the first key, moving the sixth object from the fourth storage node to a third storage node, and modifying the second key of the sixth object to the first key, wherein the hash address of the third storage node is the third hash address.

5. The method of claim 1, wherein, After the second object and the current key are sent to the slave device, the method further includes: the slave device obtains the initial name of the first object of the second object in the hash table in the slave device according to the current key.

6. The method of claim 1, wherein, calculating the hash address of the initial key in the hash table in the master device to obtain a first hash address includes: obtaining the length of the hash table to obtain an initial length; dividing the initial key by the initial length to obtain a remainder; determining the remainder as the first hash address.

7. A data processing apparatus, characterized by, includes: a first obtaining unit configured to obtain a first object added in a master device, and obtain an initial name of the first object, and generate a first value according to the initial name, and determine the first value as an initial key of the first object; a first calculating unit configured to calculate a hash address of the initial key in a hash table in the master device to obtain a first hash address, and determine whether a first storage node indicated by the first hash address stores a third object, wherein the third object is an object with the same key as the initial key; a storage unit configured to, in the case that the first storage node does not store the third object, store the initial key and the initial name in association with each other in the first storage node to obtain an updated hash table; The first changing unit is configured to change the initial keyword according to the initial name to obtain a target keyword when the third object is stored in the first storage node. The first changing unit includes: a second obtaining module configured to obtain a first preset name of the third object and determine whether a preset value corresponding to the first preset name is greater than a preset value corresponding to the initial name; a setting module configured to set the initial keyword as the target keyword when the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name; and a second determining module configured to add 1 to the initial keyword to obtain an updated initial keyword and re-perform the step of calculating the hash address of the initial keyword in the hash table in the master device to obtain a first hash address until the preset value corresponding to the first preset name is greater than the preset value corresponding to the initial name, and determine the updated initial keyword as the target keyword when the preset value corresponding to the first preset name is less than the preset value corresponding to the initial name. The second computing unit is configured to calculate a second hash address of the target keyword in the hash table, and store the target keyword and the initial name in a second storage node indicated by the second hash address to obtain an updated hash table. The synchronizing unit is configured to send the updated hash table to a slave device, receive a synchronization instruction, parse the synchronization instruction to obtain a second object, determine a keyword of a first object corresponding to the second object in the hash table to obtain a current keyword, and send the second object and the current keyword to the slave device, where the synchronization instruction is used to synchronize the second object to the slave device, and the second object is a child object of the first object.

8. A computer storage medium, characterized in that The computer storage medium is configured to store a program, where the program controls a device in which the computer storage medium is located to perform the data processing method in any one of claims 1 to 6 when the program is executed.

9. An electronic device, comprising: The device includes one or more processors and a memory configured to store one or more programs, where the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data processing method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data storage method and device and data acquisition method and device

    CN110928483A

  • Data access method and device, storage node and readable storage medium

    CN115495523A