CN113051270B - Grouping method and device based on special-shaped structure tree, electronic equipment and storage medium - Google Patents

Grouping method and device based on special-shaped structure tree, electronic equipment and storage medium Download PDF

Info

Publication number
CN113051270B
CN113051270B CN202110327405.6A CN202110327405A CN113051270B CN 113051270 B CN113051270 B CN 113051270B CN 202110327405 A CN202110327405 A CN 202110327405A CN 113051270 B CN113051270 B CN 113051270B
Authority
CN
China
Prior art keywords
tree
special
shaped structure
node
grouping
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
CN202110327405.6A
Other languages
Chinese (zh)
Other versions
CN113051270A (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.)
He'an Technology Co ltd
Original Assignee
He'an 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 He'an Technology Co ltd filed Critical He'an Technology Co ltd
Priority to CN202110327405.6A priority Critical patent/CN113051270B/en
Publication of CN113051270A publication Critical patent/CN113051270A/en
Application granted granted Critical
Publication of CN113051270B publication Critical patent/CN113051270B/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

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

Abstract

The embodiment of the invention provides a grouping method based on a special-shaped structure tree, which comprises the following steps: acquiring a special-shaped structure tree of equipment, wherein the special-shaped structure tree comprises a first hierarchical relationship and first tree nodes; generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises a second hierarchical relationship and second tree nodes; determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range, wherein the second tree node to be grouped is the same as the target type of the target group member; and instantiating the second tree node to be grouped to obtain an instantiated group member. All the grouping is performed based on the special-shaped structure tree, so that each grouping in the Internet of things system does not need to be developed respectively, various grouping scenes can be realized through tree node configuration of the special-shaped structure tree based on one-time development programming, grouping efficiency in the Internet of things system is improved, development workload is further greatly reduced, and the construction cost and period of the Internet of things system are reduced.

Description

