Real-time Compression and Reconstruction Method, Device and Equipment for Electroencephalogram Signals in Attention Glasses

By performing segmented processing, sparse decomposition and reconstruction of EEG signals, combined with feature analysis and cache strategies, the information loss and computing resource limitation of EEG signal compression methods in the existing technology is solved, and efficient and reliable EEG signal compression and reconstruction is achieved.

CN120066283BActive Publication Date: 2025-07-18XIAOZHOU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510553029.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-07-18
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

The existing EEG signal compression methods fail to fully utilize the time-frequency characteristics and spatial distribution characteristics of EEG signal, resulting in information loss and lack a systematic feature extraction and protection mechanism, making it difficult to achieve a fine balance between data compression and feature retention. At the same time, the computing resource limitation of portable devices requires efficient real-time processing capabilities, which affects the reliability of compressed data.

Method used

By performing segmented processing and local analysis of multi-channel EEG signals, time-frequency features and spatial correlation are extracted, sparse decomposition and reconstruction technology are adopted, combined with feature analysis and cache strategies, compressed sequences are generated and real-time reconstruction is carried out, data grading and storage resource allocation are optimized, and efficient compression and accurate reconstruction are achieved.

Benefits of technology

It significantly reduces the amount of data transmission, meets the real-time processing needs of portable devices, retains key signal components, improves the reliability and practical value of compressed data, and optimizes the utilization efficiency of storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066283B_ABST
    Figure CN120066283B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of brain-computer interfaces, and particularly to a method, device and equipment for real-time compression and reconstruction of electroencephalogram signals in an attention glasses. The method includes: segmenting multi-channel electroencephalogram signals collected by the attention glasses to generate a preprocessing sequence; performing local analysis on the preprocessing sequence to generate a compression sequence; generating a correlation sequence according to the preprocessing sequence and the compression sequence to generate a real-time sequence for reconstruction and generating a reconstruction sequence; performing feature analysis on the compression sequence to obtain key points, generating a protection sequence based on the key points; grading the data of the protection sequence to obtain importance, constructing a cache space based on the importance, allocating resources by using the cache space, and generating a storage sequence according to the resource allocation result corresponding to the allocated resources; generating compressed data according to the reconstruction sequence and the storage sequence, and completing the real-time compression and reconstruction of electroencephalogram signals in the attention glasses. The efficient compression of electroencephalogram signals is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of brain-computer interfaces, and in particular, to a method, device, and equipment for real-time compression and reconstruction of electroencephalogram (EEG) signals in an attention glasses. Background Art

[0002] As a portable EEG acquisition device, the attention glasses need to record and transmit a large amount of EEG data for a long time, which poses a severe challenge to the storage capacity and transmission bandwidth of the device. Traditional signal compression methods mainly adopt general data compression strategies and fail to fully utilize the time-frequency characteristics and spatial distribution characteristics of EEG signals, resulting in the loss of important physiological feature information during the compression process. Although there are already targeted EEG signal compression methods, these methods often lack a hierarchical protection mechanism for signal features and it is difficult to ensure the accurate reconstruction of key components.

[0003] In practical applications, the EEG signals collected by the attention glasses have their particularities, including complex spatial correlations between multiple channels, obvious time-frequency hierarchical structures of signal features, and the need to accurately capture attention state transitions. Existing compression methods lack a systematic feature extraction and protection mechanism and it is difficult to achieve a fine balance between data compression and feature retention. At the same time, the limited computing resources of portable devices require the compression algorithm to have efficient real-time processing capabilities. In addition, existing methods have a lag in dealing with dynamic changes in attention state and lack an effective strategy for collaborative compression of multi-channel signals, affecting the reliability of the compressed data in practical applications.

[0004] Therefore, there is an urgent need for a method to solve at least one of the above problems. Summary of the Invention

[0005] Embodiments of this application provide a method, device, and equipment for real-time compression and reconstruction of EEG signals in an attention glasses. The method aims to solve the problems that in practical applications, the EEG signals collected by the attention glasses have their particularities, including complex spatial correlations between multiple channels, obvious time-frequency hierarchical structures of signal features, and the need to accurately capture attention state transitions. Existing compression methods lack a systematic feature extraction and protection mechanism and it is difficult to achieve a fine balance between data compression and feature retention. At the same time, the limited computing resources of portable devices require the compression algorithm to have efficient real-time processing capabilities. In addition, existing methods have a lag in dealing with dynamic changes in attention state and lack an effective strategy for collaborative compression of multi-channel signals, affecting the reliability of the compressed data in practical applications.

[0006] In a first aspect, embodiments of this application provide a method for real-time compression and reconstruction of EEG signals in an attention glasses, including:

[0007] Segment the multi-channel EEG signals collected by the attention glasses to generate a preprocessing sequence; perform local analysis on the preprocessing sequence to obtain quantization intervals and construct a parameter table, use the parameter table for accuracy division, generate a quantization sequence according to the accuracy division, and generate a compression sequence according to the quantization sequence;

[0008] Generate a correlation sequence according to the preprocessing sequence and the compression sequence, perform block processing on the correlation sequence to obtain a data stream, generate a real-time sequence based on the data stream; perform reconstruction decomposition on the real-time sequence to generate a reconstruction sequence;

[0009] Perform feature analysis on the compression sequence to obtain key points, generate a protection sequence based on the key points; perform data grading on the protection sequence to obtain importance, construct a cache space based on the importance, allocate resources using the cache space, and generate a storage sequence according to the resource allocation result corresponding to the allocated resources;

[0010] Generate compressed data according to the reconstruction sequence and the storage sequence, and complete the real-time compression and reconstruction of EEG signals in the attention glasses.

[0011] In a second aspect, the present application also provides a device for real-time compression and reconstruction of EEG signals in an attention glasses, including:

[0012] A first generation unit for segmenting the multi-channel EEG signals collected by the attention glasses to generate a preprocessing sequence; performing local analysis on the preprocessing sequence to obtain quantization intervals and construct a parameter table, using the parameter table for accuracy division, generating a quantization sequence according to the accuracy division, and generating a compression sequence according to the quantization sequence;

[0013] A second generation unit for generating a correlation sequence according to the preprocessing sequence and the compression sequence, performing block processing on the correlation sequence to obtain a data stream, generating a real-time sequence based on the data stream; performing reconstruction decomposition on the real-time sequence to generate a reconstruction sequence;

[0014] A third generation unit for performing feature analysis on the compression sequence to obtain key points, generating a protection sequence based on the key points; performing data grading on the protection sequence to obtain importance, constructing a cache space based on the importance, allocating resources using the cache space, and generating a storage sequence according to the resource allocation result corresponding to the allocated resources;

[0015] A compression and reconstruction unit for generating compressed data according to the reconstruction sequence and the storage sequence, and completing the real-time compression and reconstruction of EEG signals in the attention glasses.

[0016] In a third aspect, the present application also provides a computer device, including a processor and a memory. The memory is used to store a computer program, and when the computer program is executed by the processor, it implements the method for real-time compression and reconstruction of electroencephalogram signals in the attention glasses as described in the first aspect.

[0017] This method processes multi-channel electroencephalogram signals in segments, extracts signal features (such as time-frequency features, amplitude features), identifies redundant information, and generates a preprocessing sequence. Perform local analysis on the preprocessing sequence (such as time-domain / frequency-domain statistical analysis), determine the dynamic quantization interval and construct a parameter table; generate a quantization sequence according to the precision division, and then extract the feature basis through sparse decomposition (such as wavelet transform, compressive sensing) and encode it to generate a compressed sequence. Combine the preprocessing sequence and the compressed sequence to generate a correlation sequence, process it in blocks as a data stream, and generate a real-time sequence through pipeline operation; use a reconstruction basis (such as orthogonal basis, overcomplete dictionary) to combine signals and generate a reconstruction sequence; at the same time, extract key points (such as electroencephalogram events, attention feature peaks) from the compressed sequence, construct a protection area and allocate cache resources to generate a storage sequence. Match the features of the reconstruction sequence and the storage sequence and reorganize the signals to output high-fidelity and low-latency compressed data, completing real-time compression and reconstruction.

[0018] Through segmented processing, pipeline operation, and multi-level compression strategy, the data transmission volume is significantly reduced, meeting the real-time processing requirements of electroencephalogram signals (such as attention monitoring scenarios). The combination of dynamic quantization interval and sparse decomposition retains key signal components; the dual mechanisms of reconstruction basis and protection area avoid the loss of high-frequency features (such as attention fluctuations). The cache resource allocation strategy based on key points preferentially protects important electroencephalogram features (such as event-related potential ERP) and reduces the storage overhead of invalid data. The design of the parameter table and the feature mapping table supports the adaptive compression of different signal patterns (such as resting state, task state), improving the generalization ability of the method.

