Data timestamp generation method, system and terminal device

By dynamically updating the temporal reference interval of EEG data frames and performing temporal smoothing filtering, the problem of large deviations between timestamps and actual acquisition timing in traditional methods is solved, achieving temporal stability and data integrity, and improving the accuracy and reliability of EEG analysis.

CN122513049BActive Publication Date: 2026-11-06GOERTEK INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610993573.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-11-06
Estimated Expiration
2046-07-06

AI Technical Summary

Technical Problem

The traditional method of stamping with a fixed theoretical sampling interval cannot be adapted to the dynamic transmission conditions of Bluetooth, resulting in a large deviation between the generated timestamps and the actual collection time of EEG data, which affects the accuracy of EEG data analysis and state assessment.

Method used

By acquiring the reception time of EEG data frames, the timing reference interval is dynamically updated, and a time-domain smoothing filter is used to generate a dynamic timestamp to supplement lost data frames, thereby achieving dynamic updating of the timing reference interval and timing stability.

Benefits of technology

It effectively suppresses timing errors during transmission, ensures timing stability in long-term continuous acquisition scenarios, improves the accuracy and reliability of EEG rhythm analysis and feature recognition, and reduces device power consumption and development complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122513049B_ABST
    Figure CN122513049B_ABST
Patent Text Reader

Abstract

This application provides a data timestamp generation method, system, and terminal device, belonging to the field of data transmission technology. The data timestamp generation method includes: acquiring the reception times of multiple consecutive EEG data frames, and determining the time interval between two adjacent EEG data frames based on the multiple reception times; performing temporal smoothing filtering on the multiple time intervals to dynamically update the timing reference interval; and generating timestamps corresponding to the complete data frame sequence based on the global timing reference time and timing reference interval. This method abandons the fixed theoretical sampling interval used in traditional methods, using the measured and dynamically updated timing reference interval as the timing reference interval for all subsequent data frames. It is not affected by dynamic conditions such as random delays, jitter, or offsets during EEG data transmission, thus solving the problem of large deviations between the generated timestamps and the actual EEG data acquisition timing caused by the fixed theoretical sampling interval stamping method in traditional methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data transmission technology, and in particular relates to a data timestamp generation method, system and terminal device. Background Technology

[0002] Electroencephalography (EEG) data records the electrophysiological signals generated by the firing of neurons in the brain and is widely used in clinical diagnosis and monitoring, brain-computer interfaces, neurofeedback, and mental health. EEG data can be acquired using wearable EEG acquisition devices. Currently, to control hardware costs and reduce device size, wearable EEG acquisition devices use low-cost EEG sensors without hardware clocks. Raw EEG data frames acquired by EEG sensors without hardware clocks lack native hardware timestamps and do not carry any timing information.

[0003] Traditional methods set a fixed theoretical sampling interval based on the sensor's nominal sampling frequency and assign a unified timestamp to the received EEG data frames at this fixed theoretical sampling interval to complete the data timing annotation. However, in traditional methods, the fixed theoretical sampling interval stamping method cannot adapt to the dynamic transmission conditions of Bluetooth, resulting in a large deviation between the generated timestamps and the actual EEG data acquisition timing. This leads to distortion of the subsequently reconstructed EEG waveform and significantly reduces the accuracy of EEG data analysis and state assessment. Summary of the Invention

[0004] The purpose of this application is to provide a data timestamp generation method, system, and terminal device, which aims to solve the problem that the fixed theoretical sampling interval stamping method in traditional methods cannot adapt to the dynamic transmission conditions of Bluetooth, resulting in a large deviation between the generated timestamp and the acquisition timing of the actual EEG data.

[0005] This application provides a method for generating data timestamps, including: The receiving times of multiple consecutive EEG data frames are acquired, and the time interval between two adjacent EEG data frames is determined based on the receiving times of two adjacent EEG data frames. Perform time-domain smoothing filtering on multiple time intervals and dynamically update the timing reference interval; Based on the global time-series reference time and the time-series reference interval, a timestamp corresponding to the complete data frame sequence is generated; wherein, the complete data frame sequence includes multiple consecutive EEG data frames.

[0006] In some embodiments, prior to the step of acquiring the reception times of multiple consecutive EEG data frames, the data timestamp generation method further includes: The first reception time of the first EEG data frame and the second reception time of the second EEG data frame are obtained, and the first reception time is determined as the global timing reference time. The initial timing reference interval is determined based on the first reception time and the second reception time.

