Method, device and equipment for real-time compression and reconstruction of electroencephalogram signals in attention glasses

By performing segmented processing and local analysis of the EEG signals collected by attention glasses, time-frequency features are extracted and parameter tables are constructed, precision division and quantization are performed, compressed sequences are generated, and related sequences are generated by combining preprocessing sequences and compressed sequences, block processing and reconstruction and decomposition are realized, real-time compression and reconstruction of EEG signals are solved, the balance problem between data compression and feature retention in the existing technology is solved, and the reliability of compressed data is improved.

CN120066283AActive Publication Date: 2025-05-30XIAOZHOU TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The EEG signals collected by attention glasses have complex spatial correlations and obvious time-frequency hierarchical structures. The existing compression methods are difficult to achieve a fine balance between data compression and feature retention, and lack a hierarchical protection mechanism for signal characteristics, which affects the reliability of compressed data.

Method used

By performing segmented processing and local analysis of multi-channel EEG signals, time-frequency characteristics are extracted and parameter tables are constructed, accuracy division and quantization are performed to generate compressed sequences. Combining preprocessing sequences and compressed sequences, we generate related sequences, perform chunking processing and reconstruction decomposition, obtain reconstruction sequences and storage sequences, and realize real-time compression and reconstruction.

Benefits of technology

It significantly reduces the amount of data transmission, meets the real-time processing needs of EEG signals, retains key signal components, avoids the loss of high-frequency features, prioritizes the protection of important EEG features, and improves the reliability and practical value of compressed data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066283A_ABST
    Figure CN120066283A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of brain-computer interfaces, in particular to an electroencephalogram signal real-time compression and reconstruction method, device and equipment in attention glasses. The method comprises the following steps: performing segmentation processing on a multi-channel electroencephalogram signal collected by attention glasses to generate a preprocessing sequence; performing local analysis on the preprocessing sequence to generate a compressed sequence; generating a correlation sequence according to the preprocessing sequence and the compressed sequence to generate a real-time sequence for reconstruction, and generating a reconstruction sequence; performing feature analysis according to the compressed sequence to obtain key points, and generating a protection sequence based on the key points; performing data classification on 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 a resource allocation result corresponding to the allocated resources; generating compressed data according to the reconstruction sequence and the storage sequence, and completing real-time compression and reconstruction of the electroencephalogram signals in the attention glasses. And efficient compression of the 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 particularly 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 are 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 are 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 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.