[0019] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a schematic flow chart of the method for real-time compression and reconstruction of electroencephalogram signals in the attention glasses shown in the embodiments of the present application;

[0021] Figure 2 It is a schematic structural diagram of the device for real-time compression and reconstruction of electroencephalogram signals in the attention glasses shown in the embodiments of the present application;

[0022] Figure 3 It is a schematic structural diagram of the computer device shown in the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] In the following description, specific details such as specific system architectures, technologies, etc. are presented for purposes of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obscuring the description of the present application.

[0024] It should be understood that when used in the specification of the present application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0025] It should also be understood that the term "and / or" used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0026] As used in the specification of the present application and the appended claims, the term "if" can be interpreted as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined" or "in response to determining" or "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]" depending on the context.

[0027] In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0028] Reference to "one embodiment" or "some embodiments" or the like described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0029] The technical solutions of the embodiments of the present application will be introduced below.

[0030] As a portable electroencephalogram (EEG) acquisition device, the attention glasses need to record and transmit a large amount of EEG data for a long time, which poses severe challenges to the storage capacity and transmission bandwidth of the device. Traditional signal compression methods mainly adopt general data compression strategies and fail to fully utilize the time-frequency characteristics and spatial distribution characteristics of EEG signals, resulting in the loss of important physiological feature information during the compression process. Although there are targeted EEG signal compression methods, these methods often lack a hierarchical protection mechanism for signal features and are difficult to ensure the accurate reconstruction of key components.

[0031] In practical applications, the EEG signals collected by the attention glasses have their particularities, including complex spatial correlations among multiple channels, obvious time-frequency hierarchical structures of signal features, and the need to accurately capture attention state transitions. Existing compression methods lack a systematic feature extraction and protection mechanism and are difficult to achieve a fine balance between data compression and feature retention. At the same time, the computational resource limitations of portable devices require that the compression algorithm has efficient real-time processing capabilities. In addition, existing methods have a lag in dealing with dynamic changes in the attention state and lack an effective strategy for collaborative compression of multi-channel signals, affecting the reliability of the compressed data in practical applications.

[0032] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a real-time compression and reconstruction method for EEG signals in an attention glasses provided by an embodiment of the present application. The real-time compression and reconstruction method for EEG signals in the attention glasses according to the embodiment of the present application can be applied to a computer device, which includes but is not limited to devices such as smart phones, laptop computers, tablet computers, desktop computers, physical servers, and cloud servers. As Figure 1 shown, the real-time compression and reconstruction method for EEG signals in the attention glasses of this embodiment includes steps S101 to S104, which are described in detail as follows:

[0033] Step S101: Segment the multi-channel EEG signals collected by the attention glasses to generate a preprocessing sequence; perform local analysis on the preprocessing sequence to obtain quantization intervals and construct a parameter table, use the parameter table for precision division, generate a quantization sequence according to the precision division, and generate a compression sequence according to the quantization sequence.

[0034] Specifically, adaptive segmentation processing is performed on the multi-channel EEG signals collected by the attention glasses. The overlapping sliding window method is used for signal segmentation. The window length is set to 2 seconds, and the overlapping rate of adjacent windows is 50% to ensure the continuity of signal analysis. For the signals within each time window, multi-dimensional features are extracted: in the time domain, statistical features such as mean, variance, kurtosis, skewness, and zero-crossing rate are extracted; in the frequency domain, the energy distribution, relative power, and spectral entropy of each frequency band of Delta (0.5 - 4 Hz), Theta (4 - 8 Hz), Alpha (8 - 13 Hz), and Beta (13 - 30 Hz) are extracted through fast Fourier transform; continuous wavelet transform is used to obtain time-frequency joint features, and the db4 wavelet basis function is selected for 5-layer decomposition to extract the wavelet coefficients of each scale. At the same time, spatial features between channels are calculated, including the inter-channel correlation coefficient matrix, coherence index, and phase synchronization value. Based on the extracted feature matrix, key component marking is immediately carried out: first, principal component analysis is used for dimensionality reduction, and the principal components with a cumulative contribution rate reaching 95% are retained; then, the contribution weights of each feature to the principal components are calculated, and the feature dimensions with weight values higher than 0.8 are marked as key components; for the Alpha band features related to attention, the marking threshold is particularly reduced to 0.6 to ensure retention. To cope with the non-stationary characteristics of EEG signals, a macro time window with a length of 10 seconds is used to dynamically update the key component marking, and the exponential smoothing method (smoothing coefficient 0.3) is used to stabilize the marking results. In addition, for sudden artifacts, an outlier recognition mechanism based on threshold detection is designed. When the feature value at a certain time point exceeds the normal range (mean ± 3 times the standard deviation), the local median is used for substitution to ensure the stability of feature extraction. Through this series of processes, signal features and key components are finally obtained.

[0035] Based on the signal features and key components obtained in the previous step, a multi-level redundant recognition system is constructed. In the time dimension, a similarity matrix of the key components in adjacent windows is calculated, and the cosine similarity is used as the metric. When the similarity exceeds 0.9, the corresponding components in that time window are marked as time redundancy, and the deviation value from the reference window is recorded. In the spatial dimension, the information redundancy between multiple channels is analyzed, and the mutual information value of the key components between channels is calculated. When the mutual information value between two channels exceeds 1.5, it is marked as spatial redundancy, and the dominant channel with larger information volume is determined. In the frequency dimension, the energy distribution of each frequency band is analyzed, and a frequency redundancy determination criterion is constructed: when the energy ratio of a certain frequency band is lower than 1% and the contribution degree of the key components in this frequency band to signal reconstruction is lower than 0.5%, it is marked as frequency redundancy. Further, a redundant feature association map is established, where nodes represent features, edges represent redundant relationships, and edge weights represent the degree of redundancy. Graph theory algorithms are used to analyze the clustering characteristics of redundant features, and redundant feature chains and redundant feature clusters are identified. To improve the robustness of redundant recognition, an adaptive threshold mechanism is introduced: based on the local statistical characteristics of the signal, the redundant determination threshold is dynamically adjusted, increasing the threshold during drastic signal changes to reduce misjudgment, and decreasing the threshold during relatively stable signals to improve compression efficiency. At the same time, a redundant pattern library is established to record common redundant feature combination patterns for accelerating the subsequent redundant recognition process. In addition, a signal stability evaluation mechanism based on sliding variance is designed. When the signal fluctuates greatly, the strictness of redundant recognition is appropriately reduced to protect signal details. Through these processing steps, redundant information is finally obtained.

[0036] In some embodiments, the generating the preprocessing sequence includes: obtaining the key components corresponding to the signal features extracted by the segmentation processing; identifying redundant information according to the key components, and generating the preprocessing sequence according to the redundant information.

[0037] Design an adaptive signal preprocessing strategy using the redundant information identified in the previous step. First, for the redundant components in the time dimension, implement differential coding: when the feature difference between adjacent time windows is less than the adaptive threshold (dynamically adjusted according to the signal variance, with a baseline value of 0.1), only save the difference information and perform logarithmic quantization on the difference value, with the quantization precision decreasing as the redundancy degree increases. For the redundancy in the spatial dimension, construct a reference system based on the dominant channel: select the channel with the maximum mutual information as the reference channel, and other channels only save the relative change information with respect to the reference channel and adaptively adjust the quantization precision according to the redundancy degree. In the frequency dimension, implement band adaptive compression: for the bands marked as redundant, adopt a non-uniform quantization strategy, where the quantization step size is proportional to the redundancy degree, and the maximum can reduce the quantization precision to 1 / 8 of the original precision. Then, construct a feature importance ranking table and sort all the preprocessed features according to their contribution degrees in signal reconstruction. To optimize the preprocessing performance, introduce a caching mechanism: establish a two-layer caching structure, where the fast cache stores the recently processed feature values, and the slow cache saves the historical feature statistical information for guiding the dynamic adjustment of preprocessing parameters. At the same time, implement an adaptive bit allocation strategy based on signal entropy: allocate more bits to the signal segments with high information entropy and perform stronger compression on the signal segments with low information entropy. Finally, generate a preprocessing sequence containing the data part and the header information, and at the same time generate a preprocessing mapping matrix to record the transformation relationship from the original feature space to the preprocessing feature space. Through these processing steps, the preprocessing sequence is finally obtained.

