CN-121996652-A - Data processing apparatus and storage medium
Abstract
The application discloses a data processing method, data processing equipment and a storage medium, and belongs to the field of communication. The data processing method comprises the steps of obtaining a target tree structure storing number segment information, obtaining a bracket segment range of the number segment information, recursively searching target nodes containing target numbers in the number segment range of each node in the target tree structure according to the number segment range and the node number range of each node in the target tree structure, determining the node number range according to a first attribute value and a second attribute value of the nodes, wherein the first attribute value is the minimum value of initial numbers in the number segment ranges of the nodes and the sub-nodes of the nodes, the second attribute value is the maximum value of end numbers in the number segment ranges of the nodes and the sub-nodes of the nodes, and determining number segment query results aiming at the target numbers according to the number segment information corresponding to the target nodes.
Inventors
- YANG XIAO
Assignees
- 中兴通讯股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241104
Claims (10)
- 1. A method of data processing, the method comprising: Obtaining a target tree structure storing number segment information, wherein the number segment information packages bracket segment range; Recursively searching target nodes, including target numbers, in the number segment ranges of the nodes of the target tree structure according to the number segment ranges and the node number ranges of each node in the target tree structure, wherein the node number ranges are determined according to first attribute values and second attribute values of the nodes, the first attribute values are minimum values of initial numbers in the number segment ranges of the nodes and the sub-nodes of the nodes, and the second attribute values are maximum values of end numbers in the number segment ranges of the nodes and the sub-nodes of the nodes; And determining a number segment query result aiming at the target number according to the number segment information corresponding to the target node.
- 2. The method according to claim 1, wherein recursively searching for the target node of the target tree structure that includes the target number according to the number range and the node number range of each node in the target tree structure, includes: judging whether the target number is in the number segment range of a root node in the target tree structure; if the target number is in the number segment range of the root node in the target tree structure, determining the root node as the target node, and judging whether the target number is in the node number range of the root node in the target tree structure; And if the target number is in the node number range of the root node in the target tree structure, continuing recursively searching for a target node of which the number range contains the target number in the child nodes of the root node.
- 3. The method of claim 2, the method further comprising: if the target number is not in the number segment range of the root node in the target tree structure, judging whether the target number is in the node number range of the root node in the target tree structure; And if the target number is in the node number range of the root node in the target tree structure, continuing recursively searching for a target node of which the number range contains the target number in the child nodes of the root node.
- 4. The method of claim 1, the target tree structure being a binary search tree structure, the method further comprising: receiving a storage request for a first number segment; responding to the storage request, and determining a first node in the target tree structure according to the initial number in the number segment range of each node in the target tree structure and the initial number in the number segment range of the first number segment; Determining a child node insertion position of a node corresponding to the first number segment according to the number segment range of the first node and the number segment range of the first number segment; and inserting the node corresponding to the first number segment into a child node insertion position in the target tree structure, and updating the node number range of the node in the inserted target tree structure.
- 5. The method according to claim 4, wherein the updating the node number range of the node in the inserted target tree structure includes: and in the inserted target tree structure, performing rotation processing on the node corresponding to the first number segment and the node related to the node corresponding to the first number segment, and updating the node number range of the node corresponding to the first number segment, the node related to the node corresponding to the first number segment, the front node of the node corresponding to the first number segment and the front node of the node related to the node corresponding to the first number segment in the rotated target tree structure.
- 6. The method of claim 1, the target tree structure being a binary search tree structure, the method further comprising: Receiving a deletion request for the second number segment; responding to the deleting request, and determining a first node in the target tree structure according to the initial number in the number segment range of each node in the target tree structure and the initial number in the number segment range of the second number segment; Determining a second node corresponding to the second number segment in the first node according to 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; deleting the second node, and updating the node number range of the nodes in the deleted target tree structure.
- 7. The method of claim 1, the method further comprising: receiving a home location query request for the target number; responding to the attribution inquiry request, and determining a target number segment to which the target number belongs according to a number segment inquiry result of the target number; And determining a attribution query result of the target number according to attribution information corresponding to the target number segment.
- 8. A method of data processing, the method comprising: Acquiring number segment information to be stored, wherein the number segment information packages bracket segment range; constructing an initial tree structure according to the number segment information; determining a first attribute value and a second attribute value of each node in the initial tree structure according to the number segment range of each node and the child node in the initial tree structure, wherein the first attribute value is the minimum value of the initial numbers in the number segment ranges of the nodes and the child nodes of the nodes, and the second attribute value is the maximum value of the end numbers in the number segment ranges of the nodes and the child nodes of the nodes; And determining the node number range of each node according to the first attribute value and the second attribute value to obtain a target tree structure.
- 9. A data processing apparatus comprising a processor and a memory storing a program or instruction executable on the processor, which when executed by the processor, implements the steps of the data processing method of any of claims 1 to 8.
- 10. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the data processing method according to any of claims 1-8.
Description
Data processing apparatus and storage medium Technical Field Embodiments of the present application relate to the field of communications, and in particular, to data processing, devices, and storage media. Background With the rapid development of mobile communication technology, the data volume of network element data is increasing, and how to effectively manage the network element data is the focus of attention of operators. In order to improve the data management efficiency, the number segment data in the network element data can be stored in a tree structure, for example, nodes in the tree structure can be respectively constructed according to the start number and the end number of the number segment, and the number segment query and other processing can be realized according to the index corresponding to each node in an index establishing mode. However, since the number segment data has a larger and larger data size, the algorithm for processing the number segment data in the above manner has a high complexity and low data processing efficiency, and therefore, a solution for improving the processing efficiency of processing the number segment data is needed. Disclosure of Invention The embodiment of the application provides a solution for improving the processing efficiency of processing number segment data. According to a first aspect, a data processing method is provided, the method comprises the steps of obtaining a target tree structure with number segment information stored therein, obtaining a bracket segment range of the number segment information package, recursively searching target nodes containing target numbers in the number segment range of each node in the target tree structure according to the number segment range and the node number range of each node in the target tree structure, determining the node number range according to a first attribute value and a second attribute value of the nodes, wherein the first attribute value is the minimum value of initial numbers in the number segment ranges of the nodes and the sub-nodes of the nodes, the second attribute value is the maximum value of ending numbers in the number segment ranges of the nodes and the sub-nodes of the nodes, and determining a number segment query result for the target numbers according to the number segment information corresponding to the target nodes. The second aspect provides a data processing method, which comprises the steps of obtaining number segment information to be stored, constructing an initial tree structure according to the number segment information, determining a first attribute value and a second attribute value of each node in the initial tree structure according to the number segment range of each node and sub-nodes in the initial tree structure, wherein the first attribute value is the minimum value of a starting number in the number segment range of each node and the sub-nodes of each node, the second attribute value is the maximum value of an ending number in the number segment range of each node and the sub-nodes of each node, and determining the node number range of each node according to the first attribute value and the second attribute value to obtain a target tree structure. In a third aspect, there is provided a data processing apparatus comprising a processor and a memory storing a program or instructions executable on the processor, the program or instructions implementing the steps of data processing according to the first or second aspects when executed by the processor. In a fourth aspect, there is provided a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the data processing according to the first or second aspects. The embodiment of the application adopts the following technical scheme: Obtaining a target tree structure storing number segment information, wherein the number segment information can comprise a number segment range, recursively searching target nodes of which the number segment range comprises a target number in the nodes of the target tree structure according to the number segment range and the node number range of each node in the target tree structure, wherein the node number range can be determined according to a first attribute value and a second attribute value of the nodes, the first attribute value is the minimum value of initial numbers in the number segment ranges of the nodes and the sub-nodes of the nodes, the second attribute value is the maximum value of end numbers in the number segment ranges of the nodes and the sub-nodes of the nodes, and determining a number segment query result aiming at the target number according to the number segment information corresponding to the target nodes. The above at least one technical scheme adopted by the embodiment of the application can achieve the following beneficial effects: Because the node number range is determined according to the f