CN113282799B - Node operation method, node operation device, computer equipment and storage medium - Google Patents

Node operation method, node operation device, computer equipment and storage medium Download PDF

Info

Publication number
CN113282799B
CN113282799B CN202110558073.2A CN202110558073A CN113282799B CN 113282799 B CN113282799 B CN 113282799B CN 202110558073 A CN202110558073 A CN 202110558073A CN 113282799 B CN113282799 B CN 113282799B
Authority
CN
China
Prior art keywords
node
operated
information
depth information
determining
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.)
Active
Application number
CN202110558073.2A
Other languages
Chinese (zh)
Other versions
CN113282799A (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.)
Wuhan United Imaging Healthcare Co Ltd
Original Assignee
Wuhan United Imaging Healthcare 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 Wuhan United Imaging Healthcare Co Ltd filed Critical Wuhan United Imaging Healthcare Co Ltd
Priority to CN202110558073.2A priority Critical patent/CN113282799B/en
Publication of CN113282799A publication Critical patent/CN113282799A/en
Application granted granted Critical
Publication of CN113282799B publication Critical patent/CN113282799B/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/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • 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)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a method, an apparatus, a computer device and a storage medium for operating a node. The method comprises the following steps: acquiring attribute information of a node to be operated; the attribute information is used for representing the position information of the node to be operated in the tree structure tree; determining depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated; determining object information of the node to be operated according to the depth information; the object information is used for representing the identity information of the node to be operated. When the method is used for searching the nodes, the memory space of the system can be saved.

Description