[0038] Conduct an in-depth analysis of the preprocessing sequence output from the above steps. First, extract key parameters such as the differential threshold, quantization precision, and reference channel from the header information of the preprocessing sequence, which reflect the basic statistical characteristics of the signal. According to the feature importance ranking recorded in the preprocessing sequence, identify the signal regions that need to be protected with priority, and mark the top 30% of the ranked regions as the high-fidelity regions. At the same time, use the redundant information in the preprocessing sequence to extract the redundancy degree quantization values in the time dimension, spatial dimension, and frequency dimension, and mark the regions with a redundancy degree higher than 0.8 as the low-precision quantization regions. Based on this information, conduct local statistical analysis: use a fine window with a length of 1 second in the high-fidelity regions and a rough window with a length of 4 seconds in the low-precision regions to calculate the probability distribution characteristics within each window. For the key time points (such as attention state transition points) marked in the preprocessing sequence, insert an additional transition window of 0.5 seconds. Within each analysis window, combined with the precision information of the preprocessing sequence, use the Lloyd-Max algorithm to iteratively optimize the division of the quantization intervals. The quantization interval in the high-fidelity region is set to 1 / 64 of the mean square error, and in the low-precision region is set to 1 / 16 of the mean square error. At the same time, according to the band energy distribution recorded in the preprocessing sequence, set different quantization precision weights for different frequency bands. Through the comprehensive utilization of this information, the quantization intervals and parameter tables are finally obtained.

[0039] Based on the parameter table obtained in the previous step, design a precision division strategy. First, classify signal segments according to the local importance indicators of the signal (including energy concentration, spectral complexity, and time-domain mutation degree), and establish a three-level precision division mechanism. For signal segments with high importance (such as regions containing significant attention features), the highest precision is used for quantization, and the bit depth can reach up to 12 bits; for regions of medium importance, an 8-bit quantization precision is used; for regions of low importance, a 4-bit quantization precision is used. At the same time, an adaptive bit-depth adjustment algorithm based on the local statistical characteristics of the signal is implemented: when a significant increase in the local variance of the signal is detected, the quantization precision is automatically increased to ensure the retention of signal details; when the signal tends to be stable, the quantization precision is appropriately reduced to improve the compression efficiency. Construct a precision control table to record the quantization precision and corresponding reconstruction parameters used for different signal segments. In addition, a quantization precision smooth transition mechanism is designed to avoid sudden changes in quantization precision between adjacent signal segments and reduce quantization noise. To further optimize the precision allocation, a dynamic precision adjustment strategy based on signal prediction is introduced: use linear prediction to analyze the predictability of the signal, reduce the quantization precision for signal segments with strong predictability, and increase the quantization precision for signal segments with weak predictability. Through these processing steps, a precision division scheme is finally obtained.

[0040] Using the precision division scheme obtained in the previous step, perform multi-level adaptive quantization. First, according to the quantization precision requirements of different signal segments, construct corresponding quantizers, including uniform quantizers and non-uniform quantizers. For linear feature regions, standard uniform quantization is used; for non-linear feature regions, non-uniform quantization based on probability distribution is used to match the distribution of quantization levels with the probability distribution of signal amplitudes. A quantization optimization mechanism based on error feedback is implemented: by calculating the local quantization error and feeding the error information back to the quantization process of subsequent samples, dynamic compensation of the error is achieved. During the quantization process, special attention is paid to the mutation characteristics of the signal: when a signal mutation is detected, the quantization precision is temporarily increased and a marker bit is inserted to ensure the accurate capture of mutation information. At the same time, a quantization index table is established to record the quantization scheme and corresponding reconstruction parameters used for each signal segment. To improve the quantization effect, a weighted quantization strategy based on perceptual characteristics is introduced: higher quantization precision is given to signal features that are sensitive to human perception, and lower precision is used for insensitive features. By referring to the principle of the psychoacoustic model, a feature perception importance evaluation model is constructed to guide the allocation of quantization precision. Finally, the quantized data and quantization parameters are encapsulated together to generate a quantization sequence in standard format. Through these processing steps, a quantization sequence is finally obtained.

[0041] Perform an in-depth analysis of the quantized sequence output from the above steps. First, parse the precision information in the quantized sequence to extract the quantization precision (12 bits, 8 bits, 4 bits) and quantization parameters for different regions. Based on this precision information, perform a fine wavelet decomposition on the high-precision region (12 bits), using the db4 wavelet basis function for 6-level decomposition; perform a 4-level decomposition on the medium-precision region (8 bits); and only perform a 2-level decomposition on the low-precision region (4 bits), thereby achieving a reasonable allocation of computing resources. At each decomposition level, adjust the reconstruction threshold of the wavelet coefficients according to the interval division information in the quantized sequence: the threshold for the high-precision region is set to 1 / 8 of the quantization interval, the medium-precision region is set to 1 / 4 of the quantization interval, and the low-precision region is set to 1 / 2 of the quantization interval. Specifically for the positions of the mutation points marked in the quantized sequence, use denser wavelet analysis around these positions to ensure the accurate capture of signal features. At the same time, use the parameter table information recorded in the quantized sequence to perform adaptive normalization on the wavelet coefficients, making the coefficient distribution more suitable for subsequent feature extraction. By integrating the quantization precision, interval information, and parameter table, construct a hierarchical feature extraction strategy, and finally obtain the feature basis.

[0042] Based on the feature basis obtained in the previous step, construct a sparse representation framework. First, design a multi-scale atom dictionary according to the wavelet coefficient distribution at different levels in the feature basis. For the coefficients in the high-frequency layer (layers 1-2), construct Gabor basis functions with a short time window (64 points); for the medium-frequency layer (layers 3-4), use cosine basis functions with a medium window (128 points); for the low-frequency layer (layers 5-6), use wavelet packet basis functions with a long window (256 points). In particular, at the positions of the mutation points indicated by the feature basis, add Haar basis functions to improve the representation ability for jumps. During the dictionary construction process, use the K-SVD algorithm to optimize the basis functions to better adapt to the signal features. Implement a fast sparse decomposition algorithm based on CoSaMP (Compressive Sampling Matching Pursuit) to iteratively optimize the coefficient selection. At the same time, design an adaptive iterative stopping criterion according to the energy distribution in the feature basis: the high-energy region allows more iteration times (up to 50 times), and the low-energy region stops early (at least 10 times). To improve the decomposition efficiency, introduce a prediction mechanism based on local correlation, using the results of the decomposed regions to guide the selection of basis functions for subsequent regions. Through these processing steps, finally obtain the sparse representation.

[0043] Using the sparse representation obtained in the previous step, perform encoding conversion. Design a hierarchical encoding strategy: for the coefficients with the top 10% amplitudes in the sparse representation, use 32-bit floating-point encoding; for the coefficients with amplitudes between 10% and 30%, use 16-bit fixed-point encoding; for the coefficients with amplitudes between 30% and 60%, use 8-bit fixed-point encoding; for the remaining coefficients, only save the sign bit and 3-bit magnitude information. Establish an adaptive grouping mechanism based on sparsity: for the regions with high sparsity (less than 20% non-zero coefficients), use run-length encoding to compress the positions of zero coefficients; for the regions with moderate sparsity (20% - 50% non-zero coefficients), use block position encoding; for the regions with low sparsity (more than 50% non-zero coefficients), directly encode all positions. At the same time, analyze the coefficient distribution characteristics in the sparse representation, establish a local probability model, and guide the construction of the Huffman encoding table. Introduce a context adaptation mechanism: dynamically adjust the encoding parameters according to the statistical characteristics of the encoded region. To improve the error resistance ability, add cyclic redundancy check (CRC) protection to the key coefficients. Through these processing steps, the encoding conversion result is finally obtained.

[0044] In some embodiments, generating the compressed sequence according to the quantization sequence includes: performing sparse decomposition on the quantization sequence to obtain a feature basis; constructing a sparse representation according to the feature basis, performing encoding conversion using the sparse representation, and generating the compressed sequence according to the encoding conversion.

