Brain-computer interface-based mindfulness meditation attention diversion method for user having chronic disease, and device

By collecting and analyzing brainwave signals through a brain-computer interface, personalized meditation courses can be generated, solving the problem of mismatch between tasks and user states in existing methods and improving the efficiency of attention shifting and meditation effects for patients with chronic diseases.

WO2026153571A1PCT designated stage Publication Date: 2026-07-23SOUTH CHINA BRAIN-COMPUTER INTERFACE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
SOUTH CHINA BRAIN-COMPUTER INTERFACE TECHNOLOGY CO LTD
Filing Date
2026-01-20
Publication Date
2026-07-23

AI Technical Summary

Technical Problem

Existing attention shifting methods are difficult to personalize for patients with chronic diseases, resulting in a mismatch between the task and the user's state, which reduces the efficiency and effectiveness of attention shifting.

Method used

By collecting single-channel or multi-channel EEG signals from users through a brain-computer interface, using a pre-set EEG detection model to detect load information, generating a suitable meditation course, and adjusting the course in real time during the user's mindfulness meditation to guide attention shift.

Benefits of technology

It enables the adjustment of meditation courses based on the user's real-time status, improving the efficiency and effectiveness of attention shifting and alleviating the negative impact of chronic diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026073689_23072026_PF_FP_ABST
    Figure CN2026073689_23072026_PF_FP_ABST
Patent Text Reader

Abstract

A brain-computer interface-based mindfulness meditation attention diversion method for a user having a chronic disease, and a device. The method comprises: invoking a brain-computer interface to acquire single-channel or multi-channel electroencephalogram signals of a user; determining a chronic disease on which the attention of the user is focused; inputting the electroencephalogram signals into a preset electroencephalogram detection model, in order to detect one or more types of load information generated by the user; on the basis of the load information, generating a meditation course adapted to the chronic disease; and when the user is practicing mindfulness meditation on the basis of the meditation course, controlling, on the basis of the load information, the meditation course to change, so as to guide the user to divert the attention from the chronic disease to the mindfulness meditation. In the method, a meditation course is constructed and adjusted in real time on the basis of load information of a user, and the meditation course is adjusted to adapt to the state of the user, so as to ensure that the state of each user meets the threshold of the meditation course, thereby improving the degree of adaptation between users and meditation courses, realizing personalized mindfulness meditation practice, and improving the user attention diversion efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Brain-computer interface mindfulness meditation attention shifting methods and devices for users with chronic diseases

[0001] This application claims priority to Chinese Patent Application No. 202510081917.7, filed with the Chinese Patent Office on January 20, 2025, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the technical field of brain-computer interfaces, and in particular to a brain-computer interface mindfulness meditation attention transfer method and device for users with chronic diseases. Background Technology

[0003] Patients with chronic diseases often use various methods to shift their attention away from their chronic diseases and towards other things in order to reduce the negative impact of chronic diseases.

[0004] Currently, the common method of diverting attention is to perform a task with certain cognitive requirements (such as watching TV) or a task with a certain physical intensity (such as running). These tasks are relatively difficult, so users usually input their chronic disease information into some apps and let them recommend suitable tasks.

[0005] However, these apps often build tasks offline based on chronic disease information and push the task to the user when the chronic disease information is successfully matched. The offline tasks are somewhat different from the user's real-time status, which makes the task deviate from the user's needs. In addition, these tasks have certain thresholds, and the user's status may be below the threshold of the task, resulting in poor performance of the task and low efficiency of the user's attention shift. Summary of the Invention

[0006] In view of this, this application provides a brain-computer interface mindfulness meditation attention shifting method and device for users with chronic diseases, in order to improve the efficiency of attention shifting for users with chronic diseases.

[0007] The first aspect of this application provides a brain-computer interface mindfulness meditation attention shifting method for users with chronic diseases, including:

[0008] Brain-computer interfaces are used to collect single-channel or multi-channel EEG signals from users;

[0009] Identify the chronic disease where the user's attention is focused;

[0010] The EEG signal is input into a preset EEG detection model to detect one or more load information generated by the user;

[0011] Based on the load information, a meditation course adapted to the chronic disease is generated;

[0012] While the user practices mindfulness meditation according to the meditation course, the meditation course is controlled to change based on the load information in order to guide the user's attention from the chronic disease to the mindfulness meditation.

[0013] The second aspect of this application provides a brain-computer interface mindfulness meditation attention transfer device for users with chronic diseases, comprising:

[0014] The EEG signal acquisition module is used to call the brain-computer interface to acquire single-channel or multi-channel EEG signals from the user;

[0015] The chronic disease identification module is used to identify the chronic disease in which the user's attention is focused.

[0016] The load information detection module is used to input the EEG signal into a preset EEG detection model to detect one or more load information generated by the user;

[0017] A meditation course generation module is used to generate meditation courses that are adapted to the chronic disease based on the load information;

[0018] The meditation course variation module is used to control the variation of the meditation course based on the load information when the user practices mindfulness meditation according to the meditation course, so as to guide the user's attention from the chronic disease to the mindfulness meditation.

[0019] A third aspect of this application provides an electronic device, the electronic device comprising:

[0020] At least one processor; and

[0021] A memory communicatively connected to the at least one processor; wherein,

[0022] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the brain-computer interface mindfulness meditation attention shifting method for users with chronic diseases as described in the first aspect above.

[0023] The fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the brain-computer interface mindfulness meditation attention shifting method for users with chronic diseases as described in the first aspect above.

[0024] The fifth aspect of this application provides a computer program product comprising a computer program that, when executed by a processor, implements the brain-computer interface mindfulness meditation attention shifting method for users with chronic diseases as described in the first aspect above.

[0025] In this embodiment, a brain-computer interface is invoked to collect single-channel or multi-channel EEG signals from the user; the chronic disease in which the user's attention is focused is identified; the EEG signals are input into a pre-set EEG detection model to detect one or more types of workload information generated by the user; a meditation course adapted to the chronic disease is generated based on the workload information; while the user practices mindfulness meditation according to the meditation course, the meditation course is adjusted according to the workload information to guide the user's attention from the chronic disease to mindfulness meditation. This embodiment constructs and adjusts the meditation course in real time based on the user's workload information, adapting the meditation course to the user's state, striving to ensure that each user's state reaches the threshold of the meditation course, improving the adaptability between the user and the meditation course, realizing personalized mindfulness meditation practice, improving the effect of the user's mindfulness meditation practice, improving the efficiency of the user's attention shift, and alleviating the negative impact of the chronic disease on the user.