Node operation method, node operation device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for operating a node, a computer device, and a storage medium.
Background
With the rapid development of information technology, in a service system, a tree structure tree is generally constructed to display the structure of the service system, for example, more and more medical institutions develop the construction of the medical information system, a plurality of sub-hospitals are divided under the medical institutions, and a plurality of departments, departments and the like are arranged under the sub-hospitals, so that the division is performed layer by layer. Wherein, each sub-hospital can be used as a father node of the tree structure tree, and departments, departments and the like below the sub-hospitals can be used as leaf nodes of the tree structure tree.
When a user needs to operate on a node of a tree structure tree, the node must generally be found first. In the related art, when searching nodes, most of the nodes are searched by a recursive query mode. The method comprises the following steps: each node has some relevant information of itself from the first layer of the tree structure tree, and when searching each layer of nodes, corresponding memory space is allocated to each layer of nodes to store the information of the nodes. When the required node is not found on the node of the layer, continuing to find the node of the lower layer, and also distributing memory space storage information to the node of the lower layer, and iteratively finding according to the mode until the required node is found.
However, the node searching method in the above technology wastes relatively the memory space of the system.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device, and a storage medium for operating a node, which can save a system memory space when searching for the node.
A method of operation of a node, the method comprising:
acquiring attribute information of a node to be operated; the attribute information is used for representing the position information of the node to be operated in the tree structure tree;
Determining depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated;
determining object information of a node to be operated according to the depth information; the object information is used for representing identity information of the node to be operated.
In one embodiment, determining depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated includes:
obtaining a depth information array corresponding to the attribute information of the node to be operated according to the attribute information of the node to be operated;
and determining the depth information of the node to be operated in the tree structure tree according to the depth information array.
In one embodiment, the obtaining the depth information array corresponding to the attribute information of the node to be operated according to the attribute information of the node to be operated includes:
and cutting the attribute information of the node to be operated to obtain a depth information array corresponding to the attribute information of the node to be operated.
In one embodiment, determining the object information of the node to be operated according to the depth information includes:
judging whether the depth information meets preset conditions or not to obtain a first judgment result;
And determining object information of the node to be operated according to the first judging result.
In one embodiment, the predetermined condition is a relationship with a predetermined threshold, and the determining the object information of the node to be operated according to the first determination result includes:
if the depth information is not more than 2, determining that the node to be operated is a leaf node positioned at the first layer of the tree structure tree, and determining object information of the node to be operated; and/or the number of the groups of groups,
if the depth information is greater than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a level where the node to be operated is located, and determining object information of the node to be operated according to the level where the node to be operated is located.
In one embodiment, the method further comprises:
acquiring child node attribute information corresponding to a node to be operated; the child node attribute information is used for representing whether a child node exists in the node to be operated;
and adding a new child node in the next layer of the node to be operated according to the child node attribute information corresponding to the node to be operated.
In one embodiment, adding a new child node in a next layer of the node to be operated according to the child node attribute information corresponding to the node to be operated includes:
If at least one child node exists in the node to be operated, adding a new child node in the next layer of the node to be operated based on the acquired attribute information of the child node;
if the node to be operated does not have the child node, creating the child node attribute of the node to be operated, and adding a new child node in the next layer of the node to be operated based on the created child node attribute.
In one embodiment, the method further comprises:
and modifying the object information of the node to be operated.
In one embodiment, the modifying the object information of the node to be operated includes:
acquiring information to be modified;
and modifying the object information of the node to be operated according to the information to be modified to obtain modified object information.
In one embodiment, the method further comprises:
and deleting the object information of the node to be operated according to the depth information and/or the preset threshold value.
In one embodiment, deleting the object information of the node to be operated according to the depth information and/or the preset threshold includes:
judging the relation between the depth information and the preset threshold value to obtain a second judgment result;
And deleting the object information of the node to be operated according to the second judging result.
The relationship between the depth information and the preset threshold may be that whether the depth information is greater than the preset threshold is determined.
In one embodiment, the preset threshold is 2, and deleting the object information of the node to be operated according to the second determination result includes:
if the depth information is not more than 2, determining that the node to be operated is a leaf node positioned at the first layer of the tree structure tree, and deleting object information of the node to be operated;
if the depth information is greater than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a father node corresponding to the node to be operated and attribute information of the father node, and deleting object information of the node to be operated according to the attribute information of the father node.
An operating device of a node, the device comprising:
the acquisition module is used for acquiring the node to be operated and the attribute information of the node to be operated; the attribute information is used for representing the position information of the node to be operated in the tree structure tree;
the depth information determining module is used for determining the depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated;
The object information determining module is used for determining object information of the node to be operated according to the depth information; the object information is used for representing identity information of the node to be operated.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring attribute information of a node to be operated; the attribute information is used for representing the position information of the node to be operated in the tree structure tree;
determining depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated;
determining object information of a node to be operated according to the depth information; the object information is used for representing identity information of the node to be operated.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring attribute information of a node to be operated; the attribute information is used for representing the position information of the node to be operated in the tree structure tree;
determining depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated;
Determining object information of a node to be operated according to the depth information; the object information is used for representing identity information of the node to be operated.
The method, the device, the computer equipment and the storage medium for operating the nodes are characterized in that the depth information of the nodes to be operated in the tree structure tree is determined according to the attribute information by acquiring the nodes to be operated and the attribute information thereof, and the object information of the objects to be operated is determined according to the depth information; the attribute information is used for representing the position information of the node to be operated in the tree structure tree, and the object information is used for representing the identity information of the node to be operated. In the method, the depth information of the node to be operated can be determined through the position information of the node to be operated in the tree structure tree, and the object information representing the identity information of the node to be operated can be determined through the depth information, namely the node to be operated is searched, the nodes of each layer do not need to be circularly traversed or recursively traversed in the searching process, and the information of the nodes of each layer does not need to be stored, so that the memory space of the system is saved.
Drawings
FIG. 1 is an internal block diagram of a computer device in one embodiment;
FIG. 2 is a flow diagram of a method of operation of a node in one embodiment;
FIG. 3 is a flowchart illustrating steps of operation of a node in another embodiment;
FIG. 4 is a flow chart of a method of operation of a node in another embodiment;
FIG. 5 is a flow chart of a method of operation of a node in another embodiment;
FIG. 6 is a flow chart of a method of operation of a node in another embodiment;
FIG. 7 is a flow chart of a method of operation of a node in another embodiment;
FIG. 8 is an exemplary diagram of various operations performed on a node in one embodiment;
fig. 9 is a block diagram of an operation device of a node in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The method for operating the node provided in the embodiment of the present application may be applied to a computer device, where the computer device may be a terminal or a server, and the internal structure of the computer device may be as shown in fig. 1, taking the computer device as an example. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a method of operation of a node. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
The execution body of the embodiment of the present application may be an operation device of a node, or may be a computer device, and the technical solution of the present application will be described below with the computer device as the execution body.
In one embodiment, as shown in fig. 2, a method of operation of a node is provided, which may include the steps of:
s202, acquiring attribute information of the node to be operated.
The attribute information is used for representing the position information of the node to be operated in the tree structure tree; the node to be operated may be one or more. The tree structure tree may be a structural tree composed of a plurality of nodes including a root node and leaf nodes, wherein the root node is generally only one, the leaf nodes may be one or more, and the leaf nodes may include a parent node and a child node. The nodes to be operated in this embodiment are generally referred to as leaf nodes.
In addition, the attribute information of the node may characterize the position information of the node in the tree structure tree, such as whether the node belongs to a parent node or a child node of a leaf node, which level in the tree structure tree belongs to, which branch, and so on.
When the node needs to be operated, the tree structure data can be rendered to the page through the UI tree component provided by the anti, wherein the data of the tree structure tree can be recorded as treeData, after the rendering is completed, a tree structure diagram of the hierarchical relationship can appear on the current page, and the data of each node in the tree structure tree can comprise field information such as attribute information, identification id, title and the like of the node. The operations on nodes herein may include finding nodes, deleting nodes, modifying nodes, adding/adding nodes, etc., so the node that will perform the operations herein is referred to as the node to be operated. The attribute information of any node needing to be operated can be obtained through the tree structure diagram obtained through rendering.
It should be noted that, in this embodiment, the operation on the node is mainly a search operation, that is, the node is found in the tree structure tree, and after the node is found, the node may be further operated, for example, the subsequent operations of deleting the node, modifying the node, adding/adding the node, and the like.
S204, determining depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated.
In this step, after the attribute information of the node to be operated is obtained, the specific depth of the node to be operated in the tree structure tree is obtained by analyzing the attribute information of the node to be operated, and the depth information of the node to be operated is obtained by combining the depth of the root node. Here, the depth of the root node is typically 0 or 1, and the depth information of the node to be operated may represent the number of layers of the node to be operated in the tree structure tree, the specific position in the number of layers, and so on.
S206, determining object information of the node to be operated according to the depth information.
In this step, the object information is used to characterize identity information of the node to be operated; after depth information of the node to be operated in the tree structure tree is determined, a specific layer number and a specific position of the node to be operated in the tree structure tree can be determined through the depth information, namely the node to be operated is found, then object information of the node to be operated can be obtained, and the object information can comprise field information such as identification id, title and the like of the node to be operated. For example, the id may be 0, 0-0-1, etc., and the title may be root, parent, leaf, etc.
In the node operation method, the depth information of the node to be operated in the tree structure tree is determined according to the attribute information by acquiring the node to be operated and the attribute information thereof, and the object information of the object to be operated is determined according to the depth information; the attribute information is used for representing the position information of the node to be operated in the tree structure tree, and the object information is used for representing the identity information of the node to be operated. In the method, the depth information of the node to be operated can be determined through the position information of the node to be operated in the tree structure tree, and the object information representing the identity information of the node to be operated can be determined through the depth information, namely the node to be operated is searched, the nodes of each layer do not need to be circularly traversed or recursively traversed in the searching process, and the information of the nodes of each layer does not need to be stored, so that the memory space of the system is saved.
In another embodiment, as shown in fig. 3, another method for operating a node is provided, where, based on the above embodiment, the step S204 may include the following steps:
s302, obtaining a depth information array corresponding to the attribute information of the node to be operated according to the attribute information of the node to be operated.
In this step, after the attribute information of the node to be operated is obtained, the attribute information generally characterizes the position information of the node to be operated in the tree structure tree, so the position information of the parent node/root node to which the node to be operated belongs and the position information of the parent node/root node are generally included, so the node to be operated is generally not a simple number, and is generally a numeric string or character string. After the attribute information of the node to be operated is obtained, the attribute information of the node to be operated can be segmented, the attribute information of the node to be operated is segmented into individual numbers or character strings, and the segmented individual numbers or character strings are combined into an array and recorded as a depth information array.
For example, assuming that the attribute information of the node to be operated is composed of a string of digits, for example, 0-0-1, then after the attribute information is segmented, three individual digits of 0, 1 can be obtained, and then the three digits can be combined to obtain an array, denoted as a [3], and the array a [3] = [0, 1].
S304, determining the depth information of the node to be operated in the tree structure tree according to the depth information array.
In this step, after the depth information array corresponding to the node to be operated is obtained, the number of numbers or character strings included in the depth information array may be obtained, and then the number of numbers or character strings included in the depth information array may be used as the depth information of the node to be operated. Continuing taking the attribute information of the node to be operated as 0-0-1 as an example, the depth information array of the node to be operated is [0, 1] obtained through the step S302, so that the depth information array contains 3 numbers, and the depth information of the node to be operated is 3.
After the depth information of the node to be operated is obtained, the object information may be obtained through the depth information, that is, accordingly, as shown in fig. 4, the step S206 may include the following steps:
S402, judging whether the depth information meets a preset condition or not to obtain a first judging result.
The preset condition is a relation with a preset threshold, which may be set according to an actual situation, and in this embodiment, the preset threshold is optionally 2.
After the depth information corresponding to the node to be operated is obtained, whether the depth information is larger than a preset threshold value 2 or not can be judged, and a judgment result is obtained and is recorded as a first judgment result. The method of determining the size may be that the depth information is differenced from 2, and the obtained difference is compared with 0 to obtain a first determination result, wherein if the difference is greater than 0, the depth information is indicated to be greater than 2, otherwise, the depth is indicated to be less than or equal to 2; or, the depth information and 2 are taken as a quotient, the obtained quotient value and 1 are compared to obtain a first judgment result, wherein if the quotient value is larger than 1, the depth information is larger than 2, otherwise, the depth is smaller than or equal to 2; alternatively, the depth information and 2 may be directly compared, and the obtained comparison result may be used as the first determination result.
S404, determining object information of the node to be operated according to the first judging result.
In this step, after the first determination result is obtained, it is known whether the depth information is greater than 2. Optionally, if the depth information is not greater than 2, determining that the node to be operated is a leaf node located at the first layer of the tree structure tree, and determining object information of the node to be operated; and/or if the depth information is greater than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a level where the node to be operated is located, and determining object information of the node to be operated according to the level where the node to be operated is located. Wherein the traversal may be a loop traversal, such as for loop nesting for loop; or may be a recursive traversal, traversing each level of nodes.
A general tree structure tree includes a root node and a leaf node, which may each be referred to as a node of the tree. Where the root node is typically located at a first level and the leaf nodes are typically leaf nodes starting at a second level, i.e. starting from the second level of the tree and going down.
That is, if the depth information of the node to be operated is not greater than 2, it is indicated that the node to be operated is located at the first level or the second level of the tree structure tree, generally the first level is the root node, and the leaf node is operated, so the node to be operated is the leaf node located at the first level, and then the position of the node to be operated can be found in the leaf node at the first level through the depth information of the node to be operated, so as to obtain the object information of the node to be operated. If the depth information of the node to be operated is greater than 2, it indicates that the node to be operated is located at a second level or below a leaf node of the tree structure tree (for example, the depth information of the node to be operated is 3, it indicates that the node to be operated is located at the second level of the leaf node, or is located at a third level of the tree), then 3 numbers, that is, the node to be operated is located at the second level of the leaf node, can be obtained by traversing the depth information array of the node to be operated, for example, traversing [0, 1], and then obtaining the node to be operated at the second level of the leaf node through 1 of the layer in the depth information array, so that the node to be operated can be found and the object information of the node to be operated can be obtained.
In this embodiment, the attribute information of the node to be operated is segmented, and the depth information of the node to be operated in the tree structure tree is determined by the depth information array obtained by segmentation, and the depth information determination process is simple and visual, and occupies less system resources, so that the efficiency of determining the depth information and the accuracy of determining the depth information can be improved. Further, on the basis, the object information of the node to be operated can be determined according to the judgment result of whether the depth information is larger than the preset threshold value, so that the node to be operated can be intuitively and rapidly found, the object information is obtained, and the efficiency of operating the node to be operated is further improved on the basis of saving the system memory.
In another embodiment, as shown in fig. 5, another method for operating a node is provided, where, on the basis of the above embodiment, the method may further include the following steps:
s502, obtaining child node attribute information corresponding to a node to be operated; the child node attribute information is used for representing whether a child node exists in the node to be operated.
In this step, after the above-mentioned rendering of the tree structure data onto the page, the data of each node in the tree structure tree may also include child node attribute information of the node, where the child node attribute information may be represented by a set identifier, for example, if one node has a child node, then the child node attribute of the child node may be set to h, and if another node does not have a child node, then the child node attribute of the child node may be set to n.
Through the rendering of the tree structure data on the page and the searching of the node to be operated, the child node attribute information of the node to be operated can be obtained.
S506, adding new child nodes in the next layer of the node to be operated according to the child node attribute information corresponding to the node to be operated.
In this step, after obtaining information on whether or not a child node exists in a node to be operated, there are two cases, one is the existence of the child node and the other is the absence of the child node, and the description is made below for both cases.
Optionally, in a possible implementation manner, if at least one child node exists in the node to be operated, a new child node is added in a next layer of the node to be operated based on the obtained attribute information of the child node. That is, if there are sub-nodes in the node to be operated, there may be one or more sub-nodes, and in general, when knowing that there are sub-nodes in the node, there may be several sub-nodes, and in general, all sub-nodes are arranged in sequence, so after knowing that there are sub-nodes in the node to be operated and several sub-nodes, a new sub-node may be added after the previous sub-node, and corresponding attribute information may be set for the new sub-node. For example, assuming that the node to be operated is 0-0, which has two child nodes, 0-0-0 and 0-0-1, respectively, then when a new child node is added to the node to be operated, the new child node may be added after 0-0-1, and the newly added child node may be denoted as 0-0-2.
In another possible implementation manner, if the node to be operated does not have a child node, creating a child node attribute of the node to be operated, and adding a new child node at the next layer of the node to be operated based on the created child node attribute. That is, the node to be operated does not have a child node, and then a new child node can be directly created for the node to be operated according to the setting sequence and the setting mode of the node. For example, assuming that the node to be operated is 1-1, which has no child nodes, the child node may be created directly for the node to be operated, and a new child node may be added, starting from 1-1-0, the first added child node being denoted 1-1-0, and the like.
In this embodiment, a new child node is added in the next layer of the node to be operated through the obtained child node attribute information of the node to be operated, so that the child node can be quickly and accurately added for the node to be operated, and the efficiency of operating the node is improved. Further, the child nodes can be added according to actual conditions when the child nodes exist or not exist in the node to be operated, so that the child nodes can be added for the node to be operated under various conditions, and meanwhile, the problem that when the child nodes exist, the existing child nodes are not considered to cause that the newly added child nodes cover the original child nodes is avoided.
In another embodiment, as shown in fig. 6, another method for operating a node is provided, where, on the basis of the above embodiment, the method may further include the following steps:
s602, obtaining information to be modified.
In this step, before the information of the node to be operated needs to be modified, the information to be modified, that is, the information to be modified, may be preset.
S604, modifying the object information of the node to be operated according to the information to be modified, and obtaining modified object information.
In this step, after the information to be modified and the original object information of the node to be operated are obtained, if the information to be modified includes a part of information to be modified and another part of information not to be modified in the original object information, the original object information may be directly replaced with the information to be modified; if the information to be modified only contains a part of information for modifying the original object information, the information to be modified in the original object information can be replaced by the information to be modified, and other object information is unchanged. In short, by modifying the original object information, the object information after the node to be operated is modified can be obtained.
In this embodiment, the object information of the node to be operated is modified according to the obtained information to be modified, so that the modified object information of the node to be operated can be quickly and accurately modified, and the efficiency of modifying the node to be operated is improved.
In another embodiment, another method for operating a node is provided, where, on the basis of the foregoing embodiment, the method may further include the following step a:
and step A, deleting the object information of the node to be operated according to the depth information and/or a preset threshold value.
In this step, after the node to be operated is found, the node to be operated may be deleted, and when deleting, the object information of the node to be operated may be deleted in combination with the depth information of the node to be operated and a preset threshold. When deleting specifically, as shown in fig. 7, the method may include the following steps:
s702, judging whether the depth information is larger than a preset threshold value or not, and obtaining a second judging result.
The preset threshold may be set according to actual situations, and in this embodiment, optionally, the preset threshold is 2.
The specific determination process of the depth information and the preset threshold may be referred to the description in S402, which is not repeated herein, and may be a determination result, which is herein denoted as a second determination result.
And S704, deleting the object information of the node to be operated according to the second judging result.
In this step, after the second determination result is obtained, it is known whether the depth information is greater than 2. Optionally, if the depth information is not greater than 2, determining that the node to be operated is a leaf node located at the first layer of the tree structure tree, and deleting object information of the node to be operated. That is, if the depth information of the node to be operated is not greater than 2, it is indicated that the node to be operated is located at a leaf node of the first layer of the tree structure tree, then the position of the node to be operated can be found in the leaf node of the first layer through the depth information of the node to be operated, the object information of the node to be operated is obtained, and the found object information is deleted.
If the depth information is greater than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a father node corresponding to the node to be operated and attribute information of the father node, and deleting object information of the node to be operated according to the attribute information of the father node. That is, if the depth information of the node to be operated is greater than 2, it is indicated that the node to be operated is located at the second level or below the leaf node of the tree structure tree, then the depth information array of the node to be operated may be traversed, for example, traversing [0, 1] to obtain 3 numbers, that is, the node to be operated is located at the second level of the leaf node, then the attribute information of the parent node corresponding to the node to be operated may be obtained as 0-0, that is, the parent node of the node to be operated is located at the first level of the leaf node, that is, the node of the second level of the tree, then the node to be operated may be found from the child nodes included in the parent node of the node to be operated, and through 1 in the depth information array, the node to be operated is obtained at the second position of the parent node, so that the object information of the node to be operated may be found, and the found object information may be deleted.
In this embodiment, the object information of the node to be operated is determined according to the determination result that whether the depth information is greater than the preset threshold value, so that the node to be operated can be intuitively and rapidly found and the object information can be obtained, so that the object information of the node to be operated is deleted, and the efficiency of deleting the object information of the node to be operated can be further improved on the basis of saving the system memory. Further, when the depth information is larger than 2, deleting the object information of the node to be operated through the father node of the node to be operated, so that the object information of the node to be operated can be accurately deleted, and the problem of false deletion is avoided.
By way of example, in the above embodiment, it is mentioned that the node to be operated can be queried, and operations such as adding a child node, deleting object information of the node, modifying object information of the node, and the like can be performed on the basis, and referring to fig. 8, an example diagram of an initial structure tree, creating/adding a child node, modifying a leaf node name, and deleting a child node is given, where parent is a parent node, leaf is a child node, parent0 represents a first 1 parent node, leaf0-0 represents a first child node under the first parent node, leaf0-1 represents a second child node under the first parent node, and depth information corresponding to both leaf0-0 and leaf0-1 is 2; leaf0-0-0 represents a first child node of a first child node under a first parent node, wherein depth information corresponding to leaf0-0-0 is 3, and then leaf0-0-0-0 and leaf0-0-0-0 are the same, and corresponding depth information is 4 and 5 respectively; parent1 represents a first parent node 2, leaf1-0 represents a first child node under a second parent node, leaf1-1 represents a second child node under the second parent node, and the corresponding depth information corresponds to parent 0.
It should be understood that, although the steps in the flowcharts of fig. 2-7 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in FIGS. 2-7 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 9, there is provided an operating apparatus of a node, including: an acquisition module 10, a depth information determination module 11, and an object information determination module 12, wherein:
the acquiring module 10 is configured to acquire a node to be operated and attribute information of the node to be operated; the attribute information is used for representing the position information of the node to be operated in the tree structure tree;
The depth information determining module 11 is configured to determine depth information of the node to be operated in the tree structure tree according to attribute information of the node to be operated;
an object information determining module 12, configured to determine object information of a node to be operated according to the depth information; the object information is used for representing identity information of the node to be operated.
The specific definition of the operation means of the node may be referred to as the definition of the operation method of the node hereinabove, and will not be described herein.
In another embodiment, there is provided another node operation device, and the depth information determining module 11 may include:
the depth information array determining unit is used for obtaining a depth information array corresponding to the attribute information of the node to be operated according to the attribute information of the node to be operated;
and the depth information determining unit is used for determining the depth information of the node to be operated in the tree structure tree according to the depth information array.
Optionally, the depth information array determining unit is specifically configured to segment attribute information of the node to be operated to obtain a depth information array corresponding to the attribute information of the node to be operated.
Alternatively, the object information determining module 12 may include:
The first judging unit is used for judging whether the depth information meets preset conditions or not to obtain a first judging result;
and the object information determining unit is used for determining the object information of the node to be operated according to the first judging result.
Optionally, the preset condition is a relation with a preset threshold, the preset threshold is 2, and the judging unit is specifically configured to determine that the node to be operated is a leaf node located at a first layer of the tree structure tree and determine object information of the node to be operated when the depth information is not greater than 2; and/or under the condition that the depth information is larger than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a level where the node to be operated is located, and determining object information of the node to be operated according to the level where the node to be operated is located.
In another embodiment, another node operation device is provided, where, on the basis of the above embodiment, the device may further include:
the child node attribute acquisition module is used for acquiring child node attribute information corresponding to the node to be operated; the child node attribute information is used for representing whether a child node exists in the node to be operated;
And the node adding module is used for adding a new child node in the next layer of the node to be operated according to the child node attribute information corresponding to the node to be operated.
Optionally, the node adding module is specifically configured to add a new child node in a next layer of the node to be operated based on the obtained attribute information of the child node when at least one child node exists in the node to be operated; and under the condition that the node to be operated does not have the child node, creating the child node attribute of the node to be operated, and adding a new child node in the next layer of the node to be operated based on the created child node attribute.
In another embodiment, another node operation device is provided, where, on the basis of the above embodiment, the device may further include:
the modification information acquisition module is used for acquiring information to be modified;
and the object information modification module is used for modifying the object information of the node to be operated according to the information to be modified to obtain modified object information.
In another embodiment, another node operation device is provided, where, on the basis of the above embodiment, the device may further include:
and the deleting module is used for deleting the object information of the node to be operated according to the depth information and/or the preset threshold value.
Optionally, the deleting module may include:
the second judging unit is used for judging whether the depth information is larger than a preset threshold value or not to obtain a second judging result;
and the deleting unit is used for deleting the object information of the node to be operated according to the second judging result.
Optionally, the preset threshold is 2, and the deleting unit is specifically configured to determine that the node to be operated is a leaf node located at the first layer of the tree structure tree and delete object information of the node to be operated when the depth information is not greater than 2; and under the condition that the depth information is larger than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a father node corresponding to the node to be operated and attribute information of the father node, and deleting object information of the node to be operated according to the attribute information of the father node.
The specific definition of the operation means of the node may be referred to as the definition of the operation method of the node hereinabove, and will not be described herein.
The respective modules in the operation device of the above-described node may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring attribute information of a node to be operated; the attribute information is used for representing the position information of the node to be operated in the tree structure tree; determining depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated; determining object information of a node to be operated according to the depth information; the object information is used for representing identity information of the node to be operated.
In one embodiment, the processor when executing the computer program further performs the steps of:
obtaining a depth information array corresponding to the attribute information of the node to be operated according to the attribute information of the node to be operated; and determining the depth information of the node to be operated in the tree structure tree according to the depth information array.
In one embodiment, the processor when executing the computer program further performs the steps of:
and cutting the attribute information of the node to be operated to obtain a depth information array corresponding to the attribute information of the node to be operated.
In one embodiment, the processor when executing the computer program further performs the steps of:
judging whether the depth information meets preset conditions or not to obtain a first judgment result; and determining object information of the node to be operated according to the first judging result.
In one embodiment, the processor when executing the computer program further performs the steps of:
if the depth information is not more than 2, determining that the node to be operated is a leaf node positioned at the first layer of the tree structure tree, and determining object information of the node to be operated; and/or if the depth information is greater than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a level where the node to be operated is located, and determining object information of the node to be operated according to the level where the node to be operated is located.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring child node attribute information corresponding to a node to be operated; the child node attribute information is used for representing whether a child node exists in the node to be operated; and adding a new child node in the next layer of the node to be operated according to the child node attribute information corresponding to the node to be operated.
In one embodiment, the processor when executing the computer program further performs the steps of:
if at least one child node exists in the node to be operated, adding a new child node in the next layer of the node to be operated based on the acquired attribute information of the child node; if the node to be operated does not have the child node, creating the child node attribute of the node to be operated, and adding a new child node in the next layer of the node to be operated based on the created child node attribute.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring information to be modified; and modifying the object information of the node to be operated according to the information to be modified to obtain modified object information.
In one embodiment, the processor when executing the computer program further performs the steps of:
and deleting the object information of the node to be operated according to the depth information and/or the preset threshold value.
In one embodiment, the processor when executing the computer program further performs the steps of:
judging whether the depth information is larger than a preset threshold value or not to obtain a second judging result; and deleting the object information of the node to be operated according to the second judging result.
In one embodiment, the processor when executing the computer program further performs the steps of:
if the depth information is not more than 2, determining that the node to be operated is a leaf node positioned at the first layer of the tree structure tree, and deleting object information of the node to be operated; if the depth information is greater than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a father node corresponding to the node to be operated and attribute information of the father node, and deleting object information of the node to be operated according to the attribute information of the father node.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring attribute information of a node to be operated; the attribute information is used for representing the position information of the node to be operated in the tree structure tree; determining depth information of the node to be operated in the tree structure tree according to the attribute information of the node to be operated; determining object information of a node to be operated according to the depth information; the object information is used for representing identity information of the node to be operated.
In one embodiment, the computer program when executed by the processor further performs the steps of:
obtaining a depth information array corresponding to the attribute information of the node to be operated according to the attribute information of the node to be operated; and determining the depth information of the node to be operated in the tree structure tree according to the depth information array.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and cutting the attribute information of the node to be operated to obtain a depth information array corresponding to the attribute information of the node to be operated.
In one embodiment, the computer program when executed by the processor further performs the steps of:
judging whether the depth information meets preset conditions or not to obtain a first judgment result; and determining object information of the node to be operated according to the first judging result.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the depth information is not more than 2, determining that the node to be operated is a leaf node positioned at the first layer of the tree structure tree, and determining object information of the node to be operated; and/or if the depth information is greater than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a level where the node to be operated is located, and determining object information of the node to be operated according to the level where the node to be operated is located.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring child node attribute information corresponding to a node to be operated; the child node attribute information is used for representing whether a child node exists in the node to be operated; and adding a new child node in the next layer of the node to be operated according to the child node attribute information corresponding to the node to be operated.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if at least one child node exists in the node to be operated, adding a new child node in the next layer of the node to be operated based on the acquired attribute information of the child node; if the node to be operated does not have the child node, creating the child node attribute of the node to be operated, and adding a new child node in the next layer of the node to be operated based on the created child node attribute.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring information to be modified; and modifying the object information of the node to be operated according to the information to be modified to obtain modified object information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
And deleting the object information of the node to be operated according to the depth information and/or the preset threshold value.
In one embodiment, the computer program when executed by the processor further performs the steps of:
judging whether the depth information is larger than a preset threshold value or not to obtain a second judging result; and deleting the object information of the node to be operated according to the second judging result.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the depth information is not more than 2, determining that the node to be operated is a leaf node positioned at the first layer of the tree structure tree, and deleting object information of the node to be operated; if the depth information is greater than 2, determining that the node to be operated is not located at a leaf node of the first layer of the tree structure tree, traversing the depth information array to obtain a father node corresponding to the node to be operated and attribute information of the father node, and deleting object information of the node to be operated according to the attribute information of the father node.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (9)

