Data compression method, chip, device and storage medium for electroencephalogram data

By compressing EEG data and utilizing data range division and shifting operations, the problem of insufficient storage space in brain-computer interface devices was solved, achieving efficient data storage and accuracy preservation.

CN114665886BActive Publication Date: 2026-01-13HANGZHOU GENLIGHT MEDTECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210383249.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-13
Publication Date
2026-01-13
Estimated Expiration
2042-04-13

AI Technical Summary

Technical Problem

Traditional brain-computer interface devices require long-term data collection due to the slow changes in EEG data, resulting in excessive storage space requirements.

Method used

By compressing EEG data and using data range division and shifting operations, the target data range and compression rate are determined, thus achieving compressed storage of EEG data.

Benefits of technology

This reduces the amount of data stored in brain-computer interface devices, saves storage space, maintains the accuracy of low-order data, and improves storage space utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114665886B_ABST
    Figure CN114665886B_ABST
Patent Text Reader

Abstract

The application relates to an electroencephalogram data compression method, a chip, an equipment and a storage medium, and belongs to the technical field of computers.The method comprises the following steps: obtaining target electroencephalogram data; determining a target data range to which the target electroencephalogram data belongs from each data range; the data range is obtained by dividing the maximum data range of the electroencephalogram data; determining a target data compression rate corresponding to the target data range; compressing the target electroencephalogram data by using the target data compression rate to obtain compressed electroencephalogram data; and storing the compressed electroencephalogram data; the problem that the electroencephalogram data changes slowly, the electroencephalogram data needs to be collected for a long time by a brain-computer interface device, and thus the brain-computer interface equipment stores a large amount of data can be solved; since the target electroencephalogram data is compressed first and then stored, the size of the stored electroencephalogram data can be reduced, the amount of data stored by the brain-computer interface equipment is reduced, and the storage space is saved.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates to a data compression method, chip, device, and storage medium for electroencephalogram (EEG) data, belonging to the field of computer technology. [Background Technology]

[0002] Brain-computer interface (BCI) devices serve as a crucial bridge for information transmission between the brain and computers. Their function is to convert acquired electroencephalogram (EEG) data into operational signals that can be recognized by a computer, enabling control of the computer through EEG data.

[0003] Traditional brain-computer interface devices process EEG data by directly storing the collected EEG data and then analyzing and converting the stored EEG data to generate operational signals that can be recognized by a computer.

[0004] However, because EEG data changes slowly, brain-computer interface devices usually need to collect EEG data for a long time in order to perform a complete analysis of the EEG signals. This generates a large amount of EEG data, resulting in a large amount of data to be stored in brain-computer interface devices. [Summary of the Invention]

[0005] This application provides a data compression method, chip, device, and storage medium for electroencephalogram (EEG) data, which can solve the problem that because EEG data changes slowly, brain-computer interface devices typically need to collect EEG data for extended periods, resulting in a large amount of EEG data and consequently, a large amount of data to be stored in computers. This application provides the following technical solution:

[0006] Firstly, a method for compressing electroencephalogram (EEG) data is provided, the method comprising:

[0007] Acquire target EEG data;

[0008] The target data range to which the target EEG data belongs is determined from various data ranges; the data range is obtained by dividing the maximum data range of the EEG data.

[0009] Determine the target data compression rate corresponding to the target data range; the data compression rate corresponding to the m-th data range is greater than the data compression rate corresponding to the n-th data range, the EEG data in the m-th data range is less than the EEG data in the n-th data range, and m and n are positive integers;

[0010] The target EEG data is compressed using the target data compression ratio to obtain compressed EEG data, which is then stored.

[0011] Optionally, before determining the target data range to which the target EEG data belongs from the various data ranges, the method further includes:

[0012] The maximum data range is divided according to a preset division method to obtain at least two data ranges; the EEG data in the k-th data range is greater than the EEG data in the h-th data range, the width of the k-th data range is greater than or equal to the width of the h-th data range, and k and h are positive integers.

[0013] Optionally, compressing the target EEG data using the target data compression ratio to obtain compressed EEG data includes:

[0014] The target EEG data is shifted according to the target data compression ratio to obtain the shifted EEG data;

[0015] The sum of the shifted EEG data and the target initial value corresponding to the target data range is determined as the compressed EEG data; the target initial value is determined according to the target data range.

[0016] Optionally, the step of shifting the target EEG data according to the target data compression ratio to obtain the shifted EEG data includes:

[0017] The number of bits to be shifted in the shift operation is determined based on the target data compression ratio;

[0018] The target EEG data is shifted to the right by the shift number to obtain the shifted EEG data.

[0019] Optionally, the target EEG data is represented in base p, where p is an integer greater than 1;

[0020] Determining the number of bits to be shifted in the shift operation based on the target data compression ratio includes:

