Disclosure of Invention
The invention mainly aims to provide a sensor connection method, a sensor connection device and a computer readable storage medium, and aims to solve the technical problem that extra hardware modification or new component addition is needed when an IEEE standard is used for connecting a sensor and a sensor network.
In order to achieve the above object, the present invention provides a sensor connection method, including the steps of:
establishing an ID data table, and storing the ID data table in a resource center of a wireless sensor network;
when the state of a sensor on any node in a wireless sensor network changes, providing the state change information of the sensor to the node;
and when the node receives the state change information, acquiring the ID data table stored in the resource center, and finishing sensor identification based on a sensor identification algorithm.
Preferably, the step of establishing an ID data table, and storing the ID data table in a resource center of the wireless sensor network, includes:
sending a plurality of specific ID instructions to corresponding sensors, and collecting preset replies of the sensors to the ID instructions;
and establishing an ID data table according to the ID instruction and the corresponding preset reply, and storing the ID data table in a resource center of the wireless sensor network.
Preferably, when the state of a sensor at any one node in the wireless sensor network changes, the step of providing the state change information of the sensor to the node includes:
when the sensor is connected or disconnected with any node in the wireless sensor network, activating a switch on the node;
and when the switch is activated, sending notification information of the state change of the sensor to the node.
Preferably, the step of acquiring the ID data table stored in the resource center when the node receives the state change information, and completing sensor identification based on a sensor identification algorithm includes:
when the node receives the state change information, acquiring sensor use information, and inputting the sensor use information into a neural network for hidden variable learning to obtain a sensor type recommendation list;
according to the sequence of the sensor type recommendation list, sending an ID instruction corresponding to the first sensor to be identified, and determining whether the sensor to be identified gives a reply or not;
and when the sensor to be identified gives a reply, comparing the reply with a preset reply in the ID data table, and when the reply is consistent with the preset reply, finishing the identification of the sensor.
Preferably, after the step of sending an ID instruction corresponding to a first ranked sensor to a sensor to be identified according to the order of the sensor type recommendation list and determining whether the sensor to be identified gives a reply, the method further includes:
and when the sensor to be identified does not give a reply, sequentially trying to identify the sensor type according to the sequence of the sensor type recommendation list.
Preferably, the default mode refers to reading from the ID register or any register of known data, writing and reading from a register of an unchangeable bit, returning data in a known range, writing and reading certain commands from a specific register.
Preferably, after the step of acquiring the ID data table stored in the resource center and completing sensor connection based on a sensor identification algorithm when the node receives the state change information, the method further includes:
starting a manual identification program when the sensor is failed to be identified;
and when the sensor identification is finished, connecting the sensor to the wireless sensor network, and feeding back connection result information to the server so as to update the sensor identification algorithm by the server.
Preferably, the step of connecting the sensor to the wireless sensor network and feeding back connection result information to the server when the sensor identification is completed, so that the server updates the sensor identification algorithm includes:
completing sensor connection when the sensor type is identified;
and feeding back connection result information including ID information, sensor types, ID instructions and replies given by the sensors about the ID instructions to the server so that the server trains the neural network based on the updated connection result information.
In order to achieve the above object, the present invention provides a sensor connecting device, including: a memory, a processor and a sensor connection program stored on the memory and executable on the processor, the sensor connection program when executed by the processor implementing the steps of the sensor connection method as claimed in any one of the above.
In addition, to achieve the above object, the present invention provides a computer-readable storage medium, wherein a sensor connection program is stored on the computer-readable storage medium, and when executed by a processor, the sensor connection program implements the steps of the sensor connection method according to any one of the above items.
According to the scheme, an ID data table is established, and the ID data table is stored in a resource center; then when the state of the sensor on any node changes, the state change information of the sensor is provided for the node; then when the node receives the state change information, acquiring the ID data table stored in the resource center, and finishing sensor identification based on a sensor identification algorithm; the method is not limited to a task physics protocol, a data link protocol, a network protocol or a transmission layer protocol, and can even be used together with any protocol, and no external component is required to be additionally added, so that the code amount and the occupation of the memory of the microcontroller are reduced, the node degree can be independent of the sensor, the range of the available sensor is expanded, and the method is particularly suitable for application occasions such as a mountainous power grid and the like to construct a sensor plug-and-play platform based on the Internet of things.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a terminal belonging to a device in a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC, and can also be a mobile terminal device with a display function, such as a smart phone, a tablet computer, an electronic book reader, an MP3(Moving Picture Experts Group Audio Layer III, dynamic video Experts compress standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, dynamic video Experts compress standard Audio Layer 3) player, a portable computer, and the like.
As shown in fig. 1, the terminal may include: aprocessor 1001, such as a CPU, anetwork interface 1004, auser interface 1003, amemory 1005, acommunication bus 1002. Wherein acommunication bus 1002 is used to enable connective communication between these components. Theuser interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and theoptional user interface 1003 may also include a standard wired interface, a wireless interface. Thenetwork interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). Thememory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). Thememory 1005 may alternatively be a storage device separate from theprocessor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, amemory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a sensor connection program.
In the terminal shown in fig. 1, thenetwork interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; theuser interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and theprocessor 1001 may be used to invoke the sensor connectivity program stored in thememory 1005.
In this embodiment, the sensor connection device includes: amemory 1005, aprocessor 1001, and a sensor connection program stored on thememory 1005 and operable on theprocessor 1001, wherein theprocessor 1001, when calling the sensor connection program stored in thememory 1005, performs the following operations:
establishing an ID data table, and storing the ID data table in a resource center of a wireless sensor network;
when the state of a sensor on any node in a wireless sensor network changes, providing the state change information of the sensor to the node;
and when the node receives the state change information, acquiring the ID data table stored in the resource center, and finishing sensor identification based on a sensor identification algorithm.
Further, theprocessor 1001 may call the sensor connection program stored in thememory 1005, and also perform the following operations:
sending a plurality of specific ID instructions to corresponding sensors, and collecting preset replies of the sensors to the ID instructions;
and establishing an ID data table according to the ID instruction and the corresponding preset reply, and storing the ID data table in a resource center of the wireless sensor network.
Further, theprocessor 1001 may call the sensor connection program stored in thememory 1005, and also perform the following operations:
when the sensor is connected or disconnected with any node, activating a switch on the sensor node;
and when the switch is activated, sending notification information of the state change of the sensor to the node.
Further, theprocessor 1001 may call the sensor connection program stored in thememory 1005, and also perform the following operations:
when the node receives the state change information, acquiring sensor use information, and inputting the sensor use information into a neural network for hidden variable learning to obtain a sensor type recommendation list;
according to the sequence of the sensor type recommendation list, sending an ID instruction corresponding to the first sensor to be identified, and determining whether the sensor to be identified gives a reply or not;
and when the sensor to be identified gives a reply, comparing the reply with a preset reply in the ID data table, and when the reply is consistent with the preset reply, finishing the identification of the sensor.
Further, theprocessor 1001 may call the sensor connection program stored in thememory 1005, and also perform the following operations:
and when the sensor to be identified does not give a reply, sequentially trying to identify the sensor type according to the sequence of the sensor type recommendation list.
Further, theprocessor 1001 may call the sensor connection program stored in thememory 1005, and also perform the following operations:
the default mode refers to reading from the ID register or any register of known data, writing and reading from a register of one of the unchangeable bits, returning data in a known range, writing and reading certain commands from a particular register.
Further, theprocessor 1001 may call the sensor connection program stored in thememory 1005, and also perform the following operations:
starting a manual identification program when the sensor is failed to be identified;
and when the sensor identification is finished, connecting the sensor to the wireless sensor network, and feeding back connection result information to the server so as to update the sensor identification algorithm by the server.
Further, theprocessor 1001 may call the sensor connection program stored in thememory 1005, and also perform the following operations:
completing sensor connection when the sensor type is identified;
and feeding back connection result information including ID information, sensor types, ID instructions and replies given by the sensors about the ID instructions to the server so that the server trains the neural network based on the updated connection result information.
A first embodiment of the present invention provides a sensor connection method, referring to fig. 2, where fig. 2 is a schematic flow chart of the first embodiment of the sensor connection method of the present invention, and the sensor connection method includes:
step S100, an ID data table is established, and the ID data table is stored in a resource center of a wireless sensor network;
the ID data table is a data table for recording the reply sequence generated by each type of sensor for a specific ID command and the ID command, and is obtained by a skilled person through experiments. In the case of determining the type of the sensor, a specific ID command is sent, then replies generated by the sensor about the ID command are collected, experiments are carried out on as many sensors as possible according to the method, more than 600 sensors are commonly used at present, and after the data collection of all the sensors about the ID command and the corresponding reply sequence is completed, the data are arranged into an ID data table containing the ID commands and the corresponding replies of different types of sensors. Because the wireless Sensor network WSN (wireless Sensor network) node has limited memory resources, a large amount of information and program codes are not suitable for being stored in the node, but the networking function of the WSN can be used to solve the problem. Only the program code of the sensors actually connected to the WSN node is kept in normal operation, while the required ID data and potentially software drivers for connecting other sensors are stored elsewhere in the network rc (resource center). The main function of the RC is to provide ID data and software drivers to the End Device ED (End-Device) of the node. The network access point ap (access point) or a separate node may serve as the RC. The RC may act as an access point and the data may then be stored at a remote location, such as the internet, to address the problem of the node storing the data.
Step S200, when the state of a sensor on any node in a wireless sensor network changes, providing the state change information of the sensor to the node;
a sensor network system generally includes a sensor node (sensor), a sink node (sink node), and a management node. A large number of sensor nodes are randomly deployed in or near a monitoring area (sensor field), and a network can be formed in a self-organizing manner. Data monitored by the sensor nodes are transmitted hop by hop along other sensor nodes, the monitored data can be processed by a plurality of nodes in the transmission process, and are routed to the sink node after multi-hop, and finally reach the management node through the internet or a satellite. And the user configures and manages the sensor network through the management node, issues a monitoring task and collects monitoring data.
The sensor network node comprises the following four basic units in composition and function: the device comprises a sensing unit (consisting of a sensor and an analog-digital conversion functional module), a processing unit (consisting of an embedded system, including a CPU, a memory, an embedded operating system and the like), a communication unit (consisting of a wireless communication module) and a power supply part. In addition, other functional units that may be selected include: positioning system, motion system and power generation facility etc..
A common sensor network usually includes a master device and a slave device, and the slave device refers to each common sensor connected to the sensor network. In such systems, the node's microcontroller as the master needs to initiate all communications. Therefore, to implement Plug and Play (Plug and Play) of a normal sensor network, it is necessary to notify the microcontroller of the node to provide information that the peripheral devices including the sensor are changed. The method can be realized by external signals, wireless instructions, periodic identification, power consumption monitoring and the like.
And step S300, when the node receives the state change information, acquiring the ID data table stored in the resource center, and finishing sensor identification based on a sensor identification algorithm.
When a sensor is connected or disconnected, the node connected with the sensor receives information about state change so as to inform the node that the state of the sensor changes. The neural network program stored in the server may form a recommendation list based on current conditions or information of the user, ordered by the likelihood of the presence of different sensors. For example, when a sensor accesses a wireless sensor network, the neural network generates a list according to the use frequency of various sensors in the network in the past, lists various types of sensors connected to the node this time and sorts the types according to the probability, and the highest probability can be ranked at the first place. And sending an ID instruction to the sensor to be identified according to the recommended sequence of the recommended list, comparing the obtained sensor reply with an expected reply recorded in an ID data table, if the expected reply is consistent with the expected reply, determining that the sensor is correctly identified, and if the expected reply is inconsistent with the expected reply, continuing to identify according to the next sensor type in the recommended list. Another identification method is to send an ID command to the sensor, and if a reply is received, the identification is successful, and if the reply is not received, the identification is failed.
In the sensor connection method provided in the embodiment, an ID data table is established, and the ID data table is stored in a resource center; then when the state of the sensor on any node changes, the state change information of the sensor is provided for the node; then when the node receives the state change information, acquiring the ID data table stored in the resource center, and finishing sensor identification based on a sensor identification algorithm; the method is not limited to a task physics protocol, a data link protocol, a network protocol or a transmission layer protocol, and can even be used together with any protocol, and no external component is required to be additionally added, so that the code amount and the occupation of the memory of the microcontroller are reduced, the node degree can be independent of the sensor, the range of the available sensor is expanded, and the method is particularly suitable for application occasions such as a mountainous power grid and the like to construct a sensor plug-and-play platform based on the Internet of things.
Based on the first embodiment, a second embodiment of the sensor connection method of the present invention is proposed, and referring to fig. 3, step S100 includes:
step S110, sending a plurality of specific ID instructions to corresponding sensors, and collecting preset replies of the sensors to the ID instructions;
a unique ID may be generated for each sensor based on the sensor-related information. The ID instruction and corresponding reply can generally be obtained by reading from the ID register or any register of known data, by writing to and reading from a register that cannot change bits, by command execution acknowledgement and returning data within a known range, and by writing to and reading from a particular register. The above four methods may be combined to have a specific ID command and reply sequence for each sensor, however, there is a very low probability that two sensors will have exactly the same duplicate data in the register. If this occurs, manual identification may be provided at the next stage of the identification data.
And step S120, establishing an ID data table according to the ID instruction and the corresponding preset reply, and storing the ID data table in a resource center of the wireless sensor network.
And acquiring the ID commands and replies corresponding to all available sensors according to the mode, recording the ID commands and replies, arranging the ID commands and replies into an ID data table, and storing the ID data table in a resource center. The resource center may be a particular node in the wireless sensor network.
In the sensor connection method provided in the embodiment, preset replies to the ID instructions from the sensors are collected by sending a plurality of specific ID instructions to the corresponding sensors; then, an ID data table is established according to the ID instruction and the corresponding preset reply, and the ID data table is stored in a resource center; no complex hardware or software needs to be added to identify the new sensor, only a very simple command is needed, and thus memory consumption of the ID algorithm can be minimized.
Based on the first embodiment, a third embodiment of the sensor connection method of the present invention is proposed, and referring to fig. 4, step S200 includes:
step S210, when the sensor is connected or disconnected with any node in the wireless sensor network, a switch on the node is activated;
when the connection state of the sensor on the node changes, a mode is needed to inform the microcontroller of the node, and the connection state of the sensor on the node changes when the connection state changes, including the situations that the sensor is suddenly connected or disconnected with the node, and the like, so that the connection state of the sensor on the node changes, and the switch on the node is activated.
Step S220, when the switch is activated, the notification information of the sensor state change is sent to the node.
Each sensor node is equipped with a button or switch that is activated when the sensor changes. When the switch is activated, indicating that the sensor is suddenly connected or disconnected, an external signal is sent to the microcontroller of the node, providing information about the change in the peripheral device. The connection state of the sensor may be reconfirmed each time the node is restarted, or the state change of the sensor may be notified to the node through a specially designed interface such as a power supply line.
In addition to the above, the information of the change of the peripheral device may be provided to the microcontroller in the node in any form of sending a wireless command, periodically starting an external sensor device identification program, and monitoring the power consumption of the node, and calculating the connection state of the sensor based on the monitoring result. The wireless instruction sending mode is that after the state of the sensor is changed, the node can receive a wireless instruction sent by a Network Access Point (Network Access Point) or other special nodes, so as to start the sensor identification; another way is to periodically start the device identification procedure, but it consumes a lot of computing resources and does not get accurate information about the new sensor connection of the node, also causing delays between sensor connection and start-up; the last way is to deduce the sensor connection status based on node power consumption. Through the combination of the above ways, it is detected whether the sensor is connected.
In the sensor connection method provided in this embodiment, when a sensor is connected to or disconnected from any one node, a switch on the sensor node is activated; then when the switch is activated, sending notification information of the state change of the sensor to the node; it does not require the addition of complex hardware or software to control the new sensor, it only requires very simple commands to identify the sensor, thus minimizing memory consumption by the ID algorithm.
Based on the first embodiment, a fourth embodiment of the sensor connection method of the present invention is proposed, and referring to fig. 5, step S300 includes:
step S310, when the node receives the state change information, acquiring sensor use information, inputting the sensor use information into a neural network for hidden variable learning, and obtaining a sensor type recommendation list;
sensor usage information is meant to include all information of sensors currently and once used by the current sensor network. For example, a power transmission line used by a power grid in a mountain area and a wireless sensor network used by the power transmission line need to monitor and upload line conditions of microclimate, tower inclination, anti-theft alarm, ice coating and the like of the power transmission line to a complete solution of a monitoring center. The early warning of the abnormal condition of the line is provided by monitoring parameters such as the environment of the environmental channel of the transmission line, the temperature, the humidity, the wind speed, the wind direction, the leakage current, the ice coating, the temperature of the wire, the windage yaw, the sag, the galloping, the contamination of the insulator, the surrounding construction condition, the inclination of the tower and the like in real time, the management level of the safe and economic operation of the transmission line is improved, and necessary reference is provided for the state maintenance work of the transmission line. Therefore, the neural network can be used for deep learning and inputting the sensor use condition of the current sensor network, so that the neural network can be used for hidden variable learning of all use condition data, and the more abundant the input description information is, the more accurate the hidden variable is. And mapping the obtained hidden variables to another domain through machine learning of the neural network so as to form a sensor type recommendation list.
Step S320, according to the sequence of the sensor type recommendation list, sending an ID instruction corresponding to the first sensor to be identified to determine whether the sensor to be identified gives a reply;
in the sensor type recommendation list, the sensors are scored and sorted according to the learning result of the neural network, and the sensors with higher probability are ranked in the front. Therefore, when the sensor recommendation list is acquired, the ID instruction corresponding to the first ranked sensor is sent to the sensor to be identified first. And receiving a reply given by the sensor to be identified.
And step S330, comparing the reply with the preset reply in the ID data table when the sensor to be recognized gives the reply, and finishing the sensor recognition when the reply is consistent with the preset reply in the ID data table.
When a reply sequence fed back by the sensor to be identified is received, comparing the reply sequence with an expected reply in the ID data table, if the reply sequence is consistent with the expected reply in the ID data table, representing that the sensor type corresponding to the current ID instruction is consistent with the sensor to be identified, and simultaneously verifying the reliability of the sensor type recommendation list output by the neural network. Thereby completing the sensor identification.
Further, in an embodiment, after step S320, the method further includes:
and when the sensor to be identified does not give a reply, sequentially trying to identify the sensor type according to the sequence of the sensor type recommendation list.
When the sensor to be identified does not give a reply or the given reply is inconsistent with the expected reply in the ID data table, the sensor to be identified may be considered not to be the sensor type given in the sensor recommendation list, and therefore, the next sensor needs to be tested according to the sequence of the recommendation list until a sensor that can give the expected reply is found according to the recommendation list, and the current sensor type in the recommendation list is the type of the sensor to be identified.
According to the sensor connection method provided by the embodiment, when the node receives the state change information, the using information of the sensor is obtained, and the using information of the sensor is input into a neural network to perform hidden variable learning so as to obtain a sensor type recommendation list; then according to the sequence of the sensor type recommendation list, sending an ID instruction corresponding to the first ranked sensor to a sensor to be identified, and determining whether the sensor to be identified gives a reply or not; then when the sensor to be identified gives a reply, comparing the reply with a preset reply in an ID data table, and when the reply is consistent with the preset reply, finishing the sensor identification; the method establishes the priority in a probability recommendation mode, and presumes a sensor which can be possibly applied according to the use condition of the user, so that the scanning time can be greatly reduced.
Based on the first embodiment, a fifth embodiment of the sensor connection method of the present invention is proposed, and referring to fig. 6, after step S300, the method further includes:
step S400, starting a manual identification program when the sensor is failed to be identified;
it is also possible that after the trial of all sensors has been exhausted according to the recommended list, the corresponding sensor type is not found, in which case it is necessary to start a manual identification procedure for the sensor to be identified, i.e. the driver search, for example by sending a special broadcast data packet containing the additional ID of the sensor, or using more sophisticated techniques, e.g. all the same sensor and driver comparison values that are attempted to be obtained are compared with the same type of data from the WSN nodes in the vicinity of the sensor.
And S500, when the sensor identification is finished, connecting the sensor to the wireless sensor network, and feeding back connection result information to the server so that the server can update the sensor identification algorithm.
When the type of the sensor is identified, the sensor is connected with the wireless sensor network, when the connection is successful, the connection result information is sent to the server, normal communication can be achieved normally at the moment, when the server receives the connection result information fed back by the sensor, the server can update the database by using the information used in the connection process, the neural network is trained continuously, and the sensor recommendation result generated by the neural network is more and more accurate along with the time lapse and the data accumulation.
In the sensor connection method provided in the embodiment, when the sensor is failed to be identified, a manual identification program is started; then, when the sensor identification is finished, connecting the sensor to a wireless sensor network, and feeding back connection result information to a server so that the server can update a sensor identification algorithm; the learning ability of the neural network can be improved by updating the server data, and the accuracy of subsequent recommendation is enhanced.
Based on the fifth embodiment, a sixth embodiment of the sensor connection method of the present invention is proposed, and referring to fig. 7, step S500 includes:
step S510, when the sensor type is identified, sensor connection is completed;
there is no ID data and sensor driver on the node until the sensor is connected to the wireless sensor network. After a series of sensor identification and detection processes, the type of the sensor is identified, and the sensor starts to normally communicate with the network to complete the connection between the sensor and the network.
Step S520, feeding back connection result information including ID information, sensor types, ID instructions and responses given by the sensors about the ID instructions to the server so that the server trains the neural network based on the updated connection result information.
The ID information, the sensor type, the ID instruction and the connection result information of the sensor about the reply given by the ID instruction are various information needed by the sensor connected to the wireless sensor network, the information is fed back to the server, the server can update the database by using the information used in the connection process, the neural network is trained continuously, and the sensor recommendation result generated by the neural network is more and more accurate along with the time lapse and the data accumulation.
According to the sensor connection method provided by the embodiment, the sensor connection is completed when the type of the sensor is identified; then feeding back connection result information including ID information, sensor types, ID instructions and replies given by the sensors about the ID instructions to a server so that the server trains a neural network based on the updated connection result information; the training of the neural network is a progressive process, and the feedback of the connection result information can help the server to train the neural network with stronger recommendation capability.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a sensor connection program is stored on the computer-readable storage medium, and when executed by a processor, the sensor connection program implements the following operations:
establishing an ID data table, and storing the ID data table in a resource center of a wireless sensor network;
when the state of a sensor on any node in a wireless sensor network changes, providing the state change information of the sensor to the node;
and when the node receives the state change information, acquiring the ID data table stored in the resource center, and finishing sensor identification based on a sensor identification algorithm.
Further, the sensor connection program when executed by the processor further performs the following operations:
sending a plurality of specific ID instructions to corresponding sensors, and collecting preset replies of the sensors to the ID instructions;
and establishing an ID data table according to the ID instruction and the corresponding preset reply, and storing the ID data table in a resource center of the wireless sensor network.
Further, the sensor connection program when executed by the processor further performs the following operations:
when the sensor is connected or disconnected with any node in the wireless sensor network, activating a switch on the node;
and when the switch is activated, sending notification information of the state change of the sensor to the node.
Further, the sensor connection program when executed by the processor further performs the following operations:
when the node receives the state change information, acquiring sensor use information, and inputting the sensor use information into a neural network for hidden variable learning to obtain a sensor type recommendation list;
according to the sequence of the sensor type recommendation list, sending an ID instruction corresponding to the first sensor to be identified, and determining whether the sensor to be identified gives a reply or not;
and when the sensor to be identified gives a reply, comparing the reply with a preset reply in the ID data table, and when the reply is consistent with the preset reply, finishing the identification of the sensor.
Further, the sensor connection program when executed by the processor further performs the following operations:
and when the sensor to be identified does not give a reply, sequentially trying to identify the sensor type according to the sequence of the sensor type recommendation list.
Further, the sensor connection program when executed by the processor further performs the following operations:
the default mode refers to reading from the ID register or any register of known data, writing and reading from a register of one of the unchangeable bits, returning data in a known range, writing and reading certain commands from a particular register.
Further, the sensor connection program when executed by the processor further performs the following operations:
starting a manual identification program when the sensor is failed to be identified;
and when the sensor identification is finished, connecting the sensor to the wireless sensor network, and feeding back connection result information to the server so as to update the sensor identification algorithm by the server.
Further, the sensor connection program when executed by the processor further performs the following operations:
completing sensor connection when the sensor type is identified;
and feeding back connection result information including ID information, sensor types, ID instructions and replies given by the sensors about the ID instructions to the server so that the server trains the neural network based on the updated connection result information.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.