1. A method of operation of a node, the method comprising:
acquiring attribute information of a node to be operated, wherein the attribute information is information obtained according to a rendered tree structure diagram, and the rendered tree structure diagram is a tree structure diagram with a hierarchical relationship obtained by rendering tree structure data to a page through a UI tree component;
Obtaining a depth information array corresponding to the attribute information of the node to be operated according to the attribute information of the node to be operated; the depth information array is an array obtained by segmenting attribute information of the node to be operated;
determining depth information of the node to be operated in the tree structure tree according to the depth information array, wherein the depth information is the number of numbers or character strings contained in the depth information array;
determining object information of the node to be operated according to the depth information;
the determining the object information of the node to be operated according to the depth information comprises the following steps:
judging whether the depth information meets a preset condition or not to obtain a first judgment result, wherein the preset condition is a relation with a preset threshold value;
and determining the object information of the node to be operated according to the first judging result.
2. The method according to claim 1, wherein the determining the object information of the node to be operated according to the first determination result includes:
if the depth information is not more than 2, determining that the node to be operated is a leaf node positioned at the first layer of the tree structure tree, and determining object information of the node to be operated; and/or the number of the groups of groups,
And if the depth information is greater than 2, traversing the depth information array to obtain a level of the node to be operated, and determining object information of the node to be operated according to the level.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
acquiring child node attribute information corresponding to the node to be operated; the child node attribute information is used for representing whether the child node exists in the node to be operated;
and adding a new child node in the next layer of the node to be operated according to the child node attribute information corresponding to the node to be operated.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
modifying the object information of the node to be operated; or alternatively, the first and second heat exchangers may be,
and deleting the object information of the node to be operated according to the depth information and/or a preset threshold value.
5. The method according to claim 4, wherein the deleting the object information of the node to be operated according to the depth information and/or a preset threshold value includes:
judging the relation between the depth information and the preset threshold value to obtain a second judgment result;
And deleting the object information of the node to be operated according to the second judging result.
6. The method according to claim 1, wherein the object information comprises an identification of the node to be operated, a title.
7. An operating device of a node, the device comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring attribute information of a node to be operated, wherein the attribute information is information obtained according to a rendered tree structure diagram, and the rendered tree structure diagram is a tree structure diagram with a hierarchical relationship obtained by rendering tree structure data to a page through a UI tree component;
the depth information determining module is used for obtaining a depth information array corresponding to the attribute information of the node to be operated according to the attribute information of the node to be operated; determining depth information of the node to be operated in the tree structure tree according to the depth information array; the depth information array is an array obtained by segmenting attribute information of the node to be operated; the depth information is the number of numbers or character strings contained in the depth information array;
The object information determining module is used for determining object information of the node to be operated according to the depth information;
the object information determining module includes:
the first judging unit is used for judging whether the depth information meets a preset condition or not to obtain a first judging result, wherein the preset condition is a relation with a preset threshold value;
and the object information determining unit is used for determining the object information of the node to be operated according to the first judging result.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202110558073.2A 2021-05-21 2021-05-21 Node operation method, node operation device, computer equipment and storage medium Active CN113282799B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110558073.2A CN113282799B (en) 2021-05-21 2021-05-21 Node operation method, node operation device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110558073.2A CN113282799B (en) 2021-05-21 2021-05-21 Node operation method, node operation device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113282799A CN113282799A (en) 2021-08-20
CN113282799B true CN113282799B (en) 2023-06-27

