TES parameter regulation and control method and device based on real-time EEG, and medium

Through the TES parameter control method based on real-time EEG, the Transformer model is used to process the EEG signal and generate the TES control vector, which solves the problem of limited effects caused by the fixation of existing TES parameters and realizes personalized TES parameter adjustment.

CN119386377APending Publication Date: 2025-02-07GUANGDONG INST OF INTELLIGENT SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411828930.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-02-07

Smart Images

  • Figure CN119386377A_ABST
    Figure CN119386377A_ABST
Patent Text Reader

Abstract

The invention provides a TES parameter regulation and control method and device based on real-time EEG and a medium, and the method comprises the steps: obtaining a real-time EEG analog signal of a target user, and converting the real-time EEG analog signal into a real-time EEG digital signal; performing one-hot coding on the amplitude voltage of the real-time EEG digital signal at different time points to obtain first one-hot data; acquiring a preset EEG digital signal, and performing one-hot coding on the amplitude voltage of the preset EEG digital signal at different time points to obtain second one-hot data; inputting the first one-hot data and the second one-hot data into a Transform model to obtain a TES control vector; a TES regulation signal is determined based on the TES control vector. According to the technical scheme of the embodiment of the invention, the TES parameters can be automatically adjusted according to actual conditions of different users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of TES technology, and in particular to a TES parameter control method, device and medium based on real-time EEG. Background Art

[0002] Transcranial Electrical Stimulation (TES) is a non-invasive neuromodulation technology that stimulates the cerebral cortex through low-intensity trace currents, thereby changing the user's abnormal brain waves.

[0003] When performing transcranial electrical stimulation, the TES parameter control module generates current to achieve the stimulation effect; the data acquisition module obtains the user's electroencephalogram (EEG) signal to determine the stimulation effect of TES. However, the existing TES parameters are fixed values, and the effect obtained by users using TES is limited. Fixed TES parameters are not suitable for all users. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a TES parameter control method, device, and medium based on real-time EEG, which can automatically adjust TES parameters according to the actual conditions of different users.

[0005] In a first aspect, an embodiment of the present invention provides a TES parameter control method based on real-time EEG, comprising: Acquire a real-time EEG analog signal of a target user, and convert the real-time EEG analog signal into a real-time EEG digital signal; Performing one-hot encoding on the amplitude voltage at different time points of the real-time EEG digital signal to obtain first one-hot data; Acquire a preset EEG digital signal, and perform one-hot encoding on the amplitude voltage at different time points of the preset EEG digital signal to obtain second one-hot data; Input the first one-hot data and the second one-hot data into the Transformer model to obtain a TES control vector; A TES control signal is determined based on the TES control vector.

[0006] According to some embodiments of the present invention, obtaining a real-time EEG analog signal of a target user and converting the real-time EEG analog signal into a real-time EEG digital signal includes: Acquire the real-time EEG analog signal of the target user, and perform impedance transformation processing on the real-time EEG analog signal to obtain a first analog signal; amplifying the first analog signal to obtain a second analog signal; performing notch processing on the second analog signal to obtain a third analog signal; Perform analog-to-digital conversion on the third analog signal to obtain the real-time EEG digital signal.

[0007] According to some embodiments of the present invention, inputting the first one-hot data and the second one-hot data into a Transformer model to obtain a TES control vector includes: Based on the first one-hot data and the real-time EEG digital signal, obtain a first input vector; Encode the first input vector multiple times to obtain real-time EEG output; Based on the second one-hot data and the preset EEG digital signal, obtain a second input vector; Encode the second input vector multiple times to obtain a target EEG output; The TES control vector is obtained based on the real-time EEG output and the target EEG output.

[0008] According to some embodiments of the present invention, obtaining a first input vector based on the first one-hot data and the real-time EEG digital signal includes: After performing a linear transformation on the first one-hot data, word embedding is performed to obtain an amplitude relationship vector, wherein the latitude of the amplitude relationship vector is lower than the latitude of the first one-hot data; Performing word embedding on the positional relationship of the amplitude voltage of the real-time EEG digital signal to obtain a positional relationship vector; The first input vector is obtained based on the amplitude relationship vector and the position relationship vector, wherein the first input vector is a vector sum of the amplitude relationship vector and the position relationship vector.