[0021] The negative of the logarithm of the data compression ratio with base p is determined as the number of shift bits.

[0022] Optionally, before compressing the target EEG data using the target data compression ratio, the method further includes:

[0023] Determine the target initial value corresponding to the target data range.

[0024] Optionally, determining the target initial value corresponding to the target data range includes:

[0025] From each of the stated data ranges, a reference data range is determined where the EEG data is smaller than the EEG data in the target data range;

[0026] Based on the target data compression ratio, and the width and corresponding data compression ratio of each of the reference data ranges, the target initial value corresponding to the target data range is determined.

[0027] Optionally, determining the target initial value corresponding to the target data range based on the target data compression ratio, the width of each of the reference data ranges, and the corresponding data compression ratio includes:

[0028] The sum of the products of the width of each of the reference data ranges and the corresponding data compression ratio is determined as the first target value;

[0029] The product of the sum of the widths of each of the reference data ranges and the target data compression ratio is determined as the second target value;

[0030] The difference between the first target value and the second target value is determined as the initial target value.

[0031] In a second aspect, a chip is provided for executing a data compression method for implementing the electroencephalogram (EEG) data provided in the first aspect.

[0032] Thirdly, an electronic device is provided, the device including a processor and a memory; the memory stores a program, which is loaded and executed by the processor to implement the data compression method for EEG data provided in the first aspect.

[0033] Fourthly, a computer-readable storage medium is provided, wherein a program is stored therein, and when executed by a processor, the program is used to implement the data compression method for EEG data provided in the first aspect.

[0034] The beneficial effects of this application include at least the following: acquiring target EEG data; determining the target data range to which the target EEG data belongs from various data ranges; the data range is obtained by dividing the maximum data range of the EEG data; determining the target data compression ratio corresponding to the target data range; the data compression ratio corresponding to the m-th data range is greater than the data compression ratio corresponding to the n-th data range, and the EEG data in the m-th data range is smaller than the EEG data in the n-th data range, where m and n are positive integers; compressing the target EEG data using the target data compression ratio to obtain compressed EEG data for storage; solving the problem that due to the slow changes in EEG data, brain-computer interface devices usually need to collect EEG data for a long time, which generates a large amount of EEG data, resulting in a large amount of data stored in the brain-computer interface device; and reducing the size of the stored EEG data by compressing the target EEG data before storing it, thereby reducing the amount of data stored in the brain-computer interface device and saving storage space.

[0035] Meanwhile, since the smaller the EEG data, the greater the data compression rate corresponding to the data range to which the EEG data belongs, and the greater the data compression, the higher the accuracy of the compressed data, the lower-order data is in an uncompressed or low-compression state, which can effectively ensure the accuracy of the lower-order data.

[0036] In addition, the larger the EEG data, the wider the data range to which the EEG data belongs. And because the larger the EEG data, the smaller the data compression rate corresponding to the data range to which the EEG data belongs. Therefore, within each data range, the wider the data range, the smaller the data compression rate corresponding to the data range, which can improve the data compression effect.

[0037] In addition, since the process of compressing the target EEG data is achieved by shifting and adding the target data, the compression of the target EEG data can be achieved using adders and shifters, which has low hardware requirements and is conducive to the application of data compression algorithms.

[0038] In addition, by setting a suitable compression algorithm, the compressed EEG data can make full use of the storage space, thus further saving storage space.

[0039] In addition, compressing EEG data allows for full utilization of limited storage space, increasing the duration of stored EEG data. This meets the data duration requirements of different EEG data analysis and processing algorithms, providing more flexible algorithm selection for EEG data analysis and processing.

[0040] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings. [Attached Image Description]

[0041] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0042] Figure 1 This is a schematic diagram of a data compression system for electroencephalogram (EEG) data provided in one embodiment of this application;

[0043] Figure 2 This is a flowchart of a data compression method for electroencephalogram (EEG) data provided in one embodiment of this application;

[0044] Figure 3This is a schematic diagram illustrating the correspondence between target EEG data and compressed EEG data provided in one embodiment of this application;

[0045] Figure 4 This is a flowchart of a data compression method for electroencephalogram (EEG) data provided in one embodiment of this application;

[0046] Figure 5 This is a block diagram of a data compression device for electroencephalogram (EEG) data provided in one embodiment of this application;

[0047] Figure 6 This is a block diagram of an electronic device provided in one embodiment of this application.

Detailed Implementation Methods

[0048] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. The application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0049] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0050] First, several terms used in the embodiments of this application will be introduced.

[0051] Electroencephalogram (EEG) data: Data that reflects the electrical activity of brain nerve cells in the cerebral cortex and / or on the surface of the scalp. EEG data is characterized by slow changes and low signal amplitude.

[0052] Data compression refers to a technical method that reduces the amount of data to reduce storage space and improve its transmission, storage and processing efficiency without losing useful information.