Grouping method and device based on special-shaped structure tree, electronic equipment and storage medium
Technical Field
The present invention relates to the field of artificial intelligence, and in particular, to a grouping method, apparatus, electronic device, and storage medium based on a special-shaped structure tree.
Background
With the development of smart city and internet of things, the number and types of related services and related devices of the internet of things are increasing, so in an internet of things system, the devices or services generally need to be grouped for batch operation, setting and processing. The current technology implementation is to define a corresponding database table and write a program for each packet separately. However, the city-level internet of things system has the advantages of multiple grouping types, wide selection range and multiple limiting conditions, so that development and application of each grouping need a large amount of development resources and time cost, and grouping efficiency in the internet of things system is low.
Disclosure of Invention
The embodiment of the invention provides a grouping method based on a special-shaped structure tree, which can generate a corresponding equipment selection tree through the special-shaped structure tree, select corresponding tree nodes through the equipment selection tree to carry out instantiation grouping, and all the grouping is carried out based on the special-shaped structure tree, so that each grouping in an Internet of things system does not need to be developed respectively, various grouping scenes can be realized based on one-time development programming through the tree node configuration of the special-shaped structure tree, the grouping efficiency in the Internet of things system is improved, the development workload is greatly reduced, and the construction cost and period of the Internet of things system are reduced.
In a first aspect, an embodiment of the present invention provides a grouping method based on a special-shaped structure tree, where the grouping method based on the special-shaped structure tree includes the following steps:
acquiring a special-shaped structure tree of equipment, wherein the special-shaped structure tree comprises a first hierarchical relationship and first tree nodes;
generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises a second hierarchical relationship and second tree nodes;
determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range, wherein the second tree node to be grouped is the same as the target type of the target group member;
and instantiating the second tree node to be grouped to obtain an instantiated group member.
Optionally, the acquiring the special-shaped structure tree of the device includes:
constructing a first hierarchical relationship of the special-shaped structure tree according to the supervisor area hierarchy, the supervisor equipment hierarchy and the equipment hierarchy of the group members;
constructing a first node of a special-shaped structure tree according to the supervisor area type, the supervisor equipment type and the equipment type of the group members, wherein the first node of the special-shaped structure tree comprises the first node type;
and constructing and obtaining the special-shaped structure tree of the equipment according to the first hierarchical relation of the special-shaped structure tree and the first node of the special-shaped structure tree.
Optionally, the generating a device selection tree according to the special-shaped structure tree includes:
acquiring a hierarchy L where a target tree node is located from the hierarchy of the special-shaped structure tree, wherein the target tree node is determined in the first tree node;
acquiring branch structure trees corresponding to all top tree nodes of the special-shaped structure tree;
acquiring all first tree nodes with the hierarchy less than or equal to L from a branch structure tree T1 corresponding to a top tree node to obtain a branch structure tree T2;
in the branch structure tree T2, recursively removing all first tree nodes with different types from the target tree node to obtain a branch structure tree T3;
and merging the branch structure trees T3 corresponding to all the top-level tree nodes to obtain the equipment selection tree.
Optionally, the instantiating the second tree node to be grouped to obtain an instantiated group member includes:
for each second tree node to be grouped, determining a corresponding first tree node from the special-shaped structure tree;
and selecting the corresponding first tree node and/or all first tree nodes at the lower level of the corresponding first tree node from the special-shaped structure tree to store, thereby obtaining the instantiation group member.
Optionally, the method further comprises:
defining a logical grouping template of the special-shaped structure tree, wherein the logical grouping template defines sources of grouping members and targets of grouping members, the sources of grouping members correspond to a first hierarchical relationship of the special-shaped structure tree, and the targets of grouping members correspond to types of first tree nodes in the special-shaped structure tree.
Optionally, the method further comprises:
and creating a preset number of logical groups under the logical group template.
Optionally, the logical grouping template includes a traffic grouping template, and the logical grouping includes device grouping.
In a second aspect, an embodiment of the present invention further provides a grouping apparatus based on a special-shaped structure tree, where the grouping apparatus based on the special-shaped structure tree includes:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a special-shaped structure tree of equipment, and the special-shaped structure tree comprises a first hierarchical relationship and first tree nodes;
the generation module is used for generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises a second hierarchical relationship and second tree nodes;
the determining module is used for determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range, wherein the second tree node to be grouped is the same as the target type of the target group member;
and the instantiation module is used for instantiating the second tree node to be grouped to obtain an instantiated group member.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the tree-based grouping method according to any one of the embodiments of the invention when the computer program is executed.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the method for grouping based on a special-shaped structure tree according to any of the embodiments of the present invention.
In the embodiment of the invention, a special-shaped structure tree of equipment is obtained, wherein the special-shaped structure tree comprises a first hierarchical relationship and first tree nodes; generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises a second hierarchical relationship and second tree nodes; determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range, wherein the second tree node to be grouped is the same as the target type of the target group member; and instantiating the second tree node to be grouped to obtain an instantiated group member. According to the method, the corresponding equipment selection tree can be generated through the special-shaped structure tree, the corresponding tree nodes are selected through the equipment selection tree to carry out instantiation grouping, all grouping is carried out on the basis of the special-shaped structure tree, so that each grouping in the Internet of things system does not need to be developed respectively, various grouping scenes can be realized through tree node configuration of the special-shaped structure tree on the basis of one-time development programming, grouping efficiency in the Internet of things system is improved, development workload is greatly reduced, and the construction cost and period of the Internet of things system are reduced.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, 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 grouping method based on a special-shaped structure tree according to an embodiment of the present invention;
FIG. 2 is a flow chart of another grouping method based on a special-shaped structure tree according to an embodiment of the present invention;
FIG. 3 is a flow chart of another grouping method based on a special-shaped structure tree according to an embodiment of the present invention;
FIG. 4 is a flow chart of another grouping method based on a special-shaped structure tree according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a grouping device based on a special-shaped structure tree according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a flow chart of a grouping method based on a special-shaped structure tree according to an embodiment of the present invention, as shown in fig. 1, the grouping method based on the special-shaped structure tree includes steps 101 to 104, and specific steps include the following:
101. and obtaining the special-shaped structure tree of the equipment.
In an embodiment of the present invention, the special-shaped structure tree includes a first hierarchical relationship and a first tree node. The device may be a device in an internet of things system of a smart city, for example, a smart street lamp, a smart electric box, a smart dustbin, etc., and the device may also be a device in the internet of things system based on service implementation, where the service may be a street lamp energy-saving service, an LED screen information release service, etc., and the device in the service implementation may be a device such as a street lamp, a main street lamp, an auxiliary street lamp, an intersection lamp, a hooke lamp, etc. under the street lamp energy-saving service.
The above-mentioned special-shaped structure tree may be a structure tree configured according to service information or equipment information, and the first hierarchical relationship of the above-mentioned special-shaped structure tree includes an up-down relationship between a plurality of hierarchies, where the up-down relationship between the plurality of hierarchies may also be referred to as a parent-child relationship between the plurality of hierarchies. In the first hierarchical relationship of the special-shaped structure tree, the upper hierarchy may cover a plurality of the next hierarchies. Each level of the special-shaped structure tree comprises a corresponding number of first tree nodes, in one special-shaped structure tree, the highest level is a top level tree node, one or more next levels are connected through the top level tree node, and one or more first tree nodes are included in the next level.
It should be noted that the above-mentioned special-shaped structure tree is a data structure different from a binary tree, and the same as the binary tree is that data processing can be performed by programming. Aiming at complex equipment relations in the Internet of things system, the special-shaped structure tree is adopted to carry out programming operation more flexibly, so that various grouping scenes can be realized through tree node configuration of the special-shaped structure tree based on one-time development programming, grouping efficiency in the Internet of things system is improved, development workload is greatly reduced, and the construction cost and period of the Internet of things system are reduced.
102. And generating a device selection tree according to the special-shaped structure tree.
In the embodiment of the present invention, the device selection tree includes a second hierarchical relationship and a second tree node. The second hierarchical relationship of the device selection tree is a first hierarchical relationship for distinguishing the special-shaped structure tree, and does not represent a precedence relationship. Similarly, the second hierarchical relationship of the device selection tree includes an upper-lower relationship between a plurality of hierarchies, which may also be referred to as a parent-child relationship between the plurality of hierarchies. In a first hierarchical relationship of the device selection tree, a previous level may encompass a plurality of next levels. Each level of the device structure tree includes a corresponding number of second tree nodes, and in one device selection tree, the highest level is a top level tree node, and one or more next levels are connected through the top level tree node, and one or more second tree nodes are included in the next level. Wherein the second tree node may also be called a group member, where a group member represents a device, and the target type of the group member is a device type.
The above device selection tree is a structural tree generated after the device type selection is performed on the special-shaped structural tree, which can be understood as that according to one or more target device types, a corresponding device selection tree is generated by the special-shaped structural tree, and the device types corresponding to all the second tree nodes in the device selection tree are the one or more target device types. For example, if the target device type is a street lamp, all the second tree nodes in the generated device selection tree are second tree nodes corresponding to the street lamp.
103. And determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range.
In the embodiment of the present invention, the second tree node to be grouped is the same as the target type of the target group member. The device selection tree can interact with a user through an interaction interface, the user determines a selection range in the device selection tree through the interaction interface, the selection range is a hierarchy of the device selection tree, and a second tree node in the selection range is a second tree node to be grouped. The user determines the target type of the target group member in the device selection tree through the interactive interface, wherein the target type of the target group member can be understood as the device type of the device to be grouped.
104. And instantiating the second tree node to be grouped to obtain an instantiated group member.
The above instantiation may be understood as creating a corresponding object by using the second tree node to be grouped as a class, and adding corresponding device information to each second tree node to be grouped to obtain an instantiation group member. The instantiation of the second tree node to be grouped can be performed locally or submitted to a server.
In the embodiment of the invention, a special-shaped structure tree of equipment is obtained, wherein the special-shaped structure tree comprises a first hierarchical relationship and first tree nodes; generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises a second hierarchical relationship and second tree nodes; determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range, wherein the second tree node to be grouped is the same as the target type of the target group member; and instantiating the second tree node to be grouped to obtain an instantiated group member. According to the method, the corresponding equipment selection tree can be generated through the special-shaped structure tree, the corresponding tree nodes are selected through the equipment selection tree to carry out instantiation grouping, all grouping is carried out on the basis of the special-shaped structure tree, so that each grouping in the Internet of things system does not need to be developed respectively, various grouping scenes can be realized through tree node configuration of the special-shaped structure tree on the basis of one-time development programming, grouping efficiency in the Internet of things system is improved, development workload is greatly reduced, and the construction cost and period of the Internet of things system are reduced.
Optionally, referring to fig. 2, fig. 2 is a schematic flow chart of another grouping method based on a special-shaped structure tree according to an embodiment of the present invention, and on the basis of the embodiment of fig. 1, the step of obtaining the special-shaped structure tree of the device in the step 101 specifically includes steps 201 to 203. The method comprises the following specific steps:
201. a first hierarchical relationship of the special-shaped structure tree is constructed from the supervisor area hierarchy, the supervisor equipment hierarchy, and the equipment hierarchy of the group members.
The above-mentioned main area hierarchy may include a plurality of main area hierarchies, where a main area is an area where a device is located, for example, a city is a maximum area, and then a top main area is the city, and the city is composed of several areas, and then these areas are lower main areas of the top main area.
In the first hierarchical relationship, the hosting area level is higher than the hosting equipment level, and the hosting equipment level is higher than the equipment level, where the hosting area level may include a plurality of hosting area levels having an up-down relationship, for example, the first hosting area level is a deep node, the second hosting area level is a south mountain area, a baoban area, a Fu Tian Ou, and the third hosting area level is a south mountain area science and technology park, a south mountain area Bai Danzhou, and the like, and the hosting equipment level may be a south mountain area science and technology south area circuit box, a south mountain area science and technology north area circuit box, a Futian post circuit box, a baoban post circuit box, and the like, and the equipment level is a south mountain area science and technology south area circuit box street lamp 1, a south mountain area science and technology south area circuit box street lamp 2, a south mountain area science and technology south area circuit box street lamp 3, a south mountain area science and technology north area circuit box street lamp 4, a Fushan area post circuit box street lamp 5, a Fushan area post circuit box gateway 2, and the like.
202. And constructing a first tree node of the special-shaped structure tree according to the supervisor area type, the supervisor equipment type and the equipment type of the group members.
In an embodiment of the present invention, the first tree node of the special-shaped structure tree includes a first tree node type. In the special-shaped structure tree, each hierarchy comprises one or more first tree nodes, each first tree node comprises a corresponding first tree node type, and the first tree node type comprises a supervisor area type, a supervisor equipment type and an equipment type. For example, for a special-shaped structure tree SD, the supervisor area level is 1, the supervisor area type is a, that is, the type of the first tree node corresponding to the supervisor area type is a, the supervisor device level is 2, the supervisor device type is C, that is, the type of the first tree node corresponding to the supervisor device type is C, the device level is 3, the device type corresponding to the street lamp is S, that is, the type of the first tree node corresponding to the street lamp is S, the device type corresponding to the gateway is G, that is, the type of the first tree node corresponding to the gateway is G.
203. And constructing and obtaining the special-shaped structure tree of the equipment according to the first hierarchical relation of the special-shaped structure tree and the first tree node of the special-shaped structure tree.
In the embodiment of the present invention, after determining the first hierarchical relationship of the special-shaped structure tree and each first tree node in the special-shaped structure tree, a corresponding special-shaped structure tree may be obtained, and taking Shenzhen urban internet of things system as an example for explanation, where the special-shaped structure tree may be as shown in table 1:
TABLE 1
A first main pipe region A second main pipe region A third main pipe region Main pipe equipment Apparatus and method for controlling the operation of a device
Shenzhen (Shenzhen)
South mountain area
Science and technology garden
South district circuit box
Street lamp 1
Street lamp 2
Road lamp 3
Gateway 1
North region loop box
Street lamp 4
Bai Danzhou
Futian district
Post building loop box
Street lamp 5
Gateway 2
Baoan district
Plateau circuit box
It should be understood that the names appearing in Table 1 above are for illustration only and are not limiting of embodiments of the invention. A special-shaped structure tree of the urban Internet of things system taking Shenzhen as an example is shown by a table 1.
In the embodiment of the invention, all grouping is performed based on the special-shaped structure tree, so that each grouping in the Internet of things system does not need to be developed respectively, various grouping scenes can be realized through tree node configuration of the special-shaped structure tree based on one-time development programming, the grouping efficiency in the Internet of things system is improved, the development workload is further greatly reduced, and the construction cost and period of the Internet of things system are reduced.
Optionally, referring to fig. 3, fig. 3 is a schematic flow chart of another grouping method based on a special-shaped structure tree according to an embodiment of the present invention, and on the basis of the embodiment of fig. 1, the step of generating the device selection tree in the step 102 specifically includes steps 301 to 305 according to the special-shaped structure tree. The method comprises the following specific steps:
301. and acquiring a level L where the target tree node is located from the levels of the special-shaped structure tree.
In the embodiment of the present invention, the target tree node is determined in the first tree node. The user can select or input a target tree node through the interactive interface, wherein the target tree node comprises level information and type information, and the level information of the target tree node is a specific level of the target tree node in the special-shaped structure tree. According to the level information of the target tree node, the level L of the target tree node in the special-shaped structure tree can be determined.
302. And obtaining branch structure trees corresponding to all top-level tree nodes of the special-shaped structure tree.
In the embodiment of the present invention, the top tree node of the special-shaped structure tree is a node in the hierarchy of the main management area, and each top tree node corresponds to one branch structure tree, for example, in table 1, if a tree node in the first main management area is taken as a top tree node, the branch structure tree corresponding to the top tree node is the special-shaped structure tree itself; if the tree node in the second main area is taken as a top-level tree node, the top-level tree node comprises a south mountain area tree node, a Futian area tree node and a Baoan area tree node, and the tree nodes correspond to a south mountain area branch structure tree, a Futian area branch structure tree and a Baoan area branch structure tree respectively.
The above tree of branch structures in the south mountain area may be as shown in table 2:
TABLE 2
South mountain area
Science and technology garden
South district circuit box
Street lamp 1
Street lamp 2
Road lamp 3
Gateway 1
North region loop box
Street lamp 4
Bai Danzhou
The ford area branching structure tree can be as shown in table 3:
TABLE 3 Table 3
Futian district
Post building loop box
Street lamp 5
Gateway 2
The aforementioned baoan zone branching structure tree may be as shown in table 4:
TABLE 4 Table 4
Baoan district
Plateau circuit box
303. And acquiring all first tree nodes with the hierarchy less than or equal to L from a branch structure tree T1 corresponding to one top tree node to obtain a branch structure tree T2.
In the embodiment of the present invention, the branch structure tree T1 corresponding to a top tree node includes a top tree node and a first tree node below the level of the top tree node. All the first tree nodes with the level less than or equal to L, for example, the level L, are device levels, and then the first tree nodes with the device level or the levels below the device level are obtained, so as to obtain a branch structure tree T2 corresponding to the top tree node.
304. In the branch structure tree T2, all first tree nodes of a type different from that of the target tree node are recursively removed, and a branch structure tree T3 is obtained.
In the embodiment of the invention, all the first tree nodes in the branch structure tree T2 can be traversed through a recursion algorithm, and corresponding values are returned, if the values are different from the types of the target tree nodes, the corresponding first tree nodes are discarded, so that all the first tree nodes which are different from the types of the target tree nodes in the branch structure tree T2 are removed, and a branch structure tree T3 corresponding to a top-level tree node is obtained.
305. And merging the branch structure trees T3 corresponding to all the top-level tree nodes to obtain the equipment selection tree.
In the embodiment of the invention, a branch structure tree T3 corresponding to each top-level tree node is merged to obtain the equipment selection tree. For example, using the above table 1 as a special-shaped structure tree, the level of the target tree node is a device level, the type of the target tree node is a street lamp, and the above device selection tree may be as shown in table 5:
TABLE 5
Figure BDA0002995169290000101
/>
Figure BDA0002995169290000111
It can be seen that in the above device selection tree, only street lamps are included in the device hierarchy.
In the embodiment of the invention, the corresponding equipment selection tree can be generated through the special-shaped structure tree, the corresponding tree nodes are selected through the equipment selection tree to carry out instantiation grouping, all the grouping is carried out based on the special-shaped structure tree, so that each grouping in the Internet of things system does not need to be developed respectively, various grouping scenes can be realized through the tree node configuration of the special-shaped structure tree based on one-time development programming, the grouping efficiency in the Internet of things system is improved, the development workload is further greatly reduced, and the construction cost and period of the Internet of things system are reduced.
Optionally, referring to fig. 4, fig. 4 is a schematic flow chart of another grouping method based on a special-shaped structure tree according to an embodiment of the present invention, and based on the embodiment of fig. 1, the step of instantiating the second tree node to be grouped in the step 104 to obtain the instantiated group member specifically includes a step 401 and a step 302. The method comprises the following specific steps:
401. for each second tree node to be grouped, a corresponding first tree node is determined from the special-shaped structure tree.
In the embodiment of the present invention, each of the second tree nodes to be grouped corresponds to one first tree node in a special-shaped structure tree, where each first tree node corresponds to one grouping member, and in the special-shaped structure tree, each first tree node in the equipment hierarchy corresponds to one equipment.
402. And selecting corresponding first tree nodes and/or all first tree nodes at the lower level of the corresponding first tree nodes from the special-shaped structure tree to store, thereby obtaining the instantiation group members.
In the embodiment of the invention, because the information of the corresponding equipment exists in the first tree node in the special-shaped structure tree, the first tree node and/or all first tree nodes at the lower level of the corresponding first tree node can be stored to obtain the instantiation group member.
Optionally, in an embodiment of the present invention, a logical grouping template of the special-shaped structure tree may be defined, where the logical grouping template defines a source of grouping members and a target of grouping members, where the source of grouping members corresponds to a first hierarchical relationship of the special-shaped structure tree, and the target of grouping members corresponds to a type of a first tree node in the special-shaped structure tree. Specifically, the logical grouping template defines the source (which special-shaped structure tree) of the grouping members and the destination (the type of the first tree node of the special-shaped structure tree) of the grouping members.
Further, a preset number of logical groupings may be created under the logical grouping template described above. In particular, one logical grouping template may create multiple logical groupings. It is also possible to continue to create finer granularity logical packets in the logical packets described above. Grouping members in the logical groupings described above may originate from the special-shaped structure tree and member templates defined by the logical grouping templates.
Further, the logical grouping template includes a service grouping template, and the logical grouping includes device grouping. The business grouping template can comprise a street lamp energy-saving template and an LED screen information release template; the above-mentioned equipment group may include a pedestrian street light group, a main street light group, an auxiliary street light group, an intersection light group, a hooke's light group light, etc.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a grouping device based on a special-shaped structure tree according to an embodiment of the present invention, as shown in fig. 5, the grouping device based on a special-shaped structure tree includes:
an obtaining module 501, configured to obtain a special-shaped structure tree of a device, where the special-shaped structure tree includes a first hierarchical relationship and a first tree node;
a generating module 502, configured to generate a device selection tree according to the special-shaped structure tree, where the device selection tree includes a second hierarchical relationship and a second tree node;
a determining module 503, configured to determine a selection range and a target type of a target group member in the device selection tree, and determine a second tree node to be grouped according to the selection range, where the second tree node to be grouped is the same as the target type of the target group member;
an instantiation module 504, configured to instantiate the second tree node to be grouped to obtain an instantiated group member.
Optionally, the obtaining module 501 is further configured to construct a first hierarchical relationship of the special-shaped structure tree according to a supervisor area hierarchy, a supervisor equipment hierarchy, and an equipment hierarchy of the group member; constructing a first node of a special-shaped structure tree according to the supervisor area type, the supervisor equipment type and the equipment type of the group members, wherein the first node of the special-shaped structure tree comprises the first node type; and constructing and obtaining the special-shaped structure tree of the equipment according to the first hierarchical relation of the special-shaped structure tree and the first node of the special-shaped structure tree.
Optionally, the generating module 502 is further configured to obtain, from the levels of the special-shaped structure tree, a level L at which a target tree node is located, where the target tree node is determined in the first tree node; acquiring branch structure trees corresponding to all top tree nodes of the special-shaped structure tree; acquiring all first tree nodes with the hierarchy less than or equal to L from a branch structure tree T1 corresponding to a top tree node to obtain a branch structure tree T2; in the branch structure tree T2, recursively removing all first tree nodes with different types from the target tree node to obtain a branch structure tree T3; and merging the branch structure trees T3 corresponding to all the top-level tree nodes to obtain the equipment selection tree.
Optionally, the instantiation module 504 is further configured to determine, for each second tree node to be grouped, a corresponding first tree node from the special-shaped structure tree; and selecting the corresponding first tree node and/or all first tree nodes at the lower level of the corresponding first tree node from the special-shaped structure tree to store, thereby obtaining the instantiation group member.
Optionally, the apparatus further includes:
the template definition module is used for defining a logical grouping template of the special-shaped structural tree, the logical grouping template defines sources of grouping members and targets of grouping members, the sources of the grouping members correspond to a first hierarchical relation of the special-shaped structural tree, and the targets of the grouping members correspond to types of first tree nodes in the special-shaped structural tree.
Optionally, the apparatus further includes:
and the grouping creation module is used for creating a preset number of logical groupings under the logical grouping template.
Optionally, the logical grouping template includes a traffic grouping template, and the logical grouping includes device grouping.
In the embodiment of the invention, the corresponding equipment selection tree can be generated through the special-shaped structure tree, the corresponding tree nodes are selected through the equipment selection tree to carry out instantiation grouping, all grouping is carried out based on the special-shaped structure tree, so that each grouping in the Internet of things system does not need to be developed respectively, various grouping scenes can be realized through the tree node configuration of the special-shaped structure tree based on one-time development programming, the grouping efficiency in the Internet of things system is improved, the development workload is further greatly reduced, and the construction cost and period of the Internet of things system are reduced.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 6, including: memory 602, processor 601 and a computer program stored on the memory 602 and executable on the processor 601 for a special-shaped structure tree based grouping method, wherein:
the processor 601 is configured to call a computer program stored in the memory 602, and perform the following steps:
acquiring a special-shaped structure tree of equipment, wherein the special-shaped structure tree comprises a first hierarchical relationship and first tree nodes;
generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises a second hierarchical relationship and second tree nodes;
determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range, wherein the second tree node to be grouped is the same as the target type of the target group member;
and instantiating the second tree node to be grouped to obtain an instantiated group member.
Optionally, the acquiring the special-shaped structure tree of the device executed by the processor 601 includes:
constructing a first hierarchical relationship of the special-shaped structure tree according to the supervisor area hierarchy, the supervisor equipment hierarchy and the equipment hierarchy of the group members;
constructing a first node of a special-shaped structure tree according to the supervisor area type, the supervisor equipment type and the equipment type of the group members, wherein the first node of the special-shaped structure tree comprises the first node type;
and constructing and obtaining the special-shaped structure tree of the equipment according to the first hierarchical relation of the special-shaped structure tree and the first node of the special-shaped structure tree.
Optionally, the generating, by the processor 601, a device selection tree according to the special-shaped structure tree includes:
acquiring a hierarchy L where a target tree node is located from the hierarchy of the special-shaped structure tree, wherein the target tree node is determined in the first tree node;
acquiring branch structure trees corresponding to all top tree nodes of the special-shaped structure tree;
acquiring all first tree nodes with the hierarchy less than or equal to L from a branch structure tree T1 corresponding to a top tree node to obtain a branch structure tree T2;
in the branch structure tree T2, recursively removing all first tree nodes with different types from the target tree node to obtain a branch structure tree T3;
and merging the branch structure trees T3 corresponding to all the top-level tree nodes to obtain the equipment selection tree.
Optionally, the instantiating the second tree node to be grouped, performed by the processor 601, obtains an instantiated group member, including:
for each second tree node to be grouped, determining a corresponding first tree node from the special-shaped structure tree;
and selecting the corresponding first tree node and/or all first tree nodes at the lower level of the corresponding first tree node from the special-shaped structure tree to store, thereby obtaining the instantiation group member.
Optionally, the method executed by the processor 601 further includes:
defining a logical grouping template of the special-shaped structure tree, wherein the logical grouping template defines sources of grouping members and targets of grouping members, the sources of grouping members correspond to a first hierarchical relationship of the special-shaped structure tree, and the targets of grouping members correspond to types of first tree nodes in the special-shaped structure tree.
Optionally, the method executed by the processor 601 further includes:
and creating a preset number of logical groups under the logical group template.
Optionally, the logical grouping template includes a traffic grouping template, and the logical grouping includes device grouping.
In the embodiment of the invention, the corresponding equipment selection tree can be generated through the special-shaped structure tree, the corresponding tree nodes are selected through the equipment selection tree to carry out instantiation grouping, all grouping is carried out based on the special-shaped structure tree, so that each grouping in the Internet of things system does not need to be developed respectively, various grouping scenes can be realized through the tree node configuration of the special-shaped structure tree based on one-time development programming, the grouping efficiency in the Internet of things system is improved, the development workload is further greatly reduced, and the construction cost and period of the Internet of things system are reduced.
The embodiment of the invention also provides a computer readable storage medium, and a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the computer program realizes each process of the grouping method based on the special-shaped structure tree provided by the embodiment of the invention, and can achieve the same technical effect, so that repetition is avoided, and no repeated description is provided here.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM) or the like.
The foregoing disclosure is illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims (8)