[0009] According to some embodiments of the present invention, performing multiple Encoding on the first input vector includes: Inputting the first input vector into the multi-head self-attention layer to obtain a first encoding vector; Inputting the first encoding vector into one of the residual processing and normalization processing layers to obtain a second encoding vector; Inputting the second encoding vector into a feed-forward layer to obtain a third encoding vector, wherein the feed-forward layer includes two fully connected layers and two activation functions; The third encoding vector is input again into the residual processing and normalization processing layer to obtain a fourth encoding vector, and the fourth encoding vector is input into the multi-head self-attention layer.

[0010] According to some embodiments of the present invention, obtaining the TES control vector based on the real-time EEG output and the target EEG output includes: Based on the real-time EEG output and the target EEG output, a TES adjustment vector is obtained; The TES adjustment vector passes through multiple hidden layers and a fully connected layer to obtain the TES control vector.

[0011] According to some embodiments of the present invention, determining a TES control signal based on the TES control vector includes: Based on the TES control vector, a TES control signal is obtained, wherein the TES control signal is a digital signal; The TES control signal is converted into a digital-to-analog signal to obtain the TES control signal, wherein the TES control signal is an analog signal.

[0012] In a second aspect, an embodiment of the present invention provides a TES parameter control device based on real-time EEG, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the TES parameter control method based on real-time EEG as described in the first aspect above.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, comprising the TES parameter control device based on real-time EEG as described in the second aspect above.

[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the TES parameter control method based on real-time EEG as described in the first aspect above.

[0015] According to the TES parameter control method based on real-time EEG of the embodiment of the present invention, there are at least the following beneficial effects: obtaining the real-time EEG analog signal of the target user, converting the real-time EEG analog signal into a real-time EEG digital signal; performing one-hot encoding on the amplitude voltage of the real-time EEG digital signal to obtain the first one-hot data; obtaining the preset EEG digital signal, performing one-hot encoding on the amplitude voltage of the preset EEG digital signal to obtain the second one-hot data; inputting the first one-hot data and the second one-hot data into the Transformer model to obtain the TES control vector; determining the TES control signal based on the TES control vector. According to the technical solution of the embodiment of the present invention, the TES parameters can be automatically adjusted based on the EEG of different users. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of a TES parameter control method based on real-time EEG provided by an embodiment of the present invention; Figure 2 It is a structural diagram of a TES parameter control device based on real-time EEG provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0017] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0018] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0019] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0020] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0021] According to the TES parameter control method based on real-time EEG of the embodiment of the present invention, there are at least the following beneficial effects: obtaining the real-time EEG analog signal of the target user, converting the real-time EEG analog signal into a real-time EEG digital signal; performing one-hot encoding on the amplitude voltage of the real-time EEG digital signal to obtain the first one-hot data; obtaining the preset EEG digital signal, performing one-hot encoding on the amplitude voltage of the preset EEG digital signal to obtain the second one-hot data; inputting the first one-hot data and the second one-hot data into the Transformer model to obtain the TES control vector; determining the TES control signal based on the TES control vector. According to the technical solution of the embodiment of the present invention, the TES parameters can be automatically adjusted based on the EEG of different users.

[0022] The control method of the embodiment of the present invention is further described below in conjunction with the accompanying drawings.

[0023] Reference Figure 1 The embodiment of the present invention provides a TES parameter control method based on real-time EEG, including but not limited to the following steps: S10, obtaining a real-time EEG analog signal of a target user, and converting the real-time EEG analog signal into a real-time EEG digital signal; S20, performing one-hot encoding on the amplitude voltage of the real-time EEG digital signal at different time points to obtain first one-hot data; S30, obtaining a preset EEG digital signal, and performing one-hot encoding on the amplitude voltage of the preset EEG digital signal at different time points to obtain second one-hot data; S40, inputting the first one-hot data and the second one-hot data into the Transformer model to obtain a TES control vector; S50, determining a TES regulation signal based on the TES control vector.

