[go: up one dir, main page]

CN116108235A - Path acquisition method and device for tree structure and processing equipment - Google Patents

Path acquisition method and device for tree structure and processing equipment Download PDF

Info

Publication number
CN116108235A
CN116108235A CN202310137465.0A CN202310137465A CN116108235A CN 116108235 A CN116108235 A CN 116108235A CN 202310137465 A CN202310137465 A CN 202310137465A CN 116108235 A CN116108235 A CN 116108235A
Authority
CN
China
Prior art keywords
node
data
path
tree structure
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310137465.0A
Other languages
Chinese (zh)
Other versions
CN116108235B (en
Inventor
程白羽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Anbotong Technology Co.,Ltd.
Original Assignee
Shanghai Ambiton Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Ambiton Information Technology Co ltd filed Critical Shanghai Ambiton Information Technology Co ltd
Priority to CN202310137465.0A priority Critical patent/CN116108235B/en
Publication of CN116108235A publication Critical patent/CN116108235A/en
Application granted granted Critical
Publication of CN116108235B publication Critical patent/CN116108235B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9017Indexing; Data structures therefor; Storage structures using directory or table look-up
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application provides a path acquisition method, a path acquisition device and processing equipment for a tree structure, which are used for optimizing a path storage mechanism in the tree structure, so that in the subsequent application process, the processing effects of remarkably simplifying the processing complexity and reducing the processing time length can be achieved. The method for acquiring the tree-structured path comprises the following steps: obtaining tree structure data, wherein the tree structure data comprises a large number of nodes, and node relations among different nodes are set through father nodes and child nodes; traversing paths from each node to the corresponding root node in the tree structure data; and configuring json data adapted to the tree structure data, wherein any current node in the json data is marked with a path from the node to the corresponding root node.

Description

Path acquisition method and device for tree structure and processing equipment
Technical Field
The present invention relates to the field of data mining, and in particular, to a method and an apparatus for obtaining a path of a tree structure, and a processing device.
Background
A tree (tree) is an abstract data type, or data structure of such abstract data type, used to simulate a data set having tree-structured properties, and can be understood by a hierarchical nested structure, which is a large data representation.
Tree structures are an important class of nonlinear data structures that find widespread use in the computer arts, such as in compilers, where trees can be used to represent the syntax structure of a source program; as another example, in database systems, tree structures are also one of the important organization forms of information; as in file management, the multi-level directory structure is a tree structure.
In the research process of the prior related technology, the inventor finds that the existing tree structure display is realized based on json data showing the father-son relationship, the json data needs to define the father node and the son node, and the IDs of the father node and the son node, and stores, traverses and calculates the IDs to correctly display the tree structure, if the whole path of a certain target node needs to be acquired later, each son node in the json data is required to be in one-to-one correspondence with the father node, and then the values of the target node, the relevant father node and the son node are all arranged and combined to display the whole path of the target node, which needs a certain processing time, and the problem is obvious for the display work of a large number of high-frequency tree structures.
Disclosure of Invention
The application provides a path acquisition method, a path acquisition device and processing equipment for a tree structure, which are used for optimizing a path storage mechanism in the tree structure, so that in the subsequent application process, the processing effects of remarkably simplifying the processing complexity and reducing the processing time length can be achieved.
In a first aspect, the present application provides a method for obtaining a path of a tree structure, where the method includes:
obtaining tree structure data, wherein the tree structure data comprises a large number of nodes, and node relations among different nodes are set through father nodes and child nodes;
traversing paths from each node to the corresponding root node in the tree structure data;
and configuring json data adapted to the tree structure data, wherein any current node in the json data is marked with a path from the node to the corresponding root node.
With reference to the first aspect of the present application, in a first possible implementation manner of the first aspect of the present application, after configuring json data adapted to tree structure data, the method further includes:
acquiring a data query task, wherein a query object of the data query task is corresponding data of a target node;
acquiring a target path carried by a target node from json data;
and searching the corresponding data of the target node according to the target path and feeding back the corresponding data.
With reference to the first aspect of the present application, in a second possible implementation manner of the first aspect of the present application, any one current node in json data identifies a path from a node to a corresponding root node, and the path is specifically carried in a text value of the current node.
With reference to the second possible implementation manner of the first aspect of the present application, in a third possible implementation manner of the first aspect of the present application, after configuring json data adapted to tree structure data, the method further includes:
and reading a value of a corresponding text for each node in json data, assigning the value to the path attribute, intercepting and splitting the carried path, and reassigning the value to the text attribute to generate a tree structure presented by a visual interface.
With reference to the third possible implementation manner of the first aspect of the present application, in a fourth possible implementation manner of the first aspect of the present application, for each node in json data, reading a value of a corresponding text, assigning a path attribute, splitting a carried path, reassigning the path to the text attribute, and after generating a tree structure presented by a visual interface, the method further includes:
receiving touch operation aiming at a displayed target node in a visual interface;
acquiring a path of a target node;
and searching the corresponding data of the target node according to the path of the target node and feeding back the corresponding data.
With reference to the fourth possible implementation manner of the first aspect of the present application, in a fifth possible implementation manner of the first aspect of the present application, corresponding data of different nodes including the target node is stored in a database in the background.
With reference to the fourth possible implementation manner of the first aspect of the present application, in a sixth possible implementation manner of the first aspect of the present application, after receiving a touch operation for a displayed target node in a visual interface, the method further includes:
and displaying the path information content of the path of the target node.
In a second aspect, the present application provides a path acquisition apparatus of tree structure, the apparatus comprising:
an obtaining unit, configured to obtain tree structure data, where the tree structure data includes a large number of nodes, and set node relationships between different nodes through parent nodes and child nodes;
a traversing unit, configured to traverse a path from each node to a corresponding root node in tree structure data;
the configuration unit is used for configuring json data adapted to the tree structure data, wherein any current node in the json data is marked with a path from the node to the corresponding root node.
With reference to the second aspect of the present application, in a first possible implementation manner of the second aspect of the present application, the apparatus further includes a query unit, configured to:
acquiring a data query task, wherein a query object of the data query task is corresponding data of a target node;
acquiring a target path carried by a target node from json data;
and searching the corresponding data of the target node according to the target path and feeding back the corresponding data.
With reference to the second aspect of the present application, in a second possible implementation manner of the second aspect of the present application, any one current node in the json data identifies a path from the current node to the corresponding root node, and the path is specifically carried in a text value of the current node.
With reference to the second possible implementation manner of the second aspect of the present application, in a third possible implementation manner of the second aspect of the present application, the apparatus further includes a generating unit, configured to:
and reading a value of a corresponding text for each node in json data, assigning the value to the path attribute, intercepting and splitting the carried path, and reassigning the value to the text attribute to generate a tree structure presented by a visual interface.
With reference to the third possible implementation manner of the second aspect of the present application, in a fourth possible implementation manner of the second aspect of the present application, the apparatus further includes a query unit, configured to:
receiving touch operation aiming at a displayed target node in a visual interface;
acquiring a path of a target node;
and searching the corresponding data of the target node according to the path of the target node and feeding back the corresponding data.
With reference to the fourth possible implementation manner of the second aspect of the present application, in a fifth possible implementation manner of the second aspect of the present application, corresponding data of different nodes including the target node is stored in a database in the background.
With reference to the fourth possible implementation manner of the second aspect of the present application, in a sixth possible implementation manner of the second aspect of the present application, the query unit is further configured to:
and displaying the path information content of the path of the target node.
In a third aspect, the present application provides a processing device, comprising a processor and a memory, the memory having stored therein a computer program, the processor executing the method provided by the first aspect of the present application or any one of the possible implementations of the first aspect of the present application when calling the computer program in the memory.
In a fourth aspect, the present application provides a computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the method provided in the first aspect of the present application or any one of the possible implementations of the first aspect of the present application.
From the above, the present application has the following advantages:
aiming at the application requirement of the tree structure, after the tree structure data is acquired, the path from each node to the corresponding root node is traversed, and then the json data adaptive to the tree structure data is configured, and as any current node in the json data is marked with the path from the node to the corresponding root node, the ID is not needed to be used for marking each node and the father-son relationship thereof and finishing and combining all the nodes as in the prior art, the path from the node to the corresponding root node can be directly determined through the related path mark of the target node in the json data, and the operations such as traversing, combining and the like are not involved in the subsequent application, so that the processing complexity can be obviously simplified, the processing effect of processing duration is reduced, and the application is more convenient.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a path acquisition method of the tree structure of the present application;
FIG. 2 is an interface schematic of the visual interface of the present application;
FIG. 3 is a schematic diagram of a structure of the converted data of the present application;
FIG. 4 is a schematic view of yet another interface of the visual interface of the present application
Fig. 5 is a schematic structural diagram of a path acquisition device with a tree structure according to the present application;
fig. 6 is a schematic view of a structure of the processing apparatus of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules that are expressly listed or inherent to such process, method, article, or apparatus. The naming or numbering of the steps in the present application does not mean that the steps in the method flow must be executed according to the time/logic sequence indicated by the naming or numbering, and the execution sequence of the steps in the flow that are named or numbered may be changed according to the technical purpose to be achieved, so long as the same or similar technical effects can be achieved.
The division of the modules in the present application is a logical division, and may be implemented in another manner in practical application, for example, a plurality of modules may be combined or integrated in another system, or some features may be omitted or not implemented, and in addition, coupling or direct coupling or communication connection between the modules that are shown or discussed may be through some interfaces, and indirect coupling or communication connection between the modules may be in an electrical or other similar form, which is not limited in this application. The modules or sub-modules described as separate components may or may not be physically separate, or may be distributed in a plurality of circuit modules, and some or all of the modules may be selected according to actual needs to achieve the purposes of the present application.
Before introducing the tree-structured path acquisition method provided in the present application, the background content related to the present application is first described.
The method, the device and the computer readable storage medium for obtaining the paths of the tree structure can be applied to processing equipment and used for optimizing the storage mechanism of the paths in the tree structure, so that the processing effects of remarkably simplifying the processing complexity and reducing the processing time length can be achieved in the subsequent application process.
In the tree-structured path acquisition method, the execution body may be a tree-structured path acquisition device, or different types of processing devices such as a server, a physical host, or a User Equipment (UE) integrated with the tree-structured path acquisition device. The path obtaining device of the tree structure can be realized in a hardware or software mode, the UE can be specifically a terminal device such as a smart phone, a tablet computer, a notebook computer, a desktop computer or a personal digital assistant (Personal Digital Assistant, PDA), and the processing device can be set in a device cluster mode.
It should be understood that, for the processing device related to the present application, the specific device form is configured according to the application requirements of the related data related to the tree structure in practical application, mainly for the related developer service, and is typically a device such as a physical host, a desktop computer, and the like.
Next, a path acquisition method of the tree structure provided in the present application is described.
First, referring to fig. 1, fig. 1 shows a flow chart of a tree-structured path acquisition method according to the present application, and the tree-structured path acquisition method provided in the present application may specifically include steps S101 to S103 as follows:
step S101, obtaining tree structure data, wherein the tree structure data comprises a large number of nodes, and node relations among different nodes are set through father nodes and child nodes;
it should be noted that the tree structure data obtained here corresponds to the case where the data is already set in the form of a tree structure, that is, the data is ready-made data in the prior art.
In general, the tree structure data acquired herein may directly acquire the data itself with the tree structure already set, or may directly refer to the tree structure related to the tree structure data, that is, the description data of the tree structure, which may provide data basis for setting the node relationship between different nodes through the father node and the child node, which needs to be determined in the early stage of the application.
In the prior art, the display or other application of the tree structure of the data is realized based on json data showing the father-son relationship, the IDs of the father node and the son node are required to be defined in the json data, the IDs are stored, traversed and calculated, the tree structure can be displayed correctly, if the whole path of a certain target node is required to be acquired later, each son node in the json data is required to be in one-to-one correspondence with the father node again, and the values of the target node, the relevant father node and the son node are combined together, so that the whole path of the target node can be displayed, the processing time is required to be completed to a certain extent, and the problem is further obvious for the display of a large number of high-frequency tree structures.
It can be seen that the prior art is arranged around node IDs, and in the early stage of constructing a tree structure, the following processing needs to be performed in json data:
defining the ID of each node, wherein the ID is to represent the relationship between the parent node and the child node, and storing the ID of the current node as the current node ID; storing the ID of the parent node of the current node; storing path enumeration from a root node to a current node; storing the node serial numbers of the current nodes to show the parent-child relationship of the current nodes; and marking whether the current node is a leaf node.
It is obvious that the earlier stage is directed to the excessively complicated ID processing of the nodes, and the later stage is directed to the mode of combining all the nodes, so that the problems of higher complexity and longer processing time are obvious when the display of a large number of high-frequency tree structures and other work are faced.
For the purposes of the prior art and also of json referred to in this application, json is a file used to store simple data structures and objects, json is a lightweight data exchange format based on a subset of ECMAScript (js specification formulated by the european computer institute), storing and representing data in a text format that is completely independent of the programming language, for many Web applications to exchange data.
Furthermore, for a tree structure, it is understood that a hierarchical nested structure, the outer and inner layers of a tree structure have similar structures, so that such structures can be represented recursively. The various tree diagrams in a classical data structure are a typical tree structure: a tree may simply be represented as a root, a left subtree, a right subtree, a left subtree and a right subtree, again with their own subtrees.
Step S102, traversing paths from each node to the corresponding root node in the tree structure data;
it will be appreciated that in tree structured data, which has been defined as in the prior art for each node in the data as to the relative parent-child relationship, starting from the first parent node, the path formed by the corresponding child nodes will be followed until the last root node.
Thus, in view of providing data basis for subsequent data processing, the present application may traverse, for each node therein, a path from the node to the corresponding root node.
Step S103, configuring json data adapted to the tree structure data, wherein any current node in the json data identifies a path from the current node to the corresponding root node.
It can be understood that another json data is introduced based on the existing tree structure data, in the json data, content is distinguished for each node, specifically, each node is stored until the path of the corresponding root node by taking the node as a unit, after the target node to be inquired and understood is determined, the target node can be directly locked from the json data, and the stored path of the node is called until the path of the corresponding root node.
Under the path acquisition mechanism/storage mechanism, it is obvious that complex processing of the early node ID and finishing and combining of the later nodes are not needed any more as in the prior art, and management of the corresponding path can be directly developed by the granularity of the nodes and application work can be carried out, so that convenience in related data processing is remarkably improved.
As can be seen from the content of the above embodiment, for the application requirement of the tree structure, after the tree structure data is obtained, the present application traverses the path from each node to the corresponding root node, and reconfigures the json data adapted by the tree structure data, because any current node in the json data identifies the path from the node to the corresponding root node, it is unnecessary to identify each node and its parent-child relationship by ID and also to sort and combine all nodes as in the prior art, and the path from the node to the corresponding root node can be directly determined by the relevant path identification of the target node in the json data, so that the operations such as traversing, combining, etc. are not involved in the subsequent application, thereby the processing complexity can be significantly simplified, the processing effect of the processing time length can be reduced, and the application is more convenient.
The steps of the embodiment shown in fig. 1 and the possible implementation thereof in practical applications will be described in detail.
It will be appreciated that, while it has been mentioned above, the following may relate to path-based management and related application work, for which, taking a more typical data query as an example, as a specific implementation of the present application, after configuring json data adapted by tree structure data in step S103, the method of the present application may further include:
acquiring a data query task, wherein a query object of the data query task is corresponding data of a target node;
acquiring a target path carried by a target node from json data;
and searching the corresponding data of the target node according to the target path and feeding back the corresponding data.
It will be appreciated that the data query task involved may relate to any data query scenario, for example, the requirement of querying the record content of individual aspects, and forwarding individual data, etc., and when the data is stored in a data storage structure of a tree structure, the query of specified data may be performed for a specific node/target node.
At this time, since each node in the json data directly records the relevant path, the corresponding target path of the target node can be conveniently and directly obtained, the storage position of the target data is determined based on the target path, and the feedback is searched and performed.
The data query task and the feedback are obviously in the category of more conventional data query processing, so that the application is not repeated here.
Further, for the above, the present application also provides a series of more specific landing kit schemes suitable for practical use in connection with specific applications.
As another specific implementation manner, the relevant paths described for each node in json data in the present application may specifically be carried in the values of txet, that is, the paths from the current node to the corresponding root node in any one of the current nodes in json data are identified, and may specifically be carried in the values of text of the current nodes.
Specifically, json data may be defined as follows:
and defining json data, wherein the text value in the json data is the path from the current node to the root node.
Figure BDA0004086473920000091
Figure BDA0004086473920000101
In this example, "user management/user organization/user configuration" is a path, and similarly, "user management/user organization/user/binding IP" is also a path, and specifically, reference may also be made to an interface schematic of the visual interface of the present application shown in fig. 2.
In the process of assigning the path from each node to the root node as the text value, corresponding to the presentation aspect, the tags can be used for representing how much data is under the node, and then the tags can be directly displayed in the tree structure.
In addition, along with the presentation aspect mentioned above, in order to facilitate relevant applications such as querying, managing, etc. of expanding paths directly in a manner of a functional interface/a visual interface, the present application may further implement a tree-structured content exhibition task through the following settings, that is, after configuring json data adapted to tree-structured data in step S103, the method of the present application may further include:
and reading a value of a corresponding text for each node in json data, assigning the value to the path attribute, intercepting and splitting the carried path, and reassigning the value to the text attribute to generate a tree structure presented by a visual interface.
It can be appreciated how the paths stored by json at the data plane are converted into paths in the tree structure of the line rubbed by the visual interface, and a specific floor matching scheme is provided.
In particular, the data conversion work involved in the embodiments herein may be performed as follows:
Figure BDA0004086473920000102
briefly, the value of the text of each node is obtained and directly assigned to the newly added path attribute, then the field of each text is intercepted by "/", and the intercepted value is reassigned to the text attribute.
As shown in fig. 3, a schematic structural diagram of the converted data in the application is shown, text is changed into intercepted data, path attribute is added, and content is path information.
The converted data may then be presented through a visual interface of the type shown in fig. 2.
In addition, in the visual interface, besides facilitating the presentation of the relevant paths, a touch function can be configured so as to initiate corresponding data query services directly aiming at the presented relevant nodes.
Correspondingly, as another exemplary implementation manner, for each node in json data, reading a value of a corresponding text, assigning the value to a path attribute, splitting a carried path interception, reassigning the path attribute, and generating a tree structure presented by a visual interface, the method of the present application may further include:
receiving touch operation aiming at a displayed target node in a visual interface;
acquiring a path of a target node;
and searching the corresponding data of the target node according to the path of the target node and feeding back the corresponding data.
The touch operation is usually a clicking operation, and the clicking operation can be further classified into a clicking operation of a mouse and a clicking operation on a touch screen according to the different devices.
Obviously, through the triggering of the touch operation, the data content behind the path corresponding to the node can be displayed more conveniently, so that the visual interface can realize the interface functions with high concentration of functions and very convenient operation.
In terms of specific application scenarios, the application can also relate to different application scenarios of the front end and the background, namely, corresponding data of different nodes including the target node are stored in a database of the background, and a visual interface of the front end can provide relevant nodes for inquiring and calling the background data.
In addition, in this embodiment, after receiving the touch operation for the displayed target node in the visual interface, in order to improve the clearer response effect, the method may further include:
and displaying the path information content of the path of the target node.
In the process of inquiring the data, the user can intuitively see that the device has captured the touch operation, and the path information content of the path of the target node aimed at by the touch operation is displayed while the related data behind the device is called for display, so that the user can observe whether the specific condition of the path is correct or not.
For ease of understanding, several exemplary arrangements may also be described in connection with the present disclosure by way of example below.
Based on the visual interface content shown in fig. 2, a user can click on a user configuration node to trigger a node click event of the node, so that path information from the node to a root node can be displayed at the front end directly by acquiring path attributes of the node, as shown in the right side of fig. 2, the following specific operations are performed behind the path information:
Figure BDA0004086473920000111
the path of the node clicking event is sent to the background, the background intercepts the field through '/', and the data corresponding to the intercepted field is queried in the database, and the method comprises the following steps:
Figure BDA0004086473920000121
after the query result is obtained, the query result can be fed back to the front end and is continuously displayed in the visual interface, such as a further interface schematic diagram of the visual interface shown in fig. 4.
The above is an introduction of the tree-structured path acquisition method provided by the present application, and in order to facilitate better implementation of the tree-structured path acquisition method provided by the present application, the present application further provides a tree-structured path acquisition device from the perspective of a functional module.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a tree-structured path acquisition device according to the present application, where a tree-structured path acquisition device 500 may specifically include the following structures:
an obtaining unit 501, configured to obtain tree structure data, where the tree structure data includes a large number of nodes, and set node relationships between different nodes through parent nodes and child nodes;
a traversing unit 502, configured to traverse a path from each node to a corresponding root node in the tree structure data;
a configuration unit 503, configured to configure json data adapted to the tree structure data, where any current node in the json data identifies a path from the current node to the corresponding root node.
In an exemplary implementation, the apparatus further includes a query unit 504 configured to:
acquiring a data query task, wherein a query object of the data query task is corresponding data of a target node;
acquiring a target path carried by a target node from json data;
and searching the corresponding data of the target node according to the target path and feeding back the corresponding data.
In yet another exemplary implementation, any current node in json data identifies a path from its own node to the corresponding root node, and is specifically carried in the value of the text of the current node.
In yet another exemplary implementation, the apparatus further includes a generating unit 505 configured to:
and reading a value of a corresponding text for each node in json data, assigning the value to the path attribute, intercepting and splitting the carried path, and reassigning the value to the text attribute to generate a tree structure presented by a visual interface.
In yet another exemplary implementation, the apparatus further includes a query unit 504 configured to:
receiving touch operation aiming at a displayed target node in a visual interface;
acquiring a path of a target node;
and searching the corresponding data of the target node according to the path of the target node and feeding back the corresponding data.
In yet another exemplary implementation, corresponding data for different nodes including the target node is stored in a database in the background.
In a further exemplary implementation manner, in a sixth possible implementation manner of the second aspect of the present application, the query unit 504 is further configured to:
and displaying the path information content of the path of the target node.
The present application further provides a processing device from the perspective of a hardware structure, referring to fig. 6, fig. 6 shows a schematic structural diagram of the processing device of the present application, specifically, the processing device of the present application may include a processor 601, a memory 602, and an input/output device 603, where the processor 601 is configured to implement steps of a path acquisition method of a tree structure in the corresponding embodiment of fig. 1 when executing a computer program stored in the memory 602; alternatively, the processor 601 is configured to implement functions of each unit in the corresponding embodiment of fig. 5 when executing a computer program stored in the memory 602, and the memory 602 is configured to store a computer program required for the processor 601 to execute the path acquisition method of the tree structure in the corresponding embodiment of fig. 1.
By way of example, a computer program may be partitioned into one or more modules/units, which are stored in the memory 602 and executed by the processor 601 to complete the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing particular functions to describe the execution of the computer program in a computer device.
The processing devices may include, but are not limited to, a processor 601, memory 602, and input output devices 603. It will be appreciated by those skilled in the art that the illustrations are merely examples of processing devices and do not constitute a limitation of processing devices, and that more or fewer components than shown may be included, or that certain components may be combined, or that different components may be included, for example, processing devices may also include network access devices, buses, etc., through which processor 601, memory 602, input output device 603, etc. are connected.
The processor 601 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center for a processing device, with various interfaces and lines connecting the various parts of the overall device.
The memory 602 may be used to store computer programs and/or modules, and the processor 601 implements various functions of the computer device by running or executing the computer programs and/or modules stored in the memory 602 and invoking data stored in the memory 602. The memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function, and the like; the storage data area may store data created according to the use of the processing device, or the like. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 601 is configured to execute the computer program stored in the memory 602, and may specifically implement the following functions:
obtaining tree structure data, wherein the tree structure data comprises a large number of nodes, and node relations among different nodes are set through father nodes and child nodes;
traversing paths from each node to the corresponding root node in the tree structure data;
and configuring json data adapted to the tree structure data, wherein any current node in the json data is marked with a path from the node to the corresponding root node.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the above-described tree-structured path acquisition device, processing apparatus and corresponding units may refer to the description of the tree-structured path acquisition method in the corresponding embodiment of fig. 1, which is not repeated herein.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
For this reason, the present application provides a computer readable storage medium, in which a plurality of instructions capable of being loaded by a processor are stored, so as to execute the steps of the path acquisition method of the tree structure in the corresponding embodiment of fig. 1, and specific operations may refer to the description of the path acquisition method of the tree structure in the corresponding embodiment of fig. 1, which is not repeated herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
Since the instructions stored in the computer readable storage medium may execute the steps of the path acquisition method of the tree structure in the corresponding embodiment of fig. 1, the beneficial effects that can be achieved by the path acquisition method of the tree structure in the corresponding embodiment of fig. 1 are achieved, which are detailed in the foregoing description and are not repeated herein.
The above describes the tree-structured path acquisition method, apparatus, processing device and computer readable storage medium provided in the present application in detail, and specific examples are applied herein to illustrate the principles and embodiments of the present application, where the above description of the embodiments is only for helping to understand the method and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method for obtaining a path of a tree structure, the method comprising:
obtaining tree structure data, wherein the tree structure data comprises a large number of nodes, and node relations among different nodes are set through father nodes and child nodes;
traversing paths from each node to a corresponding root node in the tree structure data;
and configuring json data adapted to the tree structure data, wherein any current node in the json data is marked with a path from the node to the corresponding root node.
2. The method of claim 1, wherein after said configuring json data for said tree structure data adaptation, the method further comprises:
acquiring a data query task, wherein a query object of the data query task is corresponding data of a target node;
acquiring a target path carried by the target node from the json data;
and searching corresponding data of the target node according to the target path and feeding back the corresponding data.
3. The method according to claim 1, wherein any current node in the json data identifies a path from its own node up to the corresponding root node, specifically carried in a value of text of the current node.
4. A method according to claim 3, wherein after said configuring json data for said tree structure data adaptation, the method further comprises:
and reading the value of the corresponding text for each node in the json data, assigning the path attribute, intercepting and splitting the carried path, and reassigning the text attribute to generate a tree structure presented by a visual interface.
5. The method according to claim 4, wherein for each node in the json data, reading a value of a corresponding text, assigning a path attribute, splitting a carried path intercept, reassigning the path attribute, and generating a tree structure presented in a visual interface, the method further comprises:
receiving touch operation aiming at a displayed target node in the visual interface;
acquiring the path of the target node;
and searching corresponding data of the target node according to the path of the target node and feeding back the corresponding data.
6. The method of claim 5, wherein the corresponding data for the different nodes including the target node is stored in a database in the background.
7. The method of claim 5, wherein after receiving the touch operation for the presented target node in the visualization interface, the method further comprises:
and displaying the path information content of the path of the target node.
8. A path acquisition device of tree structure, the device comprising:
an obtaining unit, configured to obtain tree structure data, where the tree structure data includes a large number of nodes, and set node relationships between different nodes through parent nodes and child nodes;
a traversing unit, configured to traverse a path from each node to a corresponding root node in the tree structure data;
the configuration unit is used for configuring json data adapted to the tree structure data, wherein any current node in the json data is marked with a path from the node to the corresponding root node.
9. A processing device comprising a processor and a memory, the memory having stored therein a computer program, the processor executing the method of any of claims 1 to 7 when invoking the computer program in the memory.
10. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the method of any one of claims 1 to 7.
CN202310137465.0A 2023-02-20 2023-02-20 Path acquisition method and device for tree structure and processing equipment Active CN116108235B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310137465.0A CN116108235B (en) 2023-02-20 2023-02-20 Path acquisition method and device for tree structure and processing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310137465.0A CN116108235B (en) 2023-02-20 2023-02-20 Path acquisition method and device for tree structure and processing equipment

Publications (2)

Publication Number Publication Date
CN116108235A true CN116108235A (en) 2023-05-12
CN116108235B CN116108235B (en) 2023-11-10

Family

ID=86255966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310137465.0A Active CN116108235B (en) 2023-02-20 2023-02-20 Path acquisition method and device for tree structure and processing equipment

Country Status (1)

Country Link
CN (1) CN116108235B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119130528A (en) * 2024-11-08 2024-12-13 广州中南网络技术有限公司 A new digital recording method based on different application scenarios

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080147627A1 (en) * 2006-12-15 2008-06-19 Yahoo! Inc. Clustered query support for a database query engine
CN105930447A (en) * 2016-04-20 2016-09-07 零氪科技(北京)有限公司 Method for converting tree-like nested data into plane data table
US20160314152A1 (en) * 2015-04-21 2016-10-27 International Business Machines Corporation Augmenting the display of data in a tree format
CN107679049A (en) * 2016-08-02 2018-02-09 北京京东尚科信息技术有限公司 Obtain the method, apparatus and system of the hop of tree structure data two
CN107704234A (en) * 2017-08-22 2018-02-16 北京三快在线科技有限公司 Front end engineering construction method, device, electronic equipment and readable storage medium storing program for executing
CN108733689A (en) * 2017-04-18 2018-11-02 北京京东尚科信息技术有限公司 A kind of comparison method and device of JSON texts
US20190102389A1 (en) * 2017-10-04 2019-04-04 Dell Products Lp Storing and processing json documents in a sql database table
CN110110152A (en) * 2018-01-18 2019-08-09 深圳市爱思软件技术有限公司 Processing method, device, computer equipment and the storage medium of mind map
CN110110150A (en) * 2018-01-04 2019-08-09 北大医疗信息技术有限公司 Read method, reading device, computer equipment and the storage medium of XML data
WO2020140940A1 (en) * 2019-01-06 2020-07-09 阿里巴巴集团控股有限公司 Code generation method and apparatus, and device and storage medium
CN112632065A (en) * 2020-12-18 2021-04-09 北京锐安科技有限公司 Data storage method and device, storage medium and server
CN113704294A (en) * 2021-08-17 2021-11-26 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment and storage medium
CN114491325A (en) * 2022-02-16 2022-05-13 平安科技(深圳)有限公司 Webpage data extraction method and device, computer equipment and storage medium
CN114491172A (en) * 2022-04-07 2022-05-13 深圳竹云科技股份有限公司 Method, device and equipment for quickly searching tree structure nodes and storage medium
CN115238655A (en) * 2022-07-14 2022-10-25 中汽创智科技有限公司 Json data editing method and device
CN115686606A (en) * 2022-10-11 2023-02-03 平安银行股份有限公司 Method, device, system and medium for displaying item dependency tree

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080147627A1 (en) * 2006-12-15 2008-06-19 Yahoo! Inc. Clustered query support for a database query engine
US20160314152A1 (en) * 2015-04-21 2016-10-27 International Business Machines Corporation Augmenting the display of data in a tree format
CN105930447A (en) * 2016-04-20 2016-09-07 零氪科技(北京)有限公司 Method for converting tree-like nested data into plane data table
CN107679049A (en) * 2016-08-02 2018-02-09 北京京东尚科信息技术有限公司 Obtain the method, apparatus and system of the hop of tree structure data two
CN108733689A (en) * 2017-04-18 2018-11-02 北京京东尚科信息技术有限公司 A kind of comparison method and device of JSON texts
CN107704234A (en) * 2017-08-22 2018-02-16 北京三快在线科技有限公司 Front end engineering construction method, device, electronic equipment and readable storage medium storing program for executing
US20190102389A1 (en) * 2017-10-04 2019-04-04 Dell Products Lp Storing and processing json documents in a sql database table
CN110110150A (en) * 2018-01-04 2019-08-09 北大医疗信息技术有限公司 Read method, reading device, computer equipment and the storage medium of XML data
CN110110152A (en) * 2018-01-18 2019-08-09 深圳市爱思软件技术有限公司 Processing method, device, computer equipment and the storage medium of mind map
WO2020140940A1 (en) * 2019-01-06 2020-07-09 阿里巴巴集团控股有限公司 Code generation method and apparatus, and device and storage medium
CN112632065A (en) * 2020-12-18 2021-04-09 北京锐安科技有限公司 Data storage method and device, storage medium and server
CN113704294A (en) * 2021-08-17 2021-11-26 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment and storage medium
CN114491325A (en) * 2022-02-16 2022-05-13 平安科技(深圳)有限公司 Webpage data extraction method and device, computer equipment and storage medium
CN114491172A (en) * 2022-04-07 2022-05-13 深圳竹云科技股份有限公司 Method, device and equipment for quickly searching tree structure nodes and storage medium
CN115238655A (en) * 2022-07-14 2022-10-25 中汽创智科技有限公司 Json data editing method and device
CN115686606A (en) * 2022-10-11 2023-02-03 平安银行股份有限公司 Method, device, system and medium for displaying item dependency tree

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
LV T 等: "Linked lists storage for JSON data", 2021 INTERNATIONAL CONFERENCE ON INTELLIGENT COMPUTING, AUTOMATION AND APPLICATIONS, pages 402 - 405 *
吉小洪 等: "基于trie merging机制数据流滑动窗口模型的频繁树模式挖掘", 计算机应用研究, vol. 37, no. 07, pages 1993 - 1998 *
方耀耀;: "一种基于树形结构的Sql结果集向Json数据的转换算法", 电子测试, no. 03, pages 51 - 53 *
李敏波;许鑫星;李强;韩乐;: "基于JSON文档结构的工业大数据多维分析方法", 中国机械工程, no. 14, pages 66 - 73 *
杜晓旭;贾小云;: "基于Python的新浪微博爬虫分析", 软件, no. 04 *
王荩梓;赖雯洁;: "基于房产交易网站的数据获取与在线工具开发", 计算机技术与发展, no. 05 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119130528A (en) * 2024-11-08 2024-12-13 广州中南网络技术有限公司 A new digital recording method based on different application scenarios

Also Published As

Publication number Publication date
CN116108235B (en) 2023-11-10

Similar Documents

Publication Publication Date Title
CN110716783A (en) Front-end page generation and deployment method and device, storage medium and equipment
US8924373B2 (en) Query plans with parameter markers in place of object identifiers
CN111259627A (en) Document analysis method, apparatus, computer storage medium and device
CN109002334B (en) Operation and maintenance platform and data processing method thereof
CN102279749A (en) Method and equipment for merging codes
CN106940721B (en) Data processing method and system for user-defined selection box
CN111008521A (en) Method and device for generating wide table and computer storage medium
US11531706B2 (en) Graph search using index vertices
CN116108235B (en) Path acquisition method and device for tree structure and processing equipment
CN111381820A (en) Method and device for automatically generating API based on GUI
CN112364051B (en) Data query method and device
US10585678B2 (en) Insertion of custom activities in an orchestrated application suite
CN110597435B (en) Cross-page checking system and method
CN110928900B (en) Multi-table data query method, device, terminal and computer storage medium
CN110941634A (en) Data processing method and device, storage medium and electronic device
CN115617338A (en) Method and device for quickly generating service page and readable storage medium
CN112579454B (en) Task data processing method, device and equipment
CN110888876A (en) Method and device for generating database script, storage medium and computer equipment
CN111651397B (en) Method and equipment for accessing peripheral module of PXIe
CN116467179A (en) Test case batch editing method and device and processing equipment
CN117725058A (en) Data blood-margin management system and data blood-margin management method
CN113779068B (en) Data query method, device, equipment and storage medium
CN113923250B (en) Method, device and system for assisting network service arrangement
CN116166737A (en) Resource topological graph generation method and device, electronic equipment and readable storage medium
US10855553B2 (en) Visualization of new storage area network devices and connectivity with a topology based map

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240517

Address after: 200333, 5th floor, No. 3, Lane 556, Daduhe Road, Putuo District, Shanghai

Patentee after: Shanghai Anbotong Technology Co.,Ltd.

Country or region after: China

Address before: 200062 floors 2, 3, 21 and 22, No. 89, Yunling East Road, Putuo District, Shanghai

Patentee before: Shanghai Ambiton Information Technology Co.,Ltd.

Country or region before: China