Family

ID=77280746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110558073.2A Active CN113282799B (en) 2021-05-21 2021-05-21 Node operation method, node operation device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113282799B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656533A (en) * 2021-08-23 2021-11-16 北京百度网讯科技有限公司 Tree control processing method and device and electronic equipment
CN114491164B (en) * 2022-01-17 2022-12-09 广州市玄武无线科技股份有限公司 Tree data processing method and system
CN114840293A (en) * 2022-04-22 2022-08-02 平安国际智慧城市科技股份有限公司 Rendering method and device of tree control, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102867059A (en) * 2012-09-19 2013-01-09 浪潮(北京)电子信息产业有限公司 Method and system for processing data in treelike structures
CN108874393B (en) * 2018-06-06 2021-07-02 腾讯科技(深圳)有限公司 Rendering method, rendering device, storage medium and computer equipment
CN111274242B (en) * 2020-01-07 2023-12-12 南京天溯自动化控制系统有限公司 Data searching method and device for tree structure of hospital logistics operation and maintenance

Also Published As

Publication number Publication date
CN113282799A (en) 2021-08-20

Similar Documents

Publication Publication Date Title
CN113282799B (en) Node operation method, node operation device, computer equipment and storage medium
US11003625B2 (en) Method and apparatus for operating on file
CN110888837B (en) Object storage small file merging method and device
CN108614837B (en) File storage and retrieval method and device
CN105809389A (en) Method and apparatus for generating BOM trees
CN112434027A (en) Indexing method and device for multi-dimensional data, computer equipment and storage medium
CN110851663B (en) Method and device for managing metadata
CN113655968B (en) Unstructured data storage method
CN114625696A (en) File recovery method and device, electronic equipment and storage medium
CN105843809B (en) Data processing method and device
CN111291085B (en) Hierarchical interest matching method, hierarchical interest matching device, computer equipment and storage medium
CN116226681A (en) Text similarity judging method and device, computer equipment and storage medium
KR20210077975A (en) Spatial indexing method and apparatus for blockchain-based geospatial data
CN116414935A (en) Method for distributed Search space vector data based on Elastic Search
CN116127154A (en) Knowledge tag recommendation method and device, electronic equipment and storage medium
CN114356404A (en) Interface document generating method, system and computer readable storage medium
CN110321435B (en) Data source dividing method, device, equipment and storage medium
CN113391916A (en) Organization architecture data processing method, device, computer equipment and storage medium
CN112416966A (en) Ad hoc query method, apparatus, computer device and storage medium
EP4394618A1 (en) Log data query method and apparatus, and device and medium
CN117540056B (en) Method, device, computer equipment and storage medium for data query
CN113177224B (en) Block chain based data sealing method, device, equipment and storage medium
CN117201078A (en) Malicious traffic detection method, malicious traffic detection device, computer equipment and storage medium
KR101621177B1 (en) Apparatus and Method for generating maximal common subgraphs between frequent subgraphs
CN117874038A (en) Data processing method and device of data sandbox, storage medium and electronic equipment

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