[0053] Data compression ratio: refers to the ratio of the size of the compressed data to the size of the original data.

[0054] Bit (binary digit): The smallest unit of information, which is the information contained in one bit of a binary number.

[0055] Figure 1 This application provides a data compression system for electroencephalogram (EEG) data, which includes at least: a data acquisition device 110, a data compression device 120, and a storage device 130.

[0056] The data acquisition device 110 is used to acquire electroencephalogram (EEG) signals reflecting brain activity from the scalp or inside the brain.

[0057] Optionally, the data acquisition device can be a non-invasive device, such as an EEG cap, or it can be an invasive device, such as an implantable medical device. This embodiment does not limit the type of data acquisition device.

[0058] In this embodiment, the data acquisition device 110 also has an analog-to-digital conversion (ADC) function, which is used to convert the acquired EEG signals (analog signals) into EEG data (digital signals) that can be recognized by electronic devices.

[0059] Optionally, the EEG data can be binary numbers or decimal numbers. This embodiment does not limit the representation of the EEG data.

[0060] Optionally, the maximum number of bits of EEG data generated by the data acquisition device 110 is fixed. The maximum number of bits of EEG data generated by the data acquisition device 110 can be 10 bits or 12 bits. This embodiment does not limit the maximum number of bits of EEG data generated by the data acquisition device 110.

[0061] Optionally, the maximum data range of the EEG data is determined based on the maximum number of bits in the EEG data. Specifically, the EEG data is represented in binary. When the maximum number of bits in the EEG data is 10, the maximum data range of the EEG data is 0 to 1024. Alternatively, when the maximum number of bits in the EEG data is 12, the maximum data range of the EEG data is 0 to 4096. This embodiment does not limit the maximum number of bits in the EEG data.

[0062] The data compression device 120 is connected to the data acquisition device 110 for compressing the EEG data generated by the data acquisition device.

[0063] Optionally, the data compression device 120 is a brain-computer interface chip, or it may be located in other electronic devices with computing functions other than the brain-computer interface device. This embodiment does not limit the type of data compression device 120.

[0064] In this embodiment, the data compression device 120 is used to: acquire target EEG data; determine the target data range to which the target EEG data belongs from various data ranges; the data range is obtained by dividing the maximum data range of the EEG data; determine the target data compression rate corresponding to the target data range; the data compression rate corresponding to the m-th data range is greater than the data compression rate corresponding to the n-th data range, and the EEG data in the m-th data range is less than the EEG data in the n-th data range, where m and n are positive integers; and compress the target EEG data using the target data compression rate to obtain compressed EEG data for storage.

[0065] The storage device 130 is connected to the data compression device 120 for storing the compressed EEG data.

[0066] Optionally, the storage device 130 can be an internal memory of the chip that can store data, or it can be an external memory outside the chip. The internal memory of the chip that can store data can be a static random-access memory (SRAM), flash memory (Flash EEPROM, FLASH), etc. This embodiment does not limit the type of storage device 130.

[0067] Optionally, the storage device 130 is communicatively connected to the data compression device 120 via the storage control device 140; the storage control device 140 is used to control the storage device 130 to store the compressed EEG data.

[0068] Optionally, the storage control device 140 is used to stitch together one or more compressed EEG data into a data block of a preset size, so as to store the data in a data block into the storage device 130 at one time.

[0069] Optionally, the storage control device 140 is also used to control the order in which the storage device 130 stores the compressed EEG data.

[0070] In one example, the storage control device 140 is a First-In-First-Out (FIFO) memory.

[0071] It should be noted that in this embodiment, two or more of the data acquisition device 110, data compression device 120, storage device 130 and storage control device 140 can be implemented as the same device, or they can all be implemented as different devices. This embodiment does not limit the implementation method of the data acquisition device 110, data compression device 120, storage device 130 and storage control device 140.

[0072] In summary, the EEG data compression system described in this embodiment acquires target EEG data; determines the target data range to which the target EEG data belongs from various data ranges; the data range is obtained by dividing the maximum data range of the EEG data; determines the target data compression rate corresponding to the target data range; the data compression rate corresponding to the m-th data range is greater than the data compression rate corresponding to the n-th data range, and the EEG data in the m-th data range is smaller than the EEG data in the n-th data range, where m and n are positive integers; and compresses the target EEG data using the target data compression rate to obtain compressed EEG data for storage. This solves the problem that because EEG data changes slowly, brain-computer interface devices usually need to collect EEG data for a long time, which generates a large amount of EEG data, resulting in a large amount of data to be stored in the brain-computer interface device. Since the target EEG data is compressed first and then stored, the size of the stored EEG data can be reduced, thereby reducing the amount of data stored in the brain-computer interface device and saving storage space.

[0073] Figure 2 This is a flowchart of a data compression method for electroencephalogram (EEG) data provided in one embodiment of this application. This application applies this method to... Figure 1 Taking the data compression device 120 in the EEG data compression system shown as an example, the method includes at least the following steps:

[0074] Step 201: Obtain target EEG data.

[0075] The target EEG data is collected by a data acquisition device.

[0076] Optionally, acquiring target EEG data includes: acquiring target EEG data based on a communication connection with a data acquisition device.

[0077] Step 202: Determine the target data range to which the target EEG data belongs from each data range.

[0078] The data range is defined as the maximum range of EEG data. This maximum range of EEG data is pre-stored in a data compression device.

[0079] Optionally, before determining the target data range to which the target EEG data belongs from each data range, the method further includes: dividing the maximum data range according to a preset division method to obtain at least two data ranges.

[0080] Optionally, for the k-th and h-th data ranges within each data range, if the EEG data in the k-th data range is greater than the EEG data in the h-th data range, the width of the k-th data range is greater than or equal to the width of the h-th data range, where k and h are positive integers. That is, the larger the EEG data within a data range, the larger the width of the data range. This ensures that the larger the EEG data, the wider the data range to which it belongs.

[0081] The statement that the EEG data in the k-th data range is greater than the EEG data in the h-th data range means that the minimum value of the EEG data in the k-th data range is greater than the maximum value of the EEG data in the h-th data range.

[0082] The breadth of the data range refers to the number of EEG data types included within the data range.

[0083] For example, if the k-th data range is 64 to 127 and the h-th data range is 0 to 63, then the minimum value of the EEG data in the k-th data range is 64, and the maximum value of the EEG data in the h-th data range is 63.

[0084] For example, if the range of the kth data is 128 to 511 and the range of the hth data is 64 to 127, then the width of the kth data range is 384 and the width of the hth data range is 64.

[0085] In this embodiment, the preset partitioning method is pre-stored in the data compression device, and the preset partitioning method is different for different maximum data ranges.

[0086] For example, the maximum data range is 0 to 1023, and the preset division method is to divide the maximum data range into four data ranges: 0 to 63, 64 to 127, 128 to 511, and 512 to 1023.

[0087] In actual implementation, different preset division methods can be set for the same maximum data range according to actual needs. This embodiment does not limit the division method of the maximum data range.

[0088] In one example, the maximum data range is 0 to 1023. The preset division method is to divide the maximum data range into four data ranges: 0 to 63, 64 to 127, 128 to 511, and 512 to 1023. The target EEG data is 67, so the target data range is 64 to 127.

[0089] Step 203: Determine the target data compression rate corresponding to the target data range.

[0090] For the m-th and n-th data ranges, if the data compression ratio corresponding to the m-th data range is greater than that corresponding to the n-th data range, then the EEG data in the m-th data range is smaller than the EEG data in the n-th data range, where m and n are positive integers. That is, the smaller the EEG data within a data range, the greater the data compression ratio corresponding to that range. This achieves the goal of increasing the data compression ratio of the data range to which the EEG data belongs as much as possible.

[0091] The statement that the EEG data in the m-th data range is less than the EEG data in the n-th data range means that the maximum value of the EEG data in the m-th data range is less than the minimum value of the EEG data in the n-th data range.

[0092] Data compression ratio refers to the ratio of the size of the compressed data to the size of the original data. In other words, the higher the data compression ratio, the higher the precision of the compressed data, and the lower the data compression ratio, the better the data compression effect.

[0093] In this embodiment, since the smaller the EEG data, the greater the data compression rate corresponding to the data range to which the EEG data belongs, and the greater the data compression, the higher the accuracy of the compressed data, the smaller the EEG data in the compressed EEG data, the higher the accuracy of the data, which can ensure the accuracy of low-order EEG data, that is, smaller EEG data.

[0094] In addition, the larger the EEG data, the smaller the data compression rate corresponding to the data range to which the EEG data belongs. The larger the EEG data, the wider the data range to which the EEG data belongs. Therefore, within each data range, the wider the data range, the smaller the data compression rate corresponding to the data range, which can improve the data compression effect.

[0095] In this embodiment, the data compression ratio corresponding to each data range is pre-stored in the data compression device, and the data compression ratios corresponding to different data ranges are different.

[0096] In one example, the maximum data range is 0 to 1023. The default division method is to divide the maximum data range into four data ranges: 0 to 63, 64 to 127, 128 to 511, and 512 to 1023. The data compression rate for the data range 0 to 63 is 1, the data compression rate for the data range 64 to 127 is half, the data compression rate for the data range 128 to 511 is one-quarter, and the data compression rate for the data range 512 to 1023 is one-eighth.

[0097] In actual implementation, different data compression rates can be set for the same data range according to actual needs. This embodiment does not limit the data compression rate corresponding to each data range.