1. The grouping method based on the special-shaped structure tree is characterized by comprising the following steps of:
acquiring a special-shaped structure tree of equipment, wherein the special-shaped structure tree comprises a first hierarchical relationship and first tree nodes;
generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises a second hierarchical relationship and second tree nodes;
determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range, wherein the second tree node to be grouped is the same as the target type of the target group member;
instantiating the second tree node to be grouped to obtain an instantiated group member;
the special-shaped structure tree of the acquisition equipment comprises the following components:
constructing a first hierarchical relationship of the special-shaped structure tree according to the supervisor area hierarchy, the supervisor equipment hierarchy and the equipment hierarchy of the group members;
constructing a first tree node of a special-shaped structure tree according to the supervisor area type, the supervisor equipment type and the equipment type of the group member, wherein the first tree node of the special-shaped structure tree comprises a first node type;
constructing and obtaining a special-shaped structure tree of the equipment according to the first hierarchical relation of the special-shaped structure tree and the first tree node of the special-shaped structure tree;
generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises:
acquiring a hierarchy L where a target tree node is located from the hierarchy of the special-shaped structure tree, wherein the target tree node is determined in the first tree node;
acquiring branch structure trees corresponding to all top tree nodes of the special-shaped structure tree;
acquiring all first tree nodes with the hierarchy less than or equal to L from a branch structure tree T1 corresponding to a top tree node to obtain a branch structure tree T2;
in the branch structure tree T2, recursively removing all first tree nodes with different types from the target tree node to obtain a branch structure tree T3;
and merging the branch structure trees T3 corresponding to all the top-level tree nodes to obtain the equipment selection tree.
2. The method for grouping the nodes based on the special-shaped structure tree according to claim 1, wherein the step of instantiating the second tree node to be grouped to obtain an instantiated group member comprises the steps of:
for each second tree node to be grouped, determining a corresponding first tree node from the special-shaped structure tree;
and selecting the corresponding first tree node and/or all first tree nodes at the lower level of the corresponding first tree node from the special-shaped structure tree to store, thereby obtaining the instantiation group member.
3. The special-shaped structure tree-based grouping method of claim 1, wherein the method further comprises:
defining a logical grouping template of the special-shaped structure tree, wherein the logical grouping template defines sources of grouping members and targets of grouping members, the sources of grouping members correspond to a first hierarchical relationship of the special-shaped structure tree, and the targets of grouping members correspond to types of first tree nodes in the special-shaped structure tree.
4. A method of grouping based on a special-shaped structure tree as recited in claim 3, wherein the method further comprises:
and creating a preset number of logical groups under the logical group template.
5. The special-shaped structure tree-based grouping method of claim 4 wherein the logical grouping template comprises a traffic grouping template and the logical grouping comprises device grouping.
6. A grouping device based on a special-shaped structure tree, characterized in that the grouping device based on the special-shaped structure tree comprises:
the acquisition module is used for acquiring the special-shaped structure tree of the equipment, wherein the special-shaped structure tree comprises a first hierarchical relationship and first tree nodes, and the special-shaped structure tree of the equipment comprises the following components:
constructing a first hierarchical relationship of the special-shaped structure tree according to the supervisor area hierarchy, the supervisor equipment hierarchy and the equipment hierarchy of the group members;
constructing a first tree node of a special-shaped structure tree according to the supervisor area type, the supervisor equipment type and the equipment type of the group member, wherein the first tree node of the special-shaped structure tree comprises a first node type;
constructing and obtaining a special-shaped structure tree of the equipment according to the first hierarchical relation of the special-shaped structure tree and the first tree node of the special-shaped structure tree;
the generation module is used for generating a device selection tree according to the special-shaped structure tree, wherein the device selection tree comprises a second hierarchical relationship and second tree nodes;
the determining module is used for determining a selection range and a target type of a target group member in the equipment selection tree, and determining a second tree node to be grouped according to the selection range, wherein the second tree node to be grouped is the same as the target type of the target group member;
an instantiation module, configured to instantiate the second tree node to be grouped to obtain an instantiated group member;
the generating module is specifically configured to: acquiring a hierarchy L where a target tree node is located from the hierarchy of the special-shaped structure tree, wherein the target tree node is determined in the first tree node;
acquiring branch structure trees corresponding to all top tree nodes of the special-shaped structure tree;
acquiring all first tree nodes with the hierarchy less than or equal to L from a branch structure tree T1 corresponding to a top tree node to obtain a branch structure tree T2;
in the branch structure tree T2, recursively removing all first tree nodes with different types from the target tree node to obtain a branch structure tree T3;
and merging the branch structure trees T3 corresponding to all the top-level tree nodes to obtain the equipment selection tree.
7. An electronic device, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the tree-based grouping method according to any one of claims 1 to 5 when the computer program is executed.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, implements the steps in the tree-based grouping method of any one of claims 1 to 5.
CN202110327405.6A 2021-03-26 2021-03-26 Grouping method and device based on special-shaped structure tree, electronic equipment and storage medium Active CN113051270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110327405.6A CN113051270B (en) 2021-03-26 2021-03-26 Grouping method and device based on special-shaped structure tree, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110327405.6A CN113051270B (en) 2021-03-26 2021-03-26 Grouping method and device based on special-shaped structure tree, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113051270A CN113051270A (en) 2021-06-29
CN113051270B true CN113051270B (en) 2023-05-12