[0024] It should be noted that the real-time EEG analog signal of the target user is obtained, and the real-time EEG digital signal is obtained after analog-to-digital conversion. The size of the digital signal represents the size of the analog voltage.

[0025] It should be noted that the amplitude voltage of the real-time EEG digital signal is one-hot encoded to obtain the first one-hot data. For example, when Vpp1<-500uV, the first one-hot data is [1, 0, 0, ..., 0, 0], and when Vpp2=-499.9uV, the first one-hot data is [0, 1, 0, ..., 0, 0].

[0026] The first unique hot data is obtained based on the amplitude voltage of the real-time EEG digital signal, and the second unique hot data is obtained based on the amplitude voltage of the preset EEG digital signal, that is, the digital signal is converted into a vector, so that the TES control vector can be obtained based on the real-time EEG digital signal, the preset EEG digital signal and the Transformer model. The TES control vector can represent the relationship between the amplitude and position of the acquired real-time EEG analog signal and the preset EEG digital signal.

[0027] It should be noted that the preset EEG digital signal is a custom digital signal, and the preset EEG digital signal is the EEG analog signal of the user under the target effect, and the digital signal obtained after analog-to-digital conversion. Through this application, based on the real-time EEG digital signal and the preset EEG digital signal, the TES control vector is obtained to determine the TES control parameters, and based on the TES control parameters, the real-time EEG analog signal of the target user obtained subsequently obtained after analog-to-digital conversion is obtained. The degree of similarity with the preset EEG digital signal is improved. And based on the analog EEG signal of the target user obtained subsequently, the TES control parameters generated subsequently are obtained, so that the closed-loop control of the TES control parameters is realized through this application.

[0028] It should be noted that those skilled in the art are familiar with how to convert analog signals into digital signals through analog-to-digital conversion, how to perform one-hot encoding on digital signals to vectorize them, and how to input two vectors into a Transformer model to obtain a TES control vector. This application does not make any improvements on how to perform analog-to-digital conversion, one-hot encoding, and the application of the Transformer model, and will not be elaborated on here.

[0029] It should be noted that after obtaining the TES control vector based on the real-time EEG analog signal and the preset EEG digital signal, it is converted into a TES control signal, and the TES parameters are adjusted based on the TES control signal. The TES control parameters include control parameters for frequency and amplitude. The TES control signal is associated with the real-time EEG analog signal of the target user, thereby realizing personalized TES parameter control for different users.

[0030] It should be noted that the real-time EEG analog signal of the target user is obtained, and the real-time EEG analog signal is converted into a real-time EEG digital signal; the amplitude voltage of the real-time EEG digital signal is one-hot encoded to obtain the first one-hot data; the preset EEG digital signal is obtained, and the amplitude voltage of the preset EEG digital signal is one-hot encoded to obtain the second one-hot data; the first one-hot data and the second one-hot data are input into the Transformer model, and the output is a TES control vector; the TES control vector is converted to obtain a TES control signal, the TES control signal is associated with the real-time EEG digital signal and the preset EEG digital signal of the target user, and the TES parameters are regulated based on the TES control signal.

[0031] In addition, in one embodiment, Figure 1 S10 in the illustrated embodiment also includes but is not limited to the following steps: S21, obtaining a real-time EEG analog signal of a target user, and performing impedance transformation processing on the real-time EEG analog signal to obtain a first analog signal; S22, amplifying the first analog signal to obtain a second analog signal; S23, performing notch processing on the second analog signal to obtain a third analog signal; S24, performing analog-to-digital conversion on the third analog signal to obtain a real-time EEG digital signal.

[0032] It should be noted that a multi-channel buffer is used to perform impedance transformation on the real-time EEG analog signal, thereby improving the quality of the real-time EEG analog signal.

[0033] It should be noted that the first analog signal is amplified by the differential amplifier circuit to facilitate subsequent signal processing.

