Wifi tag timing reporting system and WIFI tag transmitting method
Technical Field
The invention relates to the field of wireless sensor network communication, in particular to a Wifi tag timing reporting system and a WIFI tag transmitting method.
Background
There are roughly three major categories of products derived from RFID technology: passive RFID products, active RFID products, semi-active RFID products. Active RFID products, which have been developed slowly in recent years, have the characteristic of remote automatic identification, which determines their huge application space and market potential. The method has great application in the fields of remote automatic identification, such as intelligent prisons, intelligent hospitals, intelligent parking lots, intelligent transportation, smart cities, smart earth, Internet of things and the like. Active RFID is a special military project in this field, belonging to the remote automatic identification class. The main working frequencies of the product are ultrahigh frequency 433MHZ, microwave 2.45GHZ and microwave 5.8 GHZ.
The active tag in the prior art has the problems of short battery life, weak cruising ability and small capacity (generally within 500) of a single node; secondly, the corollary equipment of prior art is higher, and the configurability is poor.
Disclosure of Invention
The invention aims to: the Wifi tag timing reporting system and the WIFI tag transmitting method are provided, the problems that an existing active tag is short in battery life, weak in endurance capacity and small in capacity of a single node are solved, and the problems that supporting equipment in the prior art is high in total price and poor in configurability are solved.
The technical scheme adopted by the invention is as follows:
a Wifi tag timing reporting system and a WIFI tag transmitting method comprise a WIFI receiver and a plurality of WIFI tags, and are characterized in that: the WIFI tag comprises a WIFI module, a single chip microcomputer and a power supply, and the WIFI module and the power supply are connected with the single chip microcomputer;
the WIFI tag transmitting method comprises the following steps:
step 1: the single chip microcomputer is powered on, and the WIFI module is started;
step 2: the WIFI module is communicated with the WIFI receiver;
and step 3: after the communication is finished, the WIFI module sends a finishing signal to the single chip microcomputer;
and 4, step 4: the single chip microcomputer sets the sleep time and controls the WIFI module to sleep;
and 5: the singlechip sleeps;
step 6: and (5) waking up the single chip microcomputer at regular time and entering the step 1.
The Wifi tag timing reporting system and the WIFI tag transmitting method complete tag data reporting work through the cooperation of the WIFI module and the WIFI receiver, have strong configurability and short communication time, increase the safety of data reporting, have lower cost of matched equipment and have stronger practicability; the WIFI module can be controlled to be dormant and started through the cooperation of the single chip microcomputer and the WIFI module, and the single chip microcomputer is kept in a dormant state when no data is transmitted through the setting of the dormancy time, so that the electric quantity of a power supply is further saved, and the WIFI tag has good cruising ability; through the WIFI tag transmitting method, the dormancy of the single chip microcomputer is controlled in time, the dormancy of the WIFI module is controlled, and the optimal power saving effect is achieved.
Further, the specific steps of step 1 include the following steps: the single chip microcomputer is powered on, a WIFI module starting instruction and a WIFI module initialization instruction are sent, and the WIFI module is initialized. Through the initialization after the WIFI module dormancy at every turn, make the WIFI module label data transmission flow once wantonly all according to predetermineeing system work, do not receive the data influence that the preceding label data transmission flow of WIFI module produced before.
Further, the step 2 comprises the following specific steps:
step 201: the WIFI module sends tag data to a WIFI receiver;
step 202: the WIFI module receives response data from the WIFI receiver;
step 203: the WIFI module monitors response data from the WIFI receiver, and if a response is monitored, the step 204 is carried out; if the WIFI receiver does not answer, returning to the step 201, and when the step 203 is repeated and the upper limit to be preset is reached, performing the step 204;
step 204: and finishing the communication. Whether the communication is finished or not is judged by monitoring the response data, and the completeness of a tag data reporting flow is ensured; the WIFI receiver does not respond, the repeated sending of the tag data is carried out through the WIFI module, the situation that the tag data is not reported is avoided when the tag data is interfered by signals, and the accuracy of the tag data is ensured; the number upper limit of the label data is repeatedly sent through the WIFI module, and the WIFI module is guaranteed to be capable of continuously executing subsequent actions under the condition of interference or fault.
Further, the specific steps of step 3 include:
s301: the single chip microcomputer is set to be in normal sleep time and abnormal sleep time;
s302: judging the reason for finishing the communication according to the communication process in the step 203, if the single chip microcomputer adopts the normal sleep time under the condition of monitoring the response in the step 203; if the upper limit to be preset is reached by repeating the step 203, the singlechip adopts abnormal sleep time;
s303: and sending a dormancy instruction to the WIFI module, and enabling the WIFI module to be dormant. Through setting up respectively of normal dormancy time and unusual dormancy time, unusual dormancy time is shorter than normal dormancy time, and after short unusual dormancy time, the singlechip awakens up, and then awakens up the WIFI module, resumes the process of reporting, guarantees the promptness of reporting.
Further, the WIFI label still includes the wake-up switch, power and singlechip all are connected with the wake-up switch. The WIFI module not only can be wakened up by the timer of the single chip microcomputer, but also can be physically wakened up by the wakening-up switch, and when a user needs to report on the WIFI label, the switch can be wakened up by the wakening-up switch to physically waken up, so that the purpose of timely use is achieved.
Further, a step of simulating an MAC address is also included between step 1 and step 201, where the step of simulating an MAC address includes that the WIFI receiver and the WIFI module respectively simulate a first virtual MAC address and a second virtual MAC address, and the first virtual MAC address and the second virtual MAC address respectively replace an initial MAC address of the WIFI receiver and an initial MAC address of the WIFI module for communication; the WIFI receiver is set to only receive tag data from the second virtual MAC address, and the WIFI module is set to only accept response data made by the WIFI receiver from the first virtual MAC address. By simulating the first virtual MAC address and the second virtual MAC address and limiting the communication MAC of the WIFI receiver and the WIFI module, even if multiple systems are arranged in the same region, the mutual influence among different systems can be prevented; the Wifi tags in the same system communicate with the WIFI receiver through the second virtual MAC which is used, only the communication messages are different, so that all WIFI modules are the same MAC address in the view of the WIFI receiver, and the number of the WIFI tags received by the WIFI receiver is not limited.
Further, the step 2 further comprises: in step 201, the WIFI module encrypts the tag data, and the WIFI receiver decrypts the tag data after receiving the tag data, so as to protect the tag data well and prevent the tag data from being maliciously acquired by others.
In summary, due to the adoption of the technical scheme, the invention has the beneficial effects that:
1. the Wifi tag timing reporting system and the WIFI tag transmitting method complete tag data reporting work through the cooperation of the WIFI module and the WIFI receiver, have strong configurability and short communication time, increase the safety of data reporting, have lower cost of matched equipment and have stronger practicability;
2. according to the Wifi tag timing reporting system and the WIFI tag transmitting method, the WIFI module can be controlled to be dormant and started through the cooperation of the single chip microcomputer and the WIFI module, the single chip microcomputer is kept in a dormant state when no data is transmitted through the setting of dormancy time, the electric quantity of a power supply is further saved, and the WIFI tag has good cruising ability;
3. the Wifi tag timing reporting system and the WIFI tag transmitting method timely control the single chip microcomputer to sleep and control the WIFI module to sleep through the WIFI tag transmitting method, and therefore the optimal power saving effect is achieved.
4. According to the Wifi tag timing reporting system and the WIFI tag transmitting method, the first virtual MAC address and the second virtual MAC address are simulated, and the communication MAC of the WIFI receiver and the communication MAC of the WIFI module are limited, so that even if multiple systems are arranged in the same area, the mutual influence among different systems can be prevented; the Wifi tags in the same system communicate with the WIFI receiver through the second virtual MAC which is used, only communication messages are different, so that all WIFI modules are the same MAC address in the view of the WIFI receiver, the number of the WIFI tags received by the WIFI receiver is not limited, and the problem of small capacity of a single node is solved.
5. Compared with the RFID tag, the WIFI tag can communicate with the WIFI receiver without directional limitation in the coverage area of the receiver, and can generally use a mode of cascading the WIFI receiver to expand the coverage area, so that tag data can be rapidly reported in a use scene with a large area.
Drawings
The invention will now be described, by way of example, with reference to the accompanying drawings, in which:
fig. 1 is a flowchart of a WIFI tag transmission method of the present invention;
FIG. 2 is an electrical connection diagram of the single chip of the present invention;
fig. 3 is an electrical connection diagram of the WIFI module of the present invention.
Detailed Description
All of the features disclosed in this specification, or all of the steps in any method or process so disclosed, may be combined in any combination, except combinations of features and/or steps that are mutually exclusive.
The present invention will be described in detail with reference to fig. 1 to 3.
Example one
A Wifi tag timing reporting system and a WIFI tag transmitting method comprise a WIFI receiver and a plurality of WIFI tags, and are characterized in that: the WIFI tag comprises a WIFI module, a single chip microcomputer and a power supply, and the WIFI module and the power supply are connected with the single chip microcomputer;
the WIFI module selects an ESP8266 module;
the single chip microcomputer is STM8L 101;
the WIFI tag transmitting method comprises the following steps:
step 1: the single chip microcomputer is powered on, and the WIFI module is started;
step 2: the WIFI module is communicated with the WIFI receiver;
and step 3: after the communication is finished, the WIFI module sends a finishing signal to the single chip microcomputer;
and 4, step 4: the single chip microcomputer sets the sleep time and controls the WIFI module to sleep;
and 5: the singlechip sleeps;
step 6: and (5) waking up the single chip microcomputer at regular time and entering the step 1.
Compared with the RFID tag, the WIFI tag can communicate with the WIFI receiver without directional limitation in the coverage range of the receiver, and can generally use a mode of cascading the WIFI receiver to enlarge the coverage range, so that tag data can be rapidly reported when the WIFI tag is applied to a use scene with a large area; the tag data reporting work is completed through the cooperation of the WIFI module and the WIFI receiver, the configurability is strong, the communication time is short, the data reporting safety is improved, the cost of matched equipment is low, and the practicability is high; the WIFI module can be controlled to be dormant and started through the cooperation of the single chip microcomputer and the WIFI module, and the single chip microcomputer is kept in a dormant state when no data is transmitted through the setting of the dormancy time, so that the electric quantity of a power supply is further saved, and the WIFI tag has good cruising ability; through the WIFI tag transmitting method, the dormancy of the single chip microcomputer is controlled in time, the dormancy of the WIFI module is controlled, and the optimal power saving effect is achieved.
Specifically, the tag data is stored in the WIFI module, and the sleep time of the single chip microcomputer is set; electrifying the single chip microcomputer through a power supply, and further sending a starting instruction to the WIFI module, and starting the WIFI module; the WIFI receiver continuously monitors signals transmitted from the WiFi tag in an effective range through a broadcast mode, verifies whether the signals are legal link establishment applications according to the requirements of a communication protocol, and executes communication with the WIFI module; receiving an ending signal from the WIFI module through the single chip microcomputer, and controlling the WIFI module to sleep; the single chip microcomputer starts to sleep and wake up at regular time, and then wakes up the WIFI module in the sleep state, and restarts a reporting process.
Example two
On the basis of the first embodiment, the specific steps of the step 1 include the following steps: the single chip microcomputer is powered on, a WIFI module starting instruction and a WIFI module initialization instruction are sent, and the WIFI module is initialized. Through the initialization after the WIFI module dormancy at every turn, make the WIFI module label data transmission flow once wantonly all according to predetermineeing system work, do not receive the data influence that the preceding label data transmission flow of WIFI module produced before.
EXAMPLE III
On the basis of the above embodiment, the step 2 includes the following specific steps:
step 201: the WIFI module sends tag data to a WIFI receiver;
step 202: the WIFI module receives response data from the WIFI receiver;
step 203: the WIFI module monitors response data from the WIFI receiver, and if a response is monitored, the step 204 is carried out; if the WIFI receiver does not answer, returning to the step 201, and when the step 203 is repeated and the upper limit to be preset is reached, performing the step 204;
step 204: and finishing the communication. Whether the communication is finished or not is judged by monitoring the response data, and the completeness of a tag data reporting flow is ensured; the WIFI receiver does not respond, the repeated sending of the tag data is carried out through the WIFI module, the situation that the tag data is not reported is avoided when the tag data is interfered by signals, and the accuracy of the tag data is ensured; the number upper limit of the label data is repeatedly sent through the WIFI module, and the WIFI module is guaranteed to be capable of continuously executing subsequent actions under the condition of interference or fault.
Further, the specific steps of step 3 include:
s301: the single chip microcomputer is set to be in normal sleep time and abnormal sleep time;
s302: judging the reason for finishing the communication according to the communication process in the step 203, if the single chip microcomputer adopts the normal sleep time under the condition of monitoring the response in the step 203; if the upper limit to be preset is reached by repeating the step 203, the singlechip adopts abnormal sleep time;
s303: and sending a dormancy instruction to the WIFI module, and enabling the WIFI module to be dormant. Through setting up respectively of normal dormancy time and unusual dormancy time, unusual dormancy time is shorter than normal dormancy time, and after short unusual dormancy time, the singlechip awakens up, and then awakens up the WIFI module, resumes the process of reporting, guarantees the promptness of reporting.
Example four
On the basis of the embodiment, the WIFI tag further comprises a wake-up switch, and the power supply and the single chip microcomputer are connected with the wake-up switch. The WIFI module not only can be wakened up by the timer of the single chip microcomputer, but also can be physically wakened up by the wakening-up switch, and when a user needs to report on the WIFI label, the switch can be wakened up by the wakening-up switch to physically waken up, so that the purpose of timely use is achieved.
EXAMPLE five
On the basis of the above embodiment, a step of simulating an MAC address is further included between step 1 and step 201, where the step of simulating an MAC address includes that the WIFI receiver and the WIFI module respectively simulate a first virtual MAC address and a second virtual MAC address, and the first virtual MAC address and the second virtual MAC address respectively replace an initial MAC address of the WIFI receiver and an initial MAC address of the WIFI module for communication; the WIFI receiver is set to only receive tag data from the second virtual MAC address, and the WIFI module is set to only accept response data made by the WIFI receiver from the first virtual MAC address. By simulating the first virtual MAC address and the second virtual MAC address and limiting the communication MAC of the WIFI receiver and the WIFI module, even if multiple systems are arranged in the same region, the mutual influence among different systems can be prevented; the Wifi tags in the same system communicate with the WIFI receiver through the second virtual MAC which is used, only communication messages are different, so that all WIFI modules are the same MAC address in the view of the WIFI receiver, the number of the WIFI tags received by the WIFI receiver is not limited, and the problem of small capacity of a single node is solved.
EXAMPLE six
On the basis of the above embodiment, the step 2 further includes: in step 201, the WIFI module encrypts the tag data, and the WIFI receiver decrypts the tag data after receiving the tag data, so as to protect the tag data well and prevent the tag data from being maliciously acquired by others.
The above description is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be made by those skilled in the art without inventive work within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope defined by the claims.