[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

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

[0028] Figure 1 is a flowchart of a brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases, provided in Embodiment 1 of this application.

[0029] Figure 2 is a schematic diagram of the structure of an electroencephalogram (EEG) detection model provided in Embodiment 1 of this application.

[0030] Figure 3 is a schematic diagram of a brain-computer interface mindfulness meditation attention transfer device for users with chronic diseases provided in Embodiment 2 of this application.

[0031] Figure 4 is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of this application. Detailed Implementation

[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be used interchangeably where appropriate so that the embodiments of this application described herein can cover implementations in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0034] Example 1

[0035] Referring to Figure 1, a flowchart of a brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases is shown in Embodiment 1 of this application. This method can be executed by a brain-computer interface mindfulness meditation attention transfer device for users with chronic diseases. The brain-computer interface mindfulness meditation attention transfer device for users with chronic diseases can be implemented in hardware and / or software and can be configured in an electronic device.

[0036] In one scenario, the electronic device is an integrated device, especially a head-mounted device, such as a smart headband, smart helmet, or smart glasses. Virtual reality devices are equipped with brain-computer interfaces, speakers, screens, and other components. These components can be embedded in the electronic device or reused from the user's mobile terminal, such as a smartphone.

[0037] In another scenario, electronic devices can also be physically separable or detachable. In this case, virtual reality devices include independent head-mounted devices and display devices. The headband and screen can be connected via wired or wireless means, such as Wi-Fi, Bluetooth, ZigBee, etc. The head-mounted device is equipped with a brain-computer interface, and the display device is equipped with components such as a screen and speakers. The screen can be an independent display device that is paired with the headband, or it can be a device with a screen, such as a reusable television.

[0038] As shown in Figure 1, the method includes:

[0039] Step 101: Use the brain-computer interface to collect single-channel or multi-channel EEG signals from the user.

[0040] In this embodiment, the user can wear an electronic device that can access a brain-computer interface to collect single-channel or multi-channel electroencephalogram (EEG) signals from the user at a preset frequency. EEG signals are electrical signals generated by the activity of neurons in the brain. Neurons connect to each other through synapses, forming complex neural networks. When neurons are activated, they produce bioelectrical phenomena, and these EEG signals can be captured by placing electrodes on the scalp.

[0041] The frequency can be a fixed value or a value that is dynamically adjusted based on factors such as the battery level of the electronic device or the task at which attention is being diverted. This embodiment does not impose any restrictions on this.

[0042] Taking a single-channel EEG signal as an example, a brain-computer interface includes electrodes, a signal processor, and an A / D (Analogue to Digital) converter.

[0043] The electrodes include a reference electrode, a ground electrode, and an EEG electrode with a signal channel. The ground electrode is used to determine the zero potential of the EEG signal. The reference electrode and the ground electrode are placed at the temples on both sides of the user's head. The EEG electrode is placed at the Fp2 position defined in the 10-20 system.

[0044] The signal processor is used to amplify the acquired EEG signal through an amplifier at a sampling frequency of 250Hz, and to filter out 50Hz power frequency noise in the EEG signal through a notch filter, and then filter out DC components and high frequency noise through a bandpass filter of 0.1-50Hz.

[0045] The A / D converter uses a 24-bit resolution digital-to-analog converter chip to convert the amplified and filtered EEG signals from analog signals into digital signals.

[0046] Step 102: Identify the chronic disease where the user's attention is focused.

[0047] Generally, users can manually input information about their chronic diseases, such as the type of chronic disease, the duration of the disease, the severity of the disease, the frequency of flare-ups, etc., to provide more information for mindfulness meditation and better serve users.

[0048] Chronic diseases can be categorized into tinnitus and non-tinnitus types. Non-tinnitus types include chronic pain (including but not limited to cancer pain, headaches, and back pain), drug addiction, and so on.

[0049] In one scenario, when a user is using the electronic device in this embodiment, it can be assumed that the user's attention is focused on the chronic disease.

[0050] In another scenario, EEG signals can be reused to detect the severity of a user's chronic disease symptoms, thereby determining whether the user's attention is focused on the chronic disease, and thus initiating the recommended mindfulness meditation process.

[0051] In practice, EEG signals can be input into a pre-set symptom detection model to detect the degree of symptoms (i.e., the severity of chronic disease symptoms) experienced by the user in chronic diseases. The degree of symptoms is compared with a preset degree threshold. When the degree of symptoms is greater than or equal to the preset degree threshold, it indicates that the risk of chronic disease onset is high or the symptoms are more obvious. It is determined that the user's attention is focused on the chronic disease, which may amplify the negative impact of chronic disease symptoms on the user.

[0052] At this time, voice, vibration, or other methods can be used to prompt users to practice mindfulness meditation, shifting their attention from chronic diseases to mindfulness meditation and alleviating the negative impact of chronic disease symptoms on users.

[0053] For example, the symptom severity ranges from [1, 100], and a threshold a and b are set within this range, such as a=20 and b=80.

[0054] If the severity of chronic symptoms is in the range of [1, a], it indicates that the user has a low risk of developing chronic disease.

[0055] If the severity of chronic symptoms is in the range of (a, b), it indicates that the user has a higher risk of developing chronic disease.

[0056] If the severity of chronic symptoms is within (b, 100), it indicates that the user's chronic disease has developed into a relatively obvious condition.

[0057] In this example, both a and b can be set as degree thresholds.

[0058] It should be noted that the symptom detection model can be a machine learning model, such as a Support Vector Machine (SVM), decision tree, random forest, etc., or a deep learning model, such as a Convolutional Neural Network (CNN), Long Short Term Memory (LSTM), Transformer (a neural network architecture based on self-attention mechanism), etc. This embodiment does not limit the scope of the model.

[0059] In one embodiment of this application, the method for training a symptom detection model includes the following steps:

[0060] Step 1021, Signal Acquisition.

[0061] In step 1021, single-channel or multi-channel electroencephalogram (EEG) signals are collected from several (e.g., 100) users with different types of chronic diseases during periods when the chronic diseases are not flaring up and during flare-ups.

[0062] Step 1022: Signal slicing.

[0063] In step 1022, the EEG signal is divided into segments of equal duration (e.g., 10 seconds), and each segment constitutes a sample.

[0064] Step 1023: Data labeling.

[0065] In step 1023, based on the severity of chronic disease symptoms reported by the user, the fragment signals are labeled as having no chronic disease symptoms and chronic disease flare-ups as labels.

[0066] Step 1024: Model training.

[0067] The symptom detection model is trained in a supervised manner using segment signals and their labels. Upon completion of training, the output parameters of the symptom detection model are fixed.

[0068] Step 103: Input the EEG signal into a preset EEG detection model to detect one or more load information generated by the user.

[0069] In practical applications, different types of chronic diseases bring different burdens to users. In order to simplify the detection operation and improve the detection efficiency, in this embodiment, the same EEG signal can be input into a preset EEG detection model for analysis to detect various burden information generated by the user and select the burden information that is suitable for their chronic disease for subsequent processing.

[0070] For example, the load information includes at least one of attention value, mood value, sleep value and tinnitus frequency, wherein the attention value is a value that quantifies the user's level of attention concentration, the mood value is a value that quantifies the user's level of mood, the sleep value is a value that quantifies the user's level of sleep depth, and the tinnitus frequency is the frequency of tinnitus caused by the user.

[0071] When chronic diseases are not accompanied by tinnitus, EEG signals can be input into a pre-set EEG detection model to detect the user's attention, emotion, and sleep values.

[0072] When tinnitus is a chronic condition, the EEG signal is input into a pre-set EEG detection model to detect the user's attention value, emotion value, sleep value and tinnitus frequency.

[0073] In one embodiment of this application, as shown in Figure 2, the EEG detection model includes a first branch structure Branch_1 and a second branch structure Branch_2. The first branch structure Branch_1 is mainly a basic decoding network for EEG signals, and the second branch structure Branch_2 is mainly a prediction network for tinnitus frequency.

[0074] Therefore, step 103 may include the following steps:

[0075] Step 1031: Perform time-frequency conversion on the EEG signal to obtain the EEG time-frequency map.

[0076] In this embodiment, methods such as Continuous Wavelet Transform (CWT) can be used to perform time-frequency conversion on the EEG signal, converting the EEG signal from the time domain to the frequency domain to obtain an EEG time-frequency map. The size of the EEG time-frequency map is N×M×1, where N represents the length, M represents the width, and 1 represents the number of channels.

[0077] Step 1032: Query the user's tinnitus assessment scale components.

[0078] In practical applications, users can fill in or import tinnitus assessment scales in real time, such as the Tinnitus Handicap Inventory (THI), the Tinnitus Handicap Questionnaire (THQ), the Tinnitus Activity Questionnaire (TAQ), the Tinnitus Functional Index (TFI), the Tinnitus Reaction Questionnaire (TRQ), the Tinnitus Questionnaire (TQ), the Tinnitus Evaluation Questionnaire, and so on.

[0079] The tinnitus assessment scale records the user's information on each tinnitus assessment item, which can be converted into vectors to obtain the tinnitus assessment scale components.

[0080] The components of the tinnitus assessment scale are one-dimensional vectors. If the tinnitus assessment scale has L (L is a positive integer) tinnitus assessment items, then the scale of the tinnitus assessment scale components is 1×L.

[0081] Step 1033: Input the EEG time-frequency map into the first branch structure to extract the target EEG features, and generate the user's attention value, emotion value and sleep value based on the target EEG signal.

[0082] In this embodiment, as shown in Figure 2, the EEG time-frequency map is input into the first branch structure Branch_1. The first branch structure Branch_1 performs multi-task processing based on the EEG time-frequency map. During the processing, target EEG features are extracted, and user-generated attention, emotion, and sleep values ​​are generated based on the target EEG features.

[0083] In one design, as shown in Figure 2, the first branch structure Branch_1 includes a first convolutional layer Conv_1, a second convolutional layer Conv_2, a third convolutional layer Conv_3, a fourth convolutional layer Conv_4, a first fully connected layer FC_1, a second fully connected layer FC_2, and a third fully connected layer FC_3.

[0084] On the one hand, the time-frequency EEG image is input into the first convolutional layer Conv_1 to perform a time convolution operation to obtain the first candidate EEG feature.

[0085] When the size of the EEG time-frequency map is N×M×1 and the size of the convolution kernel of the first convolutional layer Conv_1 is 1×K, the size of the first candidate EEG feature is N×M×1.

[0086] On the other hand, the time-frequency EEG image is input into the second convolutional layer Conv_2 to perform time-frequency convolution operation to obtain the second candidate EEG feature.

[0087] When the size of the EEG time-frequency map is N×M×1 and the size of the convolution kernel of the second convolutional layer Conv_2 is K×K, the size of the second candidate EEG feature is N×M×1.

[0088] On the other hand, the EEG time-frequency image is input into the third convolutional layer Conv_3 to perform frequency convolution operation to obtain the third candidate EEG feature.

[0089] When the size of the EEG time-frequency map is N×M×1 and the size of the convolution kernel of the second convolutional layer Conv_2 is K×1, the size of the third candidate EEG feature is N×M×1.

[0090] The first, second, and third candidate EEG features are concatenated according to channels using functions such as Concat to form the fourth candidate EEG feature.

[0091] When the size of the first candidate EEG feature is N×M×1, the size of the second candidate EEG feature is N×M×1, the size of the third candidate EEG feature is N×M×1, the size of the fourth candidate EEG feature is N×M×3.

[0092] The fourth candidate EEG feature is input into the fourth convolutional layer Conv_4 (with a kernel size of 1×1) to perform channel convolution operation, and the target EEG feature is obtained.

[0093] The target EEG features are input into the first fully connected layer FC_1 and mapped to the first reference EEG features. The first reference EEG features are then activated into attention values ​​using activation functions such as Sigmoid.

[0094] The target EEG features are input into the second fully connected layer FC_2 and mapped to the second reference EEG features. The second reference EEG features are then activated into emotion values ​​using activation functions such as Sigmoid.

[0095] The target EEG features are input into the third fully connected layer FC_3 and mapped to the third reference EEG features. The third reference EEG features are then activated into sleep values ​​using activation functions such as Sigmoid.

[0096] Step 1034: Input the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, fuse the target EEG feature and the target tinnitus disability feature into EEG tinnitus feature, and generate the tinnitus frequency generated by the user based on the EEG tinnitus feature.

[0097] In this embodiment, as shown in Figure 2, the tinnitus assessment scale components are input into the second branch structure Branch_2. The second branch structure Branch_2 is responsible for extracting the target tinnitus disability features from the tinnitus assessment scale components, fusing the target EEG features and the target tinnitus disability features into EEG tinnitus features, and predicting the tinnitus frequency generated by the user based on the EEG tinnitus features.

[0098] In one design, as shown in Figure 2, the second branch structure includes a fifth convolutional layer Conv_5, a fourth fully connected layer FC_4, and a fifth fully connected layer FC_5.

[0099] Then, the tinnitus assessment scale components are input into the fourth fully connected layer FC_4 and mapped to candidate tinnitus disability features.

[0100] The candidate tinnitus disability features are transformed and reshaped into two-dimensional target tinnitus disability features with a size of g×g.

[0101] In the fifth convolutional layer Conv_5, the target EEG features are convolved with the target tinnitus disability features as the convolution kernel to obtain the EEG tinnitus features.

[0102] The EEG tinnitus features are input into the fifth fully connected layer FC_5 and mapped to tinnitus frequencies, which are mostly in the range of 2-8kHz.

[0103] Step 1035: If the tinnitus frequency is within the preset frequency range within the preset time period, then maintain the operation of the first branch structure and shut down the operation of the second branch structure.

[0104] In this embodiment, if the tinnitus frequencies are all within a preset frequency range and the duration exceeds a preset time period, the tinnitus frequencies can be considered as the tinnitus frequencies subjectively perceived by the user. In this case, the first branch structure can be kept running while the second branch structure is shut down, thereby reducing resource consumption.

[0105] Of course, apart from maintaining the operation of the first branch structure and shutting down the operation of the second branch structure, both the first branch structure and the second branch structure can continue to operate, and this embodiment does not impose any restrictions on this.

[0106] In one embodiment of this application, the method for training an EEG detection model includes the following steps:

[0107] S201. During the training phase of the EEG detection model, EEG signals and tinnitus assessment scale components are collected from users as samples.

[0108] During the training phase of the EEG detection model, EEG signals and tinnitus assessment scale components can be collected from the subjects as samples.

[0109] In this embodiment, the EEG signals used as samples are labeled with at least one of attention value, emotion value, and sleep value as a label. The attention value, emotion value, and sleep value can be labeled by the user based on their own physical sensations, or by external personnel based on the user's external performance, or by analyzing and labeling the user's facial expressions, body movements, and other external performances. This embodiment does not impose any restrictions on this.

[0110] In addition, the tinnitus assessment scale components used as samples have been labeled with tinnitus frequency as a label.

[0111] S202. Perform time-frequency conversion on the EEG signals used as samples to obtain the EEG time-frequency map.

[0112] In this embodiment, continuous wavelet transform and other methods can be used to perform time-frequency conversion on the EEG signal used as a sample, converting the EEG signal from the time domain to the frequency domain to obtain an EEG time-frequency map. The size of the EEG time-frequency map is N×M×1, where N represents the length, M represents the width, and 1 represents the number of channels.

[0113] S203. Input the EEG time-frequency map into the first branch structure to extract the target EEG features, and generate the user's attention value, emotion value and sleep value based on the target EEG signal.

[0114] In this embodiment, the EEG time-frequency map is input into the first branch structure Branch_1. The first branch structure Branch_1 performs multi-task processing based on the EEG time-frequency map. During the processing, target EEG features are extracted, and user-generated attention, emotion, and sleep values ​​are generated based on the target EEG features.

[0115] In one design, the first branch structure Branch_1 includes a first convolutional layer Conv_1, a second convolutional layer Conv_2, a third convolutional layer Conv_3, a fourth convolutional layer Conv_4, a first fully connected layer FC_1, a second fully connected layer FC_2, and a third fully connected layer FC_3.

[0116] On the one hand, the EEG time-frequency image is input into the first convolutional layer Conv_1 to perform a temporal convolution operation (i.e., a one-dimensional convolution operation in the time dimension) to obtain the first candidate EEG features.

[0117] When the size of the EEG time-frequency map is N×M×1 and the size of the convolution kernel of the first convolutional layer Conv_1 is 1×K, the size of the first candidate EEG feature is N×M×1.

[0118] On the other hand, the time-frequency EEG image is input into the second convolutional layer Conv_2 to perform time-frequency convolution operation (i.e., two-dimensional convolution operation in the time and frequency domains) to obtain the second candidate EEG feature.

[0119] When the size of the EEG time-frequency map is N×M×1 and the size of the convolution kernel of the second convolutional layer Conv_2 is K×K, the size of the second candidate EEG feature is N×M×1.

[0120] On the other hand, the EEG time-frequency map is input into the third convolutional layer Conv_3 to perform frequency convolution operation (i.e., one-dimensional convolution operation in the frequency domain dimension) to obtain the third candidate EEG feature.

[0121] When the size of the EEG time-frequency map is N×M×1 and the size of the convolution kernel of the second convolutional layer Conv_2 is K×1, the size of the third candidate EEG feature is N×M×1.

[0122] The first, second, and third candidate EEG features have the same size. Functions such as Concat can be used to concatenate the first, second, and third candidate EEG features according to channels to form the fourth candidate EEG feature.

[0123] When the size of the first candidate EEG feature is N×M×1, the size of the second candidate EEG feature is N×M×1, the size of the third candidate EEG feature is N×M×1, the size of the fourth candidate EEG feature is N×M×3.

[0124] The fourth candidate EEG feature is input into the fourth convolutional layer Conv_4 (with a kernel size of 1×1) to perform channel convolution operation, and the target EEG feature is obtained.

[0125] The target EEG features are input into the first fully connected layer FC_1 and mapped to the first reference EEG features. The first reference EEG features are then activated into attention values ​​using activation functions such as Sigmoid.

[0126] The target EEG features are input into the second fully connected layer FC_2 and mapped to the second reference EEG features. The second reference EEG features are then activated into emotion values ​​using activation functions such as Sigmoid.

[0127] The target EEG features are input into the third fully connected layer FC_3 and mapped to the third reference EEG features. The third reference EEG features are then activated into sleep values ​​using activation functions such as Sigmoid.

[0128] S204. Generate the first sub-loss value based on the attention value, the second sub-loss value based on the emotion value, and the third sub-loss value based on the sleep value.

[0129] On the one hand, the attention value output by the EEG detection model and the corresponding label can be substituted into a preset loss function (such as the cross-entropy loss function) to generate the first sub-loss value.

[0130] On the other hand, the emotion value output by the EEG detection model and the corresponding label are substituted into a preset loss function (such as the cross-entropy loss function) to generate a second sub-loss value.

[0131] On the other hand, the sleep values ​​output by the EEG detection model and the corresponding labels are substituted into a preset loss function (such as the cross-entropy loss function) to generate a third sub-loss value.

[0132] S205. Input the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, fuse the target EEG feature and the target tinnitus disability feature into EEG tinnitus feature, and generate the tinnitus frequency generated by the user based on the EEG tinnitus feature.

[0133] In this embodiment, the tinnitus assessment scale components are input into the second branch structure Branch_2. The second branch structure Branch_2 is responsible for extracting the target tinnitus disability features from the tinnitus assessment scale components, fusing the target EEG features and the target tinnitus disability features into EEG tinnitus features, and predicting the tinnitus frequency generated by the user based on the EEG tinnitus features.

[0134] In one design, the second branch structure includes a fifth convolutional layer Conv_5, a fourth fully connected layer FC_4, and a fifth fully connected layer FC_5.

[0135] Then, the tinnitus assessment scale components are input into the fourth fully connected layer FC_4 and mapped to candidate tinnitus disability features.

[0136] The candidate tinnitus disability features are transformed and reshaped into two-dimensional target tinnitus disability features with a size of g×g.

[0137] In the fifth convolutional layer Conv_5, the target EEG features are convolved with the target tinnitus disability features as the convolution kernel (also known as dynamic convolution) to obtain the EEG tinnitus features.

[0138] The EEG tinnitus features are input into the fifth fully connected layer FC_5 and mapped to tinnitus frequencies.

[0139] S206. Generate a fourth sub-loss value based on the tinnitus frequency.

[0140] The tinnitus frequency output by the EEG detection model and the corresponding label are substituted into a preset loss function (such as the cross-entropy loss function and the L2 norm loss function) to generate a fourth sub-loss value.

[0141] S207. Combine the first sub-loss value, the second sub-loss value, the third sub-loss value, and the fourth sub-loss value into a total loss value.

[0142] In this embodiment, linear or nonlinear methods can be used to fuse the first sub-loss value, the second sub-loss value, the third sub-loss value, and the fourth sub-loss value into a total loss value.

[0143] In the specific implementation, the first sub-loss value, the second sub-loss value, and the third sub-loss value are added together to obtain the fifth sub-loss value.

[0144] The fourth sub-loss value is assigned a first weight, and the fifth sub-loss value is assigned a second weight; the sum of the first weight and the second weight is 1.

[0145] At this point, the product of the fourth sub-loss value and the first weight, plus the product of the fifth sub-loss value and the second weight, is used as the total loss value.

[0146] Therefore, the total loss value can be expressed as:

[0147] L total =αL freq +(1-α)(L attention +L emotion +L sleep );

[0148] Among them, L total L represents the total loss value. freq For the fourth sub-loss value, L attention L is the first sub-loss value. emotion For the second sub-loss value, L sleep Let α be the third sub-loss value, α be the first weight, and (1-α) be the second weight.

[0149] Initially, α can be set to 0.5, and the four loss functions can be used to optimize the parameters of the EEG detection model with equal weights.

[0150] If the fluctuation of the total loss value during the update is less than the preset fluctuation threshold, then while maintaining the sum of the first weight and the second weight as 1, increasing the first weight and decreasing the second weight, that is, increasing the weight of the loss function for predicting tinnitus frequency, can help search for the global optimal solution and improve the convergence speed.

[0151] S208. Update the EEG detection model based on the total loss value.

[0152] In this embodiment, the total loss value can be substituted into optimization algorithms such as SGD (stochastic gradient descent) and Adam (adaptive momentum) to calculate the update magnitude of the parameters in the EEG detection model, and the parameters in the EEG detection model can be updated according to the update magnitude.

[0153] Furthermore, training conditions can be preset as conditions for stopping the training of the EEG detection model. For example, the number of iterations reaches a certain threshold, the total loss value is less than a certain threshold, the change in the total loss value in multiple training iterations is less than a certain threshold, and so on. In each round of training iterations, it is determined whether the training conditions are met.

[0154] If the training conditions are met, the EEG detection model can be considered to have completed training. At this point, the parameters in the EEG detection model are output and written to the corresponding configuration file.

[0155] If the training conditions are not met, the next round of iterative training can begin, and S202-S208 can be executed again. This iterative training cycle continues until the EEG detection model has completed training.

[0156] Step 104: Generate meditation courses tailored to chronic diseases based on load information.

[0157] In this embodiment, a meditation course tailored to chronic diseases can be generated for the user based on some or all of the user's workload information.

[0158] Among them, meditation courses refer to courses applicable to mindfulness meditation. Mindfulness meditation is a meditation method that allows users to become more aware of their feelings, emotions, and thought processes by being aware of their present experience, receiving multi-sensory feedback, and adjusting their attention targets in real time, relaxing the mind and body, and quickly concentrating their attention, thereby reducing users' concern about chronic diseases. Moreover, mindfulness meditation does not rely excessively on other tools. The basic tools are speakers, screens, etc., which can be directly reused electronic devices and can be carried out anytime and anywhere.

[0159] In practice, meditation courses include meditation scenarios and meditation instructions.

[0160] The meditation scene includes at least visual and / or audio data of mindfulness meditation. At this time, the screen can be called to play the visual of mindfulness meditation and the speaker can be called to play the audio data of mindfulness meditation, providing the user with visual and / or auditory feedback.

[0161] Of course, in addition to visual and auditory feedback, other sensory feedback components can be invoked to provide users with olfactory, tactile, and electrical stimulation feedback, etc. This embodiment does not limit this.

[0162] For example, visual feedback can include animated images of the sky, clouds, campfire, waves, and forest for meditation; auditory feedback can include pink noise, raindrops, flowing water, the sound of flames, and music; olfactory feedback can include aromatherapy; tactile feedback can include vibrations and massages from portable devices; and electrical stimulation feedback can include direct current stimulation.

[0163] In this embodiment, a functional relationship between chronic disease, workload information and meditation scenario can be constructed based on prior knowledge such as experiments (e.g., segmenting workload information under chronic disease and mapping the segments to meditation scenario). When the user's chronic disease and workload information are detected, the meditation scenario can be determined based on the functional relationship.

[0164] In addition, meditation instructions are information that guides users to practice mindfulness meditation. They are usually paired with meditation scenarios to improve the efficiency of users' mindfulness meditation practice, thereby improving the efficiency of users' attention shifting.

[0165] Generally, a corpus of mindfulness meditation can be pre-set, and the corpus can be used to train or fine-tune the Large Language Model (LLM).

[0166] The corpus stores scene text information used to describe various meditation scenarios, as well as scene text vectors converted from the scene text information. For example, some information in the knowledge base includes introductions to digital robots, the definition of mindfulness, the content of mindfulness meditation, guidelines for guiding users in mindfulness meditation in various meditation scenarios, and so on.

[0167] At this point, the guidance text information Prompt can be constructed using the meditation scenario, the user's chronic disease and workload information, and then the guidance text information Prompt can be input into LLM to generate meditation instructions.

[0168] For example, the prompt text message might read: "I suffer from chronic lower back pain. My attention score during campfire meditation is between 0 and 30, and my emotional score is between 20 and 50, and this has been going on for more than 10 minutes, indicating that I am in a poor meditative state. You need to tell me how I am currently and give me some direct advice to help me focus, improve my emotional state, and maintain a positive mental and physical state."

[0169] In one design, a meditation scenario can be built directly based on the user's workload information, and meditation instructions can be generated simultaneously based on the user's workload information.

[0170] When the chronic disease is not tinnitus, the system selects a meditation scenario for the user based on at least one of the emotional value and sleep value, and generates meditation instructions for the user based on at least one of the attention value, emotional value and sleep value.

[0171] For example, for users with chronic pain, soothing symphonic music and aerial views of natural landscapes (meditation scenes) can be provided based on their mood values, and their attention and mood values ​​can be input into the LLM to generate meditation instructions in real time.

[0172] For users addicted to drugs, a meditation scene (with low-rich audio and low-color saturation) can be provided based on their emotional value. Meditation scenes can also be constructed by combining propaganda materials about the harm of drugs, and their attention value and emotional value can be input into the LLM to generate meditation instructions in real time.

[0173] For users with chronic pain and / or addiction, low-rich, single-subject meditation scenarios, such as campfires and candlelight, can be provided based on their mood and sleep levels. The feedback in these meditation scenarios focuses on the realistic dynamic changes of objects, such as the height of a candle flame, the dynamic growth of a tree, the rotation of the earth, etc. Their attention, mood, and sleep levels are input into the LLM to generate meditation instructions in real time. For example, when the user's sleep level is low (i.e., awake) and attention level is low, the meditation instructions guide the user to focus on a specific object (the object of focus varies depending on the meditation scenario, such as a candle, breathing, etc.). When the user's sleep level is low (i.e., awake) and attention level is high, the meditation instructions guide the user to gradually relax different parts of their body. When the user's sleep level is moderate (i.e., light sleep), the feedback based on attention level is paused, and the user is given a meditation instruction indicating that they are about to enter sleep, such as "Your consciousness is becoming increasingly blurred, you are about to enter deep sleep." When the user's sleep level is high (i.e., deep sleep), the meditation instructions are stopped.

[0174] When tinnitus is a chronic condition, the system selects a mindfulness meditation scenario for the user based on at least one of emotional value and sleep value, as well as tinnitus frequency, and generates meditation instructions for the user based on at least one of attention value, emotional value, sleep value, and tinnitus frequency.

[0175] In other words, constructing a meditation field depends on two elements: one is the tinnitus frequency, and the other is at least one of the emotional value and the sleep value.

[0176] Furthermore, the audio signal in the meditation scene can be narrowband noise, white noise, music, etc. The meditation scene will filter out some audio signals, so that some audio signals are missing. The difference between the center frequency of the missing audio signal in the meditation scene and the tinnitus frequency is less than the frequency threshold, that is, the center frequency of the missing audio signal is the same as or similar to the tinnitus frequency.

[0177] Generally, filtering out sounds (i.e. audio signals) near the tinnitus frequency can reduce the overactivity of neurons related to the tinnitus frequency, thereby further distracting the user from the tinnitus.

[0178] Of course, the above meditation scenarios and instructions are merely examples. When implementing this embodiment, other meditation scenarios and instructions can be set according to the actual situation, and this embodiment does not impose any limitations on them. In addition, besides the above meditation scenarios and instructions, those skilled in the art can also use other meditation scenarios and instructions as needed, and this embodiment does not impose any limitations on them either.

[0179] In another design, a meditation course for the next mindfulness meditation practice can be built based on the user's previous mindfulness meditation practice results.

[0180] In practice, the attention value represents the effect of a user's mindfulness meditation practice to a certain extent. Therefore, the average attention value of the user during their last mindfulness meditation practice can be calculated to obtain the average attention value.

[0181] The target range is obtained by querying the average attention range among multiple preset attention ranges. Attention range, to a certain extent, represents the difficulty of practicing mindfulness meditation. Each attention range is equipped with meditation courses adapted to various chronic diseases based on prior knowledge such as experiments.

[0182] Set the meditation course corresponding to the target range as the meditation course for the user's current mindfulness meditation practice.

[0183] For example, the attention value ranges from [1, 100], and a threshold c is set within this range, such as c=60.

[0184] If the average attention level is in the range of [1, c], it indicates that the user's attention shifting effect during this mindfulness meditation practice was poor. In the next mindfulness meditation practice, an introductory meditation course is recommended.

[0185] If the average attention level is in (c, 100], it indicates that the user's attention shifting effect in this mindfulness meditation practice is good. In the next mindfulness meditation practice, a professional-level meditation course is recommended.

[0186] Step 105: When the user practices mindfulness meditation according to the meditation course, control the changes in the meditation course based on the load information to guide the user's attention from chronic diseases to mindfulness meditation.

[0187] During the user's practice of mindfulness meditation according to the meditation course, EEG signals are continuously collected, and load information is continuously generated based on the EEG signals to evaluate the user's effect on shifting attention during mindfulness meditation practice.

[0188] Subsequently, the expressiveness of various feedbacks (including visual feedback, auditory feedback, etc.) in the meditation course (including meditation scenarios and meditation instructions) can be adjusted according to the changing trend of the load information, so that users can intuitively know their own state, guide users' attention from chronic diseases to mindfulness meditation, and alleviate the negative impact of chronic diseases on users.

[0189] For visual feedback, the expressiveness includes changes in the clarity and visual quality of 3D or 2D meditation images. For auditory feedback, the expressiveness includes changes in the volume, pitch, and sound type of mindfulness meditation audio data.

[0190] In practice, when the chronic disease is not tinnitus, the meditation scene is controlled visually and aurally based on at least one of the attention value and sleep value, so as to guide the user's attention from the chronic disease that is not tinnitus to mindfulness meditation.

[0191] For example, the attention value is detected at regular intervals (e.g., 1 second), and preprocessed by moving average or other methods. If the attention value at the current moment is higher than that at the previous moment, that is, the trend of the attention value of mindfulness meditation is upward, it indicates that the user's mindfulness meditation is deeper and the effect of shifting attention is better. In this case, the clarity of the meditation image can be increased and the volume of the mindfulness meditation audio data can be increased. If the attention value at the current moment is lower than that at the previous moment, that is, the trend of the attention value of mindfulness meditation is downward, it indicates that the user's mindfulness meditation is shallower and the effect of shifting attention is worse. In this case, the clarity of the meditation image can be reduced and the volume of the mindfulness meditation audio data can be reduced.

[0192] In addition to the changes mentioned above, if a user's sleep level is detected to be high (i.e., in deep sleep), the volume of the audio signal and the brightness of the screen can be gradually reduced until the user exits the meditation course.

[0193] When tinnitus is a chronic condition, the meditation scene is controlled visually and aurally based on at least one of the attention value and sleep value. Audio signals with a difference of less than a frequency threshold between the center frequency and the tinnitus frequency are filtered out to guide the user's attention from tinnitus to mindfulness meditation.

[0194] Furthermore, the audio signals within a certain frequency band centered on the tinnitus frequency in the meditation scene are filtered out, thereby removing audio signals whose difference between the center frequency and the tinnitus frequency is less than a frequency threshold. At this point, the missing frequencies in the audio signals in the meditation scene are supplemented by the tinnitus frequency perceived by the user, thus constructing a personalized meditation scene for the current user.

[0195] In this embodiment, a brain-computer interface is invoked to collect single-channel or multi-channel EEG signals from the user; the chronic disease in which the user's attention is focused is identified; the EEG signals are input into a pre-set EEG detection model to detect one or more types of workload information generated by the user; a meditation course adapted to the chronic disease is generated based on the workload information; while the user practices mindfulness meditation according to the meditation course, the meditation course is adjusted according to the workload information to guide the user's attention from the chronic disease to mindfulness meditation. This embodiment constructs and adjusts the meditation course in real time based on the user's workload information, adapting the meditation course to the user's state, striving to ensure that each user's state reaches the threshold of the meditation course, improving the adaptability between the user and the meditation course, realizing personalized mindfulness meditation practice, improving the effect of the user's mindfulness meditation practice, improving the efficiency of the user's attention shift, and alleviating the negative impact of the chronic disease on the user.

[0196] Example 2

[0197] Referring to Figure 3, a schematic diagram of a brain-computer interface mindfulness meditation attention transfer device for users with chronic diseases is shown in Embodiment 2 of this application. As shown in Figure 3, the device includes:

[0198] The EEG signal acquisition module 301 is used to call the brain-computer interface to acquire single-channel or multi-channel EEG signals from the user;

[0199] Chronic disease determination module 302 is used to determine the chronic disease in which the user's attention is focused;

[0200] The load information detection module 303 is used to input the EEG signal into a preset EEG detection model to detect one or more load information generated by the user;

[0201] The meditation course generation module 304 is used to generate a meditation course that is adapted to the chronic disease based on the load information.

[0202] The meditation course variation module 305 is used to control the variation of the meditation course based on the load information when the user practices mindfulness meditation according to the meditation course, so as to guide the user's attention from the chronic disease to the mindfulness meditation.

[0203] In one embodiment of this application, the chronic disease determination module 302 includes:

[0204] The symptom severity detection module is used to input the electroencephalogram (EEG) signal into a preset symptom detection model to detect the severity of the symptoms the user has in chronic diseases.

[0205] An attention focus module is used to determine that the user's attention is focused on the chronic disease when the severity of the symptoms is greater than or equal to a preset severity threshold.

[0206] In one embodiment of this application, the load information includes at least one of attention value, mood value, sleep value, and tinnitus frequency;

[0207] The load information detection module 303 includes:

[0208] The first load detection module is used to input the EEG signal into a preset EEG detection model to detect the user's attention value, emotion value and sleep value when the chronic disease is not tinnitus.

[0209] The second load detection module is used to input the EEG signal into a preset EEG detection model to detect the user's attention value, emotion value, sleep value and tinnitus frequency when the chronic disease is tinnitus.

[0210] In one embodiment of this application, the meditation course includes a meditation scenario and meditation instructions;

[0211] The meditation course generation module 304 includes:

[0212] The first course construction module is used to select a meditation scenario for the user based on at least one of the emotion value and the sleep value when the chronic disease is not tinnitus, and to generate meditation instructions for the user based on at least one of the attention value, the emotion value and the sleep value.

[0213] The second course construction module is used to select a meditation scene for the user based on at least one of the emotion value and the sleep value, and the tinnitus frequency when the chronic disease is tinnitus; and to generate meditation instructions for the user based on at least one of the attention value, the emotion value, the sleep value, and the tinnitus frequency; wherein the difference between the center frequency of the missing audio signal in the meditation scene and the tinnitus frequency is less than a frequency threshold.

[0214] The meditation course variation module 305 includes:

[0215] The first change control module is used to control the change of the meditation scene visually and aurally based on at least one of the attention value and the sleep value when the chronic disease is not tinnitus, so as to guide the user's attention from the chronic disease that is not tinnitus to the mindfulness meditation.

[0216] The second change control module is used to control the change of the meditation scene visually and aurally based on at least one of the attention value and the sleep value when the chronic disease is tinnitus. Aurally, it filters out audio signals whose difference between the center frequency and the tinnitus frequency is less than a frequency threshold, so as to guide the user's attention from the tinnitus to the mindfulness meditation.

[0217] In another embodiment of this application, the meditation course generation module 304 includes:

[0218] The average attention calculation module is used to calculate the average attention value of the user during the last mindfulness meditation practice to obtain the average attention.

[0219] The target range query module is used to query the attention range in which the average attention is located among multiple preset attention ranges to obtain the target range; each attention range is configured with a meditation course adapted to each chronic disease;

[0220] The meditation course setting module is used to set the meditation course corresponding to the target range as the meditation course for the user's current mindfulness meditation practice.

[0221] In one embodiment of this application, the EEG detection model includes a first branch structure and a second branch structure; the load information detection module 303 includes:

[0222] The EEG time-frequency conversion module is used to perform time-frequency conversion on the EEG signal to obtain an EEG time-frequency map;

[0223] The tinnitus assessment scale component query module is used to query the tinnitus assessment scale components of the user.

[0224] The first branch processing module is used to input the EEG time-frequency map into the first branch structure to extract target EEG features, and to generate the user-generated attention value, emotion value and sleep value based on the target EEG signal;

[0225] The second branch processing module is used to input the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, fuse the target EEG feature and the target tinnitus disability feature into an EEG tinnitus feature, and generate the tinnitus frequency generated by the user based on the EEG tinnitus feature.

[0226] In another embodiment of this application, the load information detection module 303 further includes:

[0227] The branch adjustment module is used to maintain the operation of the first branch structure and shut down the operation of the second branch structure if the tinnitus frequencies are all within a preset frequency range within a preset time period.

[0228] In one embodiment of this application, the first branch structure includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a first fully connected layer, a second fully connected layer, and a third fully connected layer;

[0229] The first branch processing module includes:

[0230] The first candidate EEG feature generation module is used to input the EEG time-frequency map into the first convolutional layer to perform a time convolution operation to obtain the first candidate EEG features.

[0231] The second candidate EEG feature generation module is used to input the EEG time-frequency map into the second convolutional layer to perform time-frequency convolution operation to obtain the second candidate EEG features.

[0232] The third candidate EEG feature generation module is used to input the EEG time-frequency map into the third convolutional layer to perform frequency convolution operation and obtain the third candidate EEG feature.

[0233] The fourth candidate EEG feature generation module is used to concatenate the first candidate EEG feature, the second candidate EEG feature and the third candidate EEG feature according to channels to form the fourth candidate EEG feature;

[0234] The target EEG feature generation module is used to input the fourth candidate EEG feature into the fourth convolutional layer to perform channel convolution operation to obtain the target EEG feature.

[0235] The attention value generation module is used to input the target EEG feature into the first fully connected layer and map it into a first reference EEG feature, and activate the first reference EEG feature as an attention value;

[0236] The emotion value generation module is used to input the target EEG feature into the second fully connected layer and map it into a second reference EEG feature, and activate the second reference EEG feature into an emotion value;

[0237] The sleep value generation module is used to input the target EEG feature into the third fully connected layer and map it into a third reference EEG feature, and to activate the third reference EEG feature into a sleep value.

[0238] In one embodiment of this application, the second branch structure includes a fifth convolutional layer, a fourth fully connected layer, and a fifth fully connected layer;

[0239] The second branch processing module includes:

[0240] The candidate tinnitus disability feature mapping module is used to input the tinnitus assessment scale components into the fourth fully connected layer and map them into candidate tinnitus disability features.

[0241] The target tinnitus disability feature conversion module is used to transform the candidate tinnitus disability features into two-dimensional target tinnitus disability features;

[0242] The EEG tinnitus feature generation module is used to perform a convolution operation on the target EEG feature in the fifth convolutional layer, using the target tinnitus disability feature as the convolution kernel, to obtain the EEG tinnitus feature.

[0243] The tinnitus frequency generation module is used to input the EEG tinnitus features into the fifth fully connected layer and map them into tinnitus frequencies.

[0244] In one embodiment of this application, it further includes:

[0245] The sample acquisition module is used to collect EEG signals and tinnitus assessment scale components from the user as samples during the training phase of the EEG detection model.

[0246] The sample time-frequency conversion module is used to perform time-frequency conversion on the EEG signal used as a sample to obtain an EEG time-frequency map;

[0247] The first sample processing module is used to input the EEG time-frequency map into the first branch structure to extract target EEG features, and to generate the user-generated attention value, emotion value and sleep value based on the target EEG signal;

[0248] The first loss value generation module is used to generate a first sub-loss value based on the attention value, a second sub-loss value based on the emotion value, and a third sub-loss value based on the sleep value.

[0249] The second sample processing module is used to input the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, fuse the target EEG feature and the target tinnitus disability feature into an EEG tinnitus feature, and generate the tinnitus frequency generated by the user based on the EEG tinnitus feature.

[0250] The second loss value generation module is used to generate a fourth sub-loss value based on the tinnitus frequency;

[0251] The loss value fusion module is used to fuse the first sub-loss value, the second sub-loss value, the third sub-loss value and the fourth sub-loss value into a total loss value;

[0252] The EEG detection model update module is used to update the EEG detection model based on the total loss value.

[0253] In one embodiment of this application, the loss value fusion module includes:

[0254] The loss value addition module is used to add the first sub-loss value, the second sub-loss value and the third sub-loss value to obtain the fifth sub-loss value;

[0255] The weight configuration module is used to configure a first weight for the fourth sub-loss value and a second weight for the fifth sub-loss value; wherein the sum of the first weight and the second weight is 1;

[0256] The weighted summation module is used to add the product of the fourth sub-loss value and the first weight to the product of the fifth sub-loss value and the second weight, as the total loss value;

[0257] The weight adjustment module is used to increase the first weight and decrease the second weight if the fluctuation range of the total loss value during the update is less than a preset fluctuation threshold, while maintaining the sum of the first weight and the second weight as 1.

[0258] In one embodiment of this application, the first branch structure includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a first fully connected layer, a second fully connected layer, and a third fully connected layer;

[0259] The first sample processing module is also used for:

[0260] The time-frequency EEG image is input into the first convolutional layer to perform a temporal convolution operation, thereby obtaining the first candidate EEG feature.

[0261] The EEG time-frequency image is input into the second convolutional layer to perform a time-frequency convolution operation to obtain the second candidate EEG feature;

[0262] The EEG time-frequency image is input into the third convolutional layer to perform a frequency convolution operation, thereby obtaining the third candidate EEG feature;

[0263] The first candidate EEG feature, the second candidate EEG feature, and the third candidate EEG feature are spliced ​​together according to channels to form the fourth candidate EEG feature;

[0264] The fourth candidate EEG feature is input into the fourth convolutional layer to perform channel convolution operation to obtain the target EEG feature;

[0265] The target EEG feature is input into the first fully connected layer and mapped to a first reference EEG feature, and the first reference EEG feature is activated as an attention value;

[0266] The target EEG feature is input into the second fully connected layer and mapped to a second reference EEG feature, and the second reference EEG feature is activated.

[0267] The target EEG feature is input into the third fully connected layer and mapped to a third reference EEG feature, and the third reference EEG feature is activated as a sleep value.

[0268] In one embodiment of this application, the second branch structure includes a fifth convolutional layer, a fourth fully connected layer, and a fifth fully connected layer;

[0269] The second sample processing module is also used for:

[0270] The tinnitus assessment scale components are input into the fourth fully connected layer and mapped to candidate tinnitus disability features.

[0271] Transform the candidate tinnitus disability features into two-dimensional target tinnitus disability features;

[0272] In the fifth convolutional layer, the target EEG features are convolutionally processed using the target tinnitus disability feature as the convolution kernel to obtain the EEG tinnitus features;

[0273] The EEG tinnitus features are input into the fifth fully connected layer and mapped to tinnitus frequencies.

[0274] The brain-computer interface mindfulness meditation attention transfer device for users with chronic diseases provided in this application can execute the brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases.

[0275] Example 3

[0276] Referring to Figure 4, a schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0277] As shown in Figure 4, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0278] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0279] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the brain-computer interface mindfulness meditation attention shifting method for users with chronic diseases.