[0007] In some embodiments, after the step of generating timestamps corresponding to the complete data frame sequence based on the global time-series reference time and the time-series reference interval, the data timestamp generation method further includes: If the time interval between two adjacent EEG data frames is greater than the timing reference interval, then the number of packet losses between the two adjacent EEG data frames is determined. Based on the number of lost packets and the time-series reference interval, time-series filling is performed on the lost time periods between two adjacent EEG data frames, and the timestamps corresponding to the complete data frame sequence are dynamically updated.

[0008] In some embodiments, after the step of dynamically updating the timestamp corresponding to the complete data frame, the data timestamp generation method further includes: A data interpolation method is used to supplement the missing data frames in the missing time period between two adjacent EEG data frames, so as to dynamically update the complete data frame sequence. The data padding method includes at least one of the following: nearest neighbor padding, mean padding, and linear interpolation.

[0009] In some embodiments, the data timestamp generation method further includes: The timestamps corresponding to the complete data frame sequence are time-aligned with the timestamps corresponding to the wearable device data frame sequence.

[0010] In some embodiments, the step of performing time-domain smoothing filtering on the plurality of time intervals and dynamically updating the time-series reference interval includes: A time-domain smoothing filtering method is used to perform time-domain smoothing filtering on multiple time intervals, and the time-series reference interval is dynamically updated. The time-domain smoothing filtering method includes at least one of the following: moving average filtering method, weighted average filtering method, and median filtering method.

[0011] In some embodiments, the step of performing time-domain smoothing filtering on the plurality of time intervals and dynamically updating the time-series reference interval includes: In the dynamic interval update mode, time-domain smoothing filtering is performed on multiple time intervals to dynamically update the time-series reference interval; The dynamic interval update mode includes at least one of the following: timed update mode, frame-by-frame update mode, and threshold-triggered update mode.

[0012] This application provides a data timestamp generation system, including: An interval determination module is used to acquire the reception time of multiple consecutive EEG data frames and determine the time interval between two adjacent EEG data frames based on the reception time of two adjacent EEG data frames. An interval smoothing correction module is used to perform time-domain smoothing filtering on multiple time intervals and dynamically update the timing reference interval. The timing generation module is used to generate timestamps corresponding to a complete data frame sequence based on the global timing reference time and the timing reference interval; wherein, the complete data frame sequence includes multiple consecutive EEG data frames.

[0013] In some embodiments, the data timestamp generation system further includes: The EEG data acquisition module is used to acquire multiple consecutive EEG data frames; the EEG data frames do not carry timestamps. A wireless transmission module is connected to the EEG data acquisition module and the interval determination module, receives multiple consecutive EEG data frames, and transmits the multiple consecutive EEG data frames to the interval determination module.

[0014] This application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of any of the data timestamp generation methods described in the above embodiments.

[0015] This application provides a program product, including a computer program, which, when run by a processor, causes any of the data timestamp generation methods described in the above embodiments to be executed.

[0016] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: When an EEG data frame is received, a corresponding reception time is recorded, indicating when each EEG data frame is received by the terminal. Multiple consecutive EEG data frames correspond to multiple reception times. Based on the reception times of two adjacent consecutive EEG data frames, a time interval can be determined. Furthermore, based on the reception times of multiple consecutive EEG data frames, multiple time intervals can be determined.

[0017] Temporal smoothing filtering can be understood as smoothing multiple consecutive time intervals using a time-sliding window data processing method. This suppresses timing errors caused by instantaneous transmission disturbances and random delays. The results of temporal smoothing filtering are then used to iteratively refresh the timing reference interval in real time, achieving dynamic updating of the timing reference interval. Furthermore, by applying temporal smoothing filtering to multiple time intervals, gap spikes caused by sudden interference and accidental anomalies during transmission can be eliminated, resulting in smooth and stable frame intervals, thus achieving the goal of dynamically updating the timing reference interval.

[0018] The global timing reference time can be understood as the reception time of the first valid EEG data frame. The timing reference interval is a dynamically updated interval. Starting from the global timing reference time, a timing reference interval is added for each subsequent frame. The calculation is performed frame by frame according to the frame number to generate a standard timestamp corresponding to a complete sequence of data frames that is continuous, uninterrupted, and time-ordered.