[0045] Based on the encoding conversion result obtained in the previous step, generate the final compressed sequence. First, design a data frame structure hierarchically according to the importance of the encoded data: the key frame contains the complete information of the important coefficients, and the prediction frame only contains the differential information and update parameters. Design a flexible field structure in the frame header: in addition to the basic quantization parameters and encoding methods, it also includes an adaptively allocated metadata area for storing dynamically changing encoding parameters and index tables. Implement an error protection strategy based on data importance: use RS (Reed - Solomon) encoding to provide strong protection for the frame header and key coefficients, and use simple parity check for secondary information. Design an index structure that supports random access: each key frame contains the complete decoding parameters, enabling decompression to start from any key frame. At the same time, establish a data block link mechanism, where adjacent data blocks are connected by pointers to support the streaming processing of data. To optimize the storage efficiency, introduce a redundancy elimination mechanism based on a sliding window: analyze the data similarity between adjacent frames, only save the repeated patterns once and establish a reference relationship. Finally, organize all components in a standard format to generate the final compressed sequence. Through these processing steps, the compressed sequence is finally obtained.

[0046] Step S102, generate a correlation sequence according to the preprocessing sequence and the compressed sequence, perform block processing on the correlation sequence to obtain a data stream, generate a real-time sequence based on the data stream; perform reconstruction decomposition on the real-time sequence to generate a reconstruction sequence.

[0047] Specifically, the preprocessing sequence output from the above steps and the compressed sequence output from the above steps are deeply analyzed to construct a channel mapping relationship.

[0048] In some embodiments, generating a correlation sequence according to the preprocessing sequence and the compressed sequence includes: constructing a channel mapping according to the preprocessing sequence and the compressed sequence, and performing differential processing based on the channel mapping; extracting a principal component according to the differential result corresponding to the differential processing, and generating the correlation sequence according to the principal component.

[0049] First, extract the correlation information between channels and the spatial distribution characteristics from the preprocessing sequence, and at the same time parse the compression parameters and importance ratings of each channel from the compressed sequence. According to these two types of information, establish a channel correlation matrix: the matrix element aij represents the comprehensive correlation degree between the i-th channel and the j-th channel, considering the spatial correlation (weight 0.6) in the preprocessing sequence and the feature similarity (weight 0.4) in the compressed sequence. For channel pairs with a correlation degree exceeding 0.85, divide them into the same channel group. In particular, for channels marked as critical in the preprocessing sequence (such as channels containing significant attention features), set them as independent channel groups. At the same time, based on the non-zero coefficient distribution in the compressed sequence, evaluate the information density of each channel, and merge channels with similar information density (difference less than 15%). In this way, a hierarchical channel mapping is finally constructed.

[0050] Based on the channel mapping obtained in the previous step, perform differential processing. For the signals within the same channel group, first select the channel with the highest information density as the reference channel. For the signals of other channels, adopt an adaptive differential strategy: for the part highly correlated with the reference channel (correlation coefficient > 0.9), directly calculate the signal difference; for the moderately correlated part (correlation coefficient 0.7 - 0.9), perform phase correction first and then calculate the difference; for the low correlated part (correlation coefficient < 0.7), retain the original signal. When calculating the difference, dynamically adjust the differential order according to the change characteristics of the local signal: use second-order difference in the signal stable section to obtain a higher compression rate, and use first-order difference in the mutation section to preserve the signal details. At the same time, the time alignment information between channels is retained during the differential process, and a timestamp mapping table is established to ensure that the timing relationship of the signal can be accurately restored during subsequent reconstruction. For independent channel groups, select the optimal differential parameters according to their feature distribution in the preprocessing sequence.

[0051] Based on the differential results output in the previous step, principal component extraction is performed. First, analyze the statistical characteristics of the differential signals: for the highly correlated differential signals within the channel group (original correlation coefficient > 0.9), a shorter analysis window (128 points) is adopted because the signals after differentiation change faster; for moderately correlated and lowly correlated differential signals, longer analysis windows (256 points and 512 points) are used. According to the amplitude distribution characteristics of the differential signals, the parameters of time-frequency analysis are adaptively set: for regions with larger differential amplitudes (exceeding twice the standard deviation of the mean), analysis parameters with high frequency resolution are used, and for regions with smaller differential amplitudes, parameters with high time resolution are used. In particular, at the positions where the differential signals have mutations (amplitude change exceeds 50%), marker points are inserted and fine-grained analysis is performed at these locations. Then, based on these characteristics, an improved principal component analysis is executed: the covariance matrix of the differential signals is constructed, and the weights of the matrix elements are dynamically adjusted according to the differential amplitudes, with the larger the amplitude, the higher the weight. The principal component directions are obtained through eigenvalue decomposition, and the number of principal components is selected according to the energy distribution characteristics of the differential signals: for regions where the differential energy is concentrated (the proportion of the first 3 eigenvalues exceeds 85%), fewer principal components are selected, and for regions where the energy is dispersed, the number of principal components is increased.

[0052] Based on the principal components obtained in the previous step, a correlation sequence is generated. First, a mapping matrix from the principal components to the original channels is constructed according to the characteristics of the differential signals, and the matrix elements include linear transformation coefficients and time alignment parameters. To improve the reconstruction accuracy, the elements of the mapping matrix are adaptively quantized: for coefficients with high contribution (absolute value > 0.3), high-precision quantization (12 bits) is used, and for secondary coefficients, low-precision quantization (6 bits) is used. At the same time, the expression ability of the principal components in different time periods is analyzed, and when the expression error exceeds the threshold, supplementary information is inserted into the correlation sequence. To facilitate subsequent processing, the correlation sequence is organized into a hierarchical structure: the core layer contains the principal components and their mapping parameters, the enhancement layer contains differential compensation information, and the calibration layer contains time alignment parameters. Finally, an index table is established to record the storage locations and access methods of the information in each layer, and a data integrity check code is added. Through these processing steps, the correlation sequence is finally obtained. Taking the real-time monitoring scenario of attention glasses as an example, the hierarchical structure design of this correlation sequence has practical significance: the principal component data in the core layer supports quickly obtaining the change trend of the user's attention state; the differential compensation information in the enhancement layer is used to accurately restore the EEG characteristics at certain critical moments, such as attention transition points and transient fluctuations; the time alignment parameters in the calibration layer ensure the synchronization of multi-channel data, which is crucial for analyzing the collaborative activity rules of different brain regions. This hierarchical organization method enables the system to flexibly call information at different levels according to actual needs, improving the processing efficiency while ensuring the data quality.

[0053] Perform chunking on the relevant sequences output by the above steps. First, determine the basic chunk size according to the time characteristics and content features of the signals: adopt a larger chunk size (2048 points) for the intervals with stable attention states, and a smaller chunk size (512 points) for the state transition regions. When performing chunking, make full use of the hierarchical structure information in the relevant sequences: the core layer data is used to determine the key chunking points, the enhancement layer information is used to optimize the chunking boundaries, and the calibration layer parameters are used to maintain the temporal consistency of the chunking. For each data chunk, extract its feature descriptors, including data type, priority, timestamp, and dependencies, to form chunk-level metadata. By analyzing the correlation degree of adjacent data chunks, establish the link relationships between chunks, and finally mark to form a data flow structure.

[0054] In some embodiments, generating a real-time sequence based on the data flow includes: constructing a processing unit based on the data flow, and using the processing unit to perform pipelined operations; generating a real-time sequence according to the pipelined operations.

[0055] Based on the data flow obtained in the previous step, design the architecture of the processing unit. For each data chunk, first determine the processing order according to its inter-chunk link information: construct a dependency graph through the link relationships, and preferentially process the data chunks that are dependent on by multiple subsequent chunks. At the same time, use the feature descriptors in the chunk-level metadata to allocate appropriate processing resources for different types of data chunks: allocate the highest priority and the most computing resources to the chunks marked as real-time state monitoring in the data flow, followed by data integrity verification, and the lowest priority for data compression and storage. Inside the processing unit, implement intelligent data prefetching based on the temporal characteristics of the data flow: analyze the inter-chunk association patterns in the data flow, predict the next data chunk that may need to be processed, and load it into the cache in advance. The processing unit adopts a hierarchical design: the input layer is responsible for the parsing and feature extraction of data chunks, and sets multiple parallel feature extractors to process time-domain features, frequency-domain features, and spatial features respectively; the middle layer executes core algorithm processing, including functional modules such as state recognition, pattern matching, and data compression; the output layer is responsible for result integration and data encapsulation to ensure the unity of the output data format. For the data patterns that frequently appear in the data flow, dynamically establish a pattern dictionary for quickly identifying and processing similar data chunks. In particular, for the sudden changes in the data flow, an adaptive processing strategy based on the data flow characteristics is designed: when it is detected that the data flow pattern has changed significantly, automatically adjust the parameter configuration and resource allocation of the processing unit.