[0034] It should be noted that the second analog signal is notched by the notch filter to reduce power frequency interference, thereby improving the signal quality of the second analog signal. Usually, a 50 Hz notch filter is used to perform 50 Hz notch processing on the signal, thereby reducing 50 Hz power frequency interference.

[0035] It should be noted that the third analog signal is sampled by ADC and converted into a digital signal, so as to facilitate subsequent signal processing based on the real-time EEG digital signal.

[0036] In addition, in one embodiment, Figure 1 S40 in the illustrated embodiment also includes but is not limited to the following steps: S31, obtaining a first input vector based on the first one-hot data and the real-time EEG digital signal; S32, performing multiple encoding on the first input vector to obtain real-time EEG output; S33, obtaining a second input vector based on the second one-hot data and the preset EEG digital signal; S33, performing multiple encoding on the second input vector to obtain a target EEG output; S35, obtaining a TES control vector based on the real-time EEG output and the target EEG output.

[0037] It should be noted that the first one-hot data is input processed, and the input processing includes linear transformation, word embedding and position encoding. After the first one-hot data is input processed, a first input vector is obtained. The first input vector can represent the amplitude-voltage relationship and the position relationship of the amplitude-voltage of the real-time EEG digital signal.

[0038] It should be noted that the second one-hot data is input processed, and the input processing includes linear transformation, word embedding and position encoding. After the second one-hot data is input processed, the second input vector is obtained. The first input vector can represent the amplitude-voltage relationship and the position relationship of the amplitude-voltage of the preset EEG digital signal.

[0039] In addition, in one embodiment, Figure 1 S31 of the illustrated embodiment also includes but is not limited to the following steps: S41, after performing a linear transformation on the first one-hot data, perform word embedding to obtain an amplitude relationship vector, wherein the latitude of the amplitude relationship vector is lower than the latitude of the first one-hot data; S42, performing word embedding on the positional relationship of the amplitude voltage of the real-time EEG digital signal to obtain a positional relationship vector; S43, obtaining a first input vector based on the amplitude relationship vector and the position relationship vector, wherein the first input vector is a vector sum of the amplitude relationship vector and the position relationship vector.

[0040] It should be noted that since the first one-hot data is classified based on the amplitude of the real-time EEG digital signal, there are too many categories and they are too sparse. Therefore, a linear transformation is performed on the first one-hot data. After the linear transformation, the relationship between the amplitude and voltage of the real-time EEG digital signal can be represented, and the first one-hot data is converted into a low-dimensional word vector; after word embedding, the expression of the relationship between the amplitude and voltage of the real-time EEG digital signal is obtained, that is, the amplitude relationship vector.

[0041] It should be noted that, since the multi-head attention layer processes all amplitude voltages in the real-time EEG digital signal in parallel, the first input vector input to the multi-head attention layer needs to include the positional relationship of the amplitude voltage in the EEG digital signal. Therefore, the positional relationship of the amplitude voltage of the real-time EEG digital signal is obtained, and the word embedding of the method is combined with the position encoding to obtain the positional relationship vector, which can represent the positional relationship between the amplitude voltages in the real-time EEG digital signal.

[0042] It should be noted that the first input vector is the vector sum of the amplitude relationship vector and the position relationship vector, and the first input vector can represent the relationship between the amplitude voltage of the real-time EEG digital signal and the position characteristics of the amplitude voltage of the real-time EEG digital signal.

[0043] It should be noted that the process of obtaining the second input vector based on the second one-hot data and the preset EEG digital signal is the same as that of the present embodiment.

[0044] In addition, in one embodiment, Figure 1 S32 of the illustrated embodiment also includes but is not limited to the following steps: S51, input the first input vector to the multi-head self-attention layer to obtain a first encoding vector; S52, inputting the first encoding vector into a residual processing and normalization processing layer to obtain a second encoding vector; S53, inputting the second encoding vector into a feed-forward layer to obtain a third encoding vector, wherein the feed-forward layer includes two fully connected layers and two activation functions; S54, input the third encoding vector into a residual processing and normalization processing layer again to obtain a fourth encoding vector, and input the fourth encoding vector into the multi-head self-attention layer.