[0019] Furthermore, the data timestamp generation method provided in this application abandons the fixed theoretical sampling interval in traditional methods, and uses the measured and dynamically updated time-series reference interval as the time-series reference interval for all subsequent data frames. This avoids the influence of dynamic conditions such as random delays, jitter, or offsets during EEG data transmission. By dynamically updating the time-series reference interval through the data timestamp generation method provided in this application, smooth correction of the time-series reference interval is achieved, effectively suppressing timing errors caused by instantaneous interference and sudden jitter in transmission equipment, and ensuring timing stability in long-term continuous acquisition scenarios.

[0020] Therefore, the data timestamp generation method provided in this application solves the problem that the fixed theoretical sampling interval stamping method in traditional methods cannot adapt to the dynamic transmission conditions of Bluetooth, resulting in a large deviation between the generated timestamp and the actual EEG data acquisition timing. This avoids the problem of distortion in the subsequently restored EEG waveform and improves the accuracy and reliability of EEG rhythm analysis and feature recognition. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or exemplary technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 Schematic diagrams of the steps of the data timestamp generation method provided in some embodiments of this application; Figure 2 Schematic flowcharts of the data timestamp generation method in other embodiments provided in this application; Figure 3 Schematic diagrams of the data timestamp generation system provided in some embodiments of this application; Figure 4 The diagram shows the structure of the terminal device in some embodiments provided in this application. Detailed Implementation

[0023] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.

[0024] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on or indirectly on that other component. When a component is referred to as being "connected to" another component, it can be directly connected to or indirectly connected to that other component.

[0025] It should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0026] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. Additionally, in the embodiments of this application, the terms "first" and "second" are used to distinguish identical or similar items that have substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or order of execution, and that "first" and "second" do not necessarily imply difference.

[0027] In the description of this application, unless otherwise stated, " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between the related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0028] Please see Figure 1 This application provides a method for generating data timestamps, including: Step S10: Obtain the reception times of multiple consecutive EEG data frames, and determine the time interval between two adjacent EEG data frames based on the reception times of two adjacent EEG data frames. Step S20: Perform time-domain smoothing filtering on multiple time intervals and dynamically update the time-series reference interval; Step S30: Generate timestamps corresponding to the complete data frame sequence based on the global time reference time and time reference interval; wherein, the complete data frame sequence includes multiple consecutive EEG data frames.

[0029] In this embodiment, in step S10, when an EEG data frame is received, a corresponding reception time is recorded, indicating the time when each EEG data frame is received by the terminal. Multiple consecutive EEG data frames correspond to multiple reception times. Based on the reception times of two adjacent consecutive EEG data frames, a time interval can be determined. Furthermore, based on the reception times of multiple consecutive EEG data frames, multiple time intervals can be determined, such as ΔT1, ΔT2, ΔT3, etc.

[0030] In step S20, temporal smoothing filtering can be understood as smoothing multiple consecutive time intervals according to the data processing method of a time-series sliding window, in order to suppress timing errors caused by instantaneous transmission disturbances and random delays. The temporal reference interval is then iteratively refreshed in real time using the results of temporal smoothing filtering, achieving dynamic updating of the temporal reference interval. Furthermore, by performing temporal smoothing filtering on multiple time intervals, interval spikes caused by sudden interference and accidental anomalies during transmission can be eliminated, resulting in a smooth and stable frame interval, thus achieving the goal of dynamically updating the temporal reference interval.

[0031] In step S30, the global timing reference time can be understood as the reception time of the first valid EEG data frame. The timing reference interval is the timing reference interval obtained through dynamic updating in step S20. Starting from the global timing reference time, a timing reference interval is added for each frame, and the calculation is performed frame by frame according to the frame number to generate the standard timestamps corresponding to the complete data frame sequence that is continuous, uninterrupted, and has a regular timing.

[0032] Furthermore, the data timestamp generation method provided in this application abandons the fixed theoretical sampling interval in traditional methods, and uses the measured and dynamically updated time-series reference interval as the time-series reference interval for all subsequent data frames. This avoids the influence of dynamic conditions such as random delays, jitter, or offsets during EEG data transmission. By dynamically updating the time-series reference interval through the data timestamp generation method provided in this application, smooth correction of the time-series reference interval is achieved, effectively suppressing timing errors caused by instantaneous interference and sudden jitter in transmission equipment, and ensuring timing stability in long-term continuous acquisition scenarios.