[0280] In some embodiments, the brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases by any other suitable means (e.g., by means of firmware).

[0281] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0282] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0283] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0284] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0285] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0286] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0287] Example 4

[0288] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases as provided in any embodiment of this application.

[0289] In the implementation of the computer program product, computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0290] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.

[0291] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A brain-computer interface mindfulness meditation attention shifting method for users with chronic diseases, comprising: Brain-computer interfaces are used to collect single-channel or multi-channel EEG signals from users; Identify the chronic disease where the user's attention is focused; The EEG signal is input into a preset EEG detection model to detect one or more load information generated by the user; Based on the load information, a meditation course adapted to the chronic disease is generated; While the user practices mindfulness meditation according to the meditation course, the meditation course is controlled to change based on the load information in order to guide the user's attention from the chronic disease to the mindfulness meditation; The chronic disease for which the user's attention is located includes: The EEG signals are input into a preset symptom detection model to detect the severity of symptoms the user has in chronic diseases; When the severity of the symptoms is greater than or equal to a preset severity threshold, it is determined that the user's attention is focused on the chronic disease; The load information includes at least one of attention value, mood value, sleep value, and tinnitus frequency; The step of inputting the EEG signal into a preset EEG detection model to detect one or more types of load information generated by the user includes: When the chronic disease is not tinnitus, the EEG signal is input into a preset EEG detection model to detect the user's attention value, emotion value and sleep value; When the chronic disease is tinnitus, the EEG signal is input into a preset EEG detection model to detect the user's attention value, emotion value, sleep value and tinnitus frequency.