[0045] It should be noted that the first encoding vector obtained by transforming the first input vector through the multi-head self-attention layer can represent the relationship between different times, different brain area positions, and different EEG amplitudes.

[0046] It should be noted that the first coding vector is processed by residual processing and normalization processing layers. The residual processing is used to prevent the gradient of the first coding vector from disappearing, and the normalization processing enables the vector to have a stable mean and variance.

[0047] It should be noted that the feedforward layer includes two layers of full connection and two layers of activation functions. Through the feedforward layer, the second encoding vector is mapped to a low dimension, thereby increasing the fitting expression ability of the model.

[0048] It should be noted that the implementation method of performing multiple encodings on the second input vector to obtain the target EEG output is the same as that of this embodiment.

[0049] In addition, in one embodiment, Figure 1 S35 of the illustrated embodiment also includes but is not limited to the following steps: S61, obtaining a TES adjustment vector based on the real-time EEG output and the target EEG output; S62, the TES adjustment vector passes through multiple hidden layers and a fully connected layer to obtain the TES control vector.

[0050] It should be noted that the target EEG output is the EEG output corresponding to the EEG digital signal under normal circumstances; the real-time EEG output is the EEG output corresponding to the real-time EEG analog signal obtained based on the target user; based on the difference between the real-time EEG output and the target EEG output, the TES adjustment vector is obtained.

[0051] The TES adjustment vector passes through multiple hidden layers and a fully connected layer, so as to extract higher-level and more abstract features from the TES adjustment vector and obtain the TES control vector.

[0052] In addition, in one embodiment, Figure 1 S50 in the illustrated embodiment also includes but is not limited to the following steps: S71, obtaining a TES control signal based on the TES control vector, wherein the TES control signal is a digital signal; S72, performing digital-to-analog signal conversion on the TES control signal to obtain a TES control signal, wherein the TES control signal is an analog signal.

[0053] It should be noted that the TES control vector is converted into a TES control signal, that is, the vector is converted into a digital signal, and then the digital signal is converted into an analog signal, and based on the TES control signal, it is determined how to control the amplitude, voltage and other parameters of the TES parameters.

[0054] In addition, in order to better illustrate the technical solution of this embodiment, a specific example is provided below: S81, obtaining a real-time EEG analog signal of a target user, performing impedance transformation, amplification processing, notch processing, and analog-to-digital signal conversion on the real-time EEG analog signal in sequence, thereby improving the signal quality of the real-time EEG analog signal, and converting the real-time EEG analog signal into a real-time EEG digital signal; S82, performing one-hot encoding on the amplitude voltage of the real-time EEG digital signal at different time points to obtain first one-hot data, that is, converting the digital signal into a vector; S83, obtaining a preset EEG digital signal, and performing one-hot encoding on the amplitude voltage of the preset EEG digital signal at different time points to obtain second one-hot data; S84, input the first one-hot data and the second one-hot data into the Transformer model, perform a linear transformation on the first one-hot data and then perform word embedding to obtain an amplitude relationship vector, perform word embedding on the amplitude position of the real-time EEG digital signal to obtain a position relationship vector, and obtain a first input vector based on the amplitude relationship vector and the position relationship vector; obtain a second input vector based on the second one-hot data in the same manner, obtain a real-time EEG output based on the first input vector, obtain a target EEG output based on the second input vector, obtain a TES adjustment vector based on the real-time EEG output and the target EEG output, and obtain a TES control vector after the TES adjustment vector passes through multiple hidden layers and a fully connected layer; S85, converting the TES control vector into a TES control signal, which is a digital signal. The TES control signal is converted into a digital-to-analog signal to obtain a TES control signal, thereby determining how to control the amplitude, voltage and other parameters of the TES parameters.

[0055] like Figure 2 As shown, Figure 2 : is a structural diagram of a TES parameter control device based on real-time EEG provided by an embodiment of the present invention. The present invention also provides a TES parameter control device based on real-time EEG, comprising: The processor 901 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the TES parameter control method based on real-time EEG in the embodiment of this application; Input / output interface 903, used to implement information input and output; Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.); A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904); The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0056] An embodiment of the present application also provides an electronic device, including the TES parameter control device based on real-time EEG as described above.