[0033] Therefore, the data timestamp generation method provided in this application solves the problem that the fixed theoretical sampling interval stamping method in traditional methods cannot adapt to the dynamic transmission conditions of Bluetooth, resulting in a large deviation between the generated timestamp and the actual EEG data acquisition timing. This avoids the problem of distortion in the subsequently restored EEG waveform and improves the accuracy and reliability of EEG rhythm analysis and feature recognition.

[0034] Please see Figure 2 In some embodiments, before step S10, which involves obtaining the reception times of multiple consecutive EEG data frames, the data timestamp generation method further includes: Step S01: Obtain the first reception time of the first EEG data frame and the second reception time of the second EEG data frame, and determine the first reception time as the global timing reference time; Step S02: Determine the initial timing reference interval based on the first reception time and the second reception time.

[0035] In this embodiment, in step S01, by real-time monitoring of EEG data, when the first EEG data frame is received, the actual reception time of the first EEG data frame is recorded, which is the first reception time in step S01. The first reception time is determined as the global time series reference time, and used as the reference time for dynamically updating the timestamps in subsequent steps. Using the global time series reference time as a reference time can ensure that the timestamps corresponding to the complete data frame sequence are consistent in time, can be aligned, and are traceable.

[0036] In step S02, by real-time monitoring of EEG data, when the second EEG data frame is received, the actual reception time of the second EEG data frame is recorded, which is the second reception time. The difference between the second reception time and the first reception time is calculated to obtain the initial timing reference interval ΔT=T2. T1. The first and second reception times are the actual times when the EEG data was received, allowing for the calculation of the true transmission interval between the two frames. The timing reference interval reflects the actual transmission interval of the received EEG data frames. Furthermore, based on the global timing reference time and the initial timing reference interval, timestamps corresponding to the complete data frame sequence can be generated.

[0037] Therefore, through steps S01 and S02, the measured initial time reference interval ΔT is used as the dynamic time reference interval for all subsequent data frames. This eliminates the need for the traditional preset fixed theoretical sampling interval and is not affected by dynamic conditions such as random delays, jitter, or offsets during EEG data transmission. It solves the problem that the fixed theoretical sampling interval stamping method in the traditional method cannot adapt to the dynamic transmission conditions of Bluetooth, resulting in a large deviation between the generated timestamp and the actual EEG data acquisition timing.

[0038] In some embodiments, after step S30, which generates timestamps corresponding to the complete data frame sequence based on the global time-series reference time and the time-series reference interval, the data timestamp generation method further includes: Step S40: If the time interval between two adjacent EEG data frames is greater than the time reference interval, then determine the number of packets lost between two adjacent EEG data frames. Step S50: Based on the number of lost packets and the time-series reference interval, perform time-series filling for the lost time periods between two adjacent EEG data frames, and dynamically update the timestamps corresponding to the complete data frame sequence.

[0039] In this embodiment, in step S40, the reception time of the data frame is monitored in real time. By calculating the time interval between two adjacent EEG data frames and comparing it with the timing reference interval, the number of packet losses between two adjacent EEG data frames can be accurately determined. Then, in step S50, based on the number of packet losses and the timing reference interval ΔT, the lost time period between two adjacent EEG data frames is time-stitched and the timestamp corresponding to the complete data frame sequence is dynamically updated. Through steps S40 and S50, data timing discontinuities can be eliminated, ensuring the continuous timing of EEG data throughout the entire process. Packet loss timing completion calibration is achieved, facilitating data analysis in subsequent applications. Thus, steps S40 and S50 solve the problem that traditional technologies cannot identify timing discontinuities and insufficient integrity of EEG data caused by packet loss and frame breaks during transmission.

[0040] In some embodiments, in step S40, the time interval between two adjacent EEG data frames is divided by the time reference interval to determine the number of packet losses between the two adjacent EEG data frames. In step S50, if the number of packet losses is 2, two time reference intervals ΔT are added during the lost time period between two adjacent EEG data frames for time-series padding to dynamically update the timestamps corresponding to the complete data frame sequence.