2. The method according to claim 1, wherein, The meditation course includes meditation scenarios and meditation instructions; The process of generating a meditation course tailored to the chronic disease based on the load information includes: When the chronic disease is not tinnitus, a meditation scenario is selected for the user based on at least one of the emotion value and the sleep value, and meditation instructions are generated for the user based on at least one of the attention value, the emotion value, and the sleep value. When the chronic disease is tinnitus, the user selects a meditation scenario for mindfulness meditation based on at least one of the emotion value and the sleep value, and the tinnitus frequency; and generates meditation instructions for the user based on at least one of the attention value, the emotion value, the sleep value, and the tinnitus frequency; wherein the difference between the center frequency of the missing audio signal in the meditation scenario and the tinnitus frequency is less than a frequency threshold. The method of controlling the changes in the meditation course based on the load information to guide the user's attention from the chronic disease to the mindfulness meditation includes: When the chronic disease is not tinnitus, the meditation scene is controlled visually and aurally based on at least one of the attention value and the sleep value, so as to guide the user's attention from the chronic disease that is not tinnitus to the mindfulness meditation; When the chronic disease is tinnitus, the meditation scene is controlled visually and aurally based on at least one of the attention value and the sleep value. Audio signals whose difference between the center frequency and the tinnitus frequency is less than a frequency threshold are filtered out to guide the user's attention from the tinnitus to the mindfulness meditation. or, The process of generating a meditation course tailored to the chronic disease based on the load information includes: Calculate the average attention value of the user during their last mindfulness meditation practice to obtain the average attention. The target range is obtained by querying the attention range in which the average attention is located among multiple preset attention ranges; each attention range is configured with a meditation course adapted to each chronic disease. Set the meditation course corresponding to the target range as the meditation course for the user's current mindfulness meditation practice.