[0098] In one example, the maximum data range is 0 to 1023. This maximum data range is divided into four data ranges: 0 to 63, 64 to 127, 128 to 511, and 512 to 1023. The data compression rate for the range 0 to 63 is 1, the data compression rate for the range 64 to 127 is half, the data compression rate for the range 128 to 511 is one-quarter, and the data compression rate for the range 512 to 1023 is one-eighth. The target data range is 64 to 127, so the target data compression rate is half.

[0099] Step 104: Compress the target EEG data using the target data compression ratio to obtain compressed EEG data, and store the compressed EEG data.

[0100] Optionally, the target EEG data is compressed using the target data compression ratio to obtain compressed EEG data, including: shifting the target EEG data according to the target data compression ratio to obtain shifted EEG data; and determining the sum of the shifted EEG data and the target initial value corresponding to the target data range as the compressed EEG data.

[0101] The initial target value is determined based on the target data EEG data.

[0102] The shift operation refers to shifting the data to the left or right by the corresponding number of bits to obtain new data. When shifting to the right, the lower bits are shifted out (discarded), and the empty higher bits are filled with zeros. When shifting to the left, the higher bits are shifted out (discarded), and the empty lower bits are filled with zeros.

[0103] Optionally, the sum of the shifted EEG data and the target initial value corresponding to the target data range is determined as the compressed EEG data, expressed by the following formula:

[0104] f = g + s

[0105] Where f is the compressed EEG data; g is the shifted EEG data; and s is the target initial value corresponding to the target data range.

[0106] Optionally, the target EEG data is shifted according to the target data compression ratio to obtain the shifted EEG data, including: determining the number of bits to shift according to the target data compression ratio; and shifting the target EEG data to the right by the number of bits to obtain the shifted EEG data.

[0107] In one example, the target data is represented in binary. The target EEG data is 1110. The shift number is 2, so the shifted EEG data is 11.

[0108] Optionally, the target EEG data is represented in base p, where p is an integer greater than 1; the number of bits to be shifted in the shift operation is determined based on the target data compression ratio, including: determining the number of bits to be shifted by taking the negative of the logarithm of the data compression ratio with base p.

[0109] In actual implementation, in order to facilitate the shifting operation of the target data, the target EEG data is represented in binary. At this time, the number of bits to be shifted is determined according to the compression ratio of the target data, including: determining the negative number of the logarithm of the data compression ratio with base 2 as the number of bits to be shifted.

[0110] Optionally, the negative of the logarithm of the data compression ratio with base p is determined as the number of bits to be shifted, expressed by the following formula:

[0111] c = -logpb

[0112] Where p indicates that the target EEG data is in p-ary format; b is the target data compression rate; and c is the number of bits shifted.

[0113] In one example, the target EEG data is represented in binary, where p is 2, and the target data compression ratio is one-quarter. Therefore, the shift bit depth is... That is, 2.

[0114] Optionally, before compressing the target EEG data using the target data compression rate, the method further includes: determining the target initial value corresponding to the target data range.

[0115] In this embodiment, determining the target initial value corresponding to the target data range includes at least the following two cases:

[0116] In the first case, the initial value corresponding to the data range is a preset value that is stored in the electronic device in advance. In this case, determining the target initial value corresponding to the target data range includes: obtaining the target initial value corresponding to the target data range that is stored in advance in the data compression device.

[0117] In the second scenario, the target initial value is calculated by the data compression device based on the target data range. In this case, determining the target initial value corresponding to the target data range includes: determining a reference data range from each data range where the EEG data is smaller than the EEG data in the target data range; and determining the target initial value corresponding to the target data range based on the target data compression rate, the width of each reference data range, and the corresponding data compression rate.

[0118] Optionally, based on the target data compression ratio, the width of each reference data range, and the corresponding data compression ratio, the target initial value corresponding to the target data range is determined, including: determining the sum of the products of the width of each reference data range and the corresponding data compression ratio as the first target value; determining the product of the sum of the widths of each reference data range and the target data compression ratio as the second target value; and determining the difference between the first target value and the second target value as the target initial value.

[0119] Optionally, if the number of reference data ranges is 0, the initial value of the target is 0.

[0120] When the reference data range is not zero, the target initial value corresponding to the target data range is determined based on the target data compression ratio, the width of each reference data range, and the corresponding data compression ratio, expressed by the following formula:

[0121] q = e1t1 + ... + e n t n -(e1+…+e n )t o

[0122] Where q is the reference data range; e i The width of the i-th reference range, 1≤i≤n; t i Let t0 be the data compression ratio corresponding to the i-th reference range, 1≤i≤n; n is the number of reference ranges; t0 is the target data compression ratio.

[0123] For example, if the maximum data range is 0–1023, and this maximum data range is divided into four ranges: 0–63, 64–127, 128–511, and 512–1023, then the data compression rate for the range 0–63 is 1, for the range 64–127 it is half, for the range 128–511 it is one-quarter, and for the range 512–1023 it is one-eighth. If the target data range is 512–1023, then the reference data ranges are 0–63, 64–127, and 128–511. Therefore, the initial target value is... That is, 128.