[0041] In some embodiments, after the step of dynamically updating the timestamp corresponding to the complete data frame in step S50, the data timestamp generation method further includes: Step S60: A data interpolation method is used to supplement the missing data frames in the missing time period between two adjacent EEG data frames, so as to dynamically update the complete data frame sequence. The data interpolation method includes at least one of the following: nearest neighbor interpolation, mean interpolation, and linear interpolation.

[0042] In this embodiment, the nearest value filling method can be understood as taking the data of the frame before or after the lost time period as the data frame of the lost time period and supplementing it in the lost time period to dynamically update the complete data frame sequence.

[0043] The mean-filling method can be understood as taking the average value of the valid frames before and after the lost time period as the fill value. It can obtain the immediate preceding and following frame, or obtain the average of multiple preceding and following frames to supplement the lost time period, so as to dynamically update the complete data frame sequence.

[0044] The linear interpolation method can be understood as taking the data of the valid frames before and after the lost time period as the two ends of a line segment, calculating the corresponding data of the lost time period according to the time ratio, simulating the linear change process of the signal, and supplementing it within the lost time period to dynamically update the complete data frame sequence.

[0045] By determining the number of lost packets based on the time interval between two adjacent EEG data frames and automatically filling in missing time sequences using a timing reference interval, this completely solves the problem of traditional technologies being unable to identify timing gaps and incomplete integrity in EEG data caused by packet loss and frame breaks during transmission. Simultaneously, by employing a data interpolation method to supplement missing data frames in the lost time interval between two adjacent EEG data frames, the continuity and integrity of EEG data acquisition are ensured, data availability is improved in harsh transmission scenarios, and complete timing and data restoration is achieved in packet loss scenarios.

[0046] In some embodiments, after step S30 or after step S60, the data timestamp generation method further includes: Step S70: Time-align the timestamps corresponding to the complete data frame sequence with the timestamps corresponding to the wearable device data frame sequence.

[0047] In this embodiment, after step S30, if there is no packet loss between two adjacent EEG data frames, then step S70 is executed. After step S30, if there is packet loss between two adjacent EEG data frames, then steps S40, S50, and S60 are executed. After step S60, step S70 is executed.

[0048] By aligning the timestamps corresponding to the calibrated complete data frame sequence with the timestamps corresponding to the wearable device data frame sequence, synchronous acquisition and analysis of EEG physiological data and wearable device data are achieved, realizing multi-source data temporal fusion. Step S70 enables precise temporal alignment of EEG data and wearable device data, overcoming the limitations of single data acquisition, supporting multi-dimensional synchronous analysis of physiological states and device posture, and expanding the application scenarios and product functions of wearable EEG detection devices. Furthermore, step S70 solves the problem of the inability to synchronously fuse and analyze multi-source wearable data due to the inability to accurately align the temporal sequence of single EEG data with wearable device data.

[0049] In some embodiments, step S20, which involves performing time-domain smoothing filtering on multiple time intervals and dynamically updating the time-series reference interval, includes: Step S210: Use a time-domain smoothing filtering method to perform time-domain smoothing filtering on multiple time intervals and dynamically update the time-series reference interval. Among them, the time-domain smoothing filtering method includes at least one of the moving average filtering method, the weighted average filtering method, and the median filtering method.

[0050] In this embodiment, the moving average filtering method can be understood as setting a window based on multiple consecutive time intervals, and obtaining the average value of all time intervals within the window each time it slides, which is used as the dynamically updated time-series reference interval. The moving average filtering method can be applied to situations with weak wireless signal interference, and has the advantages of simplicity and low latency. It can evenly smooth out fluctuations and is suitable for scenarios with good signal quality.

[0051] The weighted average filtering method can be understood as assigning different weights to time intervals at different positions within a sliding window and then calculating a weighted average. This method can be applied to situations with moderate interference in wireless signals, suppressing increased jitter, balancing noise reduction and real-time performance, and is well-suited for moderate interference conditions.

[0052] Median filtering can be understood as obtaining the median of all time intervals within a sliding window, or as obtaining the time interval at the middle position within the sliding window. Median filtering can be applied to situations with strong wireless signal interference, directly discarding extreme outliers and quickly eliminating abnormal transitions.