3. The method according to any one of claims 1-2, wherein, The EEG detection model includes a first branch structure and a second branch structure; the step of inputting the EEG signal into the preset EEG detection model to detect one or more load information generated by the user includes: The EEG signal is converted to a time-frequency signal to obtain an EEG time-frequency map; Query the tinnitus assessment scale components of the user; The EEG time-frequency map is input into the first branch structure to extract target EEG features, and the user-generated attention value, emotion value and sleep value are generated based on the target EEG signal; The tinnitus assessment scale components are input into the second branch structure to extract the target tinnitus disability feature, the target EEG feature and the target tinnitus disability feature are fused into EEG tinnitus feature, and the tinnitus frequency generated by the user is generated based on the EEG tinnitus feature. If the tinnitus frequencies are all within a preset frequency range within a preset time period, the first branch structure will continue to operate while the second branch structure will be shut down.

4. The method according to claim 3, wherein, The first branch structure includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a first fully connected layer, a second fully connected layer, and a third fully connected layer; The step of inputting the EEG time-frequency map into the first branch structure to extract target EEG features, and generating the user-generated attention value, emotion value, and sleep value based on the target EEG signal, includes: The time-frequency EEG image is input into the first convolutional layer to perform a temporal convolution operation, thereby obtaining the first candidate EEG feature. The EEG time-frequency image is input into the second convolutional layer to perform a time-frequency convolution operation, thereby obtaining the second candidate EEG feature; The EEG time-frequency image is input into the third convolutional layer to perform a frequency convolution operation, thereby obtaining the third candidate EEG feature; The first candidate EEG feature, the second candidate EEG feature, and the third candidate EEG feature are spliced ​​together according to channels to form the fourth candidate EEG feature; The fourth candidate EEG feature is input into the fourth convolutional layer to perform channel convolution operation to obtain the target EEG feature; The target EEG feature is input into the first fully connected layer and mapped to a first reference EEG feature, and the first reference EEG feature is activated as an attention value; The target EEG feature is input into the second fully connected layer and mapped to a second reference EEG feature, and the second reference EEG feature is activated as an emotion value; The target EEG feature is input into the third fully connected layer and mapped to a third reference EEG feature, and the third reference EEG feature is activated as a sleep value.