[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 are 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 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.

[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 levels, construct a cache space based on the importance levels, allocate resources using the cache space, and generate a storage sequence according to the resource allocation results 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 glass, 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 levels, constructing a cache space based on the importance levels, allocating resources using the cache space, and generating a storage sequence according to the resource allocation results 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 further 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 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 an orthogonal basis, an 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 and recombine the signals between the reconstruction sequence and the storage sequence, and output high-fidelity and low-latency compressed data to complete real-time compression and reconstruction.

[0018] Through segmented processing, pipeline operation, and a 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 the dynamic quantization interval and sparse decomposition retains key signal components; the dual mechanisms of the reconstruction basis and the 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 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 flowchart 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 the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly 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 interfering with the description of the present application.

[0024] It should be understood that when used in the specification and appended claims of the present application, 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 and appended claims of the present application 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 and appended claims of the present application, the term "if" can be interpreted as "when", "once", "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", "in response to determining", "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 and appended claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0028] The reference to "one embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with the 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 do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.

[0029] The technical solutions of the embodiments of the present application are 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 features 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 systematic feature extraction and protection mechanisms 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 processing dynamic changes in attention states and lack effective strategies 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 in an embodiment of this application. The real-time compression and reconstruction method for EEG signals in the attention glasses according to the embodiment of this application can be applied to computer devices, including but 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: statistical features such as mean, variance, kurtosis, skewness, and zero-crossing rate are extracted in the time domain; 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 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 specifically reduced to 0.6 to ensure retention. To cope with the non-stationary characteristics of EEG signals, a macroscopic 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 identification system is constructed. In the time dimension, calculate the similarity matrix of the key components in adjacent windows, using cosine similarity as the metric. When the similarity exceeds 0.9, mark the corresponding components in that time window as time redundancy and record the deviation value from the reference window. In the space dimension, analyze the information redundancy between multiple channels, calculate the mutual information value of the key components between channels. When the mutual information value between two channels exceeds 1.5, mark it as space redundancy and at the same time determine the dominant channel with larger information volume. In the frequency dimension, analyze the energy distribution of each frequency band, and construct a frequency redundancy determination criterion: 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%, mark it as frequency redundancy. Further, establish a redundant feature association map, where nodes represent features, edges represent redundant relationships, and edge weights represent the degree of redundancy. Use graph theory algorithms to analyze the clustering characteristics of redundant features and identify redundant feature chains and redundant feature clusters. To improve the robustness of redundant identification, introduce an adaptive threshold mechanism: based on the local statistical characteristics of the signal, dynamically adjust the redundant determination threshold, increase the threshold when the signal changes violently to reduce misjudgment, and decrease the threshold when the signal is relatively stable to improve compression efficiency. At the same time, establish a redundant pattern library to record common redundant feature combination patterns for accelerating the subsequent redundant identification process. In addition, design a signal stability evaluation mechanism based on sliding variance. When the signal fluctuates greatly, appropriately reduce the strictness of redundant identification 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, and the quantization precision decreases 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 quantization precision can be reduced 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 high 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, perform 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. In each analysis window, combine the precision information of the preprocessing sequence and 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 4-level decomposition on the medium-precision region (8 bits); and only perform 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 atomic 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 middle-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 of 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% magnitudes in the sparse representation, use 32-bit floating-point encoding; for the coefficients with magnitudes between 10% and 30%, use 16-bit fixed-point encoding; for the coefficients with magnitudes 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 regions with high sparsity (less than 20% non-zero coefficients), use run-length encoding to compress the positions of zero coefficients; for regions with moderate sparsity (20% - 50% non-zero coefficients), use block position encoding; for 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 to guide the construction of the Huffman coding table. Introduce a context-adaptive 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, finally obtain the encoding conversion result.

[0044] In some embodiments, generating the compressed sequence according to the quantization sequence includes: performing sparse decomposition on the quantization sequence to obtain eigenbasis; constructing a sparse representation according to the eigenbasis, 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 important coefficients, and the prediction frame only contains 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) coding 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 complete decoding parameters, enabling decompression to start from any key frame. At the same time, establish a data block linking 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 reference relationships. Finally, organize all components in a standard format to generate the final compressed sequence. Through these processing steps, finally obtain the compressed sequence.

[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, performing differential processing based on the channel mapping; extracting principal components according to the differential result corresponding to the differential processing, and generating the correlation sequence according to the principal components.

[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, a channel correlation matrix is established: the matrix element aij represents the comprehensive correlation degree between the i-th channel and the j-th channel, considering the spatial correlation in the preprocessing sequence (weight 0.6) and the feature similarity in the compressed sequence (weight 0.4). For channel pairs with a correlation degree exceeding 0.85, they are classified into the same channel group. In particular, for channels marked as critical in the preprocessing sequence (such as channels containing significant attention features), they are set as independent channel groups. At the same time, based on the non-zero coefficient distribution in the compressed sequence, the information density of each channel is evaluated, and channels with similar information density (difference less than 15%) are merged for processing. In this way, a hierarchical channel mapping is finally constructed.

[0050] Based on the channel mapping obtained in the previous step, differential processing is performed. 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, an adaptive differential strategy is adopted: 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, the differential order is dynamically adjusted according to the change characteristics of the local signal: a second-order difference is used in the stable segment of the signal to obtain a higher compression rate, and a first-order difference is used in the mutation segment 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, the optimal differential parameters are selected 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 used 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 abrupt changes (amplitude change exceeding 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 higher amplitudes having higher weights. 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 three 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, relevant sequences are 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: high-precision quantization (12 bits) is used for coefficients with high contribution (absolute value > 0.3), and low-precision quantization (6 bits) is used for secondary coefficients. 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 relevant sequences. To facilitate subsequent processing, the relevant sequences are 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, relevant sequences are finally obtained. Taking the real-time monitoring scenario of attention glasses as an example, the hierarchical structure design of this relevant sequence has practical significance: the principal component data in the core layer supports quickly obtaining the changing 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 laws 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 data quality.

[0053] Chunk the relevant sequences output from the above steps. First, determine the basic chunk size according to the time characteristics and content features of the signals: use a larger chunk size (2048 points) for intervals with stable attention states and a smaller chunk size (512 points) for state transition regions. When chunking, make full use of the hierarchical structure information in the relevant sequences: the core layer data is used to determine the key chunk points, the enhancement layer information is used to optimize the chunk boundaries, and the calibration layer parameters are used to maintain the temporal consistency of the chunks. 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 give priority to processing the data chunks that are dependent on 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 status 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 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 uniformity of the output data format. For frequently occurring data patterns in the data flow, dynamically establish a pattern dictionary for quickly identifying and processing similar data chunks. In particular, for sudden changes in the data flow, an adaptive processing strategy based on the data flow characteristics is designed: when a significant change in the data flow pattern is detected, 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 main calculations using the resources configured by the processing unit; the third level integrates the results and synchronizes the data. For different priority settings of the processing unit, implement differential pipelining control: 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. According to the cache strategy of the processing unit, optimize the data access of the pipeline: 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 process 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] Based on the processing results of the pipelining operations, generate a real-time sequence. 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 from different processing channels. Implement a real-time data packet assembly mechanism: 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 attention state changes) 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. Taking the attention detection scenario as an example: When an attention state transition 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 activity. 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 using the constraint condition for signal combination; 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 normal priority, use the 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 assessment 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 with missing or corrupted data; 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: Containing 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 type of 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 requirements of the data.

[0060] Based on the reconstructed basis dictionary obtained in the previous step, a constraint condition system 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 derivative continuity of the signal. 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 waveform continuity; when reconstructing the Beta band (13 - 30 Hz), a bandwidth constraint is set using the frequency characteristics of the basis functions to limit the variation range of the instantaneous frequency; when reconstructing the Theta band (4 - 8 Hz), a morphology 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 marked feature regions 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 system established in the previous step, the combined process of signal reconstruction is performed. First, based on the type and complexity of the constraints, a multi-level reconstruction strategy is designed: for areas that meet basic constraints (such as energy and smoothness constraints), a fast reconstruction algorithm is used to directly combine the corresponding basis functions; for areas that need to meet multiple complex constraints (such as time-frequency and space constraints), an iterative optimization method is used to gradually adjust the reconstruction parameters. In the reconstruction process, adaptive optimization control is implemented: the optimization step size is dynamically adjusted based on the gradient information of the constraints, and a small step size (such as 0.01) is used for fine adjustment in areas where the error changes drastically, and a large step size (such as 0.1) is used to accelerate convergence in areas where the error is flat; by monitoring the degree of satisfaction of the constraints, the weight coefficients of different constraints are adaptively adjusted. For the detected data discontinuities, a special reconstruction strategy is designed: the missing of short time intervals (<100ms) uses local interpolation, and the interpolation parameters are determined based on the constraints of the previous and next data segments; the missing of long time intervals (>100ms) is predicted based on statistical models, and the credibility level is marked in the reconstruction results. Implement a block reconstruction mechanism: split the long sequence into multiple overlapping subsequences (overlap rate 50%), and then reconstruct each subsequence independently and smooth the transition at the connection by weighted average method. The weight coefficient is determined by the degree of satisfaction of the constraint conditions. During the reconstruction process, special attention is paid to the key areas indicated by the constraint conditions: for key moments such as attention state transitions, focus on ensuring the reconstruction quality of related frequency bands; for areas with obvious spatial features, focus on 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 objective metrics between the reconstructed signal and the reference signal, including mean square error, cross-correlation coefficient, and spectral similarity; analyze physiological characteristic metrics of the reconstructed signal, such as the energy ratio in each frequency band, 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 causing the problem through backtracking analysis and adjust relevant parameters for optimization; when a new signal pattern appears, update the set of constraint conditions 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 inter-channel constraints. 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 using more conservative constraint conditions. Taking the attention detection scenario as an example: the system monitors the reconstruction quality of Alpha band activity in real time, including the continuity of waveforms, the stability of phases, and the rationality of 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 levels, construct a cache space based on the importance levels, allocate resources using the cache space, and generate a storage sequence according to the resource allocation results corresponding to the allocated resources.

[0064] Specifically, perform feature analysis on the compressed sequence output from the above steps. First, extract 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 indexes 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 particularly focus on 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 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 regions 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 component of the feature point, 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 electrodes, expand the protection scope of each feature point to the relevant brain regions, considering the volume conduction effect of 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 technology 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 with concentrated spatial distribution, increase the sampling density in the central region. Implement a hierarchical protection mechanism: Adopt a lossless protection mode for the core feature area; Allow controllable information loss for the secondary feature area; Retain statistical characteristics for the basic feature area. In terms of data storage: Divide the continuous feature sequence into appropriately sized data blocks, each 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 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 access efficiency. In data continuity management: Organize 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 areas; evaluate the continuity between data blocks to identify data segments that require key protection. Construct a weight evaluation system based on protection levels: 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 area), 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 raises the 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 strategies for different importance levels: adopt the write-through strategy for the data blocks with the highest importance to ensure real-time performance; use the write-back strategy for the data blocks with medium importance to balance performance and reliability; adopt the delayed write strategy 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 terms of cache space organization, establish an importance-oriented data layout: organize data blocks with the same importance level in continuous storage areas to reduce access fragmentation; within 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, conduct 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 temporal pattern of data access and preload the data blocks that may be accessed in advance into the corresponding cache levels.

[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 regions, recording the starting address and capacity information of the regions; 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 a complete index structure and checksum information in the tail area. The location management of data blocks adopts dynamic mapping: maintain a global location mapping table to record the actual location of each data block in the storage hierarchy; maintain the association relationship between data blocks through a doubly linked list structure. Implement a data frame organization mechanism: analyze the temporal correlation 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 the 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; simultaneously, 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 time alignment accuracy; analyze the matching degree between the frequency characteristics in the reconstructed sequence and the data grading in the stored sequence. Implement a feature similarity calculation mechanism: design a time-domain matcher to calculate the cross-correlation coefficient of 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 particular attention to the preservation of characteristics in the Alpha band (8 - 13 Hz) and the Beta band (13 - 30 Hz). For the regions where the attention state changes, establish local feature matching evaluation: analyze the timing alignment degree of the state transition points, evaluate the integrity of feature retention, and verify whether the attention features in the reconstructed sequence exactly correspond 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] Perform the construction of the reconstructed representation based on the feature mapping table. First, according to the feature matching scores recorded in the mapping table, implement a hierarchical reconstruction strategy: for 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 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 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 basis function types, combination weights, and time parameters, and simultaneously 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 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 smooth transitions in the reconstructed representation: analyze the feature correlation degree of 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 in 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 according to the signal recombination result. First, analyze the specific features of the recombined signal: for data segments with high recombination quality (signal-to-noise ratio > 20dB), their reconstruction features are complete and stable, suitable for high compression ratio processing; for regions with medium recombination quality (signal-to-noise ratio 10 - 20dB), more detailed information needs to be retained; for parts with low recombination quality (signal-to-noise ratio < 10dB), additional protection mechanisms are required. Determine the specific compression strategy according to 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 Alpha-band features with good recombination effects, use a high compression ratio and a simplified index; for Beta-band features with average recombination effects, retain more reconstruction information and detailed indexes. The finally generated compressed data not only realizes efficient compression but also maintains a data organizational structure adapted to the recombination quality.

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

[0081] 1. Through multi-dimensional feature extraction and redundancy recognition, 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 demand 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 achieved, a complete data protection and reconstruction mechanism is established, the reliability and practical value of compressed data are improved, and 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 glass provided by an embodiment of the present application. For the sake of illustration, only the parts related to this embodiment are shown. The real-time compression and reconstruction device 200 for EEG signals in the attention glass 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 levels, construct a cache space based on the importance levels, allocate resources using the cache space, and generate a storage sequence according to the resource allocation result corresponding to the allocated resources;

[0088] The compression and reconstruction unit 204 is configured to generate compressed data based on the reconstruction sequence and the stored sequence, and complete the real-time compression and reconstruction of the EEG signals in the attention glasses.

[0089] The above real-time compression and reconstruction device 200 for EEG signals in the attention glasses can implement the real-time compression and reconstruction method for EEG 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 in the figure), 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 are given 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] In some embodiments, the memory 31 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 31 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the computer device 3. 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 will 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 by 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 block 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 such an 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 that can store program codes, 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.