[0056] Using the processing unit constructed in the previous step, perform pipelining operations. Based on the processing unit, establish a three-level pipeline: The first level performs feature parsing on data blocks and preprocesses them according to the preset parameters of the processing unit; the second level executes the core algorithm and performs the main calculations using the resources configured by the processing unit; the third level integrates the results and synchronizes the data. Implement differential pipelining control according to different priority settings of the processing unit: High-priority tasks can interrupt the current pipelining process and be directly processed through the fast channel of the processing unit; medium-priority tasks are processed through the regular pipeline; low-priority tasks are processed in the background when resources are idle. Optimize data access in the pipeline according to the cache strategy of the processing unit: The prefetched data is directly loaded from the cache to reduce pipeline stalls. At the same time, based on the mode dictionary of the processing unit, intelligent acceleration of the pipeline is achieved: For the identified common data patterns, directly call the optimized post-processing flow in the processing unit. To handle emergencies, design a dynamic pipeline reconstruction mechanism based on the state of the processing unit: When the processing unit detects a significant change in data characteristics, the pipeline can quickly switch the processing mode.

[0057] Generate a real-time sequence based on the processing results of the pipelining operations. First, establish a result buffer, which is divided into a real-time data area and a temporary storage area: The real-time data area stores the processing results of the current time window, and the temporary storage area is used to temporarily store data that needs further processing or waiting for time alignment. Perform time alignment processing on the data output by the pipeline: Utilize the timestamp information in the data block to ensure the temporal synchronization of data in different processing channels. Implement a real-time packetization mechanism for data: Organize the processing results of the same time window into data packets in a unified format. The packet header contains meta-information such as timestamps, data types, and processing status, and the packet body contains the processed signal data. Design a priority scheduling strategy for data packets: High-priority data packets (such as changes in attention status) enter the real-time data stream first; regular data packets are queued and processed in chronological order. When generating the real-time sequence, implement data quality control: Check the integrity of each data packet to ensure the continuity and reliability of the data. Take the attention detection scenario as an example: When a change in attention status is detected, the relevant data packets are marked as high-priority, and the system quickly integrates them into the real-time data stream to ensure timely reflection of user state changes; at the same time, the system continuously processes regular EEG data to maintain monitoring of overall EEG activities. Through these processing steps, a real-time sequence is finally obtained.

[0058] In some embodiments, the reconstructing and decomposing the real-time sequence to generate a reconstructed sequence includes: obtaining a reconstruction basis for reconstructing and decomposing the real-time sequence; constructing a constraint condition based on the reconstruction basis and performing signal combination using the constraint condition; generating a reconstructed sequence according to the signal combination.

[0059] Analyze the real-time sequence output from the above steps. First, extract the basic information required for reconstruction: Parse meta-information such as timestamps, data types, and processing status from the real-time data stream to determine the time axis and data organization method for reconstruction. For packets in different time windows, analyze their internal structures in detail: Parse the meta-information part in the packet header, including parameters such as sampling rate, data precision, and channel configuration; Read the signal data in the packet body and determine the reliability level of the data based on the processing status flag. Based on the priority information of the packets, construct a hierarchical reconstruction strategy: For packets marked as high priority (such as the attention state transition area), configure a fine reconstruction mode and call the complete set of reconstruction basis functions; For packets marked as regular priority, adopt a standard reconstruction mode and use the basic set of reconstruction basis functions; For packets marked as low priority, use a simplified reconstruction mode and only retain the main features. By analyzing the continuity of the packets, establish a detailed data quality evaluation system: Detect the time intervals between packets and mark the discontinuous points that exceed the preset threshold (such as 20 ms); Evaluate the integrity of the signals within the packets and mark the areas where data is missing or damaged; Analyze the signal-to-noise ratio level of the signals and mark the data segments with severe noise. Based on these analysis results, construct a reconstruction basis dictionary: It contains basis functions of different scales and types. Wavelet basis functions are used to capture the multi-scale features of the signals, Gabor basis functions are used to express the time-frequency local features, and spline basis functions are used for smoothing. For each basis function, configure its parameters according to the data characteristics: The decomposition level of the wavelet basis function is adaptively adjusted according to the frequency range of the signal; The time-frequency resolution of the Gabor basis function is dynamically set according to the local characteristics of the signal; The order of the spline basis function is determined according to the smoothness requirement of the data.

[0060] Based on the reconstructed basis dictionary obtained in the previous step, a system of constraint conditions is designed. First, according to the characteristics of different types of basis functions in the reconstructed basis dictionary, corresponding constraint rules are established: for the part reconstructed by wavelet basis functions, an energy constraint is set to ensure that the scale decomposition of the reconstructed signal is similar to the original signal; for the region reconstructed by Gabor basis functions, a time-frequency localization constraint is imposed to ensure a reasonable energy distribution of the reconstructed signal in the time-frequency plane; for the segment reconstructed by spline basis functions, a smoothness constraint is added to control the continuity of the signal derivative. Specific constraints are set for different EEG rhythms: when reconstructing the Alpha band (8 - 13 Hz), a phase constraint is established based on the corresponding basis functions in the reconstructed basis dictionary to ensure the continuity of the waveform; when reconstructing the Beta band (13 - 30 Hz), a bandwidth constraint is set using the frequency characteristics of the basis functions to limit the range of variation of the instantaneous frequency; when reconstructing the Theta band (4 - 8 Hz), a morphological constraint is set in combination with the characteristics of low-frequency basis functions to maintain the typical waveform of slow waves. At the same time, based on the spatial basis functions in the reconstructed basis dictionary, an inter-channel constraint is constructed: the reconstructed signals between adjacent channels should satisfy spatial smoothness, and the signal amplitude difference should not exceed the set threshold; the reconstructed signals between distant channels need to satisfy a reasonable phase difference. For the characteristic regions marked in the reconstructed basis dictionary, an additional feature fidelity constraint is set: the reconstruction error at key time points (such as attention state transition points) needs to be controlled at a low level; the energy distribution in important frequency bands (such as the dominant rhythm frequency band) needs to be accurately maintained.

[0061] Using the constraint condition system established in the previous step, perform the combined process of signal reconstruction. First, based on the type and complexity of the constraint conditions, design a multi-level reconstruction strategy: for regions that satisfy basic constraints (such as energy and smoothness constraints), adopt a fast reconstruction algorithm to directly combine the corresponding basis functions; for regions that need to satisfy multiple complex constraints (such as time-frequency and spatial constraints), use an iterative optimization method to gradually adjust the reconstruction parameters. During the reconstruction process, implement adaptive optimization control: dynamically adjust the optimization step size based on the gradient information of the constraint conditions, use a small step size (such as 0.01) for fine adjustment in regions where the error changes violently, and use a large step size (such as 0.1) to accelerate convergence in regions where the error is smooth; adaptively adjust the weight coefficients of different constraints by monitoring the satisfaction degree of the constraint conditions. For detected data discontinuity points, design special reconstruction strategies: for missing data with a short time interval (<100ms), use local interpolation, and determine the interpolation parameters based on the constraint conditions of the front and back data segments; for missing data with a long time interval (>100ms), predict based on a statistical model, and at the same time mark the credibility level in the reconstruction result. Implement a block reconstruction mechanism: divide the long sequence into multiple overlapping subsequences (overlap rate 50%), and after each subsequence is independently reconstructed, smooth the transition at the connection by the weighted average method, and the weight coefficients are determined by the satisfaction degree of the constraint conditions. During the reconstruction process, pay special attention to the key regions indicated by the constraint conditions: for critical moments such as attention state transitions, focus on ensuring the reconstruction quality of relevant frequency bands; for regions with obvious spatial features, emphasize maintaining the correlation between channels.

[0062] As the signal is continuously reconstructed, the system needs to continuously optimize its performance based on the reconstruction results. Establish a real-time evaluation system for reconstruction quality: calculate the objective indicators of the reconstructed signal and the reference signal, including mean square error, cross-correlation coefficient, and spectral similarity; analyze the physiological characteristic indicators of the reconstructed signal, such as the energy ratio of each frequency band, the phase synchronization degree between channels, etc.; evaluate the degree to which the reconstructed signal meets the constraint conditions. Based on the evaluation results, implement an adaptive optimization mechanism: when the reconstruction quality does not meet the requirements, locate the constraint conditions that cause the problem through backtracking analysis and adjust the relevant parameters for optimization; when a new signal pattern appears, update the constraint condition set in a timely manner to ensure the adaptability of the reconstruction system. For different types of reconstruction deviations, design targeted correction strategies: correct frequency feature deviations by adjusting the weights of frequency domain constraints; compensate for time alignment deviations by optimizing delay parameters; improve spatial distribution deviations by updating the constraints between channels. Establish a reliability evaluation mechanism for the reconstruction results: perform anomaly detection on the reconstructed signal to identify possible artifacts or distortions; when an anomaly is detected, initiate an alternative reconstruction plan and reprocess it using more conservative constraint conditions. Taking the attention detection scenario as an example: the system monitors the reconstruction quality of the Alpha band activity in real time, including the continuity of the waveform, the stability of the phase, and the rationality of the spatial distribution, and ensures the accurate reconstruction of these key features through timely parameter adjustment. Through these processing steps, a reconstructed sequence is finally obtained.