Family

ID=76515783

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110327405.6A Active CN113051270B (en) 2021-03-26 2021-03-26 Grouping method and device based on special-shaped structure tree, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113051270B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392065A (en) * 2014-12-08 2015-03-04 国网甘肃省电力公司刘家峡水电厂 Method for generating model of power protection device
CN109583726A (en) * 2018-11-19 2019-04-05 南京新联电能云服务有限公司 The method and system of characterization processes state
CN111124883A (en) * 2019-11-15 2020-05-08 苏州浪潮智能科技有限公司 Test case library introduction method, system and equipment based on tree form
CN112102467A (en) * 2020-07-22 2020-12-18 深圳市菲森科技有限公司 Parallel octree generation and device based on GPU and electronic equipment
CN112214238A (en) * 2020-10-15 2021-01-12 上海顺舟智能科技股份有限公司 Internet of things service system configuration method based on intelligent application scene

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7310343B2 (en) * 2002-12-20 2007-12-18 Hewlett-Packard Development Company, L.P. Systems and methods for rapid selection of devices in a tree topology network
US20070143331A1 (en) * 2005-12-14 2007-06-21 Holtz Christopher M Apparatus, system, and method for generating an IMS hierarchical database description capable of storing XML documents valid to a given XML schema
US7917541B2 (en) * 2008-03-31 2011-03-29 Microsoft Corporation Collecting and aggregating data using distributed resources
US10169215B2 (en) * 2016-09-26 2019-01-01 Cognizant Technology Solutions India Pvt. Ltd. Method and system for analyzing test cases for automatically generating optimized business models

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392065A (en) * 2014-12-08 2015-03-04 国网甘肃省电力公司刘家峡水电厂 Method for generating model of power protection device
CN109583726A (en) * 2018-11-19 2019-04-05 南京新联电能云服务有限公司 The method and system of characterization processes state
CN111124883A (en) * 2019-11-15 2020-05-08 苏州浪潮智能科技有限公司 Test case library introduction method, system and equipment based on tree form
CN112102467A (en) * 2020-07-22 2020-12-18 深圳市菲森科技有限公司 Parallel octree generation and device based on GPU and electronic equipment
CN112214238A (en) * 2020-10-15 2021-01-12 上海顺舟智能科技股份有限公司 Internet of things service system configuration method based on intelligent application scene

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
一种基于实例检索的工艺设计方法;李云龙等;现代制造工程;14-17 *
以太网交换机纵向管理系统设计与实现;刘欢;中国优秀硕士学位论文全文数据库信息科技辑(第7期);I139-39 *
基于FLEX和MDX的Web-OLAP设计及实现;向新等;微计算机应用(第03期);39-46 *
基于框架的汉语篇章结构生成和篇章关系识别;吕国英;苏娜;李茹;王智强;柴清华;;中文信息学报(06);102-113 *