[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 EEG signals in attention glasses, characterized in that: include: The multi-channel EEG signals collected by the attention glasses are processed in segments to generate a preprocessing sequence; Performing local analysis on the preprocessing sequence, obtaining quantization intervals and constructing a parameter table, performing precision division using the parameter table, generating a quantization sequence according to the precision division, and generating a compression sequence according to the quantization sequence; Generate a related sequence according to the preprocessing sequence and the compressed sequence, perform block processing on the related sequence to obtain a data stream, and generate a real-time sequence based on the data stream; Reconstruct and decompose the real-time sequence to generate a reconstructed sequence; Perform feature analysis according to the compression sequence to obtain key points, and generate a protection sequence based on the key points; Performing data classification 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 a resource allocation result corresponding to the allocated resources; Compressed data is generated according to the reconstruction sequence and the storage sequence to complete the real-time compression and reconstruction of the EEG signal in the attention glasses.

2. The method according to claim 1, characterized in that The generating of the preprocessing sequence comprises: Obtaining key components corresponding to the signal features extracted by the segmentation processing; Redundant information is identified according to the key components, and the preprocessing sequence is generated according to the redundant information.

3. The method according to claim 1, characterized in that The step of generating a compressed sequence according to the quantized sequence comprises: Performing sparse decomposition on the quantized sequence to obtain a characteristic basis; A sparse representation is constructed based on the feature base, a code conversion is performed using the sparse representation, and the compressed sequence is generated based on the code conversion.

4. The method according to claim 1, characterized in that The generating a related sequence according to the preprocessing sequence and the compressed sequence comprises: constructing a channel mapping according to the preprocessing sequence and the compression sequence, and performing differential processing based on the channel mapping; The principal component is extracted according to the differential result corresponding to the differential processing, and the correlation sequence is generated according to the principal component.

5. The method according to claim 1, characterized in that The generating a real-time sequence based on the data stream comprises: Building a processing unit based on the data stream, and using the processing unit to perform pipeline operations; A real-time sequence is generated according to the pipeline operation.

6. The method according to claim 1, characterized in that 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 constraint conditions based on the reconstruction base, and combining signals using the constraint conditions; A reconstruction sequence is generated based on the signal combination.

7. The method according to claim 1, characterized in that The generating a protection sequence based on the key point comprises: Constructing a protection area based on the key points; Feature retention is performed according to the protection area, and the protection sequence is generated according to the feature retention.

8. The method according to claim 1, characterized in that The generating compressed data according to the reconstruction sequence and the storage sequence comprises: Perform feature matching according to the reconstructed sequence and the stored sequence to obtain a feature mapping table; Constructing a reconstruction expression based on the feature mapping table; Signal reorganization is performed according to the reconstructed expression to output the compressed data.

9. A device for real-time compression and reconstruction of EEG signals in attention glasses, characterized in that: include: A first generating unit is used to perform segmented processing on the multi-channel EEG 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, performing precision division using the parameter table, generating a quantization sequence according to the precision division, and generating a compression sequence according to the quantization sequence; A second generating unit is used to generate a related sequence according to the preprocessing sequence and the compressed sequence, perform block processing on the related sequence, obtain a data stream, and generate a real-time sequence based on the data stream; Reconstruct and decompose the real-time sequence to generate a reconstructed sequence; A third generating unit is used to perform feature analysis according to the compression sequence, obtain key points, and generate a protection sequence based on the key points; Performing data classification 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 a resource allocation result corresponding to the allocated resources; The compression and reconstruction unit is used to generate compressed data according to the reconstruction sequence and the storage sequence, and complete the real-time compression and reconstruction of the EEG signal in the attention glasses.

10. A computer device, characterized in that: The method comprises a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the method according to any one of claims 1 to 8 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

  • Motion function reconstruction dynamic model construction method based on cortical muscle network

    CN115346676A

  • Image coding method, image reconstruction method and device

    CN119052478A

  • Functional ultrasound imaging of the brain using deep learning and sparse data

    US20220096055A1

Cited By

  • Guide rail precision evaluation method and system based on multi-sensor fusion

    CN120639615A

  • Electroencephalogram data compression method based on data arrangement optimization

    CN120915305A

  • Method and system for removing artifacts of electroencephalogram data and storage medium

    CN120918570A

  • Audio compression method, audio decompression method, electronic equipment and storage medium

    CN121096351A