[0124] It should be noted that in the first case above, the initial value corresponding to the pre-stored data range can also be calculated based on the data range. The calculation method of the initial value is the same as the method of calculating the target initial value based on the target data range in the second case above. For the specific calculation process, please refer to the second case. This embodiment will not repeat it here.

[0125] To better illustrate the data compression method for EEG data provided in this application, an example is given below.

[0126] Assuming EEG data is 10-bit data, meaning the maximum number of bits in EEG data is 10, then the maximum data range of EEG data is 0–1023. The preset division method divides the maximum data range into four ranges: 0–63, 64–127, 128–511, and 512–1023. The data compression rate for the range 0–63 is 1, for the range 64–127 it is half, for the range 128–511 it is one-quarter, and for the range 512–1023 it is one-eighth.

[0127] As shown above, the width of the data range 0-63 is 64, the width of the data range 64-127 is 64, the width of the data range 128-511 is 384, and the width of the data range 512-1023 is 512. Based on the width of the data range and the corresponding compression ratio, it can be calculated that the compressed width of the data range 0-63 is 64, the compressed width of the data range 64-127 is 32, the compressed width of the data range 128-511 is 96, and the compressed width of the data range 512-1023 is 64.

[0128] Based on the above method, it can be calculated that when the data compression rate is 1, the number of shifts is 0. Therefore, during the data compression process, there is no need to shift the EEG data within the data range of 0 to 63. Similarly, when the data compression rate is half, the number of shifts is 1. Therefore, during the data compression process, the EEG data within the data range of 64 to 127 needs to be shifted 1 bit to the right. When the data compression rate is one-quarter, the number of shifts is 2. Therefore, during the data compression process, the EEG data within the data range of 128 to 511 needs to be shifted 2 bits to the right. When the data compression rate is one-eighth, the number of shifts is 3. Therefore, during the data compression process, the EEG data within the data range of 512 to 1023 needs to be shifted 3 bits to the right.

[0129] Since the EEG data in the data range 0-63 is smaller than the EEG data in other data ranges, there is no reference data range for the data range 0-63, that is, the initial value corresponding to the data range 0-63 is 0; similarly, the initial value corresponding to the data range 64-127 is 32; the initial value corresponding to the data range 128-511 is 64; and the initial value corresponding to the data range 512-1023 is 128.

[0130] refer to Figure 3 The horizontal axis represents the target EEG data, and the vertical axis represents the compressed EEG data. The correspondence between the target EEG data and the compressed EEG data is as follows:

[0131] When the target EEG data is less than 64, Y = X;

[0132] When the target EEG data is greater than or equal to 64 and less than 128:

[0133] When the target EEG data is greater than or equal to 128 and less than 512:

[0134] When the target EEG data is greater than or equal to 512:

[0135] Where X represents the target EEG data; Y represents the compressed EEG data.

[0136] Based on the above correspondence, we can see that the uncompressed EEG data range of 0-63 corresponds to the compressed EEG data range of 0-63; the uncompressed EEG data range of 64-127 corresponds to the compressed EEG data range of 64-95; the uncompressed EEG data range of 128-511 corresponds to the compressed EEG data range of 96-191; and the uncompressed EEG data range of 512-1023 corresponds to the compressed EEG data range of 192-255. Therefore, the maximum data range of the compressed EEG data is 0-255.

[0137] In the above example, the maximum data range of the compressed EEG data is 0 to 255, and there is no overlapping data range. Therefore, 8 bits of storage space are sufficient to store the compressed EEG data. The compressed EEG data is 8 bits. Therefore, the data compression algorithm provided in this application can compress 10 bits of EEG data into 8 bits, which can save storage space of storage devices.

[0138] In addition, for 32-bit storage devices, a storage address can only store three 10-bit data bits, which results in the waste of two data bits. However, a storage address can store four 8-bit data bits, which does not cause the waste of data bits and can improve the utilization of storage address, thus further saving storage space of the storage device.

[0139] For example, if a single EEG data point is 30 seconds long, when storing EEG data directly, one storage address can hold three EEG data points, so one storage segment can store 90 seconds of EEG data. However, when storing compressed EEG data, one storage address can hold four EEG data points, so one storage segment can store 120 seconds of EEG data. Therefore, although compressing 10-bit EEG data to 8-bit only reduces the data size by 20%, it increases storage space utilization by 33%, thus further saving storage space.

[0140] In addition, by increasing the duration of EEG data that the storage device can store, it can meet the data duration requirements of different EEG data analysis and processing algorithms, providing more flexible algorithm selection for EEG data analysis and processing.