[0063] Step S103: Perform feature analysis on the compressed sequence to obtain key points, generate a protection sequence based on the key points; perform data grading on the protection sequence to obtain importance, construct a cache space based on the importance, allocate resources using the cache space, and generate a storage sequence according to the resource allocation result corresponding to the allocated resources.

[0064] Specifically, perform feature analysis on the compressed sequence output from the above steps. First, extract the coding information from the compressed sequence: read the Huffman coding table, run-length coding parameters, and position index information recorded in the header; parse the hierarchical structure of the compressed data, including the main EEG features in the core data layer and the auxiliary information in the enhanced data layer. Based on this coding information, identify the key features of the signal: frequently occurring coding patterns indicate the repetitive characteristics of the data, long run-length coding segments indicate stable regions of the signal, and dense position indices indicate mutation regions of the signal. Use the quantization parameters saved in the compressed sequence for multi-dimensional feature analysis: extract key waveform features related to attention from the high-precision quantization region; calculate the energy distribution of each frequency band based on the frequency band division information in the compressed sequence, and pay particular attention to the energy ratio of the Alpha (8 - 13 Hz) and Beta (13 - 30 Hz) bands; combine the quantization residual distribution to evaluate the complexity level of the signals in each brain region. In the spatial dimension, analyze the inter-channel correlation recorded in the compressed sequence and establish an association map of brain region activities. For each identified feature region, establish a detailed feature description table, including time position, frequency distribution, spatial range, amplitude characteristics, and phase information. Perform hierarchical clustering on the extracted features, identify feature groups with similar patterns, and mark their representative feature points. Specifically for the coding features in the attention state transition region of the compressed sequence, extract the typical feature combinations of the state transition. Based on all the feature analysis results, construct a multi-level feature point marking system to provide a basis for the definition of subsequent protection regions.

[0065] Based on the feature point system identified in the previous step, define a comprehensive protection region. First, determine the protection scope in the time dimension: analyze the time persistence of each feature point, set a wide time window for stable features with a duration exceeding 500 ms, and use a narrow time window for transient features (such as sharp waves); in areas with dense feature points, set overlapping time windows to ensure feature continuity. Construct a protection barrier in the frequency dimension: centered on the main frequency components of the feature points, expand the protection bandwidth upward and downward, and the bandwidth size is dynamically adjusted according to the frequency resolution requirements; for features with frequency modulation, set a protection region with a variable bandwidth. Establish a spatial protection network: based on the three-dimensional distribution of the electrodes, expand the protection scope of each feature point to the relevant brain regions, considering the volume conduction effect of the EEG signals to ensure the integrity of the signal source; for brain regions with overlapping multiple feature points, establish a hierarchical protection strategy. Implement intelligent boundary division: set a transition zone at the boundary of the protection region, and use the gradient information of the feature intensity to determine the width of the transition zone; for regions with frequent feature transitions, increase the buffer region to prevent feature aliasing. For the feature region related to attention, construct a double-layer protection mechanism: the inner layer ensures the complete retention of the core features, and the outer layer maintains the natural transition between the features and the background. Finally, generate a complete protection region mapping table, which details the attribute parameters of each protection region.

[0066] Perform feature retention operations using the detailed protection area mapping table defined in the previous step. In time-domain feature retention: Segment the original waveform to ensure the precise positioning of key turning points, peaks, and valleys; use spline interpolation techniques to maintain waveform continuity; for rapidly changing waveform segments, increase the sampling point density. In frequency-domain feature retention: Adopt a multi-resolution analysis method, using adaptive frequency resolution for features in different frequency bands; maintain the amplitude and phase relationships of the main frequency components; for the instantaneous changes in frequency components, record the modulation envelope. Spatial feature retention strategy: Maintain the correlation structure between channels and retain spatial gradient information; for features concentrated in spatial distribution, increase the sampling density in the central region. Implement a hierarchical protection mechanism: Adopt a lossless protection mode for the core feature region; allow controllable information loss for the secondary feature region; retain statistical characteristics for the basic feature region. In terms of data storage: Divide the continuous feature sequence into appropriately sized data blocks, each block containing an independent feature descriptor. Feature fusion processing: For cross-region features, construct a feature transition zone; use a weighted average method within the transition zone to achieve smooth feature transitions.

[0067] In some embodiments, generating the protection sequence based on the key points includes: constructing a protection area based on the key points; performing feature retention according to the protection area, and generating the protection sequence according to the feature retention.

[0068] Generate the final protection sequence based on the feature retention results of the previous step. In the sequence header area: Construct a protection parameter index table, including area division information, protection level configuration, and feature descriptors; establish an organizational structure description of the data block, recording the block size, storage format, and access method. The main data area adopts a hierarchical storage structure: The core layer stores the fully protected feature data, including precise timestamps, amplitude data, and phase information; the enhancement layer records auxiliary information of the features, such as trend data and statistical features; the basic layer stores background information and general parameters. Implement an efficient data indexing mechanism: Establish a feature position mapping table to support fast retrieval of features in a specific time period or of a specific type; design the organizational structure of the data within the block to optimize the access efficiency. In data continuity management: Organize the time series data using a frame structure, maintaining appropriate overlap between adjacent frames to ensure data continuity; for data segments with rich features, increase the size of the frame overlap area. Finally, encapsulate the complete protection sequence, including all necessary feature data, protection parameters, and index information. Through these processing steps, the protection sequence is finally obtained.

[0069] Perform data hierarchical analysis on the protection sequence output by the above steps. First, extract data features from the protection sequence: Parse the header information of the protection sequence to obtain the hierarchical structure of the core layer, enhancement layer, and basic layer; Read the protection parameters of each layer, including the time window size, frequency bandwidth, and spatial coverage. Conduct feature statistics based on the block information of the protection sequence: Analyze the protection level distribution of each data block, and statistically analyze the spatio-temporal distribution pattern of high-protection regions; Evaluate the continuity between data blocks to identify data segments that require key protection. Construct a weight evaluation system based on the protection level: Assign the highest weight of 0.5 to the core layer data (such as the attention state transition point) in the protection sequence, assign a medium weight of 0.3 to the enhancement layer data (such as the stable state region), and assign a basic weight of 0.2 to the basic layer data. Perform multi-dimensional importance scoring for each data block: Calculate the comprehensive score by combining the fidelity requirements (accounting for 30%), time sensitivity (accounting for 40%), and spatial correlation (accounting for 30%) recorded in the protection sequence. Pay special attention to the combination of physiological characteristics marked in the protection sequence: An additional weight score of 0.2 is added to the Alpha band activity related to attention, and the burst activity in the Beta band is given higher priority in the time dimension. Through the clustering analysis of these features, finally mark out clear importance levels.

[0070] Based on the importance grading results obtained in the previous step, construct a multi-level cache space. First, design the physical structure of the cache according to the importance distribution of the data: Allocate a high-speed cache area for data blocks with an importance score higher than 0.8, accounting for 30% of the total cache space; Allocate a medium-speed cache area for data blocks with an importance between 0.5 and 0.8, accounting for 40%; Use the basic storage area for data blocks with an importance lower than 0.5, accounting for 30%. Implement differentiated cache policies for different importance levels: Adopt the write-through policy for the data blocks with the highest importance to ensure real-time performance; Use the write-back policy for the data blocks with medium importance to balance performance and reliability; Adopt the delayed write policy for the data blocks with low importance. Implement block management based on importance: Use a smaller block size (such as 4KB) for data blocks with high importance to improve access flexibility, and use a larger block size (such as 16KB) for data blocks with low importance to improve storage efficiency. In the organization of the cache space, establish an importance-oriented data layout: Organize data blocks with the same importance level in a continuous storage area to reduce access fragmentation; Inside the block, organize the storage structure according to the time sequence and spatial correlation of the data.