[0057] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned TES parameter control method based on real-time EEG is implemented.

[0058] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0059] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0060] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A TES parameter control method based on real-time EEG, characterized in that: include: Acquire a real-time EEG analog signal of a target user, and convert the real-time EEG analog signal into a real-time EEG digital signal; Performing one-hot encoding on the amplitude voltage at different time points of the real-time EEG digital signal to obtain first one-hot data; Acquire a preset EEG digital signal, and perform one-hot encoding on the amplitude voltage at different time points of the preset EEG digital signal to obtain second one-hot data; Input the first one-hot data and the second one-hot data into the Transformer model to obtain a TES control vector; A TES control signal is determined based on the TES control vector.

2. The TES parameter control method based on real-time EEG according to claim 1, characterized in that: Acquiring a real-time EEG analog signal of a target user and converting the real-time EEG analog signal into a real-time EEG digital signal, including: Acquire the real-time EEG analog signal of the target user, and perform impedance transformation processing on the real-time EEG analog signal to obtain a first analog signal; amplifying the first analog signal to obtain a second analog signal; performing notch processing on the second analog signal to obtain a third analog signal; Perform analog-to-digital conversion on the third analog signal to obtain the real-time EEG digital signal.

3. The TES parameter control method based on real-time EEG according to claim 1, characterized in that: The first one-hot data and the second one-hot data are input into the Transformer model to obtain a TES control vector, including: Based on the first one-hot data and the real-time EEG digital signal, obtain a first input vector; Encode the first input vector multiple times to obtain real-time EEG output; Based on the second one-hot data and the preset EEG digital signal, obtain a second input vector; Encode the second input vector multiple times to obtain a target EEG output; The TES control vector is obtained based on the real-time EEG output and the target EEG output.

4. The TES parameter control method based on real-time EEG according to claim 3, characterized in that: Based on the first one-hot data and the real-time EEG digital signal, a first input vector is obtained, including: After performing a linear transformation on the first one-hot data, word embedding is performed to obtain an amplitude relationship vector, wherein the latitude of the amplitude relationship vector is lower than the latitude of the first one-hot data; Performing word embedding on the positional relationship of the amplitude voltage of the real-time EEG digital signal to obtain a positional relationship vector; The first input vector is obtained based on the amplitude relationship vector and the position relationship vector, wherein the first input vector is a vector sum of the amplitude relationship vector and the position relationship vector.

5. The TES parameter control method based on real-time EEG according to claim 3, characterized in that: The first input vector is encoded multiple times, including: Inputting the first input vector into the multi-head self-attention layer to obtain a first encoding vector; Inputting the first encoding vector into a residual processing and normalization processing layer to obtain a second encoding vector; Inputting the second encoding vector into a feed-forward layer to obtain a third encoding vector, wherein the feed-forward layer includes two fully connected layers and two activation functions; The third encoding vector is input again into a residual processing and normalization processing layer to obtain a fourth encoding vector, and the fourth encoding vector is input into the multi-head self-attention layer.

6. The TES parameter control method based on real-time EEG according to claim 3, characterized in that: Based on the real-time EEG output and the target EEG output, the TES control vector is obtained, including: Based on the real-time EEG output and the target EEG output, a TES adjustment vector is obtained; The TES adjustment vector passes through multiple hidden layers and a fully connected layer to obtain the TES control vector.

7. The TES parameter control method based on real-time EEG according to claim 1, characterized in that: Determining a TES control signal based on the TES control vector includes: Based on the TES control vector, a TES control signal is obtained, wherein the TES control signal is a digital signal; The TES control signal is converted into a digital-to-analog signal to obtain the TES control signal, wherein the TES control signal is an analog signal.

8. A TES parameter control device based on real-time EEG, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the TES parameter control method based on real-time EEG as described in any one of claims 1 to 7.

9. An electronic device, characterized in that: It includes the TES parameter control device based on real-time EEG as described in claim 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the TES parameter control method based on real-time EEG as described in any one of claims 1 to 7.