[0141] It should be noted that this embodiment only describes the process of compressing EEG data once. In actual implementation, EEG data can be compressed multiple times according to actual needs. That is, the compressed EEG data is redefined as the target EEG data and then compressed again. This embodiment does not limit the number of times EEG data can be compressed.

[0142] For example, the compression is performed three times, and the target EEG data is 20 bits. The compression process is as follows: First, the 20-bit target EEG data is compressed to 18 bits using the compression algorithm provided in this application, resulting in the first compressed EEG data; then, the first compressed EEG data is identified as the target EEG data, and the 18-bit target EEG data is compressed to 16 bits again using the compression algorithm provided in this application, resulting in the second compressed EEG data; finally, the second compressed EEG data is identified as the target EEG data, and the 16-bit target EEG data is compressed to 14 bits again using the compression algorithm provided in this application, resulting in the third compressed EEG data, which is then stored.

[0143] In summary, the EEG data compression method provided in this embodiment involves: acquiring target EEG data; determining the target data range to which the target EEG data belongs from various data ranges; the data range being obtained by dividing the maximum data range of the EEG data; determining the target data compression ratio corresponding to the target data range; the data compression ratio corresponding to the m-th data range being greater than the data compression ratio corresponding to the n-th data range, and the EEG data in the m-th data range being smaller than the EEG data in the n-th data range, where m and n are positive integers; and compressing the target EEG data using the target data compression ratio to obtain compressed EEG data for storage. This method can solve the problem that because EEG data changes slowly, brain-computer interface devices typically need to collect EEG data for a long time, resulting in a large amount of EEG data and thus a large amount of data stored in the brain-computer interface device. Since the target EEG data is compressed first and then stored, the size of the stored EEG data can be reduced, thereby reducing the amount of data stored in the brain-computer interface device and saving storage space.

[0144] Meanwhile, since the smaller the EEG data, the greater the data compression rate corresponding to the data range to which the EEG data belongs, and the greater the data compression, the higher the accuracy of the compressed data, the lower-order data is in a state of high compression rate or even no compression, which can effectively ensure the accuracy of the lower-order data.

[0145] In addition, the larger the EEG data, the wider the data range to which the EEG data belongs. And because the larger the EEG data, the smaller the data compression rate corresponding to the data range to which the EEG data belongs. Therefore, within each data range, the wider the data range, the smaller the data compression rate corresponding to the data range, which can improve the data compression effect.

[0146] In addition, since the process of compressing the target EEG data is achieved by shifting and adding the target data, the compression of the target EEG data can be achieved using adders and shifters, which has low hardware requirements and is conducive to the application of data compression algorithms.

[0147] In addition, by setting a suitable compression algorithm, the compressed EEG data can make full use of the storage space, thus further saving storage space.

[0148] In addition, compressing EEG data allows for full utilization of limited storage space, increasing the duration of stored EEG data. This meets the data duration requirements of different EEG data analysis and processing algorithms, providing more flexible algorithm selection for EEG data analysis and processing.

[0149] The data compression method for EEG data provided in this application will be described in detail below.

[0150] Figure 4 This is a flowchart illustrating a data compression method for electroencephalogram (EEG) data according to an embodiment of this application. This application applies this method to... Figure 1 Taking the data compression device 120 in the EEG data compression system shown as an example, the method includes at least the following steps:

[0151] Step 401: Obtain target EEG data.

[0152] Step 402: Divide the maximum data range according to the preset division method to obtain at least two data ranges.

[0153] Step 403: Determine the target data range to which the target EEG data belongs from each data range, and then execute steps 404 and 406.

[0154] Step 404: Determine the number of bits to be shifted for the target EEG data based on the target data compression rate.

[0155] Step 405: Shift the target EEG data to the right by one shift number to obtain the shifted EEG data, then proceed to step 407.

[0156] Step 406: Determine the target initial value corresponding to the target data range, and then proceed to step 407.

[0157] Step 407: The sum of the shifted EEG data and the target initial value corresponding to the target data range is determined as the compressed EEG data, and the compressed EEG data is stored.

[0158] Optionally, step 404 can be executed before step 406, or after step 406, or simultaneously with step 406. This embodiment does not limit the execution order of steps 404 and 406.

[0159] The relevant descriptions in this embodiment refer to the above embodiments, and will not be repeated here.

[0160] In this embodiment, since the compression of the target EEG data is achieved by shifting and adding the target data, the compression of the target EEG data can be achieved using adders and shifters, which has low hardware requirements and is conducive to the application of data compression algorithms.

[0161] Figure 5 This is a block diagram of a data compression device for electroencephalogram (EEG) data provided in one embodiment of this application. This application describes the application of this device in... Figure 1 The data compression device 120 in the EEG data compression system shown is used as an example for illustration. The device includes at least the following modules: data acquisition module 510, first determination module 520, second determination module 530 and data compression module 540.

[0162] Data acquisition module 510 is used to acquire target EEG data;

