Data acquisition system and data acquisition method
Technical Field
The invention relates to the technical field of wireless personal area networks, in particular to a data acquisition system and a data acquisition method.
Background
Wireless Personal Area Network (WPAN) is a Personal Area Network that uses Wireless connectivity. It is used for communication between devices such as telephones, computers, accessory devices, and digital assistants in small areas (wireless personal area networks typically operate within 10 meters). Technologies that support wireless personal area networks include: bluetooth technology, ZigBee technology (ZigBee), ultra wideband technology (UWB), Infrared data association (IrDA), home radio frequency technology (HomeRF), etc., wherein bluetooth technology is most widely used in wireless personal area networks.
The existing mobile terminal field has gradually started to popularize the WPAN technology, i.e., the mobile terminal is used as a master device, and other attached data acquisition devices, such as wristbands for monitoring heartbeat conditions, and storage devices for storing data therein, etc., are used as slave devices and are respectively connected to the mobile terminal as the master device through the WPAN network. By applying the technology, the wireless connection between the terminal in a smaller area can be realized to replace the traditional wired connection, the connection mode is more flexible, the size is smaller, and the operation is more convenient.
However, for a conventional WPAN network, different slave devices may generate signal interference with each other when in use, which affects the user experience.
Disclosure of Invention
According to the problems in the prior art, the technical scheme of the data acquisition system and the data acquisition method is provided, which aims to avoid signal interference among devices and reduce the energy consumption of slave devices in a mode of monitoring the channel condition and issuing a data reading request by a master device; the technical scheme specifically comprises the following steps:
a data acquisition system comprises a main device and a plurality of slave devices, wherein the main device is connected with the slave devices in a wireless personal area network to realize data interactive transmission;
the main device includes:
the system comprises a spectrum measuring unit, a signal strength threshold value and a signal strength comparison unit, wherein the spectrum measuring unit is used for measuring the spectrum of a communication channel, comparing the measured received signal strength corresponding to the communication channel with the signal strength threshold value and outputting a corresponding comparison result;
a request sending unit, connected to the spectrum measuring unit, for selecting one of the communication channels with the received signal strength lower than the signal strength threshold value according to the comparison result, and continuously sending a data reading request requesting to acquire corresponding real-time data to all the slave devices;
a data receiving unit, configured to receive the real-time data continuously returned by the slave device through the selected communication channel;
the fitting unit is connected with the data receiving unit and used for fitting to form a change curve related to the real-time data according to all the real-time data received by the data receiving unit and from the same slave device and outputting a corresponding fitting result;
the display unit is connected with the fitting unit and used for displaying the change curve formed by fitting;
the slave device comprises:
the data acquisition unit is used for continuously acquiring corresponding real-time data;
a request receiving unit, configured to continuously receive the data reading request issued by the master device through the selected communication channel;
and the data sending unit is respectively connected with the data acquisition unit and the request receiving unit and is used for continuously sending the corresponding real-time data acquired by the data acquisition unit to the main equipment through the selected communication channel according to the data reading request.
Preferably, the data acquisition system, wherein the slave device further comprises:
the data transmission unit is used for calling the corresponding real-time data from the storage unit according to the data reading request and transmitting the real-time data to the main equipment;
and the data management unit is respectively connected with the storage unit and the data sending unit and is used for clearing the sent real-time data from the storage unit after the real-time data is sent once.
Preferably, the data acquisition system, wherein the data acquisition unit further includes:
and the time stamp adding module is used for adding corresponding time stamp information to the acquired real-time data, and the time stamp information is used for indicating the acquisition time of the real-time data.
Preferably, the data acquisition system further includes, in the fitting unit:
the first judgment module is used for judging the acquisition time of the real-time data according to the timestamp information corresponding to the received real-time data and outputting a corresponding first judgment result;
and the fitting unit is used for sequentially arranging and fitting all the received real-time data from the same slave equipment according to the first judgment result and the acquisition time to form and output the corresponding change curve.
Preferably, the data acquisition system further includes, in the fitting unit:
the second judgment module is connected with the first judgment module and used for comparing the acquisition time of the currently received real-time data with the acquisition time of the previously received real-time data from the same slave device according to the first judgment result and outputting a corresponding second judgment result;
and the fitting unit judges the real-time data of which the acquisition time is earlier than the previous real-time data as historical data according to the second judgment result, updates the corresponding change curve formed by fitting according to the historical data and outputs the change curve.
Preferably, the data acquisition system, wherein the slave device further comprises:
the timing awakening unit is connected with the request receiving unit and comprises a preset awakening period;
and the timing awakening unit controls the request receiving unit to be periodically started and receive the data reading request according to the awakening period.
Preferably, in the data acquisition system, the main device is disposed in a mobile terminal.
A data acquisition method comprises a main device and a plurality of slave devices, wherein the main device realizes data interactive transmission with the slave devices in a wireless personal area network connection mode;
the data acquisition method comprises the following steps:
step S1, the main device measures the frequency spectrum of the communication channel, compares the detected received signal strength corresponding to the communication channel with a preset signal strength threshold value, and outputs the corresponding comparison result;
step S2, the master device selects one of the communication channels with the received signal strength lower than the signal strength threshold according to the comparison result, and sends corresponding data reading requests to all the slave devices through the selected communication channel;
step S3, the slave device receives the data reading request and sends corresponding real-time data to the master device through the communication channel;
and step S4, the master device fits all the real-time data from the same slave device to form a change curve associated with the real-time data according to the collection time of the received real-time data, and displays the change curve.
Preferably, in the data acquisition method, the step S3 specifically includes:
step S31, the slave device collects the real-time data and adds a corresponding time stamp information to each real-time data to indicate the collection time of the real-time data;
step S32, the slave device saves the collected real-time data and the corresponding timestamp information;
step S33, after receiving the data reading request, the slave device sends the stored real-time data and the corresponding timestamp information to the master device.
Preferably, in the data acquisition method, in step S33, the slave device deletes the transmitted real-time data each time the slave device finishes transmitting the stored real-time data.
Preferably, in the data acquisition method, in step S3, the slave device wakes up every preset wake-up period and receives the data read request.
Preferably, in the data acquisition method, in step S4, the master device determines an acquisition time of each piece of real-time data according to timestamp information corresponding to the piece of real-time data;
and the master equipment sequentially arranges and fits all the received real-time data from the same slave equipment according to the acquisition time to form and output the corresponding change curve.
Preferably, in the data acquisition method, in step S4, after the corresponding change curve is formed by fitting, the master device continues to receive the real-time data, and determines the acquisition time of each piece of real-time data according to the timestamp information corresponding to the real-time data;
the master device compares the acquisition time of the currently received real-time data with the acquisition time of the previously received real-time data from the same slave device, and judges the real-time data of which the acquisition time is earlier than the previous real-time data as historical data;
and the main equipment updates the corresponding change curve formed by fitting according to the historical data and displays the change curve.
Preferably, in the data acquisition method, the main device is disposed in a mobile terminal. Preferably, the data acquisition system, wherein the slave device further comprises:
the beneficial effects of the above technical scheme are:
1) the master device carries out spectrum measurement and judges the channel condition, so that the energy consumption of the slave device is reduced;
2) requesting to read data by the master device, and reducing invalid data transmission of the slave device;
3) timestamp information is added in data acquisition, and the main equipment can be fitted to form a corresponding change curve according to the timestamp information, so that the influence caused by unreliable networks can be reduced, and the use experience of users is improved.
Drawings
FIG. 1 is a schematic diagram of a mobile terminal applied to a WPAN network according to a preferred embodiment of the present invention;
FIG. 2 is a schematic diagram of a data acquisition system according to a preferred embodiment of the present invention;
FIG. 3 is a schematic diagram of a variation curve formed by fitting in accordance with a preferred embodiment of the present invention;
fig. 4-5 are schematic flow charts of a data acquisition method according to a preferred embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The invention is further described with reference to the following drawings and specific examples, which are not intended to be limiting.
In the prior art, the WPAN network is applied to the occasion where the mobile terminal is connected to other slave devices, so that the use efficiency between the terminal and the terminal can be improved, and the operation is more convenient. However, a typical problem when the WPAN network is used is that there are multiple wireless communication standards in an ISM Band (Industrial Scientific Medical Band ), and when different devices operate, the heterogeneous networks cannot be uniformly interfered and coordinated, which causes a problem of mutual signal interference between the devices, thereby making the WPAN network unreliable.
Another typical problem of the WPAN is that data transmission between devices is low, and the slave devices need to periodically transmit data to the master device, which results in high power consumption of the slave devices, and high transmission efficiency due to the fact that the slave devices also transmit invalid data.
In view of the above-mentioned drawbacks, a data acquisition system is provided in a preferred embodiment of the present invention.
In a preferred embodiment of the invention, the data acquisition system comprises a master device and a plurality of slave devices, wherein the master device performs data interactive transmission with the plurality of slave devices in a Wireless Personal Area Network (WPAN) mode.
In a preferred embodiment of the present invention, the network topology structure of the data acquisition system is shown in fig. 1, that is, each slave device 2 is connected to the master device 1, each slave device 2 is also connected to only the master device 1, and a star-shaped network topology structure is formed between the master device 1 and the slave device 2.
In a preferred embodiment of the present invention, as shown in fig. 2, the data acquisition system specifically includes a master device 1 and a plurality of slave devices 2 (only one master device and one slave device and their connection relationships are shown in fig. 2).
In a preferred embodiment of the present invention, the master device 1 includes:
a spectrum measuring unit 11. In a preferred embodiment of the present invention, the spectrum measurement unit 11 is used for performing spectrum measurement, and in particular, for detecting the received signal strength of a communication channel in the WPAN network. In a preferred embodiment of the present invention, the spectrum measuring unit 11 includes a preset signal strength threshold, and the spectrum measuring unit 11 compares the measured received signal strength corresponding to each communication channel with the preset signal strength threshold and outputs a corresponding comparison result.
In a preferred embodiment of the present invention, when the received signal strength of a certain communication channel is lower than a preset signal strength threshold, it indicates that the communication channel is in an "idle" state at this time, and no other device or only a few other devices occupy the communication channel for data transmission, that is, the signal interference for data transmission on the communication channel is small.
In a preferred embodiment of the present invention, the measurement mode of the spectrum measuring unit 11 can be set by the user, for example:
periodically measuring all communication channels; or,
when a certain trigger condition is fulfilled, e.g. when the master device is awake, spectrum measurements are made on all communication channels to obtain the corresponding received signal strength.
Since various spectrum measurement modes can be implemented according to the prior art, the present invention aims to obtain the received signal strength of the current communication channel through spectrum measurement, and does not aim at how to perform spectrum measurement, and therefore, the technical solution of the present invention is not limited to the mode of spectrum measurement.
In a preferred embodiment of the present invention, the main device 1 further includes:
and a request transmitter 12 connected to the spectrum measuring unit 11. In a preferred embodiment of the present invention, the request sending unit 12 receives the comparison result of the spectrum measuring unit 11, and when it is determined that a certain communication channel is in an "idle" state (i.e. the received signal strength of the communication channel is lower than a preset signal strength threshold), selects the communication channel, and continuously sends the corresponding data reading request to all the slave devices through the selected communication channel.
In a preferred embodiment of the present invention, the method for sending the data read request may include a plurality of methods, for example:
sending corresponding data reading requests to connected slave devices in a preset sequence turn; or
And sending corresponding data reading requests to different slave devices in sequence according to the degree of the data demand of the master device 1.
Since various manners of sending a data read request in a WPAN network environment can be implemented according to the prior art, the present invention aims to send a data read request to a slave device when a communication channel is idle, and does not aim at how to send the data read request, and therefore, the manner of sending the data read request is not limited in the technical solution of the present invention.
In a preferred embodiment of the present invention, when determining that a certain communication channel is in an "idle" state, the request sending unit 12 continuously sends a data reading request to the slave device through the communication channel, that is, continuously sends the data reading request within a preset time period, so as to continuously obtain corresponding returned real-time data, and thus, the change condition of the real-time data along with the acquisition time is presented to the user.
In a preferred embodiment of the present invention, the main device 1 further includes:
a data receiving unit 13. In a preferred embodiment of the invention, the data receiving unit is configured to receive real-time data returned by the slave device in response to a corresponding data read request.
And a fitting unit 14 connected to the data receiving unit 13. In a preferred embodiment of the present invention, the fitting unit 14 is configured to fit all the real-time data to form a variation curve associated with the real-time data according to the collection time of the returned real-time data.
Further, in the preferred embodiment of the present invention, the fitting unit 14 fits all the real-time data returned from the same slave device to form the above-mentioned variation curve. For example, the host device fits real-time data (which may be pulse values) from a heart monitoring wristband to form a corresponding pulse versus acquisition time curve.
In a preferred embodiment of the present invention, the fitting to form the curve may include interpolation or extrapolation.
In the preferred embodiment of the present invention, the real-time data returned from the device includes time stamp information indicating the time of acquisition thereof, and accordingly, the fitting unit 14 includes:
a first judging unit 141. In a preferred embodiment of the present invention, the first determining unit 141 is configured to determine the collecting time according to the timestamp information included in the real-time data, and output a corresponding first determination result;
the second determining unit 142 is connected to the first determining unit 141. In a preferred embodiment of the present invention, the second determining unit 142 further determines whether the collection time of the currently received real-time data (hereinafter, referred to as the current collection time) is earlier than the collection time of the previously received real-time data from the same slave device (hereinafter, referred to as the previous collection time) according to the first determination result. Namely, whether the currently received real-time data is historical data is judged. In a preferred embodiment of the present invention, if the current collecting time is earlier than the previous collecting time, the second determining unit 142 determines the currently received real-time data as the historical data, and outputs a corresponding second determining result.
In a preferred embodiment of the present invention, the fitting unit 14 sequentially arranges the real-time data from the same slave device according to the first determination result and the second determination result, and fits the real-time data according to the arrangement order to form a variation curve associated with the real-time data. As shown in fig. 3, three discrete points marked as 31 on the coordinate axis are respectively the acquired real-time data, and the acquired real-time data are sequentially arranged according to the acquisition time of the several real-time data, and are fitted to form a smooth change curve 32 to represent the change trend of the acquired real-time data.
In a preferred embodiment of the present invention, when the currently received real-time data is judged to be historical data according to the second judgment result, the corresponding change curve formed by fitting is updated according to the historical data. For example, the historical data is inserted into the coordinate axis shown in fig. 3 according to the acquisition time of the historical data, and the corresponding change curve is formed according to the updating of all the reconstructed discrete data points.
In a preferred embodiment of the present invention, the main device 1 further includes:
and a display unit 15 connected to the fitting unit 14. In a preferred embodiment of the present invention, the display unit 15 is used for displaying the variation curve. Further, in the preferred embodiment of the present invention, the display unit 15 can display various display modes, such as directly displaying the variation curve as shown in fig. 3, or displaying the variation curve in other graph forms.
In a preferred embodiment of the present invention, as shown in fig. 2, the slave device 2 includes:
a data acquisition unit 21. In a preferred embodiment of the present invention, the data acquisition unit 21 continuously acquires real-time data, and the acquisition process is independent of the data reading request sent by the host device 1.
In a preferred embodiment of the present invention, the data acquisition unit 21 further comprises:
a timestamp adding module 211. In a preferred embodiment of the present invention, the timestamp adding module 211 is configured to add corresponding timestamp information to each acquired real-time data to indicate a time of acquisition of the real-time data.
And a storage unit 22 connected to the data acquisition unit 21. In the preferred embodiment of the present invention, the storage unit 22 is used for storing the acquired real-time data and the corresponding time stamp information.
A request receiving unit 23. In a preferred embodiment of the present invention, the request receiving unit 23 is configured to receive a corresponding data reading request sent by the master device through the selected communication channel.
In the preferred embodiment of the present invention, the slave device 2 further comprises a timed wakeup unit 24 connected to the request receiving unit 23. In the preferred embodiment of the present invention, the request receiving unit 23 is in a sleep state by default, and the timed wake-up unit 24 includes a predetermined wake-up period. The timing wakeup unit 24 wakes up the request receiving unit 23 every other wakeup period, checks whether there is a data reading request sent by the master device when the request receiving unit 23 is woken up, and enters the sleep state again after the checking is finished. In other words, in the preferred embodiment of the present invention, the slave device 2 is not always in a state ready to receive a data read request, but is in a sleep state by default, and is woken up every predetermined wake-up period and checks whether there is a data read request, and after checking, the slave device enters the sleep state again after finding that there is no corresponding data read request. The arrangement is favorable for reducing the energy consumption of the slave equipment and reducing the operation cost of the data acquisition system.
In a preferred embodiment of the present invention, the slave device 2 further includes:
the data transmitting unit 25 is connected to the request receiving unit 23 and the storage unit 22, respectively. In a preferred embodiment of the present invention, after the request receiving unit 23 receives the data reading request, the data sending unit 25 is controlled to send the corresponding real-time data stored in the storage unit 22 to the host device 1 through the selected communication channel.
In a preferred embodiment of the present invention, the data transmission unit 25 transmits real-time data with time stamp information to the master device 1.
In a preferred embodiment of the present invention, the slave device 2 further includes a data management unit 26 connected to the data transmission unit 25. The data management unit 26 is also connected to the storage unit 22.
In the preferred embodiment of the present invention, the data management unit 26 is configured to delete the transmitted real-time data from the storage unit 22 after the data transmission unit 25 completes one transmission of the real-time data. In other words, in the preferred embodiment of the present invention, data is collected from the slave device, and a queue to be sent of real-time data is established. And after one-time transmission is finished, updating the queue to be transmitted, including deleting the transmitted real-time data and the like.
In summary, the present invention aims to:
a star-shaped wireless personal area network structure is formed between the master device and the slave device;
the master device actively monitors the received signal strength of all communication channels in the local area network (i.e. performs spectrum measurement), and finds and selects a communication channel (i.e. a communication channel in an "idle" state) whose received signal strength is lower than a predetermined signal strength threshold; the master device sends a data read request to all slave devices through the selected communication channel. The mode that the main equipment actively monitors and sends the request is adopted, invalid data sending caused by signal interference of the slave equipment is reduced, and the data transmission efficiency in the wireless personal area network is improved;
the slave device adds time stamp information representing the collection time when collecting data; the main equipment fits the real-time data to form a corresponding change curve according to the timestamp information and displays the change curve to a user; the processing and displaying mode can be used for a user to visually check and master the change condition of the real-time data, and the use experience is improved.
In a preferred embodiment of the present invention, the main device 1 is disposed inside a mobile terminal. For example, in a wireless personal area network, a mobile terminal is connected as a master device 1, and other slave devices such as a heart monitoring wrist band are connected as slave devices.
In a preferred embodiment of the present invention, as shown in fig. 4, a data acquisition method based on the data acquisition system is provided, which specifically includes:
step S1, the main device measures the frequency spectrum of the communication channel, compares the detected received signal strength of the corresponding communication channel with a preset signal strength threshold value, and outputs the corresponding comparison result;
in the preferred embodiment of the present invention, if the received signal strength of a communication channel is lower than the predetermined signal strength threshold, it indicates that the communication channel has less signal interference, and the method can be used,
Step S2, the master device selects a communication channel with the received signal strength lower than the signal strength threshold value according to the comparison result, and sends corresponding data reading requests to all slave devices through the selected communication channel;
in the preferred embodiment of the present invention, the master device selects a communication channel with less signal interference (i.e. in an "idle" state), and performs data interactive transmission with the slave device by using the selected communication channel;
in a preferred embodiment of the present invention, the master device sends the corresponding data reading request to the slave device through the communication channel with less signal interference, so as to avoid the influence of the signal interference on the data transmission efficiency.
Step S3, the slave device receives the data reading request and sends the corresponding real-time data to the master device through the communication channel;
the process of receiving requests from devices and sending data is described in more detail below.
And step S4, the master device fits all the real-time data from the same slave device to form a change curve associated with the real-time data according to the acquisition time of the received real-time data, and displays the change curve.
In a preferred embodiment of the present invention, as described above, the master device determines the acquisition time of the real-time data according to the timestamp information attached to the real-time data, and sequentially arranges the real-time data from the same slave device according to the acquisition time of the real-time data, and fits the real-time data to form a corresponding change curve. The master device displays the variation curve.
In a preferred embodiment of the present invention, as also described above, the master device determines whether the real-time data is historical data according to the acquisition time of the real-time data, and updates the variation curve that has been formed by fitting according to the real-time data determined as historical data.
In a preferred embodiment of the present invention, as shown in fig. 5, the step S3 specifically includes:
step S31, acquiring real-time data from the equipment, and adding a corresponding time stamp information to each piece of real-time data to indicate the acquisition time of the real-time data;
step S32, the slave device saves the collected real-time data and the corresponding timestamp information;
step S33, after receiving the data reading request, the slave device sends the stored real-time data and the corresponding timestamp information to the master device.
In a preferred embodiment of the present invention, the slave device is in a sleep state by default, and is controlled to be woken up in a preset wake-up period, and when the slave device is woken up, the slave device checks whether the master device sends a corresponding data reading request, and if not, the slave device enters the sleep state again, and is woken up every other preset wake-up period, and so on, so as to achieve the purpose of periodically wakening up, and save energy consumption of the slave device.
In a preferred embodiment of the present invention, the real-time data collected from the device is stored in the storage unit, that is, a data queue to be sent is established in the storage unit. After the slave device completes one-time data transmission, the data queue to be transmitted is updated, that is, the real-time data which is already transmitted is removed from the data queue to be transmitted, so as to ensure that the real-time data is not repeatedly transmitted.
In a preferred embodiment of the present invention, the main device is disposed in a mobile terminal.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.