CN109743355B - Method and device for developing functions of internet of things equipment, computer equipment and storage medium - Google Patents

Method and device for developing functions of internet of things equipment, computer equipment and storage medium Download PDF

Info

Publication number
CN109743355B
CN109743355B CN201811492114.7A CN201811492114A CN109743355B CN 109743355 B CN109743355 B CN 109743355B CN 201811492114 A CN201811492114 A CN 201811492114A CN 109743355 B CN109743355 B CN 109743355B
Authority
CN
China
Prior art keywords
node
target node
tree structure
internet
service
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
CN201811492114.7A
Other languages
Chinese (zh)
Other versions
CN109743355A (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.)
Qingdao Haier Technology Co Ltd
Original Assignee
Qingdao Haier 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 Qingdao Haier Technology Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN201811492114.7A priority Critical patent/CN109743355B/en
Publication of CN109743355A publication Critical patent/CN109743355A/en
Application granted granted Critical
Publication of CN109743355B publication Critical patent/CN109743355B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for developing functions of an internet of things device, a computer device and a storage medium, wherein the method comprises the following steps: storing service parameters of various services of the Internet of things equipment by using a tree structure; when an instruction of executing a certain service is received, determining the name of a target node in a tree structure according to the name of the service; and searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain the target node, and obtaining parameters required for executing the service according to the searched target node. The technical scheme of the invention converts the realization of the business function into the search of a certain business function so as to realize the control of the function of the equipment in the Internet of things, all business systems can share the business logic of the tree structure, a multiplexing solution is provided for the expansion and the function development of the business of the equipment in the Internet of things, and the access efficiency of the equipment can be improved.

Description