[0053] By employing different temporal smoothing filtering methods to address various application scenarios, and performing temporal smoothing filtering on multiple time intervals, the timing reference interval can be corrected and updated. This effectively suppresses timing errors caused by interference and sudden jitter during wireless transmission, ensuring timing stability in long-term continuous acquisition scenarios. Therefore, by using temporal smoothing filtering methods to process multiple time intervals, the dynamically updated timing reference interval becomes more accurate and more stable.

[0054] In some embodiments, step S20, which involves performing time-domain smoothing filtering on multiple time intervals and dynamically updating the time-series reference interval, includes: Step S220: In the dynamic interval update mode, perform time-domain smoothing filtering on multiple time intervals and dynamically update the time-series reference interval. The dynamic interval update mode includes at least one of the following: timed update mode, frame-by-frame update mode, and threshold-triggered update mode.

[0055] In this embodiment, the dynamic interval update mode can be configured as three modes: timed update mode, frame-by-frame update mode, and threshold-triggered update mode. In step S220, at least one of the timed update mode, frame-by-frame update mode, and threshold-triggered update mode is used to perform temporal smoothing filtering on multiple time intervals to dynamically update the timing reference interval.

[0056] The timed update mode can be understood as updating the time-series baseline interval once at a fixed time period. The frame-by-frame update mode can be understood as updating the time-series baseline interval once for each frame of EEG data received. The threshold-triggered update mode can be understood as updating the time-series baseline interval once when it exceeds a preset threshold. The dynamic interval update mode can be configured into three modes—timed update, frame-by-frame update, and threshold-triggered update—to adapt to different high- and low-speed EEG acquisition scenarios.

[0057] In some embodiments, the timed update mode is adapted to low-speed EEG acquisition scenarios. The frame-by-frame update mode is adapted to high-speed EEG acquisition scenarios. The threshold-triggered update mode can be adapted to both low-speed and high-speed EEG acquisition scenarios.

[0058] The data timestamp generation method provided in this application achieves dynamic timestamp calibration based on a dual-packet measured benchmark, ensuring that the acquisition end has no hardware clock and no native timestamp throughout the entire process. The entire timing calibration process is completed by the terminal device receiving the data, eliminating the need for clock synchronization between the two ends. It can adapt to transmission jitter, automatically complete lost packet timing, and support multi-source data timing fusion. Throughout the entire data timestamp generation method, clock synchronization between the EEG data acquisition module and the terminal device is not required. All timing calibration, calculation, and padding processes are completed independently by the terminal device, solving the problems of high power consumption, high complexity, and secondary errors caused by relying on clock synchronization between the two ends in traditional technologies.

[0059] Please see Figure 3 This application provides a data timestamp generation system 100. The data timestamp generation system 100 includes an interval determination module 10, an interval smoothing correction module 20, and a timing generation module 30. The interval determination module 10 is used to acquire the reception times of multiple consecutive EEG data frames and determine the time interval between two adjacent EEG data frames based on their reception times. The interval smoothing correction module 20 is used to perform temporal smoothing filtering on the multiple time intervals and dynamically update the timing reference interval. The timing generation module 30 is used to generate timestamps corresponding to a complete data frame sequence based on the global timing reference time and timing reference interval. The complete data frame sequence includes multiple consecutive EEG data frames.

[0060] In this embodiment, the description of the interval determination module 10 can be found in the description of step S10 in the above embodiments. The description of the interval smoothing correction module 20 can be found in the description of step S20 in the above embodiments. The description of the timing generation module 30 can be found in the description of step S30 in the above embodiments.

[0061] In some embodiments, the data timestamp generation system 100 further includes an EEG data acquisition module 40 and a wireless transmission module 50. The EEG data acquisition module 40 is used to acquire multiple consecutive EEG data frames; the EEG data frames do not carry timestamps. The wireless transmission module 50 is connected to the EEG data acquisition module 40 and the interval determination module 10, receives multiple consecutive EEG data frames, and transmits the multiple consecutive EEG data frames to the interval determination module 10.

[0062] In this embodiment, the EEG data acquisition module 40 can employ a low-cost dry electrode EEG acquisition device without a hardware clock unit. It is responsible for continuously acquiring raw EEG signals from the human body and encapsulating them into EEG data frames. The EEG data frames output by the EEG data acquisition module 40 do not carry any hardware timestamps or timing identification information.

