Data processing method, device and storage medium
By constructing a target tree structure and using node attribute values to determine the number range, the target node can be quickly located, solving the problem of low efficiency in number segment data processing and achieving efficient number segment data management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZTE CORP
- Filing Date
- 2024-11-04
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies suffer from high algorithm complexity when processing network data segment data, resulting in low data processing efficiency.
By constructing a target tree structure, the range of node numbers is determined using the first and second attribute values of the nodes, and the target nodes are searched recursively to quickly determine the query results for the number range.
It improves the efficiency of number segment data processing, avoids the high algorithm complexity caused by recursive search, and enhances the speed and accuracy of data processing.
Smart Images

Figure CN121996652A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communications, and more particularly to a data processing device and storage medium. Background Technology
[0002] With the rapid development of mobile communication technology, the amount of network data is increasing rapidly, and how to effectively manage network data has become a focus of attention for operators.
[0003] To improve data management efficiency, number segment data in network data can be stored in a tree structure. For example, nodes in the tree structure can be constructed based on the starting and ending numbers of the number segment, and number segment queries can be performed based on the index corresponding to each node by creating an index.
[0004] However, as the volume of number segment data increases, the algorithms used to process number segment data in the above manner become highly complex and inefficient. Therefore, a solution is needed to improve the processing efficiency of number segment data. Summary of the Invention
[0005] This application provides a solution to improve the processing efficiency of number segment data.
[0006] In a first aspect, a data processing method is provided, the method comprising: obtaining a target tree structure storing number segment information, the number segment information including number segment ranges; recursively searching for target nodes in the target tree structure whose number segment ranges contain target numbers, based on the number segment ranges and node number ranges of each node in the target tree structure, wherein the node number ranges are determined based on a first attribute value and a second attribute value of the node, the first attribute value being the minimum value of the starting number in the number segment ranges of the node and its child nodes, and the second attribute value being the maximum value of the ending number in the number segment ranges of the node and its child nodes; and determining a number segment query result for the target number based on the number segment information corresponding to the target node.
[0007] Secondly, a data processing method is provided, the method comprising: acquiring number segment information to be stored, the number segment information including a number segment range; constructing an initial tree structure based on the number segment information; determining a first attribute value and a second attribute value for each node in the initial tree structure based on the number segment range of each node and its child nodes, the first attribute value being the minimum value of the starting number in the number segment range of the node and its child nodes, and the second attribute value being the maximum value of the ending number in the number segment range of the node and its child nodes; and determining the node number range of each node based on the first attribute value and the second attribute value, thereby obtaining a target tree structure.
[0008] Thirdly, a data processing apparatus is provided, the apparatus including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, performing the data processing steps as described in the first or second aspect.
[0009] Fourthly, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the data processing steps as described in the first or second aspect.
[0010] The embodiments of this application adopt the following technical solutions: Obtain the target tree structure storing number segment information, where the number segment information may include number segment ranges. Based on the number segment range of each node in the target tree structure and the node number range, recursively search for target nodes in the target tree structure whose number segment ranges contain the target number. The node number range can be determined based on the node's first attribute value and second attribute value. The first attribute value is the minimum value of the starting number in the number segment range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number segment range of the node and its child nodes. Based on the number segment information corresponding to the target node, determine the number segment query result for the target number.
[0011] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: Since the node number range is determined based on the node's first and second attribute values—that is, the node number range can be constructed from the minimum starting number and the maximum ending number of the node and its child nodes—it offers two advantages. First, by considering the node number range of each node in the target tree structure, it's possible to quickly determine whether each node and its child nodes contain a target node that might contain the target number. Second, if a target node that might contain the target number is identified, the target node containing the target number can be found based on the number range. This avoids the high algorithm complexity and low data processing efficiency caused by recursively searching for each node, thus improving the processing efficiency when dealing with number range data. Attached Figure Description
[0012] Figure 1 This is a schematic flowchart of data processing according to an embodiment of this application; Figure 2 This is a schematic diagram of a target tree structure according to an embodiment of this application; Figure 3 This is a schematic flowchart illustrating another data processing method according to an embodiment of this application; Figure 4 This is a schematic flowchart illustrating another data processing method according to an embodiment of this application; Figure 5 This is a schematic diagram of another target tree structure according to an embodiment of this application; Figure 6 This is a schematic diagram of the rotated target tree structure according to an embodiment of this application; Figure 7 This is a schematic diagram of an updated target tree structure according to an embodiment of this application; Figure 8 This is a schematic flowchart illustrating another data processing method according to an embodiment of this application; Figure 9 This is a schematic diagram of another target tree structure according to an embodiment of this application; Figure 10 This is a schematic diagram of another rotated target tree structure according to an embodiment of this application; Figure 11 This is a schematic diagram of another updated target tree structure according to an embodiment of this application; Figure 12 This is a schematic flowchart illustrating another data processing method according to an embodiment of this application; Figure 13 This is a schematic diagram illustrating the relationship between number ranges corresponding to services according to an embodiment of this application; Figure 14 This is a schematic flowchart illustrating another data processing method according to an embodiment of this application; Figure 15 This is a schematic diagram of the structure of a data processing apparatus according to an embodiment of this application; Figure 16 This is a schematic diagram of the structure of another data processing apparatus according to an embodiment of this application; Figure 17 This is a schematic diagram of the structure of a data processing device according to an embodiment of this application. Detailed Implementation
[0013] This specification provides an embodiment of a data processing device and a storage medium.
[0014] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0015] The inventive concept of this application is as follows: With the rapid development of mobile communication technology, the amount of network data is increasing exponentially, and how to effectively manage network data has become a focus of attention for operators. To improve data management efficiency, number segment data in network data can be stored in a tree structure. For example, nodes in the tree structure can be constructed based on the starting and ending numbers of the number segment, and number segment queries can be performed based on the index corresponding to each node. However, due to the ever-increasing volume of number segment data, the algorithm complexity for processing number segment data in the above manner is high, resulting in low data processing efficiency. Therefore, a solution is needed to improve the processing efficiency of number segment data. To address this issue, this specification provides a technical solution that solves the aforementioned problems. This solution involves obtaining a target tree structure storing number segment information, where the number segment information can include number segment ranges. Based on the number segment range of each node in the target tree structure and the node number range, a recursive search is performed to find target nodes in the target tree structure whose number segment ranges contain the target number. The node number range can be determined based on the node's first attribute value and second attribute value. The first attribute value is the minimum starting number in the number segment range of the node and its child nodes, and the second attribute value is the maximum ending number in the number segment range of the node and its child nodes. Based on the number segment information corresponding to the target node, a number segment query result for the target number is determined. Since the node number range is determined based on the node's first and second attribute values—that is, the node number range of a node can be a number range constructed from the minimum starting number and the maximum ending number of the node and its child nodes—it can quickly determine whether each node and its child nodes contain a target number based on the node number range of each node in the target tree structure. On the other hand, if it is determined that there is a target node that may contain the target number, then the target node containing the target number can be found based on the number range. This avoids the problem of high algorithm complexity and low data processing efficiency caused by recursively searching for each node, and improves the processing efficiency when processing number range data. For details, please refer to the following content.
[0016] In one embodiment, such as Figure 1As shown in the embodiments of this specification, a data processing method is provided. The execution subject of this method can be a server, which can be a standalone server or a server cluster composed of multiple servers. Specifically, the method may include the following steps: In S102, the target tree structure containing number segment information is obtained.
[0017] The number segment information can include a number segment range, which can be constructed from the starting number and the ending number of the number segment. For example, the number segment range of number segment 1 can be (0, 8), that is, the numbers in number segment 1 can be any number from 0 to 8. For example, number segment 1 can contain any number such as 0, 3, 8, etc. The target tree structure can be any tree data structure that can store number segment information. For example, the target tree structure can be a multi-branch tree structure, specifically, the target tree structure can be a binary tree structure, a ternary tree structure, etc.
[0018] In practice, to improve the efficiency of number segment data management, the server can pre-build multiple tree structures that store number segment information, and upon receiving a number segment query request, determine the target tree structure corresponding to the number segment query request from the multiple tree structures. The number segment query request can be to query all number segments containing a certain number.
[0019] For example, suppose the server stores tree structure 1, tree structure 2, and tree structure 3. Tree structure 1 stores number segment information for region 1 and region 2, tree structure 2 stores number segment information for region 3, and tree structure 3 stores number segment information for region 4 and region 5. The server can determine the region information corresponding to the number segment query request based on the location information corresponding to the number segment query request, and then, based on the region information and the region information corresponding to each tree structure, select the target tree structure corresponding to the number segment query request from these three tree structures.
[0020] Alternatively, the server can construct different tree structures based on different business types, and filter out the target tree structure from the tree structures based on the business type to which the query request belongs.
[0021] The above-described method for determining the target tree structure is an optional and feasible method. In addition, there are many other methods that can be used. Different methods can be selected according to different application scenarios. This specification does not specifically limit the methods used in this embodiment.
[0022] In S104, based on the number range of each node in the target tree structure and the number range of the node, the target node in the target tree structure is recursively searched for whose number range contains the target number.
[0023] The range of node numbers can be determined based on the first attribute value and the second attribute value of the node. The first attribute value can be the minimum value of the starting number in the range of numbers of the node and its child nodes, and the second attribute value can be the maximum value of the ending number in the range of numbers of the node and its child nodes.
[0024] In implementation, within the 5G core network, the User Data Repository (UDR) is a distributed relational in-memory database used to store data from other network elements. To better prepare for the upcoming 6G, UDR has developed a document in-memory database based on the existing relational database. During requirements gathering, the Network Repository Function (NRF) requested support for number segment queries. NRF network elements can store number segment information from external network elements. This information can include the number segment range, i.e., the start and end numbers of the segment. Number segments may have unrelated, inclusive, overlapping, or equal relationships.
[0025] When constructing the tree structure, the server can determine the first and second attribute values of each node based on the number range of each node and its child nodes, and then determine the node number range of each node based on the first and second attribute values.
[0026] For example, in such Figure 2 In the tree structure shown, taking the root node (node 1) as an example, the minimum starting number of the child nodes (nodes 2, 3, and 4) of node 1 is 8 (i.e., the starting number in the number range of node 4), and the maximum ending number of the child nodes (nodes 2, 3, and 4) of node 1 is 40 (i.e., the ending number in the number range of node 3). Therefore, the first attribute value of node 1 can be 8, and the second attribute value can be 40, meaning the node number range of node 1 can be (8, 40). By analogy, the node number range of each node in this tree structure can be determined.
[0027] In this way, when the server receives a number segment query request for a target number, it can recursively search for the target node in the target tree structure whose number segment range contains the target number, based on the number segment range of each node in the determined target tree structure and the node number range.
[0028] For example, as Figure 2The tree structure shown is an example of the target tree structure. Assuming the target number is 5, the server can determine whether the target number is within the range of node numbers corresponding to the root node (i.e., node 1). Since the target number 5 is not within the range of node numbers of the root node, it can be determined that the target number 5 is not among the child nodes of the root node. Therefore, the query can be returned directly as a failure, without needing to recursively query other nodes in the target tree structure, thus reducing the number of queries and improving the efficiency of number segment queries.
[0029] In S106, the number segment query results for the target number are determined based on the number segment information corresponding to the target node.
[0030] In practice, the server can determine the number segment information corresponding to the target node as the number segment query result for the target number.
[0031] For example, as Figure 2 The tree structure shown is an example of the target tree structure. Assuming the target number is 21, the target nodes found through the above recursive search can include node 3 and node 4. The server can obtain the number segment information of node 3 and node 4 respectively, and determine the obtained number segment information as the number segment query result for the target number 21. Specifically, the number segment query result can be: the number segment to which the number to be queried 21 belongs includes number segment 1 (8,30) and number segment 2 (20,40).
[0032] This specification provides a data processing method that can acquire a target tree structure storing number segment information. The number segment information can include number segment ranges. Based on the number segment range of each node in the target tree structure and the node number range, a recursive search is performed to find target nodes in the target tree structure whose number segment ranges contain the target number. The node number range can be determined based on a node's first attribute value and a second attribute value. The first attribute value is the minimum starting number in the number segment range of the node and its child nodes, and the second attribute value is the maximum ending number in the number segment range of the node and its child nodes. Based on the number segment information corresponding to the target node, a number segment query result for the target number is determined. Since the node number range is determined based on the node's first and second attribute values—that is, the node number range of a node can be a number range constructed from the minimum starting number and the maximum ending number of the node and its child nodes—it can quickly determine whether each node and its child nodes contain a target number based on the node number range of each node in the target tree structure. On the other hand, if it is determined that there is a target node that may contain the target number, then the target node containing the target number can be found based on the number range. This avoids the problem of high algorithm complexity and low data processing efficiency caused by recursively searching for each node, and improves the processing efficiency when processing number range data.
[0033] In practical applications, the specific processing method for recursively searching for target nodes in the target tree structure whose number range contains the target number, based on the number range of each node in the target tree structure and the number range of the node, can vary. The following provides one optional processing method, such as... Figure 3 As shown, the specific process may include the following steps S1042 to S1048.
[0034] In S1042, it is determined whether the target number is within the range of the number segment of the root node in the target tree structure.
[0035] In S1044, if the target number is within the range of the root node in the target tree structure, the root node is determined as the target node, and it is determined whether the target number is within the range of the node number of the root node in the target tree structure.
[0036] In S1046, if the target number is within the range of the node number of the root node in the target tree structure, then continue recursively searching for the target node whose number range among the child nodes of the root node contains the target number.
[0037] In implementation, for example, taking the target tree structure as an example... Figure 2 Taking the tree structure shown as an example, assuming the target number is 19, we can determine whether the target number 19 is within the range of the root node of the target tree structure. Since the range of the root node of the target tree structure is (12, 20), and the target number 19 is within this range, the root node is considered to meet the query conditions, and the root node (i.e., node 1) can be identified as the target node. Then, we can continue to determine whether the target number 19 is within the range of the node numbers of the root node.
[0038] Since the node number range of the root node is (8,40), and the target number 19 is within this range, it indicates that there may be a target node among the child nodes of the root node whose number range contains the target number 19. Therefore, we can continue to recursively search for target nodes among the child nodes of the root node whose number range contains the target number.
[0039] For example, we can determine whether the target number 19 is within the range of node 2 and node 3. Since the target number 19 is not within the range of node 2 and node 3, we can determine whether the target number is within the range of node numbers of node 2 and node 3. Since the target number 19 is within the range of node numbers of node 2, we can continue to determine whether the target number 19 is within the range of the child node of node 2 (i.e., node 4). Since the target number 19 is within the range of node 4, we can consider node 4 to meet the query conditions, identify node 4 as the target node, end the query, and return the target nodes as node 1 and node 4.
[0040] Furthermore, if the target number is not within the range of the root node's node number in the target tree structure, it indicates that there is no target node whose number range contains the target number among the child nodes of the root node. In this case, the search can be stopped, and the target node can be returned as node 1.
[0041] In practical applications, if the target number is not within the range of the root node in the target tree structure, then, accordingly, Figure 3 As shown, it can also be processed through the following steps S302~S304.
[0042] In S302, if the target number is not within the range of the root node in the target tree structure, then it is determined whether the target number is within the range of the node number of the root node in the target tree structure.
[0043] In S304, if the target number is within the range of the node number of the root node in the target tree structure, then continue recursively searching for the target node whose number range among the child nodes of the root node contains the target number.
[0044] In implementation, for example, taking the target tree structure as an example... Figure 2 Taking the tree structure shown as an example, assuming the target number is 24, we can determine whether the target number 24 is within the range of the root node of the target tree structure. Since the range of the root node of the target tree structure is (12, 20), the target number 24 is not within the range of the target tree structure. Therefore, the root node is considered not to meet the query conditions, and we can continue to determine whether the target number 24 is within the range of the node numbers of the root node.
[0045] Since the node number range of the root node is (8, 40), and the target number 24 is within this range, it indicates that there may be a target node among the child nodes of the root node whose number range contains the target number 24. Therefore, we can continue to recursively search for target nodes among the child nodes of the root node whose number range contains the target number.
[0046] For example, we can determine whether the target number 24 falls within the range of node 2 and node 3. Since the target number 19 falls within the range of node 3 but not node 2, node 3 is considered to meet the query criteria and can be identified as the target node. Then, we can determine whether the target number falls within the range of node 2. Since the target number 24 falls within the range of node 2, we can further determine whether the target number 24 falls within the range of node 2's child node (i.e., node 4). Since the target number 24 falls within the range of node 4, node 4 is considered to meet the query criteria and can be identified as the target node. The query then ends, returning the target nodes as node 1, node 3, and node 4.
[0047] In practical applications, the target tree structure can be a binary search tree structure, or it can undergo number segment insertion processing. There are various specific methods for number segment insertion processing; the following provides one optional method, such as... Figure 4 As shown, the specific process may include the following steps S402 to S408.
[0048] In S402, a storage request for the first segment is received.
[0049] The first number segment can be any number segment.
[0050] In S404, in response to a storage request, the first node in the target tree structure is determined based on the starting number in the number range of each node in the target tree structure and the starting number in the number range of the first number segment.
[0051] In implementation, the target tree structure is used as an example. Figure 5 Taking the binary search tree shown as an example, the upper part of each node is the range of numbers for that node, and the lower part is the range of node numbers for that node.
[0052] Assuming the first number segment is (30, 55), then the starting number of this segment is 30 and the ending number is 55. The server can determine the first node in the target tree structure based on the starting number of each node's number segment range and the starting number of the first number segment's number range. In other words, the server can filter out the first node based on whether the starting number of each node's number segment range is not less than 30. For example, the filtered first node could be a node with a number segment range of (30, 50).
[0053] In S406, the insertion position of the child node for the node corresponding to the first number segment is determined based on the number range of the first node and the number range of the first number segment.
[0054] In practice, the server can determine the insertion position of the child node for the node corresponding to the first number segment based on the starting number in the number segment range of the first node and the starting number in the number segment range of the first number segment.
[0055] For example, if the starting number in the range of the first node is less than the starting number in the range of the first number segment, the child node of the target node can be inserted as the left child node of the first node. If the starting number in the range of the first node is greater than the starting number in the range of the first number segment, the child node of the target node can be inserted as the right child node of the first node.
[0056] For example, suppose the first node is as follows: Figure 5The first node shown has a number range of (30, 50), meaning the starting number in the number range of the first node is 30. If the starting number in the number range of the first node is less than 30, the child node of the target node can be inserted at the left child node of the first node. If the starting number in the number range of the first node is greater than 30, the child node of the target node can be inserted at the left child node of the first node.
[0057] Furthermore, if the starting number in the number range of the first node is equal to the starting number in the number range of the first number segment, the insertion position of the child node corresponding to the first number segment can be determined based on the ending number in the number range of the first node and the ending number in the number range of the first number segment.
[0058] For example, if the ending number in the range of the first node is less than the ending number in the range of the first number segment, the child node of the target node can be inserted as the left child node of the first node. If the ending number in the range of the first node is not less than the ending number in the range of the first number segment, the child node of the target node can be inserted as the right child node of the first node.
[0059] For example, suppose the first node is as follows: Figure 5 The first node shown has a number range of (30, 50), meaning the end number in the number range of the first node is 50. If the end number in the number range of the first node is less than 50, the child node of the target node can be inserted at the left child node of the first node. If the number range of the first node has a technical number greater than 50, the child node of the target node can be inserted at the left child node of the first node.
[0060] Since the starting number in the range of the first number segment (i.e. (30, 55)) is the same as the starting number in the range of the first node, and the ending number 55 in the range of the first number segment is greater than the ending number 50 in the range of the first node, the child node of the node corresponding to the first number segment can be inserted at the right child node of the first node.
[0061] In S408, the node corresponding to the first segment is inserted into the child node insertion position in the target tree structure, and the node number range of the node in the target tree structure after insertion is updated.
[0062] In practical applications, the specific processing method for updating the node number range of the nodes in the inserted target tree structure in step S408 can be varied. The following provides an optional processing method, which may include the processing of step A1.
[0063] In A1, the nodes corresponding to the first segment and the nodes related to the first segment in the inserted target tree structure are rotated. The node number range of the nodes corresponding to the first segment, the nodes related to the first segment, the predecessor nodes of the nodes corresponding to the first segment, and the predecessor nodes of the nodes related to the first segment in the rotated target tree structure is updated.
[0064] In implementation, to ensure that the inserted target tree structure data conforms to the predetermined rules of a binary search tree (i.e., a red-black tree), the nodes corresponding to the first segment and the nodes related to the first segment in the inserted target tree structure can be rotated. The resulting rotated target tree structure can be as follows: Figure 6 As shown.
[0065] After obtaining the rotated target tree structure, starting from the insertion position of the child node, the node number range of each node can be corrected upwards. This means updating the node number ranges of the nodes corresponding to the first segment, the nodes related to the first segment, the predecessor nodes of the first segment, and the predecessor nodes of the nodes related to the first segment in the rotated target tree structure. The resulting updated target tree structure can be as follows: Figure 7 As shown.
[0066] In practical applications, the target tree structure can be a binary search tree structure, and the target data structure can also be processed by deleting number segments. There are various specific methods for deleting number segments; the following provides one optional method, such as... Figure 8 As shown, the specific process may include the following steps S802 to S808.
[0067] In S802, a deletion request for the second segment is received.
[0068] The second segment can be any segment corresponding to any node in the target tree structure.
[0069] In S804, in response to the deletion request, the first node in the target tree structure is determined based on the starting number in the number range of each node in the target tree structure and the starting number in the number range of the second number segment.
[0070] In implementation, the target tree structure is used as an example. Figure 9 Taking the tree structure shown as an example, assuming the second segment is (8, 30), the server can determine the first node in the target tree structure based on the starting number in the segment range of each node in the target tree structure, and the starting number in the segment range of the second segment (i.e., 8). The determined first node can be... Figure 9 The node in the middle range is (8, 30).
[0071] In S806, the second node corresponding to the second number segment is determined based on the end number in the number segment range of the first node and the end number in the number segment range of the second number segment.
[0072] In practice, the server can identify the node in the first node whose end number in the number segment range is the same as the end number in the number segment range of the second node as the second node corresponding to the second number segment.
[0073] In S808, the second node corresponding to the second number segment is determined based on the end number in the number segment range of the first node and the end number in the number segment range of the second number segment.
[0074] In practical applications, the specific processing method for updating the node number range of the nodes in the deleted target tree structure in step S808 can be varied. The following provides an optional processing method, which may include the processing of step B1.
[0075] In B1, the nodes related to the second node in the target tree structure after deletion are rotated, and the node number range of the nodes related to the second node and the predecessor nodes of the nodes related to the second node in the rotated target tree structure is updated.
[0076] In implementation, to ensure that the target tree structure after deletion satisfies the predetermined rules of a binary search tree (i.e., a red-black tree), the target tree structure after deletion can be rotated. The rotated target tree structure can be obtained as follows: Figure 10 As shown.
[0077] After obtaining the rotated target tree structure, the node number range can be corrected upwards from the position of the deleted node. This means updating the node number ranges of nodes related to the second node and the predecessor nodes of those nodes in the rotated target tree structure. The resulting updated target tree structure can be as follows: Figure 11 As shown.
[0078] In practical applications, after determining the number segment query results for the target number, a location query can be performed based on these results. There are various methods for location querying; the following provides one optional method: Figure 12 As shown, the specific process may include the following steps S1202 to S1206.
[0079] In S1202, a location query request for the target number is received.
[0080] In S1204, in response to the home location query request, the target number segment to which the target number belongs is determined according to the query result of the number segment of the target number.
[0081] In S1206, the query result of the home location of the target number is determined according to the home location information corresponding to the target number segment.
[0082] In implementation, there can be various relationships between the number segment ranges of different services. For example, in the number segments corresponding to services a to h as Figure 13 shown, if the end number of the number segment range of service a is less than the start number of the number segment range of service b, that is, a.end < b.start, then it can be determined that the relationship between the number segment range of service a and the number segment range of service b is an irrelevant relationship.
[0083] If the end number of the number segment range of service c is not less than the start number of the number segment range of service d, and the start number of the number segment range of service c is not greater than the start number of the number segment range of service d, that is, c.end >= d.start & c.start <= d.start, then it can be determined that the relationship between the number segment range of service c and the number segment range of service d is an intersecting relationship.
[0084] If the start number of the number segment range of service e is not less than the start number of the number segment range of service d, and the end number of the number segment range of service e is less than the start number of the number segment range of service f, or, if the start number of the number segment range of service e is greater than the start number of the number segment range of service d, and the end number of the number segment range of service e is not greater than the start number of the number segment range of service f, that is, (e.start >= f.start & e.end < f.start) or (e.start > f.start & e.end <= f.start), then it can be determined that the relationship between the number segment range of service e and the number segment range of service f is a containment relationship.
[0085] If the start number of the number segment range of service g is equal to the start number of the number segment range of service h, and the end number of the number segment range of service g is equal to the end number of the number segment range of service h, that is, g.start == h.start & g.end == h.start, then it can be determined that the relationship between the number segment range of service g and the number segment range of service h is an equal relationship.
[0086] Because there are many types of relationships between different number segments, when the server receives a business processing request related to the target number, it can determine the number segment query result of the target number through the above recursive search method. When there are multiple target number segments to which the target number belongs, the server can determine the location query result of the target number based on the relationship between the target number segments and the location information corresponding to the target number segments.
[0087] For example, assuming the target number belongs to the target number segment 1 and number segment 2, if number segment 1 and number segment 2 are inclusive, the location query result of the target number can be determined based on the location information corresponding to the smaller number segment in number segment 1 and number segment 2. Specifically, assuming the number segment range of number segment 1 is (9, 11) and the number segment range of number segment 2 is (8, 20), that is, the number segment range of number segment 2 includes the number segment range of number segment 1, then the location query result of the target number can be determined based on the location information corresponding to number segment 1.
[0088] Alternatively, if number segment 1 and number segment 2 are related, the location query result of the target number can be determined based on the location information of number segment 1 and / or the location information of number segment 2.
[0089] This specification provides a data processing method that can acquire a target tree structure storing number segment information. The number segment information can include number segment ranges. Based on the number segment range of each node in the target tree structure and the node number range, a recursive search is performed to find target nodes in the target tree structure whose number segment ranges contain the target number. The node number range can be determined based on a node's first attribute value and a second attribute value. The first attribute value is the minimum starting number in the number segment range of the node and its child nodes, and the second attribute value is the maximum ending number in the number segment range of the node and its child nodes. Based on the number segment information corresponding to the target node, a number segment query result for the target number is determined. Since the node number range is determined based on the node's first and second attribute values—that is, the node number range of a node can be a number range constructed from the minimum starting number and the maximum ending number of the node and its child nodes—it can quickly determine whether each node and its child nodes contain a target number based on the node number range of each node in the target tree structure. On the other hand, if it is determined that there is a target node that may contain the target number, then the target node containing the target number can be found based on the number range. This avoids the problem of high algorithm complexity and low data processing efficiency caused by recursively searching for each node, and improves the processing efficiency when processing number range data.
[0090] Furthermore, upon receiving a service processing request related to a target number, the location query result for the target number can be determined based on the location information corresponding to the target number segment to which the target number belongs. The service processing request can then be processed according to this result. This improves the efficiency and accuracy of determining the location query result for the target number, thereby enhancing the processing efficiency and effectiveness of the service and ultimately increasing user satisfaction.
[0091] In another embodiment, such as Figure 14 As shown in the embodiments of this specification, a data processing method is provided. The execution subject of this method can be a server, which can be a standalone server or a server cluster composed of multiple servers. Specifically, the method may include the following steps: In S1402, the number segment information to be stored is obtained.
[0092] The number segment information can include the number segment range.
[0093] In S1404, an initial tree structure is constructed based on the number segment information.
[0094] In S1406, the first attribute value and the second attribute value of each node in the initial tree structure are determined based on the number range of each node and its child nodes in the initial tree structure.
[0095] The first attribute value can be the minimum starting number in the range of numbers of the node and its child nodes, and the second attribute value can be the maximum ending number in the range of numbers of the node and its child nodes.
[0096] In implementation, the method for determining the first and second attribute values of a node can be found in the specific details of the above embodiments, and will not be repeated here.
[0097] In S1408, the node number range of each node is determined based on the first attribute value and the second attribute value, thus obtaining the target tree structure.
[0098] In implementation, taking a binary search tree as the target tree structure as an example, in addition to the range of number segments and the range of node numbers, the field information of each node in the target tree structure can also include the field information shown in Table 1 below.
[0099] Table 1
[0100] In this way, each number segment can be saved as a base point in the target tree structure, and the left_key and right_key fields of the node can be the starting and ending numbers of the number segment range corresponding to that node, respectively.
[0101] The min_left_key and max_right_key fields of each node can be used to store the minimum value of the left_key field of the current node and all its child nodes, and the maximum value of the right_key field, respectively.
[0102] When inserting a number segment into a target tree structure, you can first compare the left_key value of the number segment to be inserted with the left_key value of each node in the target tree structure. If the left_key values are the same, you can continue to compare the right_key values. After inserting the node, you can adjust the min_left_key and max_right_key values of all nodes in the target tree structure after the insertion.
[0103] When performing a number range query, the given number can be searched within the red-black tree (i.e., the target tree structure). If the given number is not within the range of the `min_left_key` and `max_right_key` fields of the current node, the current query ends. If the given number is within the range of the `min_left_key` and `max_right_key` fields of the current node, the search is recursively performed on the left and right subtrees. Simultaneously, it is checked whether the given number is within the number range of the current node (i.e., the range constructed from the `left_key` and `right_key` fields). If the given number is within the range of the `left_key` and `right_key` fields of the current node, then the number range of the current node meets the query conditions, and the current node can be saved to the output results.
[0104] By storing the min_left_key and max_right_key fields on the node, it is possible to quickly determine whether the number to be searched is in the current subtree. If it is not in the current subtree, the search can be exited in advance to improve the efficiency of number retrieval.
[0105] The improved red-black tree (i.e., the target tree structure) described above can complete the query, deletion, and insertion of number segments in O(logN) time complexity, demonstrating excellent data management performance.
[0106] This specification provides a data processing method that can acquire number segment information to be stored, including number segment ranges. An initial tree structure is constructed based on the number segment information. Based on the number segment ranges of each node and its child nodes in the initial tree structure, a first attribute value and a second attribute value are determined for each node. The first attribute value is the minimum starting number within the number segment range of the node and its child nodes, and the second attribute value is the maximum ending number within the number segment range of the node and its child nodes. Based on the first attribute value and the attribute value, the node number range for each node is determined, resulting in a target tree structure. In this way, on the one hand, by using the node number range of each node in the target tree structure, it is possible to quickly determine whether each node and its child nodes may contain the number to be searched. On the other hand, if it is determined that a node may contain the number to be searched, then based on the number segment range, the nodes containing the number to be searched within that node and its child nodes can be found. This avoids the high algorithm complexity and low data processing efficiency caused by recursively searching for each node, thus improving the processing efficiency when processing number segment data.
[0107] In another embodiment, the above is a data processing method provided by the embodiments of this specification. Based on the same idea, the embodiments of this specification also provide a data processing apparatus, such as... Figure 15 As shown.
[0108] The data processing device includes: a first acquisition module 1501, a node search module 1502, and a result determination module 1503, wherein: The first acquisition module 1501 is used to acquire a target tree structure that stores number segment information, wherein the number segment information includes a number segment range. The node lookup module 1502 is used to recursively search for target nodes in the target tree structure whose number range contains the target number, based on the number range of each node in the target tree structure and the number range of the nodes. The number range of the nodes is determined based on the first attribute value and the second attribute value of the node. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. The result determination module 1503 is used to determine the number segment query result for the target number based on the number segment information corresponding to the target node.
[0109] In this embodiment of the specification, the node lookup module 1502 is used for: Determine whether the target number is within the number range of the root node in the target tree structure; If the target number is within the range of the root node in the target tree structure, then the root node is determined as the target node, and it is determined whether the target number is within the range of the node numbers of the root node in the target tree structure. If the target number is within the range of the node number of the root node in the target tree structure, then continue recursively searching for target nodes whose number range contains the target number among the child nodes of the root node.
[0110] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the above-described data processing apparatus embodiment is basically similar to the method embodiment, so the description is relatively simple; relevant parts can be referred to the description of the method embodiment.
[0111] This specification provides a data processing apparatus that can acquire a target tree structure storing number segment information. The number segment information may include number segment ranges. Based on the number segment range of each node in the target tree structure and the node number range, a recursive search is performed to find target nodes in the target tree structure whose number segment ranges contain the target number. The node number range can be determined based on a node's first attribute value and a second attribute value. The first attribute value is the minimum starting number in the number segment range of the node and its child nodes, and the second attribute value is the maximum ending number in the number segment range of the node and its child nodes. Based on the number segment information corresponding to the target node, a number segment query result for the target number is determined. Since the node number range is determined based on the node's first and second attribute values—that is, the node number range of a node can be a number range constructed from the minimum starting number and the maximum ending number of the node and its child nodes—it can quickly determine whether each node and its child nodes contain a target number based on the node number range of each node in the target tree structure. On the other hand, if it is determined that there is a target node that may contain the target number, then the target node containing the target number can be found based on the number range. This avoids the problem of high algorithm complexity and low data processing efficiency caused by recursively searching for each node, and improves the processing efficiency when processing number range data.
[0112] In another embodiment, the above is a data processing method provided by the embodiments of this specification. Based on the same idea, the embodiments of this specification also provide a data processing apparatus, such as... Figure 16 As shown.
[0113] The data processing device includes: a second acquisition module 1601, a first construction module 1602, an attribute determination module 1603, and a second construction module 1604, wherein: The second acquisition module 1601 is used to acquire number segment information to be stored, wherein the number segment information includes a number segment range; The first construction module 1602 is used to construct an initial tree structure based on the number segment information; The attribute determination module 1603 is used to determine the first attribute value and the second attribute value of each node in the initial tree structure based on the number range of each node and its child nodes in the initial tree structure. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. The second construction module 1604 is used to determine the node number range of each node based on the first attribute value and the second attribute value, so as to obtain the target tree structure.
[0114] This specification provides a data processing apparatus that can acquire number segment information to be stored, including number segment ranges. An initial tree structure is constructed based on the number segment information. Based on the number segment ranges of each node and its child nodes in the initial tree structure, a first attribute value and a second attribute value are determined for each node. The first attribute value is the minimum starting number within the number segment range of the node and its child nodes, and the second attribute value is the maximum ending number within the number segment range of the node and its child nodes. Based on the first attribute value and the attribute value, the node number range for each node is determined, resulting in a target tree structure. In this way, on the one hand, by using the node number range of each node in the target tree structure, it is possible to quickly determine whether each node and its child nodes may contain the number to be searched. On the other hand, if it is determined that a node may contain the number to be searched, then based on the number segment range, the nodes containing the number to be searched within that node and its child nodes can be found. This avoids the high algorithm complexity and low data processing efficiency caused by recursive searching of each node, thus improving the processing efficiency when processing number segment data.
[0115] In another embodiment, based on the same idea, this specification also provides a data processing device, such as... Figure 17 As shown.
[0116] Data processing devices can vary considerably due to differences in configuration or performance. They may include one or more processors 1701 and memory 1702, with memory 1702 storing one or more application programs or data. Memory 1702 may be temporary or persistent storage. The application programs stored in memory 1702 may include one or more modules (not shown), each module including a series of computer-executable instructions for the data processing device. Furthermore, processor 1701 may be configured to communicate with memory 1702 and execute the series of computer-executable instructions stored in memory 1702 on the data processing device. The data processing device may also include one or more power supplies 1703, one or more wired or wireless network interfaces 1704, one or more input / output interfaces 1706, and one or more keyboards 1706.
[0117] Specifically, in this embodiment, the data processing device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the data processing device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following: Obtain the target tree structure containing number segment information, wherein the number segment information includes a number segment range; Based on the number range of each node in the target tree structure and the number range of the node, recursively search for target nodes in the target tree structure whose number range contains the target number. The number range of the node is determined based on the first attribute value and the second attribute value of the node. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. Based on the number segment information corresponding to the target node, determine the number segment query results for the target number.
[0118] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the above-described data processing device embodiment is basically similar to the method embodiment, so the description is relatively simple; relevant parts can be referred to the description of the method embodiment.
[0119] Specifically, in this embodiment, the data processing device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the data processing device, and is configured to be executed by one or more processors. The one or more programs also include computer-executable instructions for performing the following: Obtain the number segment information to be stored, wherein the number segment information includes the number segment range; Construct an initial tree structure based on the number segment information; Based on the number range of each node and its child nodes in the initial tree structure, determine the first attribute value and the second attribute value of each node in the initial tree structure. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. Based on the first attribute value and the second attribute value, the range of node numbers for each node is determined, and the target tree structure is obtained.
[0120] This specification provides a data processing device. On one hand, by using the node number range of each node in the target tree structure, it is possible to quickly determine whether each node and its child nodes may contain the number to be searched. On the other hand, if it is determined that a node may contain the number to be searched, then based on the number range, the nodes containing the number to be searched in that node and its child nodes can be found. This avoids the problem of high algorithm complexity and low data processing efficiency caused by recursively searching for each node, and improves the processing efficiency when processing number range data.
[0121] Furthermore, based on the above Figures 1 to 14 The method shown in this specification, along with one or more embodiments, also provides a storage medium for storing computer-executable instruction information. In one specific embodiment, the storage medium can be a USB flash drive, optical disc, hard disk, etc. When the computer-executable instruction information stored in the storage medium is executed by a processor, it can achieve the following process: Obtain the target tree structure containing number segment information, wherein the number segment information includes a number segment range; Based on the number range of each node in the target tree structure and the number range of the node, recursively search for target nodes in the target tree structure whose number range contains the target number. The number range of the node is determined based on the first attribute value and the second attribute value of the node. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. Based on the number segment information corresponding to the target node, determine the number segment query results for the target number.
[0122] Furthermore, based on the above Figures 1 to 14 The method shown in this specification, along with one or more embodiments, also provides a storage medium for storing computer-executable instruction information. In one specific embodiment, the storage medium can be a USB flash drive, optical disc, hard disk, etc. When the computer-executable instruction information stored in the storage medium is executed by a processor, it can achieve the following process: Obtain the number segment information to be stored, wherein the number segment information includes the number segment range; Construct an initial tree structure based on the number segment information; Based on the number range of each node and its child nodes in the initial tree structure, determine the first attribute value and the second attribute value of each node in the initial tree structure. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. Based on the first attribute value and the second attribute value, the range of node numbers for each node is determined, and the target tree structure is obtained.
[0123] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the above-described storage medium embodiment is basically similar to the method embodiment, so the description is relatively simple; relevant parts can be referred to the description of the method embodiment.
[0124] This specification provides a computer-readable storage medium. On one hand, by using the node number range of each node in the target tree structure, it is possible to quickly determine whether each node and its child nodes may contain the number to be searched. On the other hand, if it is determined that a node may contain the number to be searched, then based on the number range, the nodes containing the number to be searched in that node and its child nodes can be found. This avoids the problems of high algorithm complexity and low data processing efficiency caused by recursively searching for each node, and improves the processing efficiency when processing number range data.
[0125] Furthermore, based on the above Figures 1 to 14 The method shown in this specification, along with one or more embodiments, also provides a computer program product including a computer program that, when executed by a processor, performs the following process: Obtain the target tree structure containing number segment information, wherein the number segment information includes a number segment range; Based on the number range of each node in the target tree structure and the number range of the node, recursively search for target nodes in the target tree structure whose number range contains the target number. The number range of the node is determined based on the first attribute value and the second attribute value of the node. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. Based on the number segment information corresponding to the target node, determine the number segment query results for the target number.
[0126] Furthermore, based on the above Figures 1 to 14 The method shown in this specification, along with one or more embodiments, also provides a computer program product including a computer program that, when executed by a processor, performs the following process: Obtain the number segment information to be stored, wherein the number segment information includes the number segment range; Construct an initial tree structure based on the number segment information; Based on the number range of each node and its child nodes in the initial tree structure, determine the first attribute value and the second attribute value of each node in the initial tree structure. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. Based on the first attribute value and the second attribute value, the range of node numbers for each node is determined, and the target tree structure is obtained.
[0127] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the above-described embodiment of a computer program product is relatively simple in description because it is fundamentally similar to the method embodiment; relevant parts can be referred to the description of the method embodiment.
[0128] This specification provides a computer program product that, on the one hand, can quickly determine whether each node and its child nodes may contain the number to be searched by using the node number range of each node in the target tree structure. On the other hand, if it is determined that a node may contain the number to be searched, then the nodes containing the number to be searched can be found based on the number range. This avoids the problems of high algorithm complexity and low data processing efficiency caused by recursively searching for each node, and improves the processing efficiency when processing number range data.
[0129] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0130] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There is not just one type of HDL, but many. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0131] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in one or more software and / or hardware.
[0132] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented 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.
[0133] The embodiments described herein are illustrated with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. 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 illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0134] 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 a process, method, article, or apparatus. Without further limitation, 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 said element.
[0135] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented 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.
[0136] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0137] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.
Claims
1. A data processing method, the method comprising: Obtain the target tree structure containing number segment information, wherein the number segment information includes a number segment range; Based on the number range of each node in the target tree structure and the number range of the node, recursively search for target nodes in the target tree structure whose number range contains the target number. The number range of the node is determined based on the first attribute value and the second attribute value of the node. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. Based on the number segment information corresponding to the target node, determine the number segment query results for the target number.
2. The method according to claim 1, wherein recursively searching for target nodes in the target tree structure whose number range contains the target number, based on the number range of each node in the target tree structure and the node number range, comprises: Determine whether the target number is within the number range of the root node in the target tree structure; If the target number is within the range of the root node in the target tree structure, then the root node is determined as the target node, and it is determined whether the target number is within the range of the node numbers of the root node in the target tree structure. If the target number is within the range of the node number of the root node in the target tree structure, then continue recursively searching for target nodes whose number range contains the target number among the child nodes of the root node.
3. The method according to claim 2, further comprising: If the target number is not within the range of the root node in the target tree structure, then determine whether the target number is within the range of the node number of the root node in the target tree structure. If the target number is within the range of the node number of the root node in the target tree structure, then continue recursively searching for target nodes whose number range contains the target number among the child nodes of the root node.
4. The method according to claim 1, wherein the target tree structure is a binary search tree structure, and the method further includes: Receive storage requests for the first number segment; In response to the storage request, the first node in the target tree structure is determined based on the starting number in the number range of each node in the target tree structure and the starting number in the number range of the first number segment; Based on the number range of the first node and the number range of the first number segment, determine the insertion position of the child node for the node corresponding to the first number segment. Insert the node corresponding to the first number segment into the child node insertion position in the target tree structure, and update the node number range of the node in the target tree structure after insertion.
5. The method according to claim 4, wherein updating the node number range of nodes in the inserted target tree structure includes: In the inserted target tree structure, the nodes corresponding to the first number segment and the nodes related to the nodes corresponding to the first number segment are rotated, and the node number ranges of the nodes corresponding to the first number segment, the nodes related to the nodes corresponding to the first number segment, the predecessor nodes of the nodes corresponding to the first number segment, and the predecessor nodes of the nodes related to the nodes corresponding to the first number segment in the rotated target tree structure are updated.
6. The method according to claim 1, wherein the target tree structure is a binary search tree structure, the method further includes: Receive deletion requests for the second number segment; In response to the deletion request, the first node in the target tree structure is determined based on the starting number in the number range of each node in the target tree structure and the starting number in the number range of the second number segment; Based on the end number in the number range of the first node and the end number in the number range of the second number range, determine the second node in the first node that corresponds to the second number range; Delete the second node and update the node number range of the nodes in the target tree structure after deletion.
7. The method according to claim 1, further comprising: Receive a location query request for the target number; In response to the location query request, the target number segment to which the target number belongs is determined based on the number segment query results of the target number; Based on the location information corresponding to the target number segment, determine the location query result of the target number.
8. A data processing method, the method comprising: Obtain the number segment information to be stored, wherein the number segment information includes the number segment range; Construct an initial tree structure based on the number segment information; Based on the number range of each node and its child nodes in the initial tree structure, determine the first attribute value and the second attribute value of each node in the initial tree structure. The first attribute value is the minimum value of the starting number in the number range of the node and its child nodes, and the second attribute value is the maximum value of the ending number in the number range of the node and its child nodes. Based on the first attribute value and the second attribute value, the range of node numbers for each node is determined, and the target tree structure is obtained.
9. A data processing device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the data processing method as described in any one of claims 1 to 8.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the data processing method as described in any one of claims 1-8.