Also Published As

Publication number Publication date
CN113051270A (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN111467806B (en) Method, device, medium and electronic equipment for generating resources in game scene
CN103678609A (en) Large data inquiring method based on distribution relation-object mapping processing
CN104035754A (en) XML (Extensible Markup Language)-based custom code generation method and generator
CN109635037B (en) Fragmentation storage method and device for relational distributed database
CN108733810B (en) Address data matching method and device
CN110866029B (en) sql statement construction method, device, server and readable storage medium
CN113326264A (en) Data processing method, server and storage medium
Jiang et al. Application Research of Key Frames Extraction Technology Combined with Optimized Faster R‐CNN Algorithm in Traffic Video Analysis
Liu et al. The smart architect: Scalable ontology-based modeling of ancient Chinese architectures
CN114691664B (en) AI prediction-based intelligent scene big data cleaning method and intelligent scene system
CN113051270B (en) Grouping method and device based on special-shaped structure tree, electronic equipment and storage medium
CN111475511A (en) Data storage method, data access method, data storage device, data access device and data access equipment based on tree structure
CN112783898A (en) Method and device for constructing special-shaped structure tree, electronic equipment and storage medium
CN108632386B (en) Block chain link point cluster building method and device
CN114239237A (en) Power distribution network simulation scene generation system and method supporting digital twinning
CN108683599B (en) Preprocessing-based method and system for determining maximum flow of flow network
CN108765190B (en) River network data expression method oriented to large-scale parallel and suitable for river network multilevel nesting
CN112214238B (en) Internet of things service system configuration method based on intelligent application scene
CN110096506B (en) Tree cell structure description and storage method for multi-layer requirements
KR100256686B1 (en) Method for searching adding and deleting a node on the management information tree using the multiple balanced tree
CN112994993B (en) Flexibly defined metropolitan area network topology generation method and device
CN111416631A (en) Waveform deployment implementation method based on waveform multistage nesting
CN111190952A (en) Method for extracting and persisting multi-scale features of urban portrait based on image pyramid
CN111400320B (en) Method and device for generating information
CN114465979B (en) IP library generation method, system 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