Disclosure of Invention
In order to solve the above problems, the present invention provides a data communication method, device and system.
The purpose of the invention is realized by adopting the following technical scheme:
an embodiment of a first aspect of the present invention provides a data communication method, including:
the remote data processing device receives the collected data from the wireless sensor network communication subsystem;
the remote data processing device compares the received data with pre-stored standard data to determine whether the received data is abnormal, and when the received data is abnormal, the remote data processing device sends the abnormal data to a predetermined local device;
the wireless sensor network communication module comprises a plurality of sensor nodes responsible for acquiring data and a sink node responsible for converging the data acquired by each sensor node, and the remote data processing device is in communication connection with the sink node; the sensor nodes select a direct communication mode or an indirect communication mode according to the distance from the sink nodes to communicate with the sink nodes, the direct communication mode is that the sensor nodes directly send acquired data to the sink nodes, the indirect communication mode is that the sensor nodes send the acquired data to next hop nodes, and the next hop nodes forward the acquired data until the acquired data are sent to the sink nodes.
The embodiment is based on the wireless sensor network technology, realizes the wireless communication of data and the real-time monitoring of the data, does not need wiring, and saves manpower and material resources; through the interaction of the remote data processing apparatus with the local device, data required by the user can be presented to the user more efficiently and in more real time.
In one implementation, after the step of the remote data processing device receiving the collected data from the wireless sensor network communication subsystem, the method further comprises:
the remote data processing device saves the received data;
the remote data processing device responds to an access request of the local equipment and provides an operation interface of the stored data to the local equipment;
and the remote data processing device responds to the operation of the local equipment based on the operation interface.
In one implementation, the method further comprises:
and when the received data is abnormal, the remote data processing device displays alarm information.
The embodiment of the second aspect of the invention provides a data communication method, which comprises the following steps:
the wireless sensor network communication subsystem collects data;
the wireless sensor network communication subsystem sends acquired data to a remote data processing device, the remote data processing device compares the acquired data with pre-stored standard data to determine whether the acquired data is abnormal or not, and the remote data processing device sends the abnormal data to a predetermined local device when the acquired data is abnormal;
the wireless sensor network communication subsystem comprises a plurality of sensor nodes responsible for acquiring data and a sink node responsible for converging the data acquired by each sensor node, and the sink node is in communication connection with the remote data processing device; the sensor nodes select a direct communication mode or an indirect communication mode according to the distance from the sink nodes to communicate with the sink nodes, the direct communication mode is that the sensor nodes directly send acquired data to the sink nodes, the indirect communication mode is that the sensor nodes send the acquired data to next hop nodes, and the next hop nodes forward the acquired data until the acquired data are sent to the sink nodes.
A third aspect of the present invention provides a data communication apparatus, including a receiving module, a communication module, a processing module, and a control module, where:
the receiving module is used for receiving the collected data from the wireless sensor network communication subsystem;
the processing module is used for comparing the received data with pre-stored standard data to determine whether the received data is abnormal or not and acquiring abnormal data;
the control module is used for controlling the communication module to send the abnormal data to a predetermined user terminal;
the wireless sensor network communication subsystem comprises a plurality of sensor nodes responsible for acquiring data and a sink node responsible for converging the data acquired by each sensor node, and the communication module is used for establishing communication connection with the sink node and the user terminal; the sensor nodes select a direct communication mode or an indirect communication mode according to the distance from the sink nodes to communicate with the sink nodes, the direct communication mode is that the sensor nodes directly send acquired data to the sink nodes, the indirect communication mode is that the sensor nodes send the acquired data to next hop nodes, and the next hop nodes forward the acquired data until the acquired data are sent to the sink nodes.
In a mode of possible implementation of the third aspect of the present invention, the apparatus further includes a storage module, configured to store the received data.
In one possible implementation mode of the third aspect of the invention, the control module is further configured to:
responding to an access request of local equipment, and controlling the communication module to provide an operation interface of the stored data to the local equipment;
and responding to the operation of the local equipment based on the operation interface.
In a possible mode of the third aspect of the present invention, the apparatus further includes an alarm module configured to display alarm information when the received data is abnormal.
A fourth aspect of the present invention provides a data communication system, which includes a remote data processing apparatus, a wireless sensor network communication subsystem and a local device, and the remote data processing apparatus, the wireless sensor network communication subsystem and the local device are used for executing a data communication method as described above.
The invention has the beneficial effects that: based on the wireless sensor network technology, the wireless communication of data is realized, wiring is not needed, and manpower and material resources are saved; and through the interaction of the remote data processing device and the local equipment, the processing of the data is realized, and various data are more effectively presented to the user.
Detailed Description
The invention is further described with reference to the following examples.
Referring to fig. 1, an embodiment of a first aspect of the present invention provides a data communication method, including:
s1 the remote data processing device receives the collected data from the wireless sensor network communication subsystem.
S2 the remote data processing device compares the received data with the pre-stored standard data to determine whether the received data is abnormal, and when the received data is abnormal, the remote data processing device sends the abnormal data to a predetermined local device.
The wireless sensor network communication module comprises a plurality of sensor nodes responsible for acquiring data and a sink node responsible for converging the data acquired by each sensor node, and the remote data processing device is in communication connection with the sink node; the sensor nodes select a direct communication mode or an indirect communication mode according to the distance from the sink nodes to communicate with the sink nodes, the direct communication mode is that the sensor nodes directly send acquired data to the sink nodes, the indirect communication mode is that the sensor nodes send the acquired data to next hop nodes, and the next hop nodes forward the acquired data until the acquired data are sent to the sink nodes.
The embodiment is based on the wireless sensor network technology, realizes the wireless communication of data, does not need wiring, and saves manpower and material resources; and through the interaction of the remote data processing device and the local equipment, the processing of the data is realized, and various data are more effectively presented to the user.
In one implementation, after the step of the remote data processing device receiving the collected data from the wireless sensor network communication subsystem, the method further comprises:
the remote data processing device saves the received data;
the remote data processing device responds to an access request of the local equipment and provides an operation interface of the stored data to the local equipment;
and the remote data processing device responds to the operation of the local equipment based on the operation interface.
In one implementation, the method further comprises:
and when the received data is abnormal, the remote data processing device displays alarm information.
As shown in fig. 2, a second aspect embodiment of the present invention provides a data communication method, including:
and S01 the wireless sensor network communication subsystem collects data.
S02, the wireless sensor network communication subsystem sends the collected data to a remote data processing device, the remote data processing device compares the collected data with pre-stored standard data to determine whether the collected data is abnormal, and the remote data processing device sends the abnormal data to a predetermined local device when the collected data is abnormal;
the wireless sensor network communication subsystem comprises a plurality of sensor nodes responsible for acquiring data and a sink node responsible for converging the data acquired by each sensor node, and the sink node is in communication connection with the remote data processing device; the sensor nodes select a direct communication mode or an indirect communication mode according to the distance from the sink nodes to communicate with the sink nodes, the direct communication mode is that the sensor nodes directly send acquired data to the sink nodes, the indirect communication mode is that the sensor nodes send the acquired data to next hop nodes, and the next hop nodes forward the acquired data until the acquired data are sent to the sink nodes.
As shown in fig. 3, a third aspect of the present invention provides a data communication apparatus, which includes a receiving module 1, a communication module 2, a processing module 3, and a control module 4, wherein:
the receiving module 1 is used for receiving the collected data from the wireless sensor network communication subsystem;
the processing module 3 is used for comparing the received data with pre-stored standard data to determine whether the received data is abnormal or not and acquiring abnormal data;
the control module 4 is configured to control the communication module 2 to send the abnormal data to a predetermined user terminal;
the wireless sensor network communication subsystem comprises a plurality of sensor nodes responsible for acquiring data and a sink node responsible for converging the data acquired by each sensor node, and the communication module 2 is used for establishing communication connection with the sink node and the user terminal; the sensor nodes select a direct communication mode or an indirect communication mode according to the distance from the sink nodes to communicate with the sink nodes, the direct communication mode is that the sensor nodes directly send acquired data to the sink nodes, the indirect communication mode is that the sensor nodes send the acquired data to next hop nodes, and the next hop nodes forward the acquired data until the acquired data are sent to the sink nodes.
In a mode of possible implementation of the third aspect of the present invention, the apparatus further includes a storage module, configured to store the received data.
In a possible mode of implementation of the third aspect of the invention, the control module 4 is further configured to:
responding to an access request of local equipment, and controlling the communication module 2 to provide an operation interface of the stored data to the local equipment;
and responding to the operation of the local equipment based on the operation interface.
In a possible mode of the third aspect of the present invention, the apparatus further includes an alarm module configured to display alarm information when the received data is abnormal.
As shown in fig. 4, a fourth aspect of the present invention provides a data communication system, which includes a remote data processing apparatus 10, a wireless sensor network communication subsystem 20 and a local device 30, wherein the remote data processing apparatus 10, the wireless sensor network communication subsystem 20 and the local device 30 are configured to execute a data communication method as described above.
In the data communication method, apparatus, and system of the above embodiments, the local device includes at least one of an android device, an iOS device, a personal computer, an embedded board, and a page client.
In the data communication method, apparatus and system of the above embodiments, the sensor node selects a mode of direct communication or indirect communication according to a distance to the sink node to communicate with the sink node, specifically:
(1) setting the distances from the sensor node closest to the sink node and the sensor node next closest to the sink node as H
min0、H
min1Setting an initial distance threshold of
Initially, the distance from the sensor node to the sink node does not exceed
Selecting a mode of direct communication to communicate with the sink node more than
If so, selecting an indirect communication mode to communicate with the sink node;
(2) every other preset period DeltaT0The sink node acquires energy data and position data of each sensor node through data interaction with each sensor node, judges whether the following energy conditions are met or not according to the energy data and the position data, and if the following energy conditions are met, the sink node up-regulates the current distance threshold and broadcasts the up-regulated distance threshold to each sensor node:
wherein i represents the ith sensor node with the distance to the sink node not exceeding the current distance threshold, j represents the jth sensor node with the distance to the sink node exceeding the current distance threshold, and L1Number of sensor nodes, L, whose distance to the sink node does not exceed a current distance threshold2Number of sensor nodes for which the distance to the sink node exceeds a current distance threshold, PiIs the current remaining energy, P, of the ith sensor nodejSigma is a preset energy proportion threshold value, and the value range of sigma is) 1.25,1.35]。
In this embodiment, the initial distance threshold is set to
Ensure thatThe sensor nodes directly communicate with the sink node. The embodiment further provides an energy condition for judging whether the distance threshold needs to be adjusted upwards, so that the sensor node is switched between a direct communication mode and an indirect communication mode, and the flexibility of data communication is improved; every other preset period DeltaT
0And the sink node only performs the distance threshold value up-regulation when the energy data of each sensor node conforms to the condition, so that the energy consumption caused by unnecessary threshold value distance up-regulation is avoided.
In this embodiment, the energy condition screens out the maximum remaining energy and the minimum remaining energy when calculating the average remaining energy of the sensor node, so that the average remaining energy is calculated more accurately; the energy condition enables the sink node to increase the distance threshold value in time when the average residual energy of the sensor nodes of the accessory is lower than a certain proportion relative to the average residual energy of the sensor nodes at a distance, so that more sensor nodes are prompted to undertake the task of data forwarding, the pressure of the sensor nodes which are originally in direct communication with the sink node on the aspect of forwarding data is reduced, the phenomenon of energy holes is further favorably avoided, and the running stability of the wireless sensor network is improved.
In one embodiment, the sink node adjusts the current distance threshold up according to the following formula:
in the formula, H
T' is the distance threshold after adjustment, H
TIn order to raise the distance threshold before the adjustment,
the average value of the distances from all the sensor nodes to the sink node, the distance from which to the sink node exceeds the current distance threshold value,
the distances from all the sensor nodes to the sink node are not more than the current distance threshold valueAverage value of (d);
when H is presentTWhen the preset distance upper limit is reached or the number of times of upward adjustment reaches a preset number threshold, the upward adjustment of the distance threshold is stopped.
The present embodiment provides a distance threshold value up-regulation formula, where an average value of distances from all sensor nodes to a sink node, where the distance from the sensor nodes to the sink node exceeds a current distance threshold value, is used as an increase part of the distance threshold value, and a comparison result between a relative residual energy ratio and an energy ratio threshold value is used as an influence factor that influences the increase part of the distance threshold value, so that the increase of the distance threshold value can be changed along with the change of the residual energy of the sensor nodes, which is beneficial to making the up-regulated distance threshold value more suitable for a current network condition, and ensuring that a certain number of neighboring sensor nodes are added to a sensor node set in direct communication with the sink node.
In one embodiment, initially, a sensor node selects a sensor node closest to a sink node as a next-hop node from neighboring sensor nodes closer to the sink node; the next hop node is according to the set period delta T1Recording the current residual energy and the available cache size of the node at regular time, starting from a second period, judging whether the following early warning conditions are met by a next hop node, if so, sending feedback data to the sensor node by the next hop node, and after receiving the feedback data, selecting the sensor node closest to the next hop node as a new next hop from adjacent sensor nodes closer to a sink node relative to the sensor node after the sensor node receives the feedback data:
in the formula, P
w(u) represents the current residual energy recorded by the next hop node w in the u-th period, i.e. the current judgment period, P
w(u-1) represents the current residual energy recorded by the next hop node w in the u-1 th period, u is more than or equal to 2,
to judge the value functionWhen is coming into contact with
When the temperature of the water is higher than the set temperature,
when in use
When the temperature of the water is higher than the set temperature,
S
w(u) is the size of the available buffer recorded by the next hop node w in the u-th period, i.e. the current judgment period, S
w(u-1) the size of the available buffer recorded by the next hop node w in the u-1 th period, S
minIs the set lowest caching threshold.
The embodiment provides a feedback early warning mechanism of a next hop node, wherein an early warning condition for judging the self condition of the next hop node every other period delta T is set innovatively. In the prior art, the next hop node is usually reselected only when the current remaining energy of the next hop node is lower than the minimum energy, but in the embodiment, the early warning condition takes the energy consumption rate and the available cache condition into consideration, so that the determination of the actual condition of the next hop node is more robust and accurate.
In this embodiment, the next-hop node sends the warning message to the previous-hop sensor node when the warning condition is satisfied, so that the sensor node that receives the warning message reselects the next-hop node, which is beneficial to reducing the probability of packet loss of the next-hop node due to too fast energy consumption or insufficient future cache, and further improving the reliability and efficiency of data communication.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the system is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the system and the terminal described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
From the above description of embodiments, it is clear for a person skilled in the art that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code or any appropriate combination thereof. For a hardware implementation, a processor may be implemented in one or more of the following units: an application specific integrated circuit, a digital signal processor, a digital signal processing system, a programmable logic device, a field programmable gate array, a processor, a controller, a microcontroller, a microprocessor, other electronic units designed to perform the functions described herein, or a combination thereof. For a software implementation, some or all of the procedures of an embodiment may be performed by a computer program instructing associated hardware. In practice, the program may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer. The computer-readable medium can include, but is not limited to, random access memory, read only memory images, electrically erasable programmable read only memory or other optical disk storage, magnetic disk storage media or other magnetic storage systems, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the protection scope of the present invention, although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.