CN111279728B - Internet of things data acquisition and packaging device and method - Google Patents

Internet of things data acquisition and packaging device and method Download PDF

Info

Publication number
CN111279728B
CN111279728B CN202080000215.7A CN202080000215A CN111279728B CN 111279728 B CN111279728 B CN 111279728B CN 202080000215 A CN202080000215 A CN 202080000215A CN 111279728 B CN111279728 B CN 111279728B
Authority
CN
China
Prior art keywords
data
time
acquisition
packet
sensor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202080000215.7A
Other languages
Chinese (zh)
Other versions
CN111279728A (en
Inventor
焦旭
安宣梓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing micro digital technology Co., Ltd
Original Assignee
Beijing Micro Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Micro Digital Technology Co Ltd filed Critical Beijing Micro Digital Technology Co Ltd
Publication of CN111279728A publication Critical patent/CN111279728A/en
Application granted granted Critical
Publication of CN111279728B publication Critical patent/CN111279728B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/38Services specially adapted for particular environments, situations or purposes for collecting sensor information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

The invention relates to a data acquisition and packaging device for the Internet of things, which comprises an acquisition unit, a processing unit and a transmission unit, wherein: the acquisition unit acquires sensor data of a group of sensors in the sensor array according to a preset time interval and packages the sensor data into a data frame; the processing unit receives the data frames from the acquisition unit and packs more than one data frame into a first data packet; the transmission unit receives the first data packet from the processing unit, encapsulates more than one first data packet into a second data packet, and transmits the second data packet. The invention also provides a method for acquiring and packaging the data of the Internet of things. According to the device and the method for acquiring and packaging the data of the Internet of things, a sensor array is not required to be provided with a local clock, and the application range is wider.

Description

Internet of things data acquisition and packaging device and method
Technical Field
The invention belongs to the technical field of information, and particularly relates to a device and a method for acquiring and packaging data of an Internet of things.
Background
In the process of synchronously acquiring data of the sensor network, in order to ensure synchronous data acquisition, time synchronization needs to be maintained among the sensor nodes of the sensor network. For this purpose, it is common practice in the prior art to equip each sensor node with a local clock.
However, equipping each sensor node with a local clock results in a very complex and costly sensor network. If each sensor node is not equipped with a local clock, whether data is lost or not can not be effectively detected, namely, a better standard for preventing data loss can not be achieved.
Disclosure of Invention
In order to solve the problems, the data acquisition and packing device and method are designed aiming at the situation that the sensor node is not provided with the local clock, so that synchronous acquisition of sensor data is realized, and whether the data are lost or not is convenient to detect.
According to the device and the method for acquiring and packaging the data of the Internet of things, synchronous data acquisition is carried out on each sensor of the sensor array through the device and the method for acquiring and packaging the data acquired to form transmission data packets, and packet information such as timestamps and sequence numbers in each transmission data packet is determined. And then, at a receiving end of the data packet, detecting the data packet according to packet information in the data packet, determining whether the data packet is lost, and further judging whether the data acquisition and packaging device of the Internet of things works abnormally.
According to a first aspect of the present invention, an internet of things data acquiring and packaging device is provided, which includes an acquisition unit, a processing unit and a transmission unit, wherein:
the acquisition unit acquires sensor data of a group of sensors in the sensor array according to a preset time interval and packages the sensor data into a data frame;
the processing unit receives the data frames from the acquisition unit and packages more than one data frame into a first data packet, wherein the first data packet comprises a first original timestamp and a first sequence number;
the transmission unit receives the first data packet from the processing unit, encapsulates more than one first data packet into a second data packet and sends the second data packet, wherein the second data packet comprises a second original timestamp and a second sequence number.
According to a second aspect of the present invention, there is provided a method for acquiring and encapsulating data of an internet of things, including:
acquiring sensor data of a group of sensors in a sensor array according to a preset time interval, and packaging the sensor data into a data frame;
packing more than one data frame into a first data packet, wherein the first data packet comprises a first original timestamp and a first sequence number;
and encapsulating more than one first data packet into a second data packet and transmitting the second data packet, wherein the second data packet comprises a second original timestamp and a second sequence number.
By the Internet of things data acquisition and packaging device and method, synchronous acquisition of each sensor in the sensor array can be realized under the condition that the sensor in the sensor array is not provided with a local clock, package information such as a timestamp and a serial number required by packaging is determined, and subsequent data detection is facilitated. The scheme provided by the invention does not need a sensor array to be provided with a local clock, and has wider application range.
Drawings
For further clarity of explanation of the features and technical content of the present invention, reference should be made to the following detailed description of the present invention and accompanying drawings, which are provided for reference and description purposes only and are not intended to limit the present invention.
In the following drawings:
FIG. 1 is a schematic diagram of a signal acquisition sensor array according to one embodiment.
FIG. 2 is a cross-sectional view of the signal acquisition sensor array of FIG. 1 according to one embodiment.
Fig. 3 is a schematic view of an application scenario of the data acquisition and packaging device of the internet of things according to an embodiment of the present invention.
Fig. 4 is a flowchart of a method for acquiring and packaging data of the internet of things according to an embodiment of the invention.
Fig. 5 is a flowchart of a method for acquiring and encapsulating data of the internet of things according to another embodiment of the invention.
Detailed Description
The embodiments of the present invention disclosed are described below with reference to specific embodiments, and those skilled in the art can understand the advantages and effects of the present invention from the disclosure of the present specification. The invention is capable of other and different embodiments and its several details are capable of modification and various other changes, which can be made in various details within the specification and without departing from the spirit and scope of the invention. The drawings of the present invention are for illustrative purposes only and are not drawn to scale. The following embodiments will further explain the related art of the present invention in detail, but the disclosure is not intended to limit the scope of the present invention.
FIG. 1 is a schematic diagram of a signal acquisition sensor array according to one embodiment. FIG. 2 is a cross-sectional view of the signal acquisition sensor array of FIG. 1 according to one embodiment. Referring to fig. 1 and 2, a signal acquisition sensor array 10 includes: a connection layer 105, at least two kinds of sensor units 111 and 112, a signal acquisition circuit 107, a signal line 104 for electrically connecting each of the sensor units 111 or 112 with the signal acquisition circuit 107, each of the sensor units 111 or 112 further comprising: a first seismic substrate 101 or 102; sensor elements 103, which correspond to the first vibration damping substrate 101 or 102 one by one and are disposed between the first vibration damping substrate 101 or 102 and the connection layer 105; wherein the at least two sensor units are arranged in an array at intervals on the connection layer. The vibration damping base material herein refers to a material having a vibration damping effect (damping effect), such as a material of sponge, rubber, foam, or the like. The vibration damping base material can be made into a sheet shape or a block shape with a concave shape. If the sensor element is made into a block shape with a concave shape, the sensor element can be accommodated in the concave shape, and the damping effect can be further adjusted by adjusting the size of the concave. The signal lines illustrated in fig. 1 and 2 are sequentially connected in series between the sensor units, but those skilled in the art should understand that a signal line may be connected between each sensor unit 111 or 112 and the signal acquisition circuit 107. At least two sensor units are arranged at intervals in an array form, and the sensor elements in the sensor units are arranged to be in one-to-one correspondence with the first vibration-proof base material and arranged between the first vibration-proof base material and the connecting layer, so that different signals are attenuated to different degrees after being transmitted to the sensor units, and the first vibration-proof base material is separated, so that the strong coupling of force among the sensor units is eliminated, and different physiological signals with great signal amplitude difference are accurately detected by the sensor array.
Although an 8 × 8 array is illustrated in fig. 1, it should be understood by those skilled in the art that this is merely an example, and other numbers of rows and columns may be used.
Optionally, a substrate layer 106 is further disposed between each sensor element 103 and the connection layer 105, and is used for carrying the sensor element and the related conditioning circuit, so that the sensor element and the related conditioning circuit have high rigidity as a whole and are prevented from being damaged.
Optionally, a plurality of the sensor units 111 or 112 share one signal acquisition circuit 107. Therefore, the acquisition work of a large area can be realized by fewer acquisition circuits, so that the cost is saved, the time interval of signal acquisition can be reduced by using the technologies such as a serial bus, and the signal acquisition rate is improved. Similarly, the at least one signal acquisition circuit 107 is further connected to the central processor of the entire array.
Optionally, the product of the seismic characteristic of the first seismic resistant base material included in one sensor unit 111, the sensitivity of the included sensor element, and the sensitivity of the corresponding signal acquisition circuit is more than 2 times the product of the seismic characteristic of the first seismic resistant base material included in the other sensor unit 112, the sensitivity of the included sensor element, and the sensitivity of the corresponding signal acquisition circuit. Here, the vibration damping characteristic refers to a damping multiple of vibration. For example, the damping characteristic of a material is 40%, meaning that it damps vibrations by 40%, while only 60% of the vibrations can be transmitted from one side to the other. The meanings of the sensitivity of the sensor and the sensitivity of the acquisition circuit are well defined in the prior art and are not described in detail for the sake of brevity.
The sensor element may be a piezoelectric sheet, or may be one or a combination of a plurality of strain gauges, piezoresistive sensors, and the like. The sensor element is provided with an operational amplifier circuit which can amplify the initial signal. The sensitivity of the sensor elements is different, and the sensor elements can be realized by setting different element types or different amplification factors of the operational amplification circuit.
The sensor arrays of fig. 1 and 2 include a plurality of sensors for acquiring signals. It should be noted that fig. 1 and 2 illustrate only one specific manner of sensor array structure and composition for acquiring signals. It will be appreciated by those skilled in the art that any other form of sensor array that collects signals may be used and is within the scope of the present application.
According to one aspect of the invention, the internet of things data acquisition and packaging device is provided, synchronous data acquisition is carried out on each sensor of the sensor array through the internet of things data acquisition and packaging device, the acquired data is packaged to form transmission data packets, and packet information such as timestamps and serial numbers in each transmission data packet is determined. And then, at a receiving end of the data packet, detecting the data packet according to packet information in the data packet, determining whether the data packet is lost, and further judging whether the data acquisition and packaging device of the Internet of things works abnormally.
Fig. 3 is a schematic view of an application scenario of the data acquisition and packaging device of the internet of things according to an embodiment of the present invention. In one embodiment, the sensor array is a pressure sensor array comprising a plurality of sensors. When using sensor arrays to detect signals, such as body movement, respiration, and heartbeat, it is necessary to ensure that the data sent to the processor is continuous, complete, and orderly in order for the signals to be useful in subsequent health detection procedures.
As shown in fig. 3, the sensor array may be formed by 8 × 8 sensors, such as the sensor arrays shown in fig. 1 and 2, it being understood that the sensor array may be formed by any number of sensors. The sensor array adopts a connection form of multi-stage administration, namely, one sensor array uses a plurality of Micro Control Units (MCUs), one MCU is connected with a plurality of sensor signals, and the MCU does not have a local clock. As shown in fig. 3, the sensor array is composed of 8 × 8 sensors, the sensor array uses 8 MCUs, and one MCU accesses 8 sensor signals.
The MCU connected with the sensor signal is called an acquisition unit. The acquisition unit CAN include the STM32 singlechip, does not have the local clock, and all acquisition units are connected to first higher level MCU, and this first higher level MCU is called processing unit, and acquisition unit and processing unit's connected mode includes the CAN bus, and processing unit includes the STM32 singlechip, possesses the local clock, handles the data of acquisition unit release. The processing unit is connected to the higher level MCU of second, and this higher level MCU of second is called transmission unit, and processing unit and transmission unit's connected mode includes the serial ports, and transmission unit includes the ESP8266 singlechip, possesses Wi-Fi chip and local clock, sends the data package to the high in the clouds server after collecting the data.
The internet of things data acquisition and packaging device comprises an acquisition unit, a processing unit and a transmission unit. The transmission unit is connected with a public Network through a WiFi chip, the Time of a Network Time server is acquired by using a Simple Network Time Protocol (SNTP), and the Time is pushed to the processing unit while a local clock of the transmission unit is calibrated, so that the processing unit has accurate physical Time. Although each collector has no local clock, the collector has a high-precision crystal oscillator, timing of relative time can be performed, after the device is started, the processing unit can periodically broadcast a time synchronization instruction to all the collection units, and after all the collection units receive the time synchronization instruction, the relative time is recalculated from the same time starting point. The calculation of the relative time does not generate obvious accumulated deviation in a long period, so that the broadcasting period of the time synchronization command can be longer, the system efficiency is improved, and the real-time requirement is met.
In a specific embodiment, the functions of the acquisition unit, the processing unit and the transmission unit are as follows.
For the acquisition unit, the acquisition unit acquires sensor data of a group of sensors in the sensor array according to a preset time interval and packages the sensor data into a data frame.
In the embodiment shown in fig. 3, for a sensor array composed of 8 × 8 sensors, the sensor array is divided into 8 groups, and there are 8 corresponding acquisition units, that is, one acquisition unit acquires data of 8 sensors.
One acquisition unit acquires sensor data of the corresponding 8 sensors according to a preset time interval (for example, 10 msec). This preset time interval is determined based on the relative time calculated by the acquisition unit. Specifically, the acquisition unit responds to a time setting instruction of the processing unit, recalculates the relative time from the same time starting point, and acquires the data of the corresponding group of sensors when the relative time reaches a preset time interval. The acquisition unit then packages the sensor data into data frames.
According to a preferred embodiment, the acquisition unit allocates corresponding identification numbers to the sensor data, packages the sensor data and the identification numbers into data frames, and allocates corresponding identification numbers to the sensor data according to the number of data acquisition modes, determines more than two different identification numbers for each data acquisition mode, and uses the more than two different identification numbers according to a sequential polling mechanism.
According to the embodiment shown in fig. 3, for each acquisition unit, an identification number is assigned to sensor data when the sensor data of 8 sensors are acquired and transmitted. For example, the data acquisition modes include a normal acquisition rate mode and a high acquisition rate mode, with more than two different identifiers being determined for each data acquisition mode, e.g., three identifiers, e.g., A, B and C, being determined for the normal acquisition rate mode and three identifiers, e.g., D, E and F, being determined for the high acquisition rate mode. Then, in the normal acquisition rate mode, the first acquired sensor data is assigned an identification number a, the second acquired sensor data is assigned an identification number B, the third acquired sensor data is assigned an identification number C, and the fourth acquired sensor data is assigned an identification number a … …, that is, A, B and C are used according to the sequential polling mechanism. The identification number assignment in the high acquisition rate mode is similar to that in the conventional acquisition rate mode.
Therefore, on one hand, each data frame is allocated with an identification number, which is convenient for counting the number of the data frames in the data detection process, and on the other hand, because the identification numbers are allocated to the data frames by adopting the sequential polling mechanism, the sequence of the presented identification numbers also accords with the sequential polling mechanism in the process of receiving the data frames, otherwise, data loss may exist, and therefore, the judgment of whether the data is lost in the data detection process can be facilitated.
For the processing unit, it receives the data frames from the acquisition unit and packages more than one of the data frames into a first data packet.
The processing unit packs how many data frames into a first data packet, mainly according to the size of the buffer area of the processing unit, the larger the buffer area is, the more the number of data frames that can be packed together is, otherwise, the fewer the number is. In this embodiment, each data frame has a length of 8 bytes, and when 28 data frames are accumulated, the processing unit combines the 28 data frames into a first data packet for communication with the transmission unit.
And the processing unit takes the time of receiving the first data frame in each first data packet as a first original time stamp of the first data packet, namely the collection time 'starting point' of a new data packet, receives the time of the network time server from the transmission unit, calibrates the local time of the processing unit through the time of the network time server, and then determines the first original time stamp according to the local time. In addition, a first sequence number is attached to each first data packet, the sequence number range is from 0 to 65535, and the first data packet comprises a first original timestamp and a first sequence number.
Table 1 shows the first packet structure established:
Figure BDA0002400159910000091
TABLE 1
Where the device ID in this embodiment refers to a device containing an array of sensors, for example a mattress, then the device ID refers to a mattress. In addition, it should be noted that table 1 only shows exemplary fields such as a packet header, a function code, a first original timestamp, and a byte length of data, and those skilled in the art can appreciate that any other suitable byte length may be adopted for each field and data, and all of them fall within the scope of the disclosure of the present application.
For a transmission unit, it encapsulates more than one first packet into a second packet and sends the second packet.
The transmission unit encapsulates how many first data packets into second data packets, mainly according to the size of the memory of the transmission unit, generally speaking, the larger the memory is, the more the number of first data packets that can be encapsulated together is, otherwise, the fewer the number of first data packets is. In this embodiment, each first packet has a length of 28 data frames, each data frame has 7 bytes, and when every 2 first packets are accumulated, the transmission unit combines the 2 first packets into one second packet for cloud transmission, that is, two consecutive first packets logically belong to one second packet.
In the case where one second packet is formed from two or more first packets, a plurality of first packets in the second packet have the same device ID, and different first packet numbers are assigned to the plurality of first packets, for example, there are two first packets, which are 1 and 2, respectively.
Additionally, the second data packet includes a second original timestamp and a second sequence number. The second original timestamp and the second sequence number are respectively the same as the first original timestamp and the first sequence number corresponding to the first data packet in the second data packet. That is, in the case where one second packet is formed from one first packet, the second original timestamp and the second sequence number are in one-to-one correspondence with the first original timestamp and the first sequence number, and in the case where one second packet is formed from two or more first packets, the second original timestamp of the second packet is the first original timestamp and the first sequence number of the first packet in the second packet, that is, the first original timestamp and the first sequence number of the first packet are shared by the other first packets of the second packet and the first packet.
And each group of first data packets are collected by the transmission unit, recombined and encapsulated into a second data packet, contents such as an uploading timestamp and the like are added when the second data packet is sent to the cloud, and the second data packet is sent to the cloud server, wherein the transmission unit acquires the time of the network time server, and the local clock of the transmission unit is calibrated by utilizing the time of the network time server to acquire accurate local time. The upload time stamp is determined from the local time of the transmission unit.
Table 2 shows the second packet structure established:
Figure BDA0002400159910000101
Figure BDA0002400159910000111
TABLE 2
It should be noted that table 2 only shows exemplary fields such as the header, the second original timestamp, the second sequence number, and the byte length of the data, and those skilled in the art can appreciate that any other suitable byte length can be adopted for each field and data, and these fields and data are within the scope of the disclosure.
By the Internet of things data acquisition and packaging device, synchronous acquisition of each sensor in the sensor array can be realized under the condition that the sensor in the sensor array is not provided with a local clock, package information such as a timestamp and a serial number required by packaging is determined, and subsequent data detection is facilitated. The scheme provided by the invention does not need a sensor array to be provided with a local clock, and has wider application range.
According to the two aspects of the invention, the data acquisition and packaging method of the Internet of things is provided, synchronous data acquisition is carried out on each sensor of the sensor array through the data acquisition and packaging method of the Internet of things, the acquired data are packaged to form transmission data packets, and packet information such as timestamps, serial numbers and the like in each transmission data packet is determined. Then, at the receiving end of the data packet, the data packet is detected according to the packet information in the data packet, and whether the data packet is lost or not is determined.
According to one embodiment, as shown in fig. 4, the method for acquiring and packaging data of the internet of things includes the following steps.
Step S401, collecting sensor data of a group of sensors in a sensor array according to a preset time interval, and packaging the sensor data into a data frame.
In the embodiment shown in fig. 3, for a sensor array composed of 8 × 8 sensors, the sensor array is divided into 8 groups, and there are 8 corresponding acquisition units, that is, one acquisition unit acquires data of 8 sensors.
One acquisition unit acquires sensor data of the corresponding 8 sensors according to a preset time interval (for example, 10 msec). This preset time interval is determined based on the relative time calculated by the acquisition unit. Specifically, the acquisition unit responds to a time setting instruction of the processing unit, recalculates the relative time from the same time starting point, and acquires the data of the corresponding group of sensors when the relative time reaches a preset time interval. The acquisition unit then packages the sensor data into data frames.
According to a preferred embodiment, the acquisition unit allocates corresponding identification numbers to the sensor data, packages the sensor data and the identification numbers into data frames, and allocates corresponding identification numbers to the sensor data according to the number of data acquisition modes, determines more than two different identification numbers for each data acquisition mode, and uses the more than two different identification numbers according to a sequential polling mechanism.
According to the embodiment shown in fig. 3, for each acquisition unit, an identification number is assigned to sensor data when the sensor data of 8 sensors are acquired and transmitted. For example, the data acquisition modes include a normal acquisition rate mode and a high acquisition rate mode, with more than two different identifiers being determined for each data acquisition mode, e.g., three identifiers, e.g., A, B and C, being determined for the normal acquisition rate mode and three identifiers, e.g., D, E and F, being determined for the high acquisition rate mode. Then, in the normal acquisition rate mode, the first acquired sensor data is assigned an identification number a, the second acquired sensor data is assigned an identification number B, the third acquired sensor data is assigned an identification number C, and the fourth acquired sensor data is assigned an identification number a … …, that is, A, B and C are used according to the sequential polling mechanism. The identification number assignment in the high acquisition rate mode is similar to that in the conventional acquisition rate mode.
Therefore, on one hand, each data frame is allocated with an identification number, which is convenient for counting the number of the data frames in the data detection process, and on the other hand, because the identification numbers are allocated to the data frames by adopting the sequential polling mechanism, the sequence of the presented identification numbers also accords with the sequential polling mechanism in the process of receiving the data frames, otherwise, data loss may exist, and therefore, the judgment of whether the data is lost in the data detection process can be facilitated.
Step S402, packetizes one or more data frames into a first packet.
According to the embodiment shown in fig. 3, how many data frames are packed into the first data packet by the processing unit is mainly based on the size of the buffer of the processing unit, and the larger the buffer is, the larger the number of data frames that can be packed together is, and vice versa, the smaller the number of data frames is. In this embodiment, each data frame has a length of 8 bytes, and when 28 data frames are accumulated, the processing unit combines the 28 data frames into a first data packet for communication with the transmission unit.
And the processing unit takes the time of receiving the first data frame in each first data packet as a first original time stamp of the first data packet, namely the collection time 'starting point' of a new data packet, receives the time of the network time server from the transmission unit, calibrates the local time of the processing unit through the time of the network time server, and then determines the first original time stamp according to the local time. In addition, a first sequence number is attached to each first data packet, the sequence number range is from 0 to 65535, and the first data packet comprises a first original timestamp and a first sequence number.
Step S403, encapsulating more than one first data packet into a second data packet and sending the second data packet
In the embodiment shown in fig. 3, how many first data packets are encapsulated into the second data packets by the transmission unit mainly depends on the size of the memory of the transmission unit, and generally, the larger the memory is, the larger the number of first data packets that can be encapsulated together is, and vice versa, the smaller the number of first data packets is. In this embodiment, each first packet has a length of 28 data frames, each data frame has 7 bytes, and when every 2 first packets are accumulated, the transmission unit combines the 2 first packets into one second packet for cloud transmission, that is, two consecutive first packets logically belong to one second packet.
In the case where one second packet is formed from two or more first packets, a plurality of first packets in the second packet have the same device ID, and different first packet numbers are assigned to the plurality of first packets, for example, there are two first packets, which are 1 and 2, respectively.
Additionally, the second data packet includes a second original timestamp and a second sequence number. The second original timestamp and the second sequence number are respectively the same as the first original timestamp and the first sequence number corresponding to the first data packet in the second data packet. That is, in the case where one second packet is formed from one first packet, the second original timestamp and the second sequence number are in one-to-one correspondence with the first original timestamp and the first sequence number, and in the case where one second packet is formed from two or more first packets, the second original timestamp of the second packet is the first original timestamp and the first sequence number of the first packet in the second packet, that is, the first original timestamp and the first sequence number of the first packet are shared by the other first packets of the second packet and the first packet.
And each group of first data packets are collected by the transmission unit, recombined and encapsulated into a second data packet, contents such as an uploading timestamp and the like are added when the second data packet is sent to the cloud, and the second data packet is sent to the cloud server, wherein the transmission unit acquires the time of the network time server, and the local clock of the transmission unit is calibrated by utilizing the time of the network time server to acquire accurate local time. The upload time stamp is determined from the local time of the transmission unit.
According to another embodiment, as shown in fig. 5, the method for acquiring and encapsulating data of the internet of things includes the following steps.
Step S501, receiving the time of the network time server, and calibrating the local time through the time of the network time server.
And the processing unit of the Internet of things data acquisition and packaging device receives the time of the network time server from the transmission unit, and the local time of the processing unit is calibrated through the time of the network time server.
Step S502, calculating a relative time in response to the time setting instruction.
And the acquisition unit of the Internet of things data acquisition and packaging device responds to the time setting instruction of the processing unit and recalculates the relative time from the same time starting point.
Step S503, collecting sensor data of a group of sensors in the sensor array according to a preset time interval.
In the embodiment shown in fig. 3, for a sensor array composed of 8 × 8 sensors, the sensor array is divided into 8 groups, and there are 8 corresponding acquisition units, that is, one acquisition unit acquires data of 8 sensors.
One acquisition unit acquires sensor data of the corresponding 8 sensors according to a preset time interval (for example, 10 msec). This preset time interval is determined based on the relative time calculated by the acquisition unit as described in step S502. And when the relative time reaches a preset time interval, acquiring data of a corresponding group of sensors. The acquisition unit then packages the sensor data into data frames.
And step S504, distributing corresponding identification numbers for the sensor data.
According to a preferred embodiment, the acquisition unit allocates corresponding identification numbers to the sensor data, and allocates corresponding identification numbers to the sensor data according to the number of data acquisition modes, determines more than two different identification numbers for each data acquisition mode, and uses the more than two different identification numbers according to a sequential polling mechanism.
According to the embodiment shown in fig. 3, for each acquisition unit, an identification number is assigned to sensor data when the sensor data of 8 sensors are acquired and transmitted. For example, the data acquisition modes include a normal acquisition rate mode and a high acquisition rate mode, with more than two different identifiers being determined for each data acquisition mode, e.g., three identifiers, e.g., A, B and C, being determined for the normal acquisition rate mode and three identifiers, e.g., D, E and F, being determined for the high acquisition rate mode. Then, in the normal acquisition rate mode, the first acquired sensor data is assigned an identification number a, the second acquired sensor data is assigned an identification number B, the third acquired sensor data is assigned an identification number C, and the fourth acquired sensor data is assigned an identification number a … …, that is, A, B and C are used according to the sequential polling mechanism. The identification number assignment in the high acquisition rate mode is similar to that in the conventional acquisition rate mode.
Therefore, on one hand, each data frame is allocated with an identification number, which is convenient for counting the number of the data frames in the data detection process, and on the other hand, because the identification numbers are allocated to the data frames by adopting the sequential polling mechanism, the sequence of the presented identification numbers also accords with the sequential polling mechanism in the process of receiving the data frames, otherwise, data loss may exist, and therefore, the judgment of whether the data is lost in the data detection process can be facilitated.
And step S505, packaging the sensor data into a data frame.
Without step S504, packetizing the sensor data into a data frame is based on the sensor data, and with step S504, packetizing the sensor data into a data frame is based on the sensor data and the identification number.
Step S506 is to pack one or more data frames into a first data packet.
According to the embodiment shown in fig. 3, how many data frames are packed into the first data packet by the processing unit is mainly based on the size of the buffer of the processing unit, and the larger the buffer is, the larger the number of data frames that can be packed together is, and vice versa, the smaller the number of data frames is. In this embodiment, each data frame has a length of 8 bytes, and when 28 data frames are accumulated, the processing unit combines the 28 data frames into a first data packet for communication with the transmission unit.
And, the processing unit takes the time of receiving the first data frame in each first data packet as the first original timestamp of the first data packet, i.e. the "starting point" of the acquisition time of the new data packet, as stated in step S501, the processing unit receives the time of the network time server from the transmission unit, calibrates the local time of the processing unit according to the time of the network time server, and then determines the first original timestamp according to the local time. In addition, a first sequence number is attached to each first data packet, the sequence number range is from 0 to 65535, and the first data packet comprises a first original timestamp and a first sequence number.
Step S507, encapsulating more than one first data packet into a second data packet and sending the second data packet.
In the embodiment shown in fig. 3, how many first data packets are encapsulated into the second data packets by the transmission unit mainly depends on the size of the memory of the transmission unit, and generally, the larger the memory is, the larger the number of first data packets that can be encapsulated together is, and vice versa, the smaller the number of first data packets is. In this embodiment, each first packet has a length of 28 data frames, each data frame has 7 bytes, and when every 2 first packets are accumulated, the transmission unit combines the 2 first packets into one second packet for cloud transmission, that is, two consecutive first packets logically belong to one second packet.
In the case where one second packet is formed from two or more first packets, a plurality of first packets in the second packet have the same device ID, and different first packet numbers are assigned to the plurality of first packets, for example, there are two first packets, which are 1 and 2, respectively.
Additionally, the second data packet includes a second original timestamp and a second sequence number. The second original timestamp and the second sequence number are respectively the same as the first original timestamp and the first sequence number corresponding to the first data packet in the second data packet. That is, in the case where one second packet is formed from one first packet, the second original timestamp and the second sequence number are in one-to-one correspondence with the first original timestamp and the first sequence number, and in the case where one second packet is formed from two or more first packets, the second original timestamp of the second packet is the first original timestamp and the first sequence number of the first packet in the second packet, that is, the first original timestamp and the first sequence number of the first packet are shared by the other first packets of the second packet and the first packet.
And each group of first data packets are collected by the transmission unit, recombined and encapsulated into a second data packet, contents such as an uploading timestamp and the like are added when the second data packet is sent to the cloud, and the second data packet is sent to the cloud server, wherein the transmission unit acquires the time of the network time server, and the local clock of the transmission unit is calibrated by utilizing the time of the network time server to acquire accurate local time. The upload time stamp is determined from the local time of the transmission unit.
It is noted that while for simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently. Further, those skilled in the art will also appreciate that the embodiments described in the specification are exemplary embodiments and that acts and modules referred to are not necessarily required by the disclosure.
It should be further noted that, although the steps in the flowcharts of fig. 4 and 5 are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 4 and 5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
By the method for acquiring and packaging the data of the Internet of things, synchronous acquisition of each sensor in the sensor array can be realized under the condition that the sensor in the sensor array is not provided with a local clock, package information such as a timestamp and a serial number required by packaging is determined, and subsequent data detection is facilitated. The scheme provided by the invention does not need a sensor array to be provided with a local clock, and has wider application range.
According to the embodiment shown in fig. 3, the remote data processing device (shown in fig. 3 as a server) at the opposite end of the data obtaining and packaging device for the internet of things disassembles the received second data packet, and since the data generation time period is predetermined in advance, the processing program takes the data packet timestamp as the starting point of the data collection time of the data frame, and calculates the actual collection time of each data frame according to the number of occurrences of the identification number of the data frame in the second data packet, and then performs calculation processing.
However, if the data is not truly continuous and complete data, or there is a large fluctuation in the actual generation period, an error may be generated in the data calculation, so an effective method needs to be found to determine whether there is an abnormality in the hardware of the data acquisition and encapsulation device of the internet of things and the work of the program of the single chip microcomputer, whether the data is missing, and the specific situation, and within a theoretical allowable range, to perform compensation processing on the missing data, or to request the device to reissue the missing historical data if necessary.
Then, receiving and analyzing the second data packet at the detection end to obtain the second original timestamp; and then, carrying out data detection on the second data packet based on the second original timestamp in a preset detection mode.
According to a first specific embodiment, the detection means comprises:
and for two second data packets adjacent to the second original timestamp, determining that data in the second data packets sent by the internet of things data acquisition and packaging device is lost in response to the judgment that the time interval of the second original timestamps of the two second data packets exceeds a preset time interval value. Wherein, the preset time interval value is determined according to the actual application situation.
According to a second specific embodiment, after obtaining the second sequence number, the detecting method includes: and for two second data packets adjacent to the second original timestamp, determining that data in the second data packets sent by the internet of things data acquisition and packaging device is lost in response to the judgment that the second sequence numbers of the two second data packets are discontinuous.
In addition, as described above, the acquisition unit allocates corresponding identification numbers to the sensor data according to the number of data acquisition modes, determines two or more different identification numbers for each data acquisition mode, and uses the two or more different identification numbers according to a sequential polling mechanism. Therefore, on one hand, each data frame is allocated with an identification number, which is convenient for counting the number of the data frames in the data detection process, and on the other hand, because the identification numbers are allocated to the data frames by adopting the sequential polling mechanism, the sequence of the presented identification numbers also accords with the sequential polling mechanism in the process of receiving the data frames, otherwise, data loss may exist, and therefore, the judgment of whether the data is lost in the data detection process can be facilitated.
Thus, according to a third specific embodiment, the detection means comprises: counting the number of data frames corresponding to one identification number or two different identification numbers in two same time periods; and determining that the data in the second data packet sent by the Internet of things data acquisition and packaging device is lost in response to the judgment that the difference value between the number of data frames corresponding to one identification number or more than two different identification numbers in two same time periods is greater than a first preset value. The first preset value is determined according to the actual application situation, and is, for example, 3.
For example, the number of data frames with identification numbers a (or identification numbers a and B) in two same time periods (for example, 5 seconds) is counted, and the number of the two time periods is found, for example, the first preset value is 3, the number of data frames with identification numbers a (or identification numbers a and B) counted in one time period is 10000, and the number of data frames with identification numbers a (or identification numbers a and B) counted in another time period is also 10000, which is generally considered as a normal situation; however, if the number of data frames with the identification number a (or the identification numbers a and B) counted in another time period is also 10008, it is determined that there is data loss.
According to a fourth specific embodiment, the detection method includes: and determining that the data in the second data packet sent by the Internet of things data acquisition and packaging device is lost in response to the judgment that the appearance sequence of the data frame identification numbers corresponding to the same acquisition unit does not conform to the sequential polling mechanism.
For example, in a data acquisition mode, the data frame has identification numbers A, B and C, and the occurrence of the identification numbers should be abcabcabc … according to the sequential polling mechanism, however, if the statistical occurrence order of the data frame identification numbers does not conform to the sequential polling mechanism, the data is judged to be lost.
According to a fifth specific embodiment, the detecting means includes: counting the total number of identification numbers corresponding to different acquisition units within a period of time; and determining that the data in the second data packet sent by the Internet of things data acquisition and packaging device is lost in response to the judgment that the difference value between the total number of the identification numbers corresponding to the different acquisition units and the total number of the standards is greater than a second preset value. The maximum total number of the identification numbers is used as a standard number, and the second preset value is determined according to practical application situations, and is 3 for example.
For example, the identification numbers of the data frames of the first acquisition units in one data acquisition mode are A, B and C, the identification numbers of the data frames of the second acquisition units in the same data acquisition mode are D, E and F, the total times of the identification numbers A, B and C appearing in a period of time are counted as the total number of the identification numbers corresponding to the first acquisition units, the total times of the identification numbers D, E and F appearing in a period of time are counted as the total number of the identification numbers corresponding to the second acquisition units, the total number of the identification numbers of all the acquisition units is counted in sequence, the maximum total number of the identification numbers is used as the standard number, and if the total number of the identification numbers corresponding to the acquisition units is less than the standard number by a second preset value, data loss is considered.
Therefore, according to the device and the method for acquiring and packaging the data of the internet of things, packet information such as a timestamp, a serial number, a data frame identification number and the like is embedded in the packaging process, and whether the data are lost or not can be detected according to the embedded packet information in the subsequent data detection process. It should be noted that the above only illustrates a specific implementation of data detection according to packet information, and other data detection methods obtained by those skilled in the art based on the above implementation are all within the scope covered by the present application.
It should be understood that the above-described apparatus embodiments are merely exemplary, and that the apparatus of the present disclosure may be implemented in other ways. For example, the division of the units/modules in the above embodiments is only one logical function division, and there may be another division manner in actual implementation. For example, multiple units, modules, or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included therein.

Claims (14)

1. The utility model provides a thing networking data acquisition and packaging hardware, its includes acquisition unit, processing unit and transmission unit, wherein:
the acquisition unit responds to a time setting instruction of the processing unit, recalculates relative time from the same time starting point, acquires sensor data of a group of sensors in the sensor array according to a preset time interval, and packs the sensor data into a data frame;
the processing unit receives the data frames from the acquisition unit and packages more than one data frame into a first data packet, wherein the first data packet comprises a first original timestamp and a first sequence number;
the transmission unit receives the first data packet from the processing unit, encapsulates more than one first data packet into a second data packet and sends the second data packet, wherein the second data packet comprises a second original timestamp and a second sequence number.
2. The apparatus of claim 1, wherein the acquisition unit assigns a corresponding identification number to the sensor data and packages the sensor data and the identification number into a data frame.
3. The apparatus of claim 2, wherein the acquisition unit assigns corresponding identification numbers to the sensor data according to a number of data acquisition modes, determines more than two different identification numbers for each data acquisition mode, and uses the more than two different identification numbers according to a sequential polling mechanism, wherein the data acquisition modes include a regular acquisition rate mode and a high acquisition rate mode.
4. The apparatus of claim 1, wherein the first original timestamp is a time when a first data frame in the first data packet was received by the processing unit.
5. The apparatus of claim 4, wherein the second original timestamp and the second sequence number are the same as the first original timestamp and the first sequence number, respectively, corresponding to a first packet in the second packet.
6. The apparatus of any of claims 1 to 5, wherein the processing unit receives a time of a network time server, a local time of the processing unit being calibrated by the time of the network time server, the first original timestamp being determined from the local time.
7. The apparatus of any one of claims 1 to 5, wherein the acquisition unit calculates a relative time in response to a time tick instruction of the processing unit, the preset time interval being determined according to the relative time.
8. An Internet of things data acquisition and packaging method comprises the following steps:
in response to a time setting instruction of a processing unit, recalculating relative time from the same time starting point, acquiring sensor data of a group of sensors in a sensor array according to a preset time interval, and packaging the sensor data into a data frame;
packing more than one data frame into a first data packet, wherein the first data packet comprises a first original timestamp and a first sequence number;
and encapsulating more than one first data packet into a second data packet and transmitting the second data packet, wherein the second data packet comprises a second original timestamp and a second sequence number.
9. The method of claim 8, further comprising assigning a corresponding identification number to the sensor data, and wherein the packaging the sensor data into a data frame comprises packaging the sensor data and the identification number into a data frame.
10. The method of claim 9, wherein the assigning the sensor data with corresponding identification numbers comprises assigning the sensor data with corresponding identification numbers according to a number of data acquisition modes, determining two or more different identification numbers for each data acquisition mode, and using the two or more different identification numbers according to a sequential polling mechanism, wherein the data acquisition modes include a regular acquisition rate mode and a high acquisition rate mode.
11. The method of claim 8, wherein the first original timestamp is a time of receipt of a first data frame in the first data packet.
12. The method of claim 11, wherein the second original timestamp and the second sequence number are the same as the first original timestamp and the first sequence number, respectively, corresponding to a first packet in the second packet.
13. The method of any of claims 8 to 12, further comprising receiving a time of a network time server, calibrating a local time by the time of the network time server, wherein the first original timestamp is determined from the local time.
14. The method of any one of claims 8 to 12, further comprising calculating a relative time in response to a time tick instruction, wherein the preset time interval is determined in dependence on the relative time.
CN202080000215.7A 2020-01-22 2020-01-22 Internet of things data acquisition and packaging device and method Active CN111279728B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/073885 WO2021147021A1 (en) 2020-01-22 2020-01-22 Internet of things data acquisition and encapsulation apparatus and method

Publications (2)

Publication Number Publication Date
CN111279728A CN111279728A (en) 2020-06-12
CN111279728B true CN111279728B (en) 2021-08-31

Family

ID=71002827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202080000215.7A Active CN111279728B (en) 2020-01-22 2020-01-22 Internet of things data acquisition and packaging device and method

Country Status (2)

Country Link
CN (1) CN111279728B (en)
WO (1) WO2021147021A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511587B (en) * 2020-10-23 2024-02-09 许继集团有限公司 Communication data processing method and device for power distribution network differential service
CN115038161B (en) * 2022-07-25 2023-10-13 苏州德姆斯信息技术有限公司 Vibration data wireless synchronous acquisition method, system and vibration monitoring system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100521654C (en) * 2006-05-30 2009-07-29 杭州华三通信技术有限公司 Method for synchronous frame transmitting on IP network and network apparatus for transmission
CN101651517A (en) * 2008-08-13 2010-02-17 中兴通讯股份有限公司 Method and device for detecting loss of burst sequences
CN202276347U (en) * 2011-11-04 2012-06-13 上海湾流仪器技术有限公司 High-density E1 data acquisition card supporting global positioning system (GPS) timestamp synchronization function
US9143808B2 (en) * 2012-09-14 2015-09-22 Cisco Technology, Inc. Multi-channel MPEG between headend and fiber node
CN102984757B (en) * 2012-11-16 2015-05-20 感知集团有限公司 Gateway data processing method and gateway data processing device for Internet of Things
US10362145B2 (en) * 2013-07-05 2019-07-23 The Boeing Company Server system for providing current data and past data to clients
CN104850573A (en) * 2014-11-25 2015-08-19 北汽福田汽车股份有限公司 Data collection method and device
KR101848616B1 (en) * 2016-06-22 2018-05-28 현대자동차주식회사 Apparatus and method for controlling electric device in vehicle
CN109217961B (en) * 2018-06-25 2020-10-16 北京津发科技股份有限公司 Multi-channel human-computer interaction and human-computer environment test data synchronization device and method

Also Published As

Publication number Publication date
WO2021147021A1 (en) 2021-07-29
CN111279728A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
CN111279728B (en) Internet of things data acquisition and packaging device and method
EP3564921B1 (en) Sensing system and time synchronization method
CN110166952B (en) Wireless sensor network data acquisition method and system based on broadcast synchronization
JP5804086B2 (en) Node device and time synchronization method
US8947206B2 (en) Method and a system for enabling a wireless communication between a master unit and a sensor unit
US20120020445A1 (en) Wireless sensor synchronization methods
US9665524B2 (en) Method and device for coupling a first sensor to at least one second sensor
CN105610652B (en) Method and device for acquiring data transmission delay
US20150139198A1 (en) Sensor node and gateway mutually communicating in wireless sensor network
CN109426299A (en) Sensor device, method and multiple sensor apparatus
CN107248892B (en) Monitoring system of security inspection equipment
WO2019105487A1 (en) Differential protection method and system
US8489776B2 (en) Apparatus and method for synchronizing wireless devices
CN106455042A (en) Inter-node time synchronization method, wireless sensor network and node thereof
JP4102991B2 (en) Communication control device
Lindh et al. Performance evaluation of time synchronization and clock drift compensation in wireless personal area networks
JP3906918B2 (en) Data communication system
KR101464517B1 (en) Multi Sensor Nodes Monitoring System, Concurrent Measure and Time Division Transmission Method
CN112710377A (en) Dynamic weighing apparatus
CN102404872A (en) Sensor system and data collection method thereof
JP2669314B2 (en) Data transfer device
CN215573074U (en) Network intelligence temperature and humidity sensor
EP4152656A1 (en) Method for synchronization of timestamped data
CN108241589A (en) A kind of data processing method and device
JP7070290B2 (en) Communication equipment, aggregation equipment, communication systems and control programs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200629

Address after: 1219, floor 11, No.19, Madian East Road, Haidian District, Beijing 100088

Applicant after: Beijing micro digital technology Co., Ltd

Address before: 100095 Beijing Haidian District Hot Spring Town Dongbutou Village District No.398

Applicant before: Jiao Xu

GR01 Patent grant
GR01 Patent grant