[0071] Utilize the hierarchical cache space constructed in the previous step to perform resource allocation operations. First, based on the hierarchical structure of the cache space, perform feature analysis on data blocks: calculate the adaptability of each data block in each cache layer, including access frequency (accounting for 40%), temporal locality (accounting for 30%), and spatial locality (accounting for 30%). Implement adaptive cache resource allocation: for data blocks in the high-speed cache area, when their access frequency exceeds the set threshold, dynamically expand their allocated space; for data blocks in the medium-speed cache area, adjust the cache space according to the stability of the access pattern; for data blocks in the basic storage area, mainly consider storage efficiency. Establish a data block migration mechanism: when the access pattern of a data block changes by more than 20%, trigger the block migration operation; maintain data consistency during the migration process to ensure no data loss. For the characteristics of time series data, implement a data prefetching mechanism in resource allocation: analyze the time pattern of data access and preload the data blocks that may be accessed into the corresponding cache levels in advance.

[0072] Based on the resource allocation results of the previous step, generate the final storage sequence. First, construct a multi-level index structure: the first-level index points to different cache areas, recording the starting address and capacity information of the areas; the second-level index points to specific data blocks, including the importance level and access attributes of the blocks; the third-level index points to the specific positions within the data blocks to support fine-grained data access. Implement data organization based on the allocation results: record the resource allocation configuration information, including cache levels, block sizes, and management policies, in the header area; organize data blocks according to the allocation scheme in the main body area to ensure the physical proximity of related data; maintain the complete index structure and check information in the tail area. The location management of data blocks adopts dynamic mapping: maintain a global location mapping table to record the actual positions of each data block in the storage hierarchy; maintain the association relationship between data blocks through a doubly linked list structure. Implement the data frame organization mechanism: analyze the temporal association between data blocks and organize adjacent data blocks into a frame structure; maintain a 30% overlapping area between frames to ensure data continuity. Through these processing steps, the storage sequence is finally obtained.

[0073] Step S104, generate compressed data according to the reconstruction sequence and the storage sequence, and complete the real-time compression and reconstruction of EEG signals in the attention glasses.

[0074] Specifically, perform feature matching analysis on the reconstruction sequence of the above steps and the storage sequence of the above steps.

[0075] In some embodiments, the generating compressed data according to the reconstruction sequence and the storage sequence includes: performing feature matching on the reconstruction sequence and the storage sequence to obtain a feature mapping table; constructing a reconstruction expression based on the feature mapping table; and performing signal recombination according to the reconstruction expression to output the compressed data.

[0076] First, extract key information from the reconstructed sequence: analyze the distribution characteristics of the reconstructed basis functions, obtain the quality parameters and importance markers for signal reconstruction; at the same time, read the organizational structure and access attributes of data blocks from the stored sequence. Construct feature correspondence relationships: establish a one-to-one mapping between the time windows in the reconstructed sequence and the data blocks in the stored sequence to ensure the time alignment accuracy; analyze the matching degree between the frequency characteristics in the reconstructed sequence and the data classification in the stored sequence. Implement a feature similarity calculation mechanism: design a time-domain matcher to calculate the cross-correlation coefficient between the waveforms of the reconstructed data and the stored data; construct a frequency-domain analyzer to compare the consistency of the energy distributions in each frequency band of the two sequences, with a focus on the feature retention in the Alpha band (8 - 13 Hz) and the Beta band (13 - 30 Hz). For the regions with changing attention states, establish a local feature matching evaluation: analyze the temporal alignment degree of the state transition points, evaluate the integrity of feature retention, and verify whether the attention features in the reconstructed sequence correspond precisely to the marked positions in the stored sequence. After performing feature matching, the generated feature mapping table completely records the feature correspondence relationships, matching quality, and feature attributes.

[0077] Based on the feature mapping table, perform the construction of the reconstructed representation. First, according to the feature matching scores recorded in the mapping table, implement a hierarchical reconstruction strategy: for the feature regions with a matching degree higher than 0.9 (mainly the attention state transition points), perform precise reconstruction using the original reconstruction parameters recorded in the mapping table; for the regions with a matching degree between 0.7 and 0.9, optimize the reconstruction parameters according to the feature correspondence relationships in the mapping table; for the regions with a matching degree lower than 0.7, redesign the reconstruction scheme based on the feature attribute descriptions in the mapping table. Create the data structure of the reconstructed representation: convert each pair of matching features in the mapping table into specific reconstruction expressions, including the basis function type, combination weights, and time parameters, and inherit the importance markers of the features from the mapping table. Design a differentiated reconstruction strategy: for the frequently accessed features marked in the mapping table, construct a fast reconstruction channel; for the regions marked as key physiological features, establish an accurate reconstruction mode. In terms of time organization, utilize the continuity information in the mapping table to achieve a smooth transition of the reconstructed representation: analyze the feature correlation degree between adjacent time windows, design an adaptive smoothing function to ensure the continuity of the reconstruction process. After the construction process is completed, the reconstructed representation contains all the necessary reconstruction parameters and expression structures.

[0078] Perform signal recombination processing according to the reconstructed expression. First, process it completely in accordance with the calculation framework specified in the reconstructed expression: analyze the combination method of basis functions in the expression, and perform superposition strictly according to the recorded weight coefficients to ensure that the reconstruction accuracy at each time point meets the requirements of the expression. For different feature types marked in the expression, perform differential processing: when the expression indicates a steady-state feature region, directly use the standard basis function set provided by the expression for reconstruction, and superpose the basis functions in the order of the recorded weight coefficients; when the expression marks a transient feature region, enable the special basis function combination defined in the expression and use the recorded high-time-resolution parameters for fine recombination. In the feature fusion link, strictly follow the scale fusion rule of the expression: calculate the reconstruction results of each scale according to the time scale levels recorded in the expression; combine the results of different scales according to the fusion weights specified by the expression, and pay special attention to the reconstruction quality of the key frequency bands marked in the expression. After the recombination processing is completed, the signal recombination result realizes the complete reconstruction of time-domain and frequency-domain features.

[0079] Generate compressed data based on the signal recombination result. First, analyze the specific features of the recombined signal: for data segments with high recombination quality (signal-to-noise ratio > 20 dB), their reconstruction features are complete and stable, suitable for high compression ratio processing; for regions with medium recombination quality (signal-to-noise ratio 10 - 20 dB), more detailed information needs to be retained; for parts with low recombination quality (signal-to-noise ratio < 10 dB), additional protection mechanisms are required. Determine the specific compression strategy based on these recombination features: use wavelet transform compression for high-quality recombination regions to retain the most significant wavelet coefficients; use adaptive quantization for medium-quality regions, and adjust the quantization accuracy according to the importance of local features; use approximate lossless compression for low-quality regions to ensure no additional distortion is introduced. In terms of data organization, it is completely based on the feature distribution of the recombination result: store the recombined high-frequency feature data blocks centrally for fast access; store the medium-frequency feature data blocks dispersedly to balance access efficiency and storage space; and store the low-frequency feature data blocks in batches to optimize storage efficiency. Construct an index structure oriented to recombination quality: according to the quality assessment results during the recombination process, establish a multi-level index table, with high-quality recombination blocks at the front of the index table to support fast retrieval; at the same time, record the recombination parameters of each data block for subsequent data recovery. The parameter selection during compression strictly follows the guidance of recombination quality: for the Alpha band features with good recombination effects, use a high compression ratio and a simplified index; for the Beta band features with average recombination effects, retain more reconstruction information and detailed indexes. The finally generated compressed data not only achieves efficient compression but also maintains a data organizational structure adapted to the recombination quality.

[0080] The method has at least the following beneficial effects:

[0081] 1. Through multi-dimensional feature extraction and redundancy identification, combined with quantization processing of precision grading and sparse decomposition based on the feature basis, the efficient compression of EEG signals is achieved, effectively reducing the data scale and the requirement for transmission bandwidth, ensuring the accurate retention of attention features, and improving the pertinence and effectiveness of signal compression.

[0082] 2. Through channel mapping and principal component extraction, combined with a real-time pipeline architecture and a constraint-based reconstruction mechanism, a reliable reconstruction path from compressed data to the original signal is established, ensuring the spatial correlation and temporal continuity of multi-channel signals. While ensuring the reconstruction quality, it meets the real-time processing requirements of portable devices.

[0083] 3. Through key feature extraction and protection area division, combined with data hierarchical storage and reconstruction expression based on feature matching, the priority protection and efficient access of important information are realized, a complete data protection and reconstruction mechanism is established, the reliability and practical value of compressed data are improved, and at the same time, the utilization efficiency of storage resources is optimized.