[0063] The wireless transmission module 50 can implement Bluetooth wireless transmission or WiFi wireless transmission, etc., and this application does not specifically limit it. The wireless transmission module 50 is electrically bound to the EEG data acquisition module 40 and receives the raw EEG data frames continuously acquired by the EEG data acquisition module 40. All EEG data frames do not have native timestamp information. They are broadcast outward in real time through the wireless transmission module 50 without data timing preprocessing and do not carry timestamps.

[0064] In some embodiments, the interval determination module 10, the interval smoothing correction module 20, and the timing generation module 30 can be integrated into the data processing module of the terminal device. Furthermore, the data processing module, EEG data acquisition module 40, and wireless transmission module 50 of the terminal device work collaboratively with a streamlined overall architecture, making them adaptable to wearable devices. The data timestamp generation system 100 is suitable for precise timing correction of EEG data in scenarios such as the fusion acquisition of data from wearable EEG detection devices and other wearable devices. The data timestamp generation system 100 eliminates the need for clock synchronization between the acquisition end and the terminal device throughout the process, removing the communication interaction and program logic for bidirectional clock calibration, reducing the power consumption of the wearable device, and simplifying the hardware control program. Therefore, the data timestamp generation system 100 reduces device power consumption and development complexity, meeting the application requirements of lightweight and low-cost wearable devices.

[0065] In some embodiments, the data timestamp generation system 100 further includes a dual-packet baseline calibration module 60, a packet loss identification and compensation module 70, and a multi-source timing interface 80. The dual-packet baseline calibration module 60 executes steps S01 and S02, the relevant descriptions of which can be found in steps S01 and S02. The packet loss identification and compensation module 70 executes steps S40, S50, and S60, the relevant descriptions of which can be found in steps S40, S50, and S60. The multi-source timing interface 80 executes step S70, the relevant description of which can be found in step S70. The multi-source timing interface 80 accesses data from other wearable devices to achieve cross-device timing alignment.

[0066] In some embodiments, the multi-source timing interface 80 can be adapted to various wearable device data such as heart rate, gyroscope, and accelerometer, and this application does not make specific limitations.

[0067] In some embodiments, the interval determination module 10, the interval smoothing correction module 20, the timing generation module 30, the dual-packet reference calibration module 60, the packet loss identification and compensation module 70, and the multi-source timing interface 80 can be integrated into the data processing module of the terminal device 200 and deployed on receiving devices such as mobile phones or wearable terminals. They can independently complete all timestamp generation and timing calibration without needing to synchronize with the acquisition end clock. Furthermore, the data timestamp generation system 100 provided in this application has strong versatility and scalability, and is compatible with various low-cost EEG acquisition sensors without hardware clocks. Moreover, the data timestamp generation system 100 provided in this application has a simplified and adaptable hardware architecture, can be expanded to adapt to various types of wearable sensing devices, and is easy to industrialize.

[0068] Please see Figure 4 This application provides a terminal device 200, including a memory 210, a processor 220, and a computer program 211 stored in the memory 210 and executable on the processor 220. When the processor 220 executes the computer program 211, it implements the steps of the data timestamp generation method as described in any of the above embodiments.

[0069] In this embodiment, when the processor 220 executes the computer program 211, it implements the steps in the above-described embodiments of the data timestamp generation methods. Alternatively, when the processor 220 executes the computer program 211, it implements the functions of each module in the above-described data timestamp generation system 100.

[0070] For example, computer program 211 may be divided into one or more modules, one or more modules may be stored in memory 210 and executed by processor 220 to complete this application. One or more modules may be a series of computer program instruction segments capable of performing a specific function, which are used to describe the execution process of computer program 211 in terminal device 200.

[0071] Terminal device 200 may be a receiving device such as a mobile phone or wearable terminal. Terminal device 200 may include, but is not limited to, a processor 220 and a memory 210. Those skilled in the art will understand that... Figure 4 This is merely an example of terminal device 200 and does not constitute a limitation on terminal device 200. It may include more or fewer components than shown, or combine certain components, or different components. For example, terminal device 200 may also include input / output devices, network access devices, buses, etc.

[0072] The processor 220 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0073] The memory 210 can be an internal storage unit of the terminal device 200, such as a hard disk or RAM of the terminal device 200. The memory 210 can also be an external storage device of the terminal device 200, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or FlashCard equipped on the terminal device 200. Furthermore, the memory 210 can include both internal and external storage units of the terminal device 200. The memory 210 is used to store computer programs and other programs and data required by the terminal device. The memory 210 can also be used to temporarily store data that has been output or will be output.