[0163] The first determining module 520 is used to determine the target data range to which the target EEG data belongs from various data ranges; the data range is obtained by dividing the maximum data range of the EEG data;

[0164] The second determining module 530 is used to determine the target data compression rate corresponding to the target data range; the data compression rate corresponding to the m-th data range is greater than the data compression rate corresponding to the n-th data range, and the EEG data in the m-th data range is less than the EEG data in the n-th data range, where m and n are positive integers.

[0165] The data compression module 540 is used to compress the target EEG data using the target data compression rate to obtain compressed EEG data for storage.

[0166] For relevant details, please refer to the above methods and system implementation examples.

[0167] It should be noted that the EEG data compression device provided in the above embodiments is only illustrated by the division of the functional modules described above when compressing EEG data. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the EEG data compression device can be divided into different functional modules to complete all or part of the functions described above. In addition, the EEG data compression device and the EEG data compression method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0168] Figure 6 This is a block diagram of an electronic device provided in one embodiment of this application. This application describes the application of this electronic device... Figure 1 The data compression device 120 in the data compression system of the EEG data shown is used as an example for illustration. The electronic device includes at least a processor 601 and a memory 602.

[0169] Processor 601 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 601 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 601 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 601 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0170] The memory 602 may include one or more computer-readable and writable storage media, which may be non-volatile. The memory 602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-volatile computer-readable and writable storage media in the memory 602 are used to store at least one instruction, which is executed by the processor 601 to implement the data compression method for EEG data provided in the method embodiments of this application.

[0171] In some embodiments, the electronic device may also optionally include a peripheral device interface and at least one peripheral device. The processor 601, memory 602, and peripheral device interface can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface via a bus, signal line, or circuit board. Indicatively, peripheral devices include, but are not limited to, radio frequency circuits, touch displays, audio circuits, and power supplies.

[0172] Of course, electronic devices may also include fewer or more components, and this embodiment does not limit this.

[0173] Optionally, this application also provides a chip that may include at least a processor and internal memory, and optionally an ADC. The processor can retrieve program instructions from the internal memory and execute the program instructions to perform the data compression method for EEG data as described in the foregoing method embodiments.

[0174] The processor can be a hardware circuit with information processing capabilities, a software instruction, or a combination of hardware and software. In implementation, each step of the above method can be completed through integrated logic circuits in the processor's hardware or through software instructions. The chip can send or receive data, instructions, or information. The processor can process the data, instructions, or other information received through the interface, and can also send the processed information out through the interface.

[0175] Optionally, this application also provides a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the data compression method for EEG data in the above method embodiments.

[0176] Optionally, this application also provides a computer product including a computer-readable storage medium storing a program, which is loaded and executed by a processor to implement the data compression method for EEG data in the above method embodiments.

[0177] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0178] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method of data compression of electroencephalographic data, characterized by, The method comprises: acquiring target electroencephalogram data; determining a target data range to which the target electroencephalogram data belongs from each data range; the data range is obtained by dividing a maximum data range of electroencephalogram data; determining a target data compression rate corresponding to each target data range according to a size of the target data range; a data compression rate corresponding to an mth data range is greater than a data compression rate corresponding to an nth data range, electroencephalogram data in the mth data range is less than electroencephalogram data in the nth data range, and m and n are positive integers; determining a reference data range in which electroencephalogram data is less than electroencephalogram data in the target data range from each data range; determining a first target value as a sum of a product of a width of each reference data range and a corresponding data compression rate; determining a second target value as a product of a sum of widths of each reference data range and the target data compression rate; and determining a target initial value as a difference between the first target value and the second target value; the target electroencephalogram data is represented in base p, and p is an integer greater than 1; determining a moving bit number as a reciprocal of a logarithm of the data compression rate in base p; right-shifting the target electroencephalogram data by the moving bit number to obtain shifted electroencephalogram data; determining compressed electroencephalogram data as a sum of the shifted electroencephalogram data and a target initial value corresponding to the target data range, and storing the compressed electroencephalogram data; and the target initial value is determined according to the target data range.

2. The method of claim 1, wherein, Before the determining a target data range to which the target electroencephalogram data belongs from each data range, the method further comprises: dividing the maximum data range according to a preset division manner to obtain at least two data ranges; electroencephalogram data in a kth data range is greater than electroencephalogram data in an hth data range, a width corresponding to the kth data range is greater than or equal to a width of the hth data range, and k and h are positive integers.

3. A chip, characterized by The chip is used to execute the method according to any one of claims 1 to 2.

4. An electronic device, comprising: The device comprises a processor and a memory; the memory stores a program, the program is loaded and executed by the processor to implement the electroencephalogram data compression method according to any one of claims 1 to 2.

5. A computer readable storage medium, characterized in that, The storage medium stores a program, and the program is executed by the processor to implement the electroencephalogram data compression method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Image processing apparatus

    EP1098507A2