[0084] In order to execute the real-time compression and reconstruction method of EEG signals in the attention glasses corresponding to the above method embodiments to achieve the corresponding functions and technical effects. Refer to Figure 2 , Figure 2 FIG. shows a structural block diagram of a real-time compression and reconstruction device 200 for EEG signals in an attention glasses provided by an embodiment of the present application. For the sake of convenience of description, only the parts related to this embodiment are shown. The real-time compression and reconstruction device 200 for EEG signals in the attention glasses provided by the embodiment of the present application includes:

[0085] A first generation unit 201, configured to segment multi-channel EEG signals collected by the attention glasses to generate a preprocessing sequence; perform local analysis on the preprocessing sequence to obtain a quantization interval and construct a parameter table, perform precision division using the parameter table, generate a quantization sequence according to the precision division, and generate a compression sequence according to the quantization sequence;

[0086] A second generation unit 202, configured to generate a correlation sequence according to the preprocessing sequence and the compression sequence, perform block processing on the correlation sequence to obtain a data stream, generate a real-time sequence based on the data stream; perform reconstruction decomposition on the real-time sequence to generate a reconstruction sequence;

[0087] A third generation unit 203, configured to perform feature analysis on the compression sequence to obtain key points, generate a protection sequence based on the key points; perform data grading on the protection sequence to obtain importance, construct a cache space based on the importance, allocate resources using the cache space, and generate a storage sequence according to the resource allocation result corresponding to the allocated resources;

[0088] A compression and reconstruction unit 204, configured to generate compressed data according to the reconstruction sequence and the stored sequence, so as to complete real-time compression and reconstruction of electroencephalogram signals in the attention glasses.

[0089] The above-mentioned real-time compression and reconstruction device 200 of electroencephalogram signals in the attention glasses can implement the real-time compression and reconstruction method of electroencephalogram signals in the attention glasses in the above method embodiment. The optional items in the above method embodiment are also applicable to this embodiment, and will not be elaborated here. The remaining content of the embodiment of the present application can refer to the content of the above method embodiment, and will not be repeated in this embodiment.

[0090] Figure 3 It is a schematic structural diagram of a computer device provided in an embodiment of the present application. As Figure 3 shown, the computer device 3 in this embodiment includes: at least one processor 30 ( Figure 3 only one is shown), a memory 31, and a computer program 32 stored in the memory 31 and executable on the at least one processor 30. When the processor 30 executes the computer program 32, the steps in any of the above method embodiments are implemented.

[0091] The computer device 3 may be a computing device such as a smart phone, a tablet computer, a desktop computer, and a cloud server. The computer device may include, but is not limited to, the processor 30 and the memory 31. Those skilled in the art can understand that Figure 3 merely examples of the computer device 3, and do not constitute a limitation on the computer device 3. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.

[0092] The so-called processor 30 may be a central processing unit (CPU), and the processor 30 may also be 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 may be a microprocessor or the processor may also be any conventional processor, etc.

[0093] The memory 31 may be an internal storage unit of the computer device 3 in some embodiments, such as a hard disk or memory of the computer device 3. The memory 31 may also be an external storage device of the computer device 3 in some other embodiments, such as a plug-in hard disk equipped on the computer device 3, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 31 may also include both the internal storage unit and the external storage device of the computer device 3. The memory 31 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of the computer program. The memory 31 may also be used to temporarily store data that has been output or is to be output.

[0094] In addition, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0095] An embodiment of the present application provides a computer program product, and when the computer program product runs on a computer device, the computer device is caused to implement the steps in each of the above method embodiments when executed.

[0096] In several embodiments provided in the present application, it can be understood that each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, the program segment, or the part of code includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in an order different from that marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.

[0097] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0098] The specific embodiments described above further elaborate on the purpose, technical solution, and beneficial effects of this application. It should be understood that the above description is only specific embodiments of this application and is not used to limit the protection scope of this application. In particular, it is pointed out that for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this application should be included in the protection scope of this application.

Claims

1. A method for real-time compression and reconstruction of electroencephalogram signals in an attention glasses, characterized in that Including: Segmenting the multi-channel electroencephalogram signals collected by the attention glasses to generate a preprocessing sequence; Performing local analysis on the preprocessing sequence, obtaining quantization intervals and constructing a parameter table, using the parameter table for accuracy division, generating a quantization sequence according to the accuracy division, and generating a compression sequence according to the quantization sequence; Generating a correlation sequence according to the preprocessing sequence and the compression sequence, including: constructing a channel mapping according to the preprocessing sequence and the compression sequence, and performing differential processing based on the channel mapping; extracting principal components according to the differential results corresponding to the differential processing, and generating the correlation sequence according to the principal components; performing block processing on the correlation sequence to obtain a data stream, generating a real-time sequence based on the data stream; performing reconstruction decomposition on the real-time sequence to generate a reconstruction sequence; Performing feature analysis on the compression sequence to obtain key points, and generating a protection sequence based on the key points, including: constructing a protection area based on the key points; performing feature retention according to the protection area, and generating the protection sequence according to the feature retention; performing data grading on the protection sequence to obtain importance, constructing a cache space based on the importance, allocating resources using the cache space, and generating a storage sequence according to the resource allocation results corresponding to the allocated resources; Generating compressed data according to the reconstruction sequence and the storage sequence, completing real-time compression and reconstruction of electroencephalogram signals in the attention glasses.

2. The method according to claim 1, wherein The generating of the preprocessing sequence includes: Obtaining key components corresponding to the signal features extracted by the segmentation processing; Identifying redundant information according to the key components, and generating the preprocessing sequence according to the redundant information.

3. The method according to claim 1, characterized in that, The generating of the compression sequence according to the quantization sequence includes: Performing sparse decomposition on the quantization sequence to obtain feature bases; Constructing a sparse representation according to the feature bases, performing encoding conversion using the sparse representation, and generating the compression sequence according to the encoding conversion.

4. The method according to claim 1, wherein The generating of the real-time sequence based on the data stream includes: Constructing a processing unit based on the data stream, and performing pipelining operations using the processing unit; Generating a real-time sequence according to the pipelining operations.

5. The method according to claim 1, wherein The performing of reconstruction decomposition on the real-time sequence to generate a reconstruction sequence includes: Obtaining reconstruction bases for performing reconstruction decomposition on the real-time sequence; Constructing constraint conditions based on the reconstruction bases, and performing signal combination using the constraint conditions; Generating a reconstruction sequence according to the signal combination.

6. The method according to claim 1, wherein The generating of the compressed data according to the reconstruction sequence and the storage sequence includes: Performing feature matching according to the reconstruction sequence and the storage sequence to obtain a feature mapping table; Constructing a reconstruction expression based on the feature mapping table; Performing signal recombination according to the reconstruction expression to output the compressed data.

7. A real-time compression and reconstruction device for electroencephalogram signals in an attention glasses, characterized in that, Including: A first generating unit for segmenting the multi-channel electroencephalogram signals collected by the attention glasses to generate a preprocessing sequence; Performing local analysis on the preprocessing sequence, obtaining quantization intervals and constructing a parameter table, using the parameter table for accuracy division, generating a quantization sequence according to the accuracy division, and generating a compression sequence according to the quantization sequence; A second generation unit, configured to generate a correlation sequence according to the preprocessing sequence and the compression sequence, includes: constructing a channel mapping according to the preprocessing sequence and the compression sequence, and performing differential processing based on the channel mapping; extracting a principal component according to a differential result corresponding to the differential processing, and generating the correlation sequence according to the principal component; performing block processing on the correlation sequence to obtain a data stream, and generating a real-time sequence based on the data stream; performing reconstruction decomposition on the real-time sequence to generate a reconstruction sequence; A third generation unit, configured to perform feature analysis on the compression sequence to obtain key points, and generate a protection sequence based on the key points, includes: constructing a protection area based on the key points; performing feature retention according to the protection area, and generating the protection sequence according to the feature retention; performing data grading on the protection sequence to obtain an importance degree, constructing a cache space based on the importance degree, allocating resources by using the cache space, and generating a storage sequence according to a resource allocation result corresponding to the allocated resources; A compression and reconstruction unit, configured to generate compressed data according to the reconstruction sequence and the storage sequence, and complete real-time compression and reconstruction of electroencephalogram signals in the attention glasses.

8. A computer device, characterized in that, It includes a memory and a processor; the memory is used for storing a computer program; the processor is used for executing the computer program and implementing the method according to any one of claims 1 to 6 when executing the computer program.

Citation Information

Patent Citations

  • Method for reconstructing image based on blind compressed sensing module

    CN103400349A

  • A low-complexity brain wave signal compression and classification method

    CN109711278A