5. The method according to claim 3, wherein, The second branch structure includes a fifth convolutional layer, a fourth fully connected layer, and a fifth fully connected layer; The step of inputting the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, fusing the target EEG feature with the target tinnitus disability feature to form an EEG tinnitus feature, and generating the tinnitus frequency generated by the user based on the EEG tinnitus feature includes: The tinnitus assessment scale components are input into the fourth fully connected layer and mapped to candidate tinnitus disability features. Transform the candidate tinnitus disability features into two-dimensional target tinnitus disability features; In the fifth convolutional layer, the target EEG features are convolutionally processed using the target tinnitus disability feature as the convolution kernel to obtain the EEG tinnitus features; The EEG tinnitus features are input into the fifth fully connected layer and mapped to tinnitus frequencies.

6. The method according to claim 3, further comprising: During the training phase of the EEG detection model, EEG signals and tinnitus assessment scale components were collected from users as samples. The EEG signals used as samples are subjected to time-frequency conversion to obtain an EEG time-frequency map; The EEG time-frequency map is input into the first branch structure to extract target EEG features, and the user-generated attention value, emotion value and sleep value are generated based on the target EEG signal; A first sub-loss value is generated based on the attention value, a second sub-loss value is generated based on the emotion value, and a third sub-loss value is generated based on the sleep value; The tinnitus assessment scale components are input into the second branch structure to extract the target tinnitus disability feature, the target EEG feature and the target tinnitus disability feature are fused into EEG tinnitus feature, and the tinnitus frequency generated by the user is generated based on the EEG tinnitus feature. A fourth sub-loss value is generated based on the tinnitus frequency; The first sub-loss value, the second sub-loss value, the third sub-loss value, and the fourth sub-loss value are combined into a total loss value. The EEG detection model is updated based on the total loss value.