[0074] This application provides a program product including a computer program 211, which, when run by a processor 220, causes the data timestamp generation method of any of the above embodiments to be executed.

[0075] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0076] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0077] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0078] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0079] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0080] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0081] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0082] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0083] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for generating data timestamps, characterized in that, include: The receiving times of multiple consecutive EEG data frames are acquired, and the time interval between two adjacent EEG data frames is determined based on the receiving times of two adjacent EEG data frames. A time-domain smoothing filtering method is used to perform time-domain smoothing filtering on multiple time intervals to dynamically update the time-series reference interval; wherein, the time-domain smoothing filtering method includes at least one of a moving average filtering method, a weighted average filtering method, and a median filtering method; Based on the global timing reference time and the timing reference interval, a timestamp corresponding to the complete data frame sequence is generated; wherein, the complete data frame sequence includes multiple consecutive EEG data frames; the global timing reference time is the first reception time for acquiring the first EEG data frame.

2. The data timestamp generation method as described in claim 1, characterized in that, Before the step of acquiring the reception times of multiple consecutive EEG data frames, the data timestamp generation method further includes: Acquire the second reception time of the second EEG data frame; The initial timing reference interval is determined based on the first reception time and the second reception time.

3. The data timestamp generation method as described in claim 1, characterized in that, After the step of generating timestamps corresponding to the complete data frame sequence based on the global time-series reference time and the time-series reference interval, the data timestamp generation method further includes: If the time interval between two adjacent EEG data frames is greater than the timing reference interval, then the number of packet losses between the two adjacent EEG data frames is determined. Based on the number of lost packets and the time-series reference interval, time-series filling is performed on the lost time periods between two adjacent EEG data frames, and the timestamps corresponding to the complete data frame sequence are dynamically updated.

4. The data timestamp generation method as described in claim 3, characterized in that, After the step of dynamically updating the timestamp corresponding to the complete data frame, the data timestamp generation method further includes: A data interpolation method is used to supplement the missing data frames in the missing time period between two adjacent EEG data frames, so as to dynamically update the complete data frame sequence. The data padding method includes at least one of the following: nearest neighbor padding, mean padding, and linear interpolation.

5. The data timestamp generation method according to any one of claims 1 to 4, characterized in that, The data timestamp generation method further includes: The timestamps corresponding to the complete data frame sequence are time-aligned with the timestamps corresponding to the wearable device data frame sequence.

6. The data timestamp generation method according to any one of claims 1 to 4, characterized in that, The step of performing time-domain smoothing filtering on multiple time intervals and dynamically updating the time-series reference interval includes: In the dynamic interval update mode, time-domain smoothing filtering is performed on multiple time intervals to dynamically update the time-series reference interval; The dynamic interval update mode includes at least one of the following: timed update mode, frame-by-frame update mode, and threshold-triggered update mode.

7. A data timestamp generation system, characterized in that, include: An interval determination module is used to acquire the reception time of multiple consecutive EEG data frames and determine the time interval between two adjacent EEG data frames based on the reception time of two adjacent EEG data frames. An interval smoothing correction module is used to perform time-domain smoothing filtering on multiple time intervals using a time-domain smoothing filtering method, and dynamically update the time-series reference interval; wherein, the time-domain smoothing filtering method includes at least one of a moving average filtering method, a weighted average filtering method, and a median filtering method; The timing generation module is used to generate timestamps corresponding to a complete data frame sequence based on the global timing reference time and the timing reference interval; wherein, the complete data frame sequence includes multiple consecutive EEG data frames; the global timing reference time is the first reception time of acquiring the first EEG data frame.

8. The data timestamp generation system as described in claim 7, characterized in that, The data timestamp generation system also includes: The EEG data acquisition module is used to acquire multiple consecutive EEG data frames; the EEG data frames do not carry timestamps. A wireless transmission module is connected to the EEG data acquisition module and the interval determination module, receives multiple consecutive EEG data frames, and transmits the multiple consecutive EEG data frames to the interval determination module.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data timestamp generation method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Network delay determination method and device, electronic equipment and storage medium

    CN122226193A

  • Methods and systems for synchronization using delay asymmetry

    WO2018096304A1