Method and device for developing functions of internet of things equipment, computer equipment and storage medium
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for developing functions of an internet of things device, a computer device, and a storage medium.
Background
The internet of things technology is one of the hottest technologies in the current era and is also an important development stage in the information era. The existing internet-of-things household appliance control has no uniform protocol, and even if the description of equipment (such as intelligent household appliances) functions and business logic required to be processed when commands are issued by manufacturers under the same protocol are varied.
With the improvement of the living standard of modern people, various intelligent household appliances are widely used. Internet manufacturers and internet companies have also begun to have a large amount of access to various intelligent appliances. Because of the differences of the internet of things protocols among manufacturers and the huge number of models of the internet of things equipment, the included equipment functions (such as the functions of various intelligent household appliances) are very complicated, how to describe the functional logic of the equipment (various intelligent household appliances) and multiplex all service systems by a more intelligent method makes the access of the internet of things equipment developed at one time, and the problem that the access of the internet of things equipment can be quickly iteratively repaired and adapted to all development platforms needs to be solved urgently is solved.
In the prior art, similar solutions have substantially the same idea, that is, a formatted data storage device command or logic is used, an application side executes device control by using a standard interface, for example, an APP side uses a Hybrid or H5 access scheme for device control, or some simple device control functions are implemented by using a configuration file. And configuring the function description file of the equipment through the background, finishing the default configuration of the command correspondingly issued by the equipment in the file, downloading the function description file of the equipment by the service end or the system, and calling an equipment control interface to execute equipment control. However, for a large number of internet of things devices and large telephones with complex functions, the intelligent development workload of the internet of things devices is still large, the access efficiency of the devices is low, and the systems are difficult to interconnect and intercommunicate.
Disclosure of Invention
In order to solve the problems that the access efficiency of equipment is low and interconnection and intercommunication among systems are difficult in the prior art, the embodiment of the invention provides a method and a device for developing functions of an internet of things equipment, computer equipment and a storage medium.
The embodiment of the invention provides a method for developing functions of an internet of things device, which comprises the following steps:
storing service parameters of various services of the Internet of things equipment by using a tree structure;
when an instruction of executing a certain service is received, determining the name of a target node in the tree structure according to the name of the service;
searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain a target node, and obtaining parameters required for executing the service according to the searched target node;
the tree structure comprises behavior nodes and control nodes, the behavior nodes are leaf nodes of the tree structure, and preconditions for selecting the nodes and parameters required by the internet of things equipment to execute the business are configured in each behavior node; the control nodes are other nodes except all behavior nodes in the tree structure, and each control node is provided with a precondition for selecting the node and a selection strategy of a next-level node of the control node.
Optionally, in the method for developing functions of an internet of things device according to the embodiment of the present invention, the preset search algorithm is a depth-first search algorithm.
Optionally, in the method for developing functions of an internet of things device according to the embodiment of the present invention, searching in the tree structure by using a depth-first search algorithm according to the name of the target node to obtain the target node includes:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
Optionally, in the method for developing functions of an internet of things device according to the embodiment of the present invention, the determining whether the current node is a target node according to the name of the target node and the precondition configured in the current node includes:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
and when the current node is the same as the target node, judging that the current node is the target node.
Optionally, in the method for developing functions of an internet of things device according to the embodiment of the present invention, the obtaining, according to the searched target node, a parameter required for executing the service includes:
when the searched target node is a behavior node, directly extracting parameters needed when the service is executed from the target node;
and when the searched target node is a control node, determining all behavior nodes which are in line with the next-level node selection strategy of the target node under the target node, and extracting parameters required for executing the service from the determined behavior nodes respectively.
Optionally, in the method for developing functions of an internet of things device according to the embodiment of the present invention, the method further includes the following steps:
and receiving and storing the state data and/or the configuration data of the equipment of the Internet of things.
The embodiment of the invention also provides a device for developing the functions of the internet of things equipment, which comprises: the system comprises a storage module, a target node determination module and a parameter extraction module;
the storage module is used for storing service parameters of various services of the internet of things equipment by utilizing a tree structure;
the target node determining module is used for determining the name of a target node in the tree structure according to the name of a certain service when receiving an instruction of executing the service;
the parameter extraction module is used for searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain the target node, and obtaining parameters required for executing the service according to the searched target node;
the tree structure comprises behavior nodes and control nodes, the behavior nodes are leaf nodes of the tree structure, and preconditions for selecting the nodes and parameters required by the internet of things equipment to execute the business are configured in each behavior node; the control nodes are other nodes except all behavior nodes in the tree structure, and each control node is provided with a precondition for selecting the node and a selection strategy of a next-level node of the control node.
Optionally, in the apparatus for developing functions of an internet of things device according to the embodiment of the present invention, the preset search algorithm is a depth-first search algorithm.
Optionally, in the apparatus for developing functions of an internet of things device according to the embodiment of the present invention, the parameter extraction module is specifically configured to:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
Optionally, in the apparatus for developing functions of an internet of things device according to the embodiment of the present invention, the parameter extraction module is specifically configured to:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
and when the current node is the same as the target node, judging that the current node is the target node.
Optionally, in the apparatus for developing functions of an internet of things device according to the embodiment of the present invention, the parameter extraction module is specifically configured to:
when the searched target node is a behavior node, directly extracting parameters needed when the service is executed from the target node;
and when the searched target node is a control node, determining all behavior nodes which are in line with the next-level node selection strategy of the target node under the target node, and extracting parameters required for executing the service from the determined behavior nodes respectively.
Optionally, in the apparatus for developing functions of an internet of things device according to the embodiment of the present invention, the apparatus further includes a shared data module:
and the shared data module is used for receiving and storing the state data and/or the configuration data of the equipment of the internet of things.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored on the storage medium, and when the program is executed by a processor, the steps of the method for developing the functions of the internet of things equipment are realized.
The embodiment of the invention also provides computer equipment, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the steps of the function development method of the internet of things equipment when executing the program.
The embodiment of the invention has the following beneficial effects:
the method, the device, the computer equipment and the storage medium for developing the functions of the internet of things equipment, provided by the embodiment of the invention, utilize the tree structure to store the service parameters of the internet of things equipment, convert the realization of the service functions into the search of a certain service function so as to realize the control of the functions of the internet of things equipment, all service systems can share the service logic of the tree structure and can display the service logic.
Drawings
Fig. 1 is a schematic flow chart of a method for developing functions of an internet of things device according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of a tree structure according to a first embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a process of searching in a tree structure by using a depth-first search algorithm according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a function development device of an internet of things device in a fourth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to solve the problems that the access efficiency of equipment is low and interconnection and intercommunication among systems are difficult in the prior art, the embodiment of the invention provides a method and a device for developing functions of an internet of things equipment, computer equipment and a storage medium. The present invention will be described in further detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
According to a first embodiment of the invention, a method for developing functions of an internet of things device is provided. Fig. 1 is a schematic flow chart of a method for developing functions of an internet of things device according to a first embodiment of the present invention, and as shown in fig. 1, the method for developing functions of an internet of things device according to the first embodiment of the present invention includes the following steps:
s101: and storing the service parameters of each service of the Internet of things equipment by using the tree structure.
In the embodiment of the invention, the internet of things equipment can be understood as an intelligent household appliance.
Specifically, the tree structure includes behavior nodes and control nodes, the behavior nodes are leaf nodes of the tree structure, and each behavior node is configured with a precondition for selecting the node and a parameter required by the internet of things device when executing a service; the control nodes are other nodes except all behavior nodes in the tree structure, and each control node is provided with a precondition for selecting the node and a selection strategy of a next-level node of the control node.
Specifically, the selection strategy includes selecting a part of sub-nodes in the next-level sub-node, sequentially selecting all sub-nodes of the next-level sub-node, and simultaneously selecting all sub-nodes of the next-level sub-node. When the selection strategy is to simultaneously select all the child nodes of the next-level child node, all the child nodes of the next-level child node are judged to be the target node if all the child nodes meet the requirements of the preconditions and the names, and the target node is not judged if one of the child nodes does not meet the requirements.
Fig. 2 is a schematic diagram of a tree structure in the first embodiment of the present invention, in fig. 2, P denotes a precondition, C denotes a control node, and a denotes a behavior node. As shown in fig. 2, each node of the tree structure includes a precondition, all leaf nodes are behavior nodes, and all nodes except the leaf nodes are control nodes. The preconditions provide the basis for a "selection" which includes the conditions for entering, or selecting, the node, and when used, the preconditions for testing each node in turn, and if satisfied, selecting the node. The behavior node is configured with specific device control functions, that is, parameters required for controlling the device, including the type of command execution and the command.
S102: and when an instruction of executing a certain service is received, determining the name of the target node in the tree structure according to the name of the service.
S103: and searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain the target node, and obtaining parameters required for executing the service according to the searched target node.
If the parameters needed for executing the service are searched, the service is proved to be executable, otherwise, the service operation is considered to be failed or has no operation condition, so that the control on the matching function of the intelligent Internet of things equipment can be realized.
Each model of device (smart appliance) stores business logic in a tree structure. The service end, i.e. different service systems, use a standard interpreter to parse the tree structure data.
The first method embodiment of the invention mainly solves the problem that the equipment with the same type is repeatedly developed in a plurality of service systems for a plurality of times. Development and test resources are invested greatly, learning cost is high, and functions and functional logics of the access type equipment need to be known besides functional test; meanwhile, the access speed of the equipment is low, and the access speed of part of the equipment is lower than the model release speed of the net device manufacturers.
The method for developing the functions of the equipment connected with the internet of things provided by the first method embodiment of the invention utilizes the tree structure to store the service parameters of the equipment connected with the internet of things, converts the realization of the service functions into the search of a certain service function so as to realize the control of the functions of the equipment connected with the internet of things, all service systems can share the service logic of the tree structure and can display the service logic.
According to a second embodiment of the invention, a method for developing functions of an internet of things device is provided. The method for developing the functions of the internet of things equipment in the second embodiment of the invention comprises the following steps:
s201: and storing the service parameters of each service of the Internet of things equipment by using the tree structure.
S202: and when an instruction of executing a certain service is received, determining the name of the target node in the tree structure according to the name of the service.
S203: and searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain the target node, and obtaining parameters required for executing the service according to the searched target node.
Optionally, the preset search algorithm is a depth-first search algorithm. Fig. 3 is a schematic flow chart of searching in a tree structure by using a depth-first search algorithm in a second embodiment of the present invention, and as shown in fig. 3, searching in the tree structure by using the depth-first search algorithm according to the name of the target node to obtain the target node includes the following steps:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
More specifically, determining whether the current node is the target node according to the name of the target node and the preconditions configured in the current node includes:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
and when the current node is the same as the target node, judging that the current node is the target node.
Specifically, the obtaining of the parameters required for executing the service according to the searched target node includes:
when the searched target node is a behavior node, directly extracting parameters needed when the service is executed from the target node;
and when the searched target node is a control node, determining all behavior nodes which are in line with the next-level node selection strategy of the target node under the target node, and extracting parameters required for executing the service from the determined behavior nodes respectively.
To explain step S203 of the second embodiment in more detail, the following detailed description is given in conjunction with fig. 2. For example, when the service to be executed is called a3 in the tree structure of fig. 2, the following search and judgment are required:
1. taking the root node of the tree structure, namely C1 in FIG. 2;
2. judging whether the C1 is a target node, specifically: respectively acquiring preconditions configured in a C1 node and the current state of equipment, when the current state of the equipment meets the preconditions of the node, continuously judging whether the name of the node is the same as the name of a node corresponding to a service to be executed in a tree structure, obviously judging that the C1 is not a target node if the C1 is different from the A1;
3. whether the C1 has child nodes or not is judged, if yes, the first child node is selected, and the specific child node of the C1 is C2;
4. judging whether the C2 is a target node, obviously, the C2 is not the target node;
5. whether the C2 has child nodes or not is judged, and if yes, the first child node is selected, and the specific first child node of the C2 is A1;
6. judging whether the A1 is a target node, obviously, the A1 is not the target node;
7. whether the A1 has child nodes or not is judged, if yes, the first child node is selected, and the specific A1 has no child nodes; taking a neighbor node, wherein the specific neighbor node is A2;
8. judging whether the A2 is a target node, obviously, the A2 is not the target node;
9. judging whether the C3 is a target node, obviously, the C3 is not the target node;
10. whether the C3 has child nodes or not is judged, and if yes, the first child node is selected, and the specific first child node of the C3 is A3;
11. and judging whether the A3 is the target node or not, and obviously, the A3 is the target node.
The method for developing the functions of the internet of things equipment, provided by the second embodiment of the invention, stores the service parameters of the internet of things equipment by using the tree structure, converts the realization of the service functions into the search of a certain service function so as to realize the control of the functions of the internet of things equipment, all service systems can share the service logic of the tree structure and can display the service logic, and by adopting the technical scheme of the embodiment of the invention, the interconnection and intercommunication among all service systems can be realized, a multiplexing solution is provided for the expansion and function development of the services of the internet of things equipment, and the access efficiency of the equipment can be improved; the searching method for searching in the tree structure provided by the second embodiment of the invention is simple, convenient and highly reliable.
According to a third method embodiment of the invention, a method for developing functions of an internet of things device is provided. The method for developing the functions of the internet of things equipment in the third method embodiment of the invention comprises the following steps:
s301: and storing the service parameters of each service of the Internet of things equipment by using the tree structure.
S302: status data and/or configuration data for the device is received and saved.
Specifically, state data and/or configuration data of the device is received and saved for being called by a relevant interface and a service implementer. The status data and/or configuration data includes default values of certain functions of the device, value ranges of the function values, status data in execution of the device, and the like.
S303: and when an instruction of executing a certain service is received, determining the name of the target node in the tree structure according to the name of the service.
S304: and searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain the target node, and obtaining parameters required for executing the service according to the searched target node.
Specifically, searching in the tree structure by using a depth-first search algorithm according to the name of the target node to obtain the target node includes the following steps:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
More specifically, the determining whether the current node is the target node according to the name of the target node and the precondition configured in the current node includes:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
and when the current node is the same as the target node, judging that the current node is the target node.
In the third embodiment of the present invention, when it is necessary to obtain the current state of the equipment in the internet of things, the current state may be obtained from the state data and/or configuration data of the equipment received and saved in step S302.
The method for developing the functions of the equipment connected with the internet of things provided by the third method embodiment of the invention utilizes the tree structure to store the service parameters of the equipment connected with the internet of things, converts the realization of the service functions into the search of a certain service function so as to realize the control of the functions of the equipment connected with the internet of things, all service systems can share the service logic of the tree structure and can display the service logic, the technical scheme of the embodiment of the invention can realize the interconnection and intercommunication among all service systems, provide a multiplexing solution for the expansion and the function development of the services of the equipment connected with the internet of things, and improve the access efficiency of the equipment; in addition, in the third method embodiment of the present invention, when the current state of the device needs to be acquired, the current state can be acquired from the received and stored state data and/or configuration data of the device, which is more convenient and efficient.
The invention also provides a device for developing the functions of the Internet of things equipment. Fig. 4 is a schematic structural diagram of a function development apparatus of an internet of things device according to a fourth embodiment of the present invention, and as shown in fig. 4, the function development apparatus of the internet of things device according to the fourth embodiment of the present invention includes a storage module 40, a target node determination module 42, and a parameter extraction module 44, which are described in detail below.
The storage module 40 is configured to store service parameters of various services of the internet of things device by using a tree structure.
Specifically, the tree structure includes behavior nodes and control nodes, the behavior nodes are leaf nodes of the tree structure, and each behavior node is configured with a precondition for selecting the node and a parameter required by the internet of things device when executing a service; the control nodes are other nodes except all behavior nodes in the tree structure, and each control node is provided with a precondition for selecting the node and a selection strategy of a next-level node of the control node.
The target node determining module 42 is configured to determine a name of a target node in the tree structure according to a name of a certain service when receiving an instruction that the service needs to be executed.
The parameter extraction module 44 is configured to search in the tree structure according to the name of the target node by using a preset search algorithm to obtain the target node, and obtain a parameter required for executing the service according to the searched target node.
Optionally, the preset search algorithm is a depth-first search algorithm.
When the search algorithm is a depth-first search algorithm, the parameter extraction module 44 is specifically configured to:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
More specifically, the parameter extraction module 44 is configured to:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
and when the current node is the same as the target node, judging that the current node is the target node.
The parameter extraction module 44 is specifically configured to:
when the searched target node is a behavior node, directly extracting parameters needed when the service is executed from the target node;
and when the searched target node is a control node, determining all behavior nodes which are in line with the next-level node selection strategy of the target node under the target node, and extracting parameters required for executing the service from the determined behavior nodes respectively.
Further, in the apparatus for developing functions of an internet of things device according to the embodiment of the present invention, the apparatus further includes a shared data module: and the shared data module is used for receiving and storing the state data and/or the configuration data of the equipment of the internet of things.
The device for developing the functions of the internet of things equipment, which is provided by the embodiment of the invention, stores the service parameters of the internet of things equipment by using the tree structure, converts the realization of the service functions into the search of a certain service function so as to realize the control of the functions of the internet of things equipment, all service systems can share the service logic of the tree structure and can display the service logic.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
step 11: and storing the service parameters of each service of the Internet of things equipment by using the tree structure.
The tree structure comprises behavior nodes and control nodes, the behavior nodes are leaf nodes of the tree structure, and each behavior node is configured with a precondition for selecting the node and parameters required by the internet of things equipment when executing services; the control nodes are other nodes except all behavior nodes in the tree structure, and each control node is provided with a precondition for selecting the node and a selection strategy of a next-level node of the control node.
Step 12: and when an instruction of executing a certain service is received, determining the name of the target node in the tree structure according to the name of the service.
Step 13: and searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain the target node, and obtaining parameters required for executing the service according to the searched target node.
When the preset search algorithm is a depth-first search algorithm, the following steps are specifically realized when the computer program is executed by the processor:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
More specifically, the computer program when executed by the processor implements the steps of:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
if yes, continuing to judge whether the name of the target node is the same as that of the current node, and if so, judging that the current node is the target node
In particular, the computer program when executed by the processor implements the steps of:
when the searched target node is a behavior node, directly extracting parameters needed when the service is executed from the target node;
and when the searched target node is a control node, determining all behavior nodes which are in line with the next-level node selection strategy of the target node under the target node, and extracting parameters required for executing the service from the determined behavior nodes respectively.
Further, the computer program when executed by the processor performs the steps of: status data and/or configuration data for the device is received and saved.
The computer-readable storage medium provided by the embodiment of the invention stores the service parameters of the equipment of the internet of things by using the tree structure, converts the realization of the service function into the search of a certain service function so as to realize the control of the function of the equipment of the internet of things, all service systems can share the service logic of the tree structure and can display the service logic.
The embodiment of the invention also provides computer equipment, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
step 21: and storing the service parameters of each service of the Internet of things equipment by using the tree structure.
The tree structure comprises behavior nodes and control nodes, the behavior nodes are leaf nodes of the tree structure, and each behavior node is configured with a precondition for selecting the node and parameters required by the internet of things equipment when executing services; the control nodes are other nodes except all behavior nodes in the tree structure, and each control node is provided with a precondition for selecting the node and a selection strategy of a next-level node of the control node.
Step 22: and when an instruction of executing a certain service is received, determining the name of the target node in the tree structure according to the name of the service.
Step 23: and searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain the target node, and obtaining parameters required for executing the service according to the searched target node.
When the preset search algorithm is a depth-first search algorithm, the following steps are specifically realized when the processor executes a program:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
More specifically, the processor executes the program to implement the following steps:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
if yes, continuing to judge whether the name of the target node is the same as that of the current node, and if so, judging that the current node is the target node
Specifically, the processor implements the following steps when executing the program:
when the searched target node is a behavior node, directly extracting parameters needed when the service is executed from the target node;
and when the searched target node is a control node, determining all behavior nodes which are in line with the next-level node selection strategy of the target node under the target node, and extracting parameters required for executing the service from the determined behavior nodes respectively.
Further, the processor executes the program to further implement the following steps: status data and/or configuration data for the device is received and saved.
The computer device provided by the embodiment of the invention stores the service parameters of the equipment of the internet of things by using the tree structure, converts the realization of the service function into the search of a certain service function so as to realize the control of the function of the equipment of the internet of things, all service systems can share the service logic of the tree structure and can display the service logic.
The above is only an example of the present invention, and is not intended to limit the present invention, and it is obvious to those skilled in the art that various modifications and variations can be made in the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (14)