7. The method according to claim 6, wherein, The step of fusing the first sub-loss value, the second sub-loss value, the third sub-loss value, and the fourth sub-loss value into a total loss value includes: The first sub-loss value, the second sub-loss value, and the third sub-loss value are added together to obtain the fifth sub-loss value; A first weight is assigned to the fourth sub-loss value, and a second weight is assigned to the fifth sub-loss value; wherein the sum of the first weight and the second weight is 1; The product of the fourth sub-loss value and the first weight, plus the product of the fifth sub-loss value and the second weight, is used as the total loss value. If the fluctuation range of the total loss value during the update is less than the preset fluctuation threshold, then while maintaining the sum of the first weight and the second weight at 1, the first weight is increased and the second weight is decreased.

8. A brain-computer interface mindfulness meditation attention transfer device for users with chronic diseases, comprising: The EEG signal acquisition module is used to call the brain-computer interface to acquire single-channel or multi-channel EEG signals from the user; The chronic disease identification module is used to identify the chronic disease in which the user's attention is focused. The load information detection module is used to input the EEG signal into a preset EEG detection model to detect one or more load information generated by the user; A meditation course generation module is used to generate meditation courses that are adapted to the chronic disease based on the load information; The meditation course variation module is used to control the variation of the meditation course based on the load information when the user practices mindfulness meditation according to the meditation course, so as to guide the user's attention from the chronic disease to the mindfulness meditation; The chronic disease determination module includes: The symptom severity detection module is used to input the electroencephalogram (EEG) signal into a preset symptom detection model to detect the severity of the symptoms the user has in chronic diseases. An attention focus module is used to determine that the user's attention is focused on the chronic disease when the severity of the symptoms is greater than or equal to a preset severity threshold. The load information includes at least one of attention value, mood value, sleep value, and tinnitus frequency; The load information detection module includes: The first load detection module is used to input the EEG signal into a preset EEG detection model to detect the user's attention value, emotion value and sleep value when the chronic disease is not tinnitus. The second load detection module is used to input the EEG signal into a preset EEG detection model to detect the user's attention value, emotion value, sleep value and tinnitus frequency when the chronic disease is tinnitus.

9. An electronic device, the electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the brain-computer interface mindfulness meditation attention shifting method for users with chronic diseases as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the brain-computer interface mindfulness meditation attention transfer method for users with chronic diseases as described in any one of claims 1-7.