CN115167612A - Wall time and supplementary packet method, device and medium for synchronizing data - Google Patents

Wall time and supplementary packet method, device and medium for synchronizing data Download PDF

Info

Publication number
CN115167612A
CN115167612A CN202210826794.1A CN202210826794A CN115167612A CN 115167612 A CN115167612 A CN 115167612A CN 202210826794 A CN202210826794 A CN 202210826794A CN 115167612 A CN115167612 A CN 115167612A
Authority
CN
China
Prior art keywords
data
data packet
time
packet
stored
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.)
Granted
Application number
CN202210826794.1A
Other languages
Chinese (zh)
Other versions
CN115167612B (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 Zhongke Xinyan Technology Co ltd
Original Assignee
Beijing Zhongke Xinyan 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 Zhongke Xinyan Technology Co ltd filed Critical Beijing Zhongke Xinyan Technology Co ltd
Priority to CN202210826794.1A priority Critical patent/CN115167612B/en
Publication of CN115167612A publication Critical patent/CN115167612A/en
Application granted granted Critical
Publication of CN115167612B publication Critical patent/CN115167612B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/12Synchronisation of different clock signals provided by a plurality of clock generators
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/02Detecting, measuring or recording pulse, heart rate, blood pressure or blood flow; Combined pulse/heart-rate/blood pressure determination; Evaluating a cardiovascular condition not otherwise provided for, e.g. using combinations of techniques provided for in this group with electrocardiography or electroauscultation; Heart catheters for measuring blood pressure
    • A61B5/024Detecting, measuring or recording pulse rate or heart rate
    • A61B5/02416Detecting, measuring or recording pulse rate or heart rate using photoplethysmograph signals, e.g. generated by infrared radiation
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/05Detecting, measuring or recording for diagnosis by means of electric currents or magnetic fields; Measuring using microwaves or radio waves 
    • A61B5/053Measuring electrical impedance or conductance of a portion of the body
    • A61B5/0531Measuring skin impedance
    • A61B5/0533Measuring galvanic skin response
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/103Detecting, measuring or recording devices for testing the shape, pattern, colour, size or movement of the body or parts thereof, for diagnostic purposes
    • A61B5/11Measuring movement of the entire body or parts thereof, e.g. head or hand tremor, mobility of a limb
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/14Time supervision arrangements, e.g. real time clock
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • 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
    • H04QSELECTING
    • H04Q9/00Arrangements in telecontrol or telemetry systems for selectively calling a substation from a main station, in which substation desired apparatus is selected for applying a control signal thereto or for obtaining measured values therefrom
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q2209/00Arrangements in telecontrol or telemetry systems
    • H04Q2209/80Arrangements in the sub-station, i.e. sensing device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q2209/00Arrangements in telecontrol or telemetry systems
    • H04Q2209/80Arrangements in the sub-station, i.e. sensing device
    • H04Q2209/82Arrangements in the sub-station, i.e. sensing device where the sensing device takes the initiative of sending data
    • H04Q2209/826Arrangements in the sub-station, i.e. sensing device where the sensing device takes the initiative of sending data where the data is sent periodically
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention discloses a method, a device, equipment and a medium for synchronizing wall time and supplement packets of data, wherein the method is used for physiological data acquisition equipment and comprises the following steps: selecting the time on the target wall as the starting time after receiving the acquisition instruction; generating a wall time at intervals of a first preset time from the start time as a current wall time; when the current wall time is reached, detecting whether an initial data packet is stored in a data cache pool or not; and determining a data packet packaging mode according to the detection result to generate a target data packet, and sending the target data packet. The invention solves the problems that the real starting acquisition time of each sensor of the physiological data acquisition equipment is inconsistent, and the acquisition frequency of each sensor has errors, and the accumulated errors are caused by long-time acquisition.

Description

Wall time and supplementary packet method, device and medium for synchronizing data
Technical Field
The invention relates to the technical field of data acquisition, in particular to a wall time and supplementary packet synchronizing method for multi-modal data, a wall time and supplementary packet synchronizing device for multi-modal data, physiological data acquisition equipment and a computer readable storage medium.
Background
Generally, a plurality of sensors are installed on physiological data acquisition equipment, when an acquisition starting instruction is sent to the physiological data acquisition equipment, the physiological data acquisition equipment controls each sensor to start acquisition, and the actual acquisition starting time of each sensor is inconsistent because the acquisition starting time received by each sensor is inconsistent with the initialization time of the sensor.
In addition, the sensors on the physiological data acquisition equipment generally work according to a set sampling rate, but the sensors have certain errors in actual operation. Taking PPG (photoplethysmography) sensor as an example, the predetermined sampling rate is 100HZ, and 100 sampling points are generally used as a packet of data to report to the upper layer during sampling. When the actual sampling rate of the PPG is higher than 100HZ, the time for actually sampling 100 points is less than 1 second, so that the upper layer receives 1 data packet containing 100 sampling points every less than 1 second when receiving data from the sensor. When the actual sampling rate of the PPG is lower than 100HZ, the time for actually sampling 100 points is higher than 1 second, so that the time interval for reporting data by the sensor is higher than 1 second every time. The problem of accumulated errors occurs in practical application, because the sampling rate of one sensor is generally biased to be unstable when unstable, that is, if the sampling rate of one sensor is biased to be high, the sampling rate of the sensor is always biased to be high during working, so that when a packet of data is processed as one second, the problem of accumulated errors occurs after long-time acquisition.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method and a device for synchronizing wall time and supplement packets of multi-modal data, physiological data acquisition equipment and a storage medium, so as to solve the problems that the acquisition time of each sensor on the physiological data acquisition equipment is inconsistent and the accumulated error occurs during long-time acquisition.
To solve the above technical problems, according to an aspect of the present invention, there is provided a wall time and supplementary packet method of synchronizing multi-modal data for a physiological data acquisition apparatus, the method including:
selecting the target wall time as a starting time when a preset condition is reached;
generating a wall time as a current wall time at intervals of a first preset time from the start time;
when the current wall time is reached, detecting whether an initial data packet is stored in a data cache pool or not;
and determining a data packet packaging mode according to the detection result to generate a target data packet, and sending the target data packet.
In some embodiments, the step of generating the target data packet according to the detection result and determining the data packet packaging mode includes:
when detecting that an initial data packet is stored in the data cache pool, judging whether the data volume of the stored initial data packet is larger than a theoretical value or not to obtain a first judgment result;
and determining the data packet packaging mode to generate the target data packet according to the first judgment result.
In some embodiments, the step of determining, according to the first determination result, that the data packet is generated by the data packet packaging method includes:
when the data amount of the stored initial data packet is smaller than or equal to the theoretical value, taking the initial data packet as the target data packet based on the current wall time;
and when the data volume of the stored initial data packet is larger than the theoretical value, performing group packet increase on the initial data packet based on the current wall time, and taking the increased packet as the target data packet.
In some embodiments, the step of generating the target data packet according to the detection result and determining the data packet packaging mode includes:
when the initial data packet is not stored in the data cache pool, detecting whether the initial data packet is stored in the data cache pool or not every second preset time;
when third preset time is reached, judging whether the initial data packet is stored in the data cache pool or not so as to obtain a second judgment result;
determining the data packet packaging mode to generate the target data packet according to the second judgment result;
the third preset time is an integral multiple of the second preset time, and is less than or equal to the first preset time.
In some embodiments, the step of determining, according to the second determination result, that the data packet is generated in the data packet packaging mode includes:
when the third preset time is reached, the initial data packet is not stored in the data cache pool, the empty packet is used as the target data packet based on the current wall time group empty packet, and the empty packet does not contain data;
and when the third preset time is reached, storing the initial data packet in the data cache pool, and taking the initial data packet as the target data packet based on the current wall time.
According to another aspect of the present invention, there is provided a wall time and supplement packet apparatus for synchronizing multimodal data, characterized in that, for a physiological data acquisition device, the apparatus comprises:
a selection module configured to select a target wall time as a start time when a preset condition is reached;
a generating module configured to generate a wall time as a current wall time every first preset time from the start time;
the detection module is configured to detect whether the initial data packet is stored in the data cache pool or not when the current wall time is reached;
and the group packaging module is configured to determine a data packaging mode according to the detection result to generate a target data packet and send the target data packet.
In some embodiments, the group package module comprises:
the first judging unit is configured to judge whether the data volume of the stored initial data packet is larger than a theoretical value or not when the initial data packet is detected to be stored in the data cache pool, so as to obtain a first judging result;
and the first group of packet units are configured to determine the data group packaging mode according to the first judgment result to generate the target data packet.
In some embodiments, the first group of packet units is specifically configured to:
when the stored data amount of the initial data packet is smaller than or equal to the theoretical value, taking the initial data packet as the target data packet based on the current wall time;
and when the stored data quantity of the initial data packet is larger than the theoretical value, performing group packet increase on the initial data packet based on the current wall time, and taking the increased packet as the target data packet.
In some embodiments, the set of modules includes:
the detection unit is configured to detect whether the initial data packet is stored in the data cache pool once every second preset time when the data cache pool is detected not to store the initial data packet;
the second judgment unit is configured to judge whether the initial data packet is stored in the data cache pool or not when third preset time is reached so as to obtain a second judgment result;
the second group of packet units are configured to determine the data group packet mode according to the second judgment result to generate a target data packet;
the third preset time is an integral multiple of the second preset time, and is less than or equal to the first preset time.
In some embodiments, the second group of packet units is specifically configured to:
when the third preset time is reached, the initial data packet is not stored in the data cache pool, and the empty packet is used as the target data packet based on the current empty packet of the wall time group, wherein the empty packet does not contain data;
and when the third preset time is reached, storing the initial data packet in the data cache pool, and taking the initial data packet as the target data packet based on the current wall time.
According to another aspect of the present invention, there is provided a physiological data acquisition device comprising the wall time and augmentation package apparatus for synchronizing multimodal data as described in any one of the above.
According to another aspect of the invention, there is provided a physiological data acquisition device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, is capable of implementing the steps of the method for wall time and augmentation packaging of synchronized multimodal data as described in any one of the above.
According to yet another aspect of the present invention, there is provided a computer readable storage medium for storing a computer program which, when executed by a computer or processor, performs the steps of any of the above-described methods for synchronizing wall time and augmentation packets of multimodal data.
Compared with the prior art, the invention has obvious advantages and beneficial effects. By the technical scheme, the method and the device for synchronizing the wall time and supplement packet of the multi-mode data, the physiological data acquisition equipment and the storage medium can achieve considerable technical progress and practicability, have wide industrial utilization value and at least have the following advantages:
the method and the device enable the sensors of the physiological data acquisition equipment to start to acquire the physiological data synchronously based on the wall time by defining the wall time so as to align the sampling time of each sensor, thereby solving the problem of inconsistent real acquisition starting time of each sensor.
According to the invention, when the first preset time is preset at intervals, different initial data packet packaging modes are determined according to whether the initial data packets are stored in the cache pool or not to generate the target data packets, so that the target data packets are ensured to be sent at each interval of the first preset time, and the problem of accumulated errors caused by long-time collection when the collection frequency of each sensor has errors is solved.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Drawings
FIG. 1 is a schematic diagram of aligning sensor sampling times by defining a wall time according to one embodiment of the present invention;
FIG. 2 is a schematic flow diagram of a method for synchronizing wall time and augmentation packets of multimodal data in accordance with an embodiment of the present invention;
FIG. 3 is a schematic block diagram of a wall time and supplemental packet arrangement for synchronizing multimodal data in accordance with an embodiment of the present invention;
FIG. 4 is a schematic block diagram of a group package module of an embodiment of the present invention;
FIG. 5 is a schematic flow diagram of a method for synchronizing wall time and augmentation packets of multimodal data in accordance with an embodiment of the present invention;
FIG. 6 is a diagram illustrating a group packaging method according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a group package according to another embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description will be given to specific embodiments and effects of a method and apparatus for synchronizing wall time and supplementary package of multi-modal data, a physiological data acquisition device and a storage medium according to the present invention, with reference to the accompanying drawings and preferred embodiments.
The invention leads the acquisition time of each sensor of the physiological data acquisition equipment to be aligned by defining the on-wall time mode.
In one embodiment, as shown in fig. 1, the PPG, GSR (Galvanic skin response), acceleration sensor, etc. described on the left side of fig. 1 represent sensors on the physiological data acquisition device. Of course, other sensors may be installed on the physiological data acquisition device, and the sensors shown in fig. 1 are only examples and are not intended to limit the types of sensors of the physiological data acquisition device of the present invention. The horizontal lines represent a timeline of wall time. The diamond on the time line represents the data packet formed by sampling data when each sensor is on the wall at 1 second intervals.
It can be appreciated that the sensors of the physiological data acquisition device generally operate at a fixed sampling rate, and in a high sampling rate scenario, the time accuracy requirements may be very strict. However, the sampling rate of the physiological data acquisition device is not an accurate value, which causes accumulated errors in the process of calculating the sampling value time through the sampling rate and the data amount. The invention eliminates the accumulated error of each sensor by performing blank frame and frame increasing processing on the data based on the wall time.
Specifically, the invention provides a wall time and supplementary package method for synchronizing multi-modal data, which is used for a physiological data acquisition device and comprises the following steps:
and step S20, selecting the target wall time as the starting time when the preset condition is reached.
Specifically, the preset condition refers to that the physiological data acquisition device receives an acquisition instruction of an upper layer device; or when the physiological data acquisition equipment finishes sequential physiological data acquisition after receiving an acquisition instruction of upper-layer equipment and stores the initial data packet into the cache pool.
Based on this, when the physiological data acquisition device receives an acquisition instruction of the upper layer device or receives the acquisition instruction and stores the initial data packet into the cache pool, the current wall time (i.e., the target wall time) is selected as the start time, and each sensor of the physiological data acquisition device starts to acquire physiological data based on the start time.
The wall time is initialized according to data stored by a Real Time Clock (RTC) chip in the system starting process, maintained by the system clock during the system running period and synchronized with the RTC chip at a proper time. The wall time is stored in a system core variable xtime that records the time in a year, month, day format in the real world, so that the kernel time stamps certain objects and events, such as recording the creation time, modification time, last access time of a file, or for use by user processes through system calls.
And S21, generating a wall time at intervals of a first preset time from the start time as the current wall time.
Specifically, after the target wall time is selected as the start time in step S20, based on the start time, the sensors on the physiological data acquisition device start to acquire physiological data, and a first preset time is set according to the acquisition cycle of each sensor, for example, the first preset time is set to 1 second, although setting the first preset time to 1 second is only one specific embodiment of the present invention and is not intended to limit the scope of the present invention, and the first preset time may also be set to 2 seconds, 3 seconds, and the like.
From the start time, generating a wall time as the current wall time at intervals of a first preset time, namely at intervals of a physiological data acquisition cycle of each sensor of one physiological data acquisition device.
And S22, detecting whether the initial data packet is stored in the data cache pool or not when the current wall time is reached.
Specifically, when the physiological data acquisition period of each sensor of one physiological data acquisition device is reached, each sensor packs the acquired physiological data and stores the physiological data into the data cache pool. Based on the above, when the time from the start time does not reach a current wall time, that is, each time a data acquisition cycle of each sensor of the physiological data acquisition device is reached, whether a data packet (that is, an initial data packet) of the physiological data acquired by each sensor is stored in the data cache pool is detected, and a detection result is generated.
And step S23, determining a data package packaging mode according to the detection result to generate a target data package, and sending the target data package.
It can be known that, if the data sampling frequency of each sensor is greater than the specified frequency, that is, the sampling period of the sensor is less than the first preset time, in one sampling period, the sensor may have a situation of collecting physiological data for a plurality of times, and the data amount in the data cache pool may exceed the theoretical value. If the data sampling frequency of each sensor is less than the specified frequency, namely the sampling period of the sensor is greater than the first preset time, in one sampling period, the sensor can have the condition that physiological data is not collected, and the data volume in the data cache pool is less than the theoretical value.
Based on the method, the device and the system, the packaging mode of the initial data packet in the data cache pool is determined by detecting the data volume of the physiological data acquired by the sensor in the data cache pool, the target data packet is generated according to the determined packaging mode, and the generated target data packet is sent to the upper-layer equipment.
In one embodiment, step S23 includes: when the initial data packet is stored in the detection data cache pool, judging whether the data volume of the stored initial data packet is larger than a theoretical value or not to obtain a first judgment result; and determining a data packet packaging mode according to the first judgment result to generate a target data packet.
Specifically, when the detection result shows that the initial data packet acquired by each sensor is stored in the data cache pool, whether the data volume of the initial data packet is larger than the theoretical value of the physiological data is further judged. Furthermore, whether the number of the initial data packets in the data cache pool is larger than the theoretical initial data packet number is judged. After the first judgment result is obtained, determining a packaging mode of the initial data packet in the data cache pool according to the first judgment result, and packaging the initial data packet according to the determined packaging mode to obtain a target data packet.
When the first judgment result is that the data volume of the initial data packet stored in the data cache pool is smaller than or equal to the theoretical value of the data volume, that is, in one physiological data acquisition cycle, the data sampling frequency of each sensor is equal to the specified frequency. Then the initial data packet in the data buffer pool is taken as the target data packet based on the current wall time and is sent to the upper layer equipment.
For example, in one data acquisition cycle, since the data sampling frequency of each sensor is equal to the specified frequency, the number of initial data packets stored into the data buffer pool by each sensor is 1, and the theoretical value of the data amount is also 1 data packet. Then 1 initial packet in the data cache pool is sent to the upper layer device as a target packet.
When the first judgment result is that the data volume of the initial data packet stored in the data cache pool is larger than the theoretical value of the data volume, namely, in one physiological data acquisition cycle, the data sampling frequency of each sensor is larger than the specified frequency. Then, the initial data packets in the data cache pool are subjected to packet increase based on the current wall time, and the increased packets are used as target data packets and sent to the upper-layer equipment.
For example, in a data acquisition cycle, since the data sampling frequency of each sensor is greater than the specified frequency, there exists a sampling cycle in which the number of initial data packets stored by each sensor in the data buffer pool is multiple, for example, 2, and the theoretical value of the data amount is 1 data packet. Then the plurality of initial data packets are grouped into an additional packet, that is, the plurality of initial data packets are grouped into one data packet, that is, a target data packet, and the target data packet is sent to the upper layer device.
In one embodiment, step S23 includes: when detecting that the initial data packet is not stored in the data cache pool, detecting whether the initial data packet is stored in the data cache pool at intervals of second preset time; when the third preset time is reached, judging whether the initial data packet is stored in the data cache pool or not so as to obtain a second judgment result; determining a data packet packaging mode according to the second judgment result to generate a target data packet; the third preset time is an integral multiple of the second preset time, and the third preset time is less than or equal to the first preset time.
Specifically, when the detection result shows that the initial data packet is not stored in the data cache pool, it indicates that the data sampling frequency of each sensor is less than the predetermined frequency, and therefore, there may be a case where physiological data sampling is not performed in one data sampling period. Therefore, it is necessary to re-detect whether the initial data packet is stored in the data buffer pool every second preset time from the current wall time.
It is to be understood that the third predetermined time is an integer multiple of the second predetermined time, such as one time, two times, etc. And the third preset time is less than the first preset time. For example, when the first preset time is 1 second, the third preset time may be 100 milliseconds, 200 milliseconds, etc., and the second preset time is 100 milliseconds.
That is, if the initial data packet is detected to be stored in the data cache pool at a second preset time, the third preset time is twice the second preset time, that is, the third preset time is equal to the second preset time. If the initial data packet is detected to be stored in the data cache pool at the two second preset times, the third preset time is twice as long as the second preset time, that is, the third preset time is equal to the two second preset times. However, the third predetermined time is set to a maximum value, and the third predetermined time of the maximum value is smaller than the first predetermined time.
And when the time on the current wall reaches a third preset time, judging whether the initial data packet is stored in the data cache pool or not. And if the initial data packet is stored in the data cache pool, taking the initial data packet as a target data packet, and sending the target data packet to the upper-layer equipment. And if the initial data packet is not stored in the data cache pool, grouping an empty packet based on the current wall time, taking the empty packet as a target data packet, and sending the target data packet to the upper-layer equipment, wherein the physiological data does not exist in the empty packet.
According to the invention, through the mode, one target data packet can be sent to the upper layer equipment in each physiological data acquisition cycle, so that the condition of sending a plurality of target data packets is avoided, and the problem of accumulated errors caused by the sending of a plurality of data packets in the process of calculating the data sampling time through the data sampling frequency and the data amount is further avoided.
In another embodiment of the present invention, a wall time and supplementary packet device for synchronizing multi-modal data is provided, which is used in a physiological data collecting apparatus, as shown in fig. 3, and includes: a selection module 10, a generation module 20, a detection module 30 and a group package module 40.
Wherein the selection module 10 is configured to select a target wall time as a start time when a preset condition is reached; the generating module 20 is configured to generate a wall time at intervals of a first preset time from the start time as a current wall time; the detection module 30 is configured to detect whether the initial data packet is stored in the data cache pool when the current wall time is reached; the group package module 40 is configured to determine a data package mode according to the detection result to generate a target data package, and send the target data package.
Specifically, the preset condition refers to that the physiological data acquisition device receives an acquisition instruction of an upper layer device; or when the physiological data acquisition equipment finishes sequential physiological data acquisition after receiving an acquisition instruction of upper-layer equipment and stores the initial data packet into the cache pool.
Based on this, when the physiological data acquisition device receives an acquisition instruction from the upper device or receives an acquisition instruction and stores the initial data packet into the cache pool, the selection module 10 selects the current wall time (i.e., the target wall time) as the start time, and the sensors of the physiological data acquisition device start to acquire physiological data based on the start time.
The wall time is initialized according to data stored by a Real Time Clock (RTC) chip in the starting process of the system, maintained by the system clock during the running period of the system and synchronized with the RTC chip at a proper time. The wall time is stored in a system core variable xtime that records the time in a year, month, day format in the real world, so that the kernel time stamps certain objects and events, such as recording the creation time, modification time, last access time of a file, or for use by user processes through system calls.
After the selection module 10 selects the target wall time as the start time, the sensors on the physiological data acquisition device start to acquire the physiological data based on the start time, and a first preset time is set according to the physiological data acquisition cycle of each sensor, for example, the first preset time is set to 1 second, although setting the first preset time to 1 second is only one specific embodiment of the present invention and is not intended to limit the scope of the present invention, the first preset time may also be set to 2 seconds, 3 seconds, and the like.
The generating module 20 generates a wall time as the current wall time every first preset time from the start time, that is, every other physiological data acquisition cycle of each sensor of one physiological data acquisition device.
When the physiological data acquisition period of each sensor of one physiological data acquisition device is reached, each sensor can pack the acquired physiological data and store the physiological data in a data cache pool. Based on this, when the time from the start time does not reach a current wall time, that is, each time the data acquisition period of each sensor of one physiological data acquisition device is reached, the detection module 30 detects whether a data packet (that is, an initial data packet) of physiological data acquired by each sensor is stored in the data cache pool, and generates a detection result.
It can be known that, if the data sampling frequency of each sensor is greater than the specified frequency, that is, the sampling period of the sensor is less than the first preset time, in one sampling period, the sensor may have a situation of collecting physiological data for a plurality of times, and the data amount in the data cache pool exceeds the theoretical value. If the data sampling frequency of each sensor is less than the specified frequency, namely the sampling period of the sensor is greater than the first preset time, in one sampling period, the sensor can have the condition that physiological data is not collected, and the data volume in the data cache pool is less than the theoretical value.
Based on this, the group package module 40 determines the group package mode of the initial data packet in the data cache pool by detecting the data amount of the physiological data acquired by the sensor in the data cache pool, further generates the target data packet according to the determined group package mode, and sends the generated target data packet to the upper layer device.
In one embodiment, as shown in FIG. 4, the group package module 40 includes: a first judgment unit 401 and a first group packing unit 402.
The first determining unit 401 is configured to, when an initial data packet is stored in the detection data cache pool, determine whether a data amount of the stored initial data packet is greater than a theoretical value, so as to obtain a first determination result; the first packet unit is configured to determine a packet mode according to the first judgment result to generate a target packet.
Specifically, when the detection result shows that the initial data packet acquired by each sensor is stored in the data cache pool, the first determining unit 401 further determines whether the data amount of the initial data packet is greater than the theoretical value of the physiological data. Furthermore, whether the number of the initial data packets in the data cache pool is larger than the theoretical initial data packet number is judged. After the first determination result is obtained, the first packet grouping unit 402 determines a packet grouping method for the initial data packet in the data cache pool according to the first determination result, and performs packet grouping on the initial data packet according to the determined packet grouping method to obtain the target data packet.
When the first judgment result of the first judgment unit 401 is that the data amount of the initial data packet stored in the data buffer pool is smaller than or equal to the theoretical value of the data amount, that is, in one physiological data acquisition cycle, the data sampling frequency of each sensor is equal to the specified frequency. The first packetizing unit 402 sends the initial packet in the data buffer pool as the target packet to the upper layer device based on the current wall time.
For example, in one data acquisition cycle, since the data sampling frequency of each sensor is equal to the specified frequency, the number of initial data packets stored into the data buffer pool by each sensor is 1, and the theoretical value of the data amount is also 1 data packet. Then 1 initial packet in the data cache pool is sent to the upper layer device as a target packet.
When the first judgment result of the first judgment unit 401 is that the data volume of the initial data packet stored in the data cache pool is greater than the theoretical value of the data volume, that is, in one physiological data acquisition cycle, the data sampling frequency of each sensor is greater than the specified frequency. The first packet packing unit 402 performs packet packing and packet adding on the initial packet in the data buffer pool based on the current wall time, and sends the added packet as a target packet to the upper layer device.
For example, in a data collection cycle, since the data sampling frequency of each sensor is greater than the specified frequency, there exists a sampling cycle in which the number of initial data packets stored by each sensor into the data buffer pool is multiple, for example, 2, and the theoretical value of the data amount is 1 data packet. Then the plurality of initial data packets are grouped into an additional packet, that is, the plurality of initial data packets are grouped into one data packet, that is, a target data packet, and the target data packet is sent to the upper layer device.
In one embodiment, as shown in FIG. 4, the group package module 40 includes: a detection unit 403, a second decision unit 404 and a second group of packet units 405.
The detecting unit 403 is configured to detect whether the initial data packet is stored in the data cache pool at every second preset time when detecting that the initial data packet is not stored in the data cache pool; the second determining unit 404 is configured to determine whether the initial data packet is stored in the data cache pool when a third preset time is reached, so as to obtain a second determining result; the second group packet unit 405 is configured to determine a data group packet mode according to the second determination result to generate a target data packet; the third preset time is an integral multiple of the second preset time, and is less than or equal to the first preset time.
Specifically, when the detection result shows that the initial data packet is not stored in the data cache pool, it indicates that the data sampling frequency of each sensor is less than the predetermined frequency, and therefore, there may be a case where physiological data sampling is not performed in one data sampling period. Therefore, the detecting unit 403 needs to detect whether the initial data packet is stored in the data buffer pool again every second preset time interval from the current wall time.
It is to be understood that the third predetermined time is an integer multiple of the second predetermined time, such as one time, two times, etc. And the third preset time is less than the first preset time. For example, when the first preset time is 1 second, the third preset time may be 100 milliseconds, 200 milliseconds, etc., and the second preset time is 100 milliseconds.
That is, if the detecting unit 403 detects that the initial data packet is stored in the data buffer pool at a second preset time, the third preset time is twice the second preset time, that is, the third preset time is equal to the second preset time. If the detecting unit 403 detects that the initial data packet is stored in the data buffer pool at two second preset times, the third preset time is twice the second preset time, that is, the third preset time is equal to the two second preset times. However, the third predetermined time is set to a maximum value, and the third predetermined time of the maximum value is smaller than the first predetermined time.
When the time on the current wall reaches a third preset time, the second determining unit 404 determines whether the initial data packet is stored in the data cache pool. If the second group of packet units 405 of the initial packet is stored in the data cache pool, the initial packet is used as a target packet, and the target packet is sent to the upper layer device. If the initial data packet is not stored in the data cache pool, the second grouping unit 405 groups an empty packet based on the current wall time, and sends the target data packet to the upper device by using the empty packet as a target data packet, where no physiological data exists in the empty packet.
According to the invention, through the mode, one target data packet can be sent to the upper layer equipment in each physiological data acquisition cycle, so that the condition of sending a plurality of target data packets is avoided, and the problem of accumulated errors caused by the sending of a plurality of data packets in the process of calculating the data sampling time through the data sampling frequency and the data amount is further avoided.
In a specific embodiment, as shown in FIG. 5, a method of synchronizing wall time and augmentation packets of multimodal data includes the steps of:
and S50, selecting the current wall time as the starting time when the starting instruction is received.
Step S51, from the start time, generates one wall time per second as the current wall time.
And step S52, judging whether the data cache pool stores data or not. If yes, go to step S53, otherwise go to step S56.
And step S53, judging whether the data in the data cache pool is larger than a theoretical value, if so, executing step S54, otherwise, executing step S55.
And S54, performing group packet adding on the data in the data cache pool based on the current wall time. The size of the added packet is larger than the size of the normal data packet.
In one example, as shown in fig. 6, if the data sampling frequency of the sensor of the physiological data acquisition device is greater than a predetermined value (i.e. the time interval between the data packets acquired by the sensor and stored in the data buffer pool is less than 1 second), at T +3 seconds, the data packet 3 and the data packet 4 stored in the data buffer pool are packaged to form an additional packet.
And step S55, normally packaging the data in the data cache pool based on the current wall time, namely, a common data packet.
And step S56, detecting whether the data cache pool has data every x milliseconds.
Step S57, determine whether data is detected in the data buffer pool within y milliseconds. If yes, go to step S55, otherwise go to step S58.
Step S58, the empty packet is formed based on the current wall time.
In one example, as shown in fig. 7, if the data sampling frequency of the sensor of the physiological data acquisition device is less than a predetermined value (i.e. the time interval between the data packets acquired by the sensor and stored in the data buffer pool is greater than 1 second), at T +3 seconds, the data buffer pool does not store data, the data buffer pool starts to wait, at 100 milliseconds, the data buffer pool still does not store data, the waiting is continued, and if at 200 milliseconds, the data buffer pool still does not store data, an empty packet is formed.
The physiological data acquisition device of another embodiment of the present invention comprises the wall time and supplementary package device for synchronizing multi-modal data of any of the above embodiments.
The physiological data acquisition device may be a smart band or a smart watch, and the invention is not limited thereto.
A physiological data acquisition device according to another embodiment of the present invention comprises a memory and a processor, the memory storing a computer program that, when executed by the processor, enables the steps of the method of synchronizing wall time and augmentation packets of multimodal data according to any of the embodiments.
A computer-readable storage medium of a further embodiment of the invention stores a computer program which, when executed by a computer or processor, implements the steps of the method of synchronizing wall time and supplementary packets of multimodal data as described in any of the embodiments.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (13)

1. A method of synchronizing wall time and augmentation packets of multimodal data for a physiological data acquisition device, the method comprising:
selecting the target wall time as a starting time when a preset condition is reached;
generating a wall time as a current wall time at intervals of a first preset time from the start time;
when the current wall time is reached, detecting whether an initial data packet is stored in a data cache pool or not;
and determining a data packet packaging mode according to the detection result to generate a target data packet, and sending the target data packet.
2. The method for synchronizing wall time and augmentation packets of multimodal data as claimed in claim 1, wherein said step of generating a target data packet by determining a data packet packing manner according to said detection result comprises:
when detecting that an initial data packet is stored in the data cache pool, judging whether the data volume of the stored initial data packet is larger than a theoretical value or not to obtain a first judgment result;
and determining the data packet packaging mode to generate the target data packet according to the first judgment result.
3. The method for synchronizing wall time and augmentation packets of multimodal data as claimed in claim 2, wherein said step of determining said data packet package based on said first determination result to generate said target data packet comprises:
when the data amount of the initial data packet stored is less than or equal to the theoretical value, taking the initial data packet as the target data packet based on the current wall time;
and when the stored data volume of the initial data packet is larger than the theoretical value, performing group packet increase on the initial data packet based on the current wall time, and taking the increased packet as the target data packet.
4. The method for synchronizing wall time and augmentation packets of multimodal data as claimed in any one of claims 1-3, wherein said step of generating a target data packet by determining a data packet packing manner according to said detection result comprises:
when detecting that the initial data packet is not stored in the data cache pool, detecting whether the initial data packet is stored in the data cache pool or not every second preset time;
when third preset time is reached, judging whether the initial data packet is stored in the data cache pool or not so as to obtain a second judgment result;
determining the data packet packaging mode to generate the target data packet according to the second judgment result;
the third preset time is an integral multiple of the second preset time, and is less than or equal to the first preset time.
5. The method for wall time and augmentation packaging of synchronized multimodal data as claimed in claim 4, wherein said step of determining said data packet package manner to generate said target data packet based on said second determination result comprises:
when the third preset time is reached, the initial data packet is not stored in the data cache pool, and the empty packet is used as the target data packet based on the current empty packet of the wall time group, wherein the empty packet does not contain data;
and when the third preset time is reached, storing the initial data packet in the data cache pool, and taking the initial data packet as the target data packet based on the current wall time.
6. A wall time and supplement packet apparatus for synchronizing multimodal data, for a physiological data acquisition device, the apparatus comprising:
a selection module configured to select a target wall time as a start time when a preset condition is reached;
a generating module configured to generate a wall time at an interval of a first preset time from the start time as a current wall time;
the detection module is configured to detect whether the initial data packet is stored in the data cache pool or not when the current wall time is reached;
and the group packaging module is configured to determine a data packaging mode according to the detection result to generate a target data packet and send the target data packet.
7. The wall time and augmentation package apparatus for synchronizing multimodal data as recited in claim 6, wherein the packaging module comprises:
the first judging unit is configured to judge whether the data volume of the stored initial data packet is larger than a theoretical value or not when the initial data packet is detected to be stored in the data cache pool, so as to obtain a first judging result;
and the first group of packet units are configured to determine the data group packaging mode according to the first judgment result to generate the target data packet.
8. The wall time and add-on package apparatus for synchronizing multimodal data as recited in claim 7, wherein the first set of package units is specifically configured to:
when the stored data amount of the initial data packet is smaller than or equal to the theoretical value, taking the initial data packet as the target data packet based on the current wall time;
and when the stored data volume of the initial data packet is larger than the theoretical value, performing group packet increase on the initial data packet based on the current wall time, and taking the increased packet as the target data packet.
9. The wall time and augmentation package apparatus for synchronizing multimodal data as claimed in any one of claims 6-8, wherein the group including module comprises:
the detection unit is configured to detect whether the initial data packet is stored in the data cache pool once every second preset time when the data cache pool is detected not to store the initial data packet;
the second judgment unit is configured to judge whether the initial data packet is stored in the data cache pool or not when third preset time is reached so as to obtain a second judgment result;
the second group of packet units are configured to determine the data group packet mode according to the second judgment result to generate a target data packet;
the third preset time is an integral multiple of the second preset time, and is less than or equal to the first preset time.
10. The wall time and padding apparatus for synchronizing multimodal data as recited in claim 9, wherein the second set of packet units is specifically configured to:
when the third preset time is reached, the initial data packet is not stored in the data cache pool, and the empty packet is used as the target data packet based on the current empty packet of the wall time group, wherein the empty packet does not contain data;
and when the third preset time is reached, storing the initial data packet in the data cache pool, and taking the initial data packet as the target data packet based on the current wall time.
11. A physiological data acquisition device comprising the wall time and supplemental package means of synchronizing multi-modal data of any of claims 6-10.
12. A physiological data acquisition device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, is capable of carrying out the steps of the method of any one of claims 1 to 5.
13. A computer-readable storage medium for storing a computer program which, when executed by a computer or processor, implements the steps of the method of any one of claims 1 to 5.
CN202210826794.1A 2022-07-14 2022-07-14 Wall time and supplementary packet method, device and equipment for synchronizing data and medium Active CN115167612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210826794.1A CN115167612B (en) 2022-07-14 2022-07-14 Wall time and supplementary packet method, device and equipment for synchronizing data and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210826794.1A CN115167612B (en) 2022-07-14 2022-07-14 Wall time and supplementary packet method, device and equipment for synchronizing data and medium

Publications (2)

Publication Number Publication Date
CN115167612A true CN115167612A (en) 2022-10-11
CN115167612B CN115167612B (en) 2023-06-16

Family

ID=83492830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210826794.1A Active CN115167612B (en) 2022-07-14 2022-07-14 Wall time and supplementary packet method, device and equipment for synchronizing data and medium

Country Status (1)

Country Link
CN (1) CN115167612B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015007099A1 (en) * 2013-07-19 2015-01-22 华为技术有限公司 Data packet transmission method and device
US20150172705A1 (en) * 2013-12-13 2015-06-18 Realtek Semiconductor Corp. Window detection device and method on multi-media system
WO2016061987A1 (en) * 2014-10-24 2016-04-28 中兴通讯股份有限公司 Packet processing method and device
WO2020258901A1 (en) * 2019-06-25 2020-12-30 上海商汤智能科技有限公司 Method and apparatus for processing data of sensor, electronic device, and system
CN113552826A (en) * 2021-07-12 2021-10-26 西人马(西安)测控科技有限公司 Data acquisition system and method
CN215986942U (en) * 2021-07-12 2022-03-08 西人马(西安)测控科技有限公司 Data acquisition system
WO2022068192A1 (en) * 2020-09-30 2022-04-07 三维通信股份有限公司 Relay transmission scheduling method and apparatus, storage medium, and electronic device
WO2022116000A1 (en) * 2020-12-01 2022-06-09 华为技术有限公司 Communication method and apparatus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015007099A1 (en) * 2013-07-19 2015-01-22 华为技术有限公司 Data packet transmission method and device
US20150172705A1 (en) * 2013-12-13 2015-06-18 Realtek Semiconductor Corp. Window detection device and method on multi-media system
WO2016061987A1 (en) * 2014-10-24 2016-04-28 中兴通讯股份有限公司 Packet processing method and device
WO2020258901A1 (en) * 2019-06-25 2020-12-30 上海商汤智能科技有限公司 Method and apparatus for processing data of sensor, electronic device, and system
WO2022068192A1 (en) * 2020-09-30 2022-04-07 三维通信股份有限公司 Relay transmission scheduling method and apparatus, storage medium, and electronic device
WO2022116000A1 (en) * 2020-12-01 2022-06-09 华为技术有限公司 Communication method and apparatus
CN113552826A (en) * 2021-07-12 2021-10-26 西人马(西安)测控科技有限公司 Data acquisition system and method
CN215986942U (en) * 2021-07-12 2022-03-08 西人马(西安)测控科技有限公司 Data acquisition system

Also Published As

Publication number Publication date
CN115167612B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
CN102298334B (en) Breakpoint simulation controller and control method for ground simulation system
CN106453437A (en) Equipment identification code acquisition method and device
CN114048520B (en) Detection system for cross-chip access control
CN108988974A (en) Measurement method, device and the system to electronic equipment time synchronization of time delays
TW201405102A (en) Sensor and method for relating time information to measurement data to be detected by a sensor
CN109240159A (en) Multi-path synchronous signal triggering method, terminal, data collection system and storage medium
CN101141238A (en) Superframe frame synchronization method and device
CN108521547A (en) Image processing method, device and equipment
CN115167612A (en) Wall time and supplementary packet method, device and medium for synchronizing data
US8264462B2 (en) Motion estimation with adaptation of the correlation block size
CN106373616A (en) Method and apparatus for detecting failure of random access memory, and network processor
CN102610002A (en) Machine station state detection system and method
US7827377B2 (en) Method for reading out sensor data
CN100495952C (en) Method for determining asynchronous reason of frame protocol transmission channel
CN104410483B (en) One kind receives packet sequencing and invalid bag processing system
CN105527957A (en) Method for saving fault wave data
CN111858703B (en) Method and device for counting performance test data of benchmark SQL
CN101634939A (en) Fast addressing device and method thereof
CN109831251B (en) Method and device for obtaining bit error rate based on dynamic resource allocation algorithm
CN104614980A (en) Clock synchronizing optimizing method for automatic identification system (AIS) terminal device
JP2018046390A (en) Processing unit, system, processing method and processing program
CN112328463A (en) Log monitoring method and device
CN101964845A (en) Method and device for recovering terminal operation
US20230289417A1 (en) Method for processing fingerprint information, hardware accelerator and fingerprint verification device
CN110442436A (en) Process management method and relevant apparatus based on container

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
GR01 Patent grant
GR01 Patent grant