1. A method for developing functions of an internet of things device is characterized by comprising the following steps:
storing service parameters of various services of the Internet of things equipment by using a tree structure;
when an instruction of executing a certain service is received, determining the name of a target node in the tree structure according to the name of the service;
searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain a target node, and obtaining parameters required for executing the service according to the searched target node;
the tree structure comprises behavior nodes and control nodes, the behavior nodes are leaf nodes of the tree structure, and preconditions for selecting the nodes and parameters required by the internet of things equipment to execute the business are configured in each behavior node; the control nodes are other nodes except all behavior nodes in the tree structure, and each control node is provided with a precondition for selecting the node and a selection strategy of a next-level node of the control node.
2. The method of claim 1, wherein the predetermined search algorithm is a depth-first search algorithm.
3. The method of claim 2, wherein searching in the tree structure using a depth-first search algorithm according to the name of the target node to obtain the target node comprises:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
4. The method of claim 3, wherein the determining whether the current node is a target node according to the name of the target node and preconditions configured in the current node comprises:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
and when the current node is the same as the target node, judging that the current node is the target node.
5. The method of claim 1, wherein obtaining parameters required for performing the service according to the searched target node comprises:
when the searched target node is a behavior node, directly extracting parameters needed when the service is executed from the target node;
and when the searched target node is a control node, determining all behavior nodes which are in line with the next-level node selection strategy of the target node under the target node, and extracting parameters required for executing the service from the determined behavior nodes respectively.
6. The method of claim 1, further comprising:
and receiving and storing the state data and/or the configuration data of the equipment of the Internet of things.
7. A device for developing functions of Internet of things equipment is characterized by comprising: the system comprises a storage module, a target node determination module and a parameter extraction module;
the storage module is used for storing service parameters of various services of the internet of things equipment by utilizing a tree structure;
the target node determining module is used for determining the name of a target node in the tree structure according to the name of a certain service when receiving an instruction of executing the service;
the parameter extraction module is used for searching in the tree structure by using a preset search algorithm according to the name of the target node to obtain the target node, and obtaining parameters required for executing the service according to the searched target node;
the tree structure comprises behavior nodes and control nodes, the behavior nodes are leaf nodes of the tree structure, and preconditions for selecting the nodes and parameters required by the internet of things equipment to execute the business are configured in each behavior node; the control nodes are other nodes except all behavior nodes in the tree structure, and each control node is provided with a precondition for selecting the node and a selection strategy of a next-level node of the control node.
8. The apparatus of claim 7, wherein the predetermined search algorithm is a depth-first search algorithm.
9. The apparatus of claim 8, wherein the parameter extraction module is specifically configured to:
taking a root node of the tree structure as a current node, and judging whether the current node is a target node according to the name of the target node and a precondition configured in the current node;
when the current node is not the target node, searching by using the depth-first search algorithm and the selection strategy of the control node in the tree structure to obtain the next current node in the tree structure, and judging whether the next current node is the target node;
and when the next current node is not the target node, continuously utilizing the depth-first search algorithm and the selection strategy of the control node in the tree structure to search and judge until the target node is obtained.
10. The apparatus of claim 9, wherein the parameter extraction module is specifically configured to:
acquiring the current state of the Internet of things equipment;
judging whether the current state of the internet of things equipment meets the precondition configured in the current node;
and when the current node is the same as the target node, judging that the current node is the target node.
11. The apparatus of claim 7, wherein the parameter extraction module is specifically configured to:
when the searched target node is a behavior node, directly extracting parameters needed when the service is executed from the target node;
and when the searched target node is a control node, determining all behavior nodes which are in line with the next-level node selection strategy of the target node under the target node, and extracting parameters required for executing the service from the determined behavior nodes respectively.
12. The apparatus of claim 7, further comprising a shared data module:
and the shared data module is used for receiving and storing the state data and/or the configuration data of the equipment of the internet of things.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for developing a function of an equipment for internet of things according to any one of claims 1 to 6.
14. A computer device, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method for developing the functions of the internet of things device according to any one of claims 1 to 6.
CN201811492114.7A 2018-12-07 2018-12-07 Method and device for developing functions of internet of things equipment, computer equipment and storage medium Active CN109743355B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811492114.7A CN109743355B (en) 2018-12-07 2018-12-07 Method and device for developing functions of internet of things equipment, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811492114.7A CN109743355B (en) 2018-12-07 2018-12-07 Method and device for developing functions of internet of things equipment, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109743355A CN109743355A (en) 2019-05-10
CN109743355B true CN109743355B (en) 2021-08-24

Family

ID=66358639

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811492114.7A Active CN109743355B (en) 2018-12-07 2018-12-07 Method and device for developing functions of internet of things equipment, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109743355B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103060A (en) * 2017-04-14 2017-08-29 李长云 The storage method and system of a kind of sensing data
CN108282363A (en) * 2017-12-30 2018-07-13 京信通信系统(中国)有限公司 Remote configuring method, device and the system of CPE and ACS

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8775579B2 (en) * 2010-01-13 2014-07-08 Htc Corporation Method for addressing management object in management tree and associated device management system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103060A (en) * 2017-04-14 2017-08-29 李长云 The storage method and system of a kind of sensing data
CN108282363A (en) * 2017-12-30 2018-07-13 京信通信系统(中国)有限公司 Remote configuring method, device and the system of CPE and ACS

Also Published As

Publication number Publication date
CN109743355A (en) 2019-05-10

Similar Documents

Publication Publication Date Title
JP6581097B2 (en) Method and apparatus for automatic device program generation
CN107592238B (en) Automatic test method and system of interface, service terminal and memory
CN105786549B (en) Smart machine and its upgrade method
JP6925365B2 (en) Methods and equipment for creating and managing controller-based remote solutions
CN101930400A (en) SDK (Software Development Kit) automatic test system and method
CN111694617B (en) Processing method of network offline model, artificial intelligence processing device and related products
CN112114892A (en) Deep learning model obtaining method, loading method and selecting method
CN108255717B (en) Interface automation test optimization method, system, electronic device and storage medium
CN111666217B (en) Method and apparatus for testing code
CN112464497B (en) Fault drilling method, device, equipment and medium based on distributed system
CN105718307B (en) Process management method and management of process device
CN104346279A (en) Method and device for software testing
CN111651351A (en) Software performance testing method and device based on Jenkins
CN114019817A (en) Control method and control device of intelligent household equipment and Internet of things system
CN109743355B (en) Method and device for developing functions of internet of things equipment, computer equipment and storage medium
CN109246161B (en) Scheduling method and device of controller and computer readable storage medium
CN109446146B (en) State transition sequence generation method of application layer communication protocol
CN113342456A (en) Connection method, device, equipment and storage medium
CN114116487B (en) Pressure testing method and device, electronic equipment and storage medium
KR100930962B1 (en) Remote security testing device and method of RPC-based software
CN106951288B (en) Development and application method and device of hot upgrade resource
CN115269117A (en) Resource creating method and device, computer equipment and storage medium
CN112667334B (en) Configuration method and device of equipment control information, electronic equipment and storage medium
CN113240088A (en) Training method of text intention recognition model
CN112199085A (en) Application program development method, application program operation method and application program operation device based on flow graph drawing

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