An operating system for an implantable closed-loop brain-machine interface

CN115509356BActive Publication Date: 2026-08-07HANGZHOU NUOWEI MEDICAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU NUOWEI MEDICAL TECH CO LTD
Filing Date
2022-09-23
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

然而,比较遗憾的是目前并没有针对此类可以用于管理植入式闭环脑机接口的操作系统

Benefits of technology

[0020]本披露实施例提供的一种用于植入式闭环脑机接口的操作系统,利用脑电采样模块实现对脑电信号的采样,利用脑电分析模块对脑电采样模块采集的脑电信号采样数据进行实时分析,实现了脑电信号的采集和实时分析。进一步地,在实时分析结果表征脑电信号采样数据满足设定要求时,利用脑电存储模块将对应的脑电采样数据存储到存储器,利用刺激管理模块控制刺激电路输出第一刺激脉冲,实现了脑电信号采样数据满足设定要求时的实时存储和实时刺激,满足实时性要求。同时,利用通信管理模块实现与第一外部设备进行通信的功能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115509356B_ABST
    Figure CN115509356B_ABST
Patent Text Reader

Abstract

The disclosure discloses an operating system for an implantable closed-loop brain-computer interface, which realizes sampling of electroencephalogram signals by using an electroencephalogram sampling module, realizes real-time analysis of electroencephalogram signal sampling data collected by the electroencephalogram sampling module by using an electroencephalogram analysis module, and realizes collection and real-time analysis of electroencephalogram signals. Further, when the real-time analysis result indicates that the electroencephalogram signal sampling data meets the set requirement, the corresponding electroencephalogram signal sampling data is stored into a memory by using an electroencephalogram storage module, and a first stimulation pulse is output by a stimulation circuit controlled by a stimulation management module, thereby realizing real-time storage and real-time stimulation when the electroencephalogram signal sampling data meets the set requirement and meeting the real-time requirement. Meanwhile, the communication management module is used to realize the function of communication with the first external device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the field of brain-computer interfaces, and more specifically, this disclosure relates to an operating system for implantable closed-loop brain-computer interfaces. Background Technology

[0002] Brain-computer interface (BCI) is a technology that enables the human brain to interact with external devices based on electroencephalogram (EEG) signals. Based on whether the system control provides feedback, BCIs are divided into open-loop and closed-loop BCIs. Closed-loop BCIs, in particular, can interact with the brain by recording and modulating neural activity, achieving true brain-computer interaction.

[0003] Furthermore, depending on whether a control chip is implanted in the brain, closed-loop brain-computer interfaces are divided into implantable closed-loop brain-computer interfaces (also known as invasive closed-loop brain-computer interfaces) and non-implantable closed-loop brain-computer interfaces. Among them, implantable closed-loop brain-computer interfaces have been extensively studied because the EEG signals they acquire have a high signal-to-noise ratio and spatiotemporal resolution.

[0004] One aspect is that for implantable closed-loop brain-computer interfaces (BCIs), to enable interaction between the BCI and the brain, tasks such as EEG signal acquisition, stimulation tasks, and external communication are required. These tasks have very strict requirements for real-time performance and other indicators. Meeting these requirements requires not only the participation of the hardware system but also the participation of the operating system to achieve coordination between the hardware and software systems. However, it is regrettable that there is currently no operating system specifically designed for managing implantable closed-loop BCIs.

[0005] In view of this, there is an urgent need to provide an operating system for implantable closed-loop brain-computer interfaces. Summary of the Invention

[0006] To address at least one or more of the technical issues mentioned above, this disclosure proposes an operating system for implantable closed-loop brain-computer interfaces to achieve coordination between hardware and software systems in implantable closed-loop brain-computer interfaces.

[0007] This disclosure provides an operating system for an implantable closed-loop brain-computer interface, comprising: an EEG sampling module, an EEG analysis module, an EEG storage module, a stimulation management module, and a communication management module; wherein, the EEG sampling module is used to continuously sample EEG signals; the EEG analysis module is used to receive EEG signal sampling data from the EEG sampling module in real time, and to perform real-time analysis on the received EEG signal sampling data, and send the real-time analysis results to the EEG storage module and the stimulation management module; the EEG storage module is used to store the EEG signal sampling data obtained by the EEG sampling module, and to use the real-time analysis results... When the EEG signal sampling data meets the set requirements, the corresponding EEG signal sampling data is stored in the memory. The stimulation management module is used to control the stimulation circuit to output a first stimulation pulse when the real-time analysis result indicates that the EEG signal sampling data meets the set requirements. The communication management module is used to receive the storage data acquisition instruction sent by the first external device and send it to the EEG storage module. The EEG storage module is also used to send the corresponding EEG signal sampling data as first feedback information to the communication management module when it receives the storage data acquisition instruction. The communication module is also used to send the first feedback information to the first external device.

[0008] In one specific embodiment disclosed herein, it further includes: a power management module; the power management module is used to acquire the system operating status and control the operating mode of the hardware resources in the implanted closed-loop brain-computer interface according to the system operating status, the system operating status being used to characterize the operating status of the operating system.

[0009] In one specific embodiment disclosed herein, the operating modes include: no-response mode, reduced-frequency operation mode, and full-speed operation mode; when the operating system communicates with the first external device, the power management module controls the hardware resources to enter the full-speed operation mode; when the operating system does not communicate with the first external device, and the stimulation management module controls the stimulation circuit to output stimulation pulses, the power management module controls the hardware resources to enter the reduced-frequency operation mode; when the operating system does not communicate with the first external device, and the stimulation management module does not control the stimulation circuit to output stimulation pulses, the power management module controls the hardware resources to enter the no-response mode.

[0010] In one specific embodiment disclosed herein, when the hardware resources enter the unresponsive mode, the processor, high-speed clock, and peripherals that require the high-speed clock as a clock source are shut down, while the low-speed clock and timers that use the low-speed clock are turned on, and the timers are configured so that the processor can still respond to external interrupts; when the hardware resources enter the down-frequency operation mode, the processor and the peripherals operate at a preset clock frequency.

[0011] In one specific embodiment disclosed herein, the preset clock frequency corresponds to the task executed by the operating system.

[0012] In one specific embodiment of this disclosure, the frequency and amplitude of the first stimulation pulse are determined based on the real-time analysis results.

[0013] In one specific embodiment disclosed herein, the analysis algorithm used by the EEG analysis module to perform real-time analysis on the real-time received EEG signal sampling data is configured through the first external device.

[0014] In one specific embodiment disclosed herein, the communication management module is further configured to receive a stimulation instruction sent by the first external device and send it to the stimulation management module; the stimulation management module is further configured to send second feedback information to the communication management module upon receiving the stimulation instruction, and control the stimulation circuit to output a second stimulation pulse corresponding to the stimulation instruction.

[0015] In one specific embodiment disclosed herein, it further includes a version management module, which is used for upgrading and rolling back the operating system.

[0016] In one specific embodiment disclosed herein, the operating system upgrade process executed by the version management module includes: the version management module receiving an upgrade firmware package sent by a second external device from the communication management module and generating update information; the version management module performing integrity verification on the upgrade firmware package, and upon successful verification, writing the upgrade firmware package and the update information into the download area; the version management module resetting the operating system, using the operating system's bootloader to detect the update information, and upon successful detection, copying the firmware version from the runtime area to the backup area, and copying the upgrade firmware package from the download area to the runtime area; the version management module using the operating system's bootloader to perform the upgrade firmware package; and the upgrade firmware package being upgraded by the bootloader to the operating system. The system's bootloader sets a version rollback flag and enables a watchdog timer. Then, it jumps to the runtime environment and starts the operating system. After the second external device successfully connects, the version rollback flag is cleared, and the firmware upgrade is complete. The rollback process of the operating system executed by the version management module includes: if the operating system crashes after the upgrade, the watchdog timer enabled in the operating system's bootloader resets the operating system; the version management module uses the operating system's bootloader to detect the version rollback flag; if the detection passes, the firmware version in the backup area is copied to the runtime environment, the version rollback flag is cleared, and the system jumps to the runtime environment and starts the operating system.

[0017] In one specific embodiment disclosed herein, the rollback process of the operating system executed by the version management module further includes: when the operating system cannot be connected to the second external device after the upgrade, the operating system is physically reset; the version management module uses the bootloader of the operating system to detect the version rollback flag; if the detection is successful, the firmware version in the backup area is copied to the running area, the version rollback flag is cleared, and the system is switched to the running area and started.

[0018] In one specific embodiment disclosed herein, it further includes: a hardware abstraction layer; the hardware abstraction layer includes: an EEG sampling function interface and a stimulation function interface, wherein the EEG sampling function interface is a function interface abstracted from the sampling circuit, and the stimulation function interface is a function interface abstracted from the stimulation circuit.

[0019] In one specific embodiment disclosed herein, the EEG storage module is further configured to receive an EEG storage instruction sent by the first external device through the communication management module, and store the EEG signal sample data corresponding to the EEG storage instruction into the memory.

[0020] This disclosure provides an operating system for an implantable closed-loop brain-computer interface. It utilizes an EEG sampling module to sample EEG signals and an EEG analysis module to perform real-time analysis of the sampled EEG data, thus achieving both EEG signal acquisition and real-time analysis. Furthermore, when the real-time analysis results indicate that the sampled EEG data meets set requirements, an EEG storage module stores the corresponding sampled data in a memory, and a stimulation management module controls the stimulation circuit to output a first stimulation pulse. This achieves real-time storage and stimulation when the sampled EEG data meets the set requirements, satisfying real-time performance requirements. Simultaneously, a communication management module enables communication with a first external device. Attached Figure Description

[0021] The above and other objects, features, and advantages of exemplary embodiments of this disclosure will become readily apparent upon reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this disclosure are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein:

[0022] Figure 1 A block diagram of an operating system for an implantable closed-loop brain-computer interface is shown, according to an embodiment of this disclosure.

[0023] Figure 2 A block diagram of another operating system for an implantable closed-loop brain-computer interface is shown, according to an embodiment of this disclosure.

[0024] Figure 3 A block diagram of another operating system for an implantable closed-loop brain-computer interface is shown, according to an embodiment of this disclosure.

[0025] Figure 4 A flowchart illustrating the startup process of an operating system for an implantable closed-loop brain-computer interface according to an embodiment of this disclosure is shown.

[0026] Figure 5 A block diagram of another operating system for an implantable closed-loop brain-computer interface is shown, according to an embodiment of this disclosure.

[0027] Figure 6 A flowchart illustrating the interaction between the components of an operating system for an implantable closed-loop brain-computer interface according to an embodiment of this disclosure is shown. Detailed Implementation

[0028] The technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0029] It should be understood that the terms “comprising” and “including” used in this disclosure and claims indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0030] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this disclosure. As used in this disclosure and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this disclosure and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0031] As used in this specification and claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0032] The specific embodiments disclosed herein will now be described in detail with reference to the accompanying drawings.

[0033] Before providing a detailed description of the embodiments disclosed herein, a brief introduction to the technical concept of the embodiments disclosed herein will be given.

[0034] As mentioned in the background section, when an implantable closed-loop brain-computer interface (BCI) is implanted into the brain, a complete BCI system, including both hardware and operating systems, is required to coordinate the hardware and software systems and complete tasks such as EEG signal acquisition, stimulation tasks, and external communication. Unfortunately, although some hardware systems have been developed, there is currently no operating system to accompany them.

[0035] Based on this, this disclosure provides an operating system for an implantable closed-loop brain-computer interface. The operating system includes an EEG sampling module, an EEG analysis module, an EEG storage module, and a stimulation management module. The EEG analysis module can acquire and analyze the EEG signal sampling data obtained by the EEG sampling module in real time. When the analyzed EEG signal sampling data meets set requirements, the EEG storage module stores the EEG signal sampling data required for offline analysis into a memory. Simultaneously, the stimulation management module generates a first stimulation pulse that matches the real-time analysis result, thereby completing the EEG signal acquisition and stimulation task and meeting real-time requirements. This disclosure also includes a communication management module for enabling communication between the EEG storage module and other components and external systems.

[0036] After briefly introducing the technical concept of the embodiments disclosed herein, the operating system provided in the embodiments of this disclosure will be described in more detail below with reference to the accompanying drawings.

[0037] See Figure 1 As shown, Figure 1 A block diagram of an operating system for an implantable closed-loop brain-computer interface provided in this disclosure embodiment is shown. Figure 1 The operating system shown includes: an EEG sampling module 101, an EEG analysis module 102, an EEG storage module 103, a stimulation management module 104, and a communication management module 105.

[0038] Furthermore, in practical applications, Figure 1 The operating system shown may also include: a protocol stack 106, an inter-task communication component 107, a software timer 108, a scheduler 109, and a memory management module 110.

[0039] It should be noted that, Figure 1 The operating system shown relies on the hardware system of an implantable closed-loop brain-computer interface. This hardware system includes a processor, non-volatile memory, sampling circuitry, stimulation circuitry, a high-speed clock, a low-speed clock, and peripherals of the processor. The sampling and stimulation circuitry can be electrodes. For details on the composition and connections of the specific hardware system, please refer to existing technologies on implantable closed-loop brain-computer interfaces; further details are omitted here. Figure 1 The operating system runs on the processor. The modules within the operating system are described in detail below. In practical use, the processor can take the form of a CPU (central processing unit), MCU (microcontroller unit), etc. This embodiment does not limit the form of the processor.

[0040] The EEG sampling module 101 is used for continuous sampling of EEG signals. Specifically, a timer using a low-speed clock as the clock source generates periodic interrupt signals. The EEG sampling module 101 continuously samples the EEG signals under the influence of these periodic interrupt signals. The sampling frequency is the same as the frequency of the periodic interrupt signals, and the specific sampling frequency is determined according to actual needs. For example, in one specific embodiment, the sampling frequency is 200Hz, and in another specific embodiment, the sampling frequency is 1000Hz. Of course, this disclosed embodiment is not limited to these, and other sampling frequencies may also exist. It should be noted that, to meet the continuous sampling requirements, the sampling process of the EEG sampling module is not affected by the scheduler.

[0041] The EEG analysis module 102 receives EEG signal sampling data from the EEG sampling module 101 in real time, performs real-time analysis on the received EEG signal sampling data, and sends the real-time analysis results to the EEG storage module 103 and the stimulation management module 104. In practical use, the real-time analysis results may include tagged EEG signal sampling data, and the EEG storage module 103 and the stimulation management module 104 subsequently execute corresponding actions based on the tags.

[0042] Furthermore, the algorithm used by the EEG analysis module 102 to perform real-time analysis of the EEG signal sampling data is determined according to specific analysis requirements. For example, in practical use, one or more of the following analysis algorithms can be used to analyze the EEG signal sampling data: line length analysis algorithm, area analysis algorithm, bandpass analysis algorithm, low-frequency analysis algorithm, and high-frequency analysis algorithm. More specifically, based on the characteristics of the EEG signals during the user's episode, an analysis algorithm with a high recognition rate for these characteristics is selected to analyze the EEG signal sampling data. If the analysis algorithm with the highest recognition rate exists, it can be used to analyze the EEG signal sampling data. In particular, when the EEG sampling module can acquire multiple EEG signals using the EEG sampling circuit, a corresponding analysis algorithm can be selected and analyzed for each EEG signal sampling data channel.

[0043] Furthermore, in one specific embodiment of this disclosure, the analysis algorithm used by the EEG analysis module 102 to perform real-time analysis of the received EEG signal sampling data can be configured via an external device (i.e., the first external device). In another specific embodiment of this disclosure, the analysis algorithm used by the EEG analysis module 102 to perform real-time analysis of the received EEG signal sampling data can also be pre-configured, without the need for external device involvement. Considering that implantable closed-loop brain-computer interfaces are mostly used in medical and other scenarios, configuring the analysis algorithm via an external device allows for flexible configuration according to actual needs to achieve different analysis objectives.

[0044] The EEG storage module 103 is used to store the EEG signal sampling data obtained by the EEG sampling module 101, and to receive the real-time analysis results sent by the EEG analysis module 102. When the real-time analysis results indicate that the EEG signal sampling data meets the set requirements, the corresponding EEG sampling data is stored in the memory. Specifically, the EEG storage module 103 generally puts the EEG signal sampling data into memory to achieve fast sampling. When the real-time analysis results indicate that the EEG signal sampling data meets the set requirements, the corresponding EEG signal sampling data is stored in the memory, which facilitates subsequent offline analysis of the EEG signal sampling data stored in the memory. Here, "corresponding EEG signal sampling data" can be understood as the EEG signal sampling data required for offline analysis. In practical applications, "corresponding EEG signal sampling data" can include EEG signal sampling data that makes the real-time analysis results meet the set requirements, but is not limited to this. The specific data included depends on the offline analysis requirements. For example, in some embodiments, "corresponding EEG signal sampling data" may also include some EEG signal sampling data before the real-time analysis results meet the set requirements, and some EEG signal sampling data after the real-time analysis results meet the set requirements. It should be noted that in practical applications, when the real-time analysis results characterize the EEG signal sampling data to meet the set requirements, the corresponding EEG signal sampling data can be stored in either non-volatile or volatile memory. Considering data security issues after power failure, non-volatile memory is preferred.

[0045] Furthermore, the "setting requirements" depend on the application scenario of the implanted closed-loop brain-computer interface. For example, for epilepsy patients, the "setting requirements" are the presence of epileptiform waves or epileptiform waves of analytical significance in the real-time analysis results of the brain signal sampling data. For paralyzed patients, the "setting requirements" are the presence of signals indicating that the patient is controlling a certain object, such as controlling a computer cursor, in the real-time analysis results of the brain signal sampling data.

[0046] The stimulation management module 104 receives real-time analysis results from the EEG analysis module 102. When the real-time analysis results indicate that the EEG signal sampling data meets the set requirements, it controls the stimulation circuit to output a first stimulation pulse. In some embodiments, when the real-time analysis results indicate that the EEG signal sampling data meets the set requirements, the stimulation management module 104 can control the stimulation circuit to output a first stimulation pulse with a specific frequency and amplitude. In other embodiments, the stimulation management module 104 can determine the frequency and amplitude of the first stimulation pulse based on the real-time analysis results, and the relationship between the real-time analysis results and the frequency and amplitude of the first stimulation pulse can be preset. For example, different frequencies and amplitudes of first stimulation pulses can be used to stimulate different epileptiform waves, so that the EEG signal can return to normal as quickly as possible, thereby controlling epileptic seizures.

[0047] Furthermore, implantable closed-loop brain-computer interfaces are typically worn inside the patient's body. In scenarios such as patient visits, offline analysis of the EEG signal sampling data stored in the memory is required. This necessitates an external device (i.e., the first external device) retrieving the EEG signal sampling data from the EEG storage module 103. This function is implemented by the communication management module 105. Physically, the communication management module 105 controls the communication-related hardware in the hardware system, serving as the communication interface for the implantable closed-loop brain-computer interface to interact with external devices.

[0048] Specifically, the communication management module 105 receives a storage data retrieval command sent by the first external device and sends it to the EEG storage module 103. The EEG storage module 103, upon receiving the storage data retrieval command, sends the corresponding EEG signal sampling data as first feedback information to the communication management module 105. The communication management module 105 then sends the first feedback information to the first external device. Here, the "corresponding EEG signal sampling data" can be EEG signal sampling data stored in non-volatile memory or EEG signal sampling data sampled in real-time and stored in volatile memory. Specifically, the first external device issues a corresponding command based on the data retrieval requirement to obtain the EEG signal sampling data. For example, if the data retrieval requirement is to obtain real-time sampled EEG signal sampling data stored in volatile memory, the first external device sends a storage data retrieval command to obtain data from volatile memory; conversely, if the data retrieval requirement is to obtain EEG signal sampling data stored in non-volatile memory, the first external device sends a storage data retrieval command to obtain data from non-volatile memory.

[0049] It should be noted that, due to the communication involved between the first external device and the implanted closed-loop brain-computer interface, the communication between the communication management module 105 and the EEG storage module 103 requires the participation of the protocol stack 106 in practical applications. Specifically, the communication management module 105 receives the storage data retrieval instruction sent by the first external device and sends it to the protocol stack 106. The protocol stack 106 parses the storage data retrieval instruction and sends it to the EEG storage module 103. After receiving the parsed storage data retrieval instruction, the EEG storage module 103 sends the EEG signal sampling data stored in its memory as first feedback information to the protocol stack 106. The protocol stack 106 encapsulates the first feedback information into a data frame and sends it to the communication management module 105 in the form of a data frame. The communication management module 105 then sends the first feedback information encapsulated into a data frame to the first external device.

[0050] Furthermore, as mentioned above, the EEG sampling module 101, EEG analysis module 102, EEG storage module 103, stimulation management module 104, and communication management module 105 need to communicate with each other. These modules can be referred to as tasks, and communication between them is achieved through the inter-task communication component 107. Alternatively, the inter-task communication component 107 is used for communication between the EEG sampling module 101, EEG analysis module 102, EEG storage module 103, stimulation management module 104, and communication management module 105.

[0051] In practical applications, the inter-task communication component 107 can support events, task notifications, messages, and mutex lock mechanisms. Events support many-to-many, many-to-one, or one-to-many inter-task communication scenarios without data; task notifications support many-to-one inter-task communication scenarios without data; messages support many-to-one inter-task communication scenarios with data; and mutex locks are used for mutual exclusion of software or hardware resources. The communication mechanism between the EEG sampling module 101, EEG analysis module 102, EEG storage module 103, stimulus management module 104, and communication management module 105 is determined based on the specific communication content. For example, communication between the EEG analysis module 102 and the EEG storage module 103 and stimulus management module 104 can use an event mechanism, while communication between the EEG sampling module 101 and the EEG analysis module 102 and EEG storage module 103 can use a task notification mechanism.

[0052] The software timer 108 is used for tasks where high time precision is not required. In other words, the use of the software timer 108 is determined based on the task's time precision requirements. The triggering mode of the software timer 108 is determined according to actual needs. In some specific embodiments, the software timer 108 supports single-trigger and periodic triggering modes. In other embodiments, the software timer 108 supports single-trigger. In still other embodiments, the software timer 108 supports periodic triggering. The single-trigger software timer 108 executes only once when the set time arrives and is then destroyed. The periodically triggered software timer 108 runs periodically at the set time interval. The designer pre-determines which tasks have low time precision requirements. Specifically, tasks with small time granularity and high precision requirements, such as those requiring strict control of the stimulus pulse output duration, cannot use a software timer; for tasks with large time granularity and low precision requirements, such as performing a 3-second stimulus every 10 minutes, a software timer can be used.

[0053] Furthermore, the reason for using software timers is explained here: The number of hardware timers is limited, and the duration of the timer can be limited by the size of the time granularity; a larger time granularity allows for a longer timer, and a smaller time granularity allows for a shorter timer. In practical applications, there may be scenarios that exceed the limits of hardware timers. In such cases, hardware timers cannot fully meet the needs of all tasks, necessitating the use of software timers.

[0054] Furthermore, the EEG sampling module 101, EEG analysis module 102, EEG storage module 103, stimulation management module 104, and communication management module 105 require corresponding computing and memory resources to run, which is implemented by the scheduler 109 and the memory management module 110.

[0055] Scheduler 109 employs a time-slice round-robin scheduling algorithm for task scheduling, supporting task preemption and multiple priorities. Specifically, higher-priority tasks preempt lower-priority tasks; tasks with the same priority are scheduled using the time-slice round-robin scheduling algorithm.

[0056] In some implementations, the memory management module 110 only supports static memory management, which divides available memory into fixed-size memory blocks. Compared to dynamic memory management, static memory management has the advantages of shorter allocation time and no memory fragmentation. It is understood that in other implementations, the memory management module 110 may also support dynamic memory management.

[0057] This disclosure provides an operating system for an implantable closed-loop brain-computer interface. It utilizes an EEG sampling module to sample EEG signals and an EEG analysis module to perform real-time analysis of the sampled EEG data, thus achieving both EEG signal acquisition and real-time analysis. Furthermore, when the real-time analysis results indicate that the sampled EEG data meets set requirements, an EEG storage module stores the corresponding sampled data in a memory, and a stimulation management module controls the stimulation circuit to output a first stimulation pulse. This achieves real-time storage and stimulation when the sampled EEG data meets the set requirements, satisfying real-time performance requirements. Simultaneously, a communication management module enables communication with a first external device.

[0058] Furthermore, considering the application scenarios of implantable closed-loop brain-computer interfaces, power consumption is usually a factor to consider. For this purpose, see [link to relevant documentation]. Figure 2 As shown, in Figure 1 Based on the embodiment shown, the operating system may further include a power management module 111.

[0059] Specifically, the power management module 111 is used to acquire the system's operating status and control the operating mode of the hardware resources in the implantable closed-loop brain-computer interface based on this status. The system operating status characterizes the running state of the operating system, or in other words, the system operating status is determined based on the running state of each component within the operating system. Hardware resources can be understood as the processor, high-speed clock, low-speed clock, and processor peripherals, etc. Specifically, by performing operations such as enabling and disabling hardware resources and adjusting their operating rates, the module controls system power consumption and maximizes the system's operating time after a single charge of the implantable closed-loop brain-computer interface.

[0060] Furthermore, in one specific embodiment disclosed herein, the operating modes of the hardware resources may include: a tickless mode, a reduced-frequency operating mode, and a full-speed operating mode. The tickless mode can be understood as a Tickless mode.

[0061] Specifically, when the operating system communicates with the first external device, the power management module 111 controls the hardware resources to enter full-speed operation mode; when the operating system does not communicate with the first external device and the stimulation management module controls the stimulation circuit to output stimulation pulses, the power management module 111 controls the hardware resources to enter frequency reduction operation mode; when the operating system does not communicate with the first external device and the stimulation management module does not control the stimulation circuit to output stimulation pulses, the power management module 111 controls the hardware resources to enter non-responsive mode.

[0062] More specifically, when hardware resources enter unresponsive mode, the processor, high-speed clock, and peripherals requiring a high-speed clock as their clock source are shut down. A low-speed clock and timers using the low-speed clock are enabled, and the timers are configured so that the processor can still respond to external interrupts, supporting continuous sampling of brain signals by the EEG sampling module 101. When hardware resources enter downclocking mode, the processor and peripherals operate at a preset clock frequency.

[0063] It should be noted that the operating modes of hardware resources are not limited to simultaneously including unresponsive mode, downclocked operation mode, and full-speed operation mode. In some specific implementations, the operating modes of hardware resources may include downclocked operation mode and full-speed operation mode. Furthermore, the specific form of unresponsive mode can also have more options. For example, when hardware resources enter unresponsive mode, they may only shut down the high-speed clock and peripherals that require the high-speed clock as a clock source, without shutting down the processor.

[0064] Furthermore, in some embodiments disclosed herein, the preset clock frequency when hardware resources enter the reduced-frequency operation mode corresponds to the task executed by the operating system. Thus, when selecting the reduced-frequency operation mode, corresponding clock frequency presets can be set according to different task scenarios. The operating system switches the clock frequency according to the corresponding preset when processing different tasks to reduce power consumption. For example, when performing long stimuli and not requiring communication with the first external device, the preset clock frequency can be set to meet the pulse width adjustment granularity requirements of the stimulation pulse. For instance, if the minimum granularity of the stimulation pulse width is 1µs, the clock frequency can be 1MHz; or if the minimum granularity of the stimulation pulse width is 10µs, the clock frequency can be reduced to 100kHz.

[0065] Specifically, considering scenarios where doctors examine or test patients, in one specific embodiment disclosed herein, stimulation can also be applied to the patient externally. Specifically, the communication management module 105 receives a stimulation command sent by a first external device and sends it to the stimulation management module 104. Then, upon receiving the stimulation command from the first external device, the stimulation management module 104 sends second feedback information to the communication management module 105 and controls the stimulation circuit to output a second stimulation pulse corresponding to the stimulation command. The second feedback information indicates that the stimulation management module has correctly received the stimulation command from the first external device.

[0066] More specifically, the communication management module 105 receives the stimulation command sent by the first external device and sends it to the protocol stack 106. The protocol stack 106 parses the stimulation command and sends it to the stimulation management module 104. Then, when the stimulation management module 104 receives the stimulation command sent by the first external device, it sends second feedback information to the communication management module 105 through the protocol stack 106 and controls the stimulation circuit to output a second stimulation pulse corresponding to the stimulation command.

[0067] Furthermore, considering that doctors may need to obtain EEG signals during patient examinations and diagnoses, in one specific embodiment of this disclosure, the EEG storage module 103 is also used to receive an EEG storage instruction sent by a first external device through the communication management module 105, and store the EEG signal sampling data corresponding to the EEG storage instruction in the memory. Specifically, the first external device sends an EEG storage instruction to the communication management module 105, which then sends the instruction to the protocol stack 106. The protocol stack parses the instruction and sends it to the EEG storage module 103, which stores the EEG signal sampling data corresponding to the instruction in the memory. For example, if a doctor sends an EEG storage instruction to the EEG storage module 103 via the first external device to store EEG signal sampling data for the next hour, the EEG storage module 103 will store the corresponding duration of EEG signal sampling data upon receiving the instruction. Understandably, to ensure that the EEG storage module 103 correctly receives the EEG storage command sent by the first external device, the EEG storage module 103 can send feedback information to the first external device through the protocol stack 106 and the communication management module 105 when it receives the EEG storage command. The memory here can be either non-volatile or volatile memory.

[0068] Considering practical applications, and the need for feature upgrades or software defect fixes, please refer to [link / reference]. Figure 3 As shown, in one specific embodiment disclosed herein, the operating system may further include: a version management module 112, which is used for upgrading and rolling back the operating system.

[0069] In some implementations, the operating system upgrade process executed by the version management module 112 may include: the version management module 112 receiving the upgrade firmware package sent by the second external device from the communication management module 105 and generating update information; the version management module 112 performing integrity verification on the upgrade firmware package, and writing the upgrade firmware package and update information to the download area after the verification passes; the version management module 112 resetting the operating system and entering the Bootloader stage. The bootloader of the operating system detects the update information, and if the detection passes, copies the firmware version in the runtime area to the backup area and copies the upgrade firmware package in the download area to the runtime area; the version management module 112 sets a version rollback flag and enables the watchdog timer using the operating system's bootloader, then jumps to the runtime area, starts the operating system, and clears the version rollback flag after the second external device successfully connects, completing the firmware upgrade. In practical applications, the second external device may be the same as or different from the first external device. Successful connection of the second external device indicates that the operating system is running normally.

[0070] The operating system rollback process executed by the version management module 112 includes: when the upgraded operating system crashes, the watchdog timer enabled in the operating system's bootloader resets the operating system and enters the bootloader stage. The version management module 112 uses the operating system's bootloader to detect the version rollback flag. If the detection passes, the firmware version in the backup area is copied to the runtime area, the version rollback flag is cleared, and the system jumps to the runtime area and starts the operating system. The design of the operating system rollback process ensures the reliability of the upgrade mechanism, preventing operating system failure when the upgrade firmware package has problems, and enhancing the robustness of the operating system.

[0071] This disclosed embodiment provides storage space for the upgrade firmware package and the original firmware version respectively during the operating system upgrade process by setting up a download area, a running area, and a backup area, thereby avoiding conflicts between the upgrade firmware package and the original firmware version and facilitating the execution of rollback operations.

[0072] It should be noted that when upgrading the operating system, if the operating system corresponding to the upgraded firmware package is problem-free, a rollback process is not required; in some implementations, a rollback process may not even be necessary. Furthermore, since the version management module 112 utilizes the operating system's bootloader during the upgrade and rollback process, and the operating system itself is not started, the version management module 112 is partly located within the operating system's bootloader and partly located within the operating system itself. The operating system's bootloader is also known as the Bootloader.

[0073] In particular, in extreme cases, the upgraded operating system may be unable to connect to the second external device. Therefore, in one specific embodiment disclosed herein, the operating system rollback process executed by the version management module 112 may further include: when the upgraded operating system cannot connect to the second external device, physically resetting the operating system; the version management module 112 uses the operating system's bootloader to detect the version rollback flag; if the detection passes, the firmware version in the backup area is copied to the runtime area, the version rollback flag is cleared, and the system jumps to the runtime area and starts the operating system. The physical method can be an external method such as using physical buttons to restart the implanted closed-loop brain-computer interface.

[0074] It should be noted that when the version management module 112 obtains the upgrade firmware package from the communication management module 105, it also needs to send the upgrade firmware package to the protocol stack 106 for parsing. The protocol stack 106 then sends the parsed package back to the version management module 112. Specifically, to ensure that the version management module 112 correctly receives the upgrade firmware package sent by the second external device, upon receiving the package, the version management module 112 can send feedback information to the second external device through the protocol stack 106 and the communication management module 105.

[0075] To facilitate a more intuitive understanding of the operating system upgrade process in this disclosed embodiment, the following is combined with... Figure 4 The startup process of the operating system in this embodiment will be described. Wherein, Figure 4 In this document, BCIOS (Brain Computer Interface Operating System) represents the operating system in this embodiment. Creating an EEG task can be understood as creating an EEG sampling module 101, an EEG analysis module 102, an EEG storage module 103, a stimulus management module 104, and a communication management module 105.

[0076] Specifically, upon entering the Bootloader stage, after the system powers on, it first checks for update information and version rollback flags to ensure that a version upgrade or rollback is not necessary. If update information is available, the aforementioned operating system upgrade process is executed; if a version rollback flag is present, the aforementioned operating system rollback process is executed. If neither update information nor a version rollback flag is present, the version upgrade and rollback processes are skipped, and the system jumps to BCIOS, entering the BCIOS startup process. During this process, the operating system runs while initializing hardware resources, creating EEG XX tasks, and starting the protocol stack.

[0077] Furthermore, considering the portability of the operating system, see [link to relevant documentation]. Figure 5 As shown, in one specific embodiment disclosed herein, the operating system may further include: a hardware abstraction layer 113.

[0078] Specifically, the hardware abstraction layer 113 may include an EEG sampling function interface and a stimulation function interface. The EEG sampling function interface is a function interface abstracted from the sampling circuit, and the stimulation function interface is a function interface abstracted from the stimulation circuit. Thus, for different implantable closed-loop brain-computer interfaces, only the hardware abstraction layer needs to be modified to run on different implantable closed-loop brain-computer interfaces. It is understandable that, like computer operating systems, in practical applications, the hardware abstraction layer 113 also has other necessary function interfaces, such as communication function interfaces and memory management function interfaces.

[0079] To facilitate a more intuitive understanding of the interaction relationships among the components of the operating system in this disclosed embodiment, the following is combined with... Figure 6 The interaction relationships among the components of the operating system in this embodiment are explained.

[0080] Figure 6 In this code, the communication management module is represented by communication management, the version management module by version management, the EEG analysis module by EEG analysis, the EEG storage module by EEG storage, the stimulation management module by stimulation management, and the EEG sampling module by EEG sampling. The communication management module communicates with the protocol layer of the protocol stack, while the version management module, EEG analysis module, EEG storage module, and stimulation management module communicate with the application layer of the protocol stack. Figure 6 Solid lines in the protocol stack, pointing from the application layer to the version management module, EEG analysis module, EEG storage module, and stimulation management module, are used for transmitting instructions and upgrading firmware packages. Dashed lines, pointing from these modules to the application layer of the protocol stack, are used for transmitting feedback information. The scheduler is used to schedule all parts except the EEG sampling module.

[0081] The scheduler, controlled by a 1000Hz clock signal, schedules all components except the EEG sampling module. The EEG sampling module continuously samples EEG signals under the control of periodic interrupt signals at 200Hz or 1000Hz. The EEG sampling module, EEG analysis module, and EEG storage module communicate via task notifications to instruct the EEG analysis module to perform real-time analysis of the sampled EEG data and to instruct the EEG storage module to store the sampled EEG data. The EEG analysis module communicates with the EEG storage module and stimulation management module via events to instruct the stimulation management module to execute stimulation operations and to instruct the EEG storage module to store the sampled EEG data in memory. This memory can be either non-volatile or volatile.

[0082] While numerous embodiments of this disclosure have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and intent of this disclosure. It should be understood that various alternatives to the embodiments of this disclosure described herein may be employed in the practice of this disclosure. The appended claims are intended to define the scope of this disclosure and therefore cover equivalents or alternatives within the scope of these claims.

Claims

1. An operating system for implantable closed-loop brain-computer interfaces, characterized in that, include: The system includes an EEG sampling module, an EEG analysis module, an EEG storage module, a stimulation management module, a communication management module, and a power consumption management module; among which, The EEG sampling module is used to continuously sample EEG signals; The EEG analysis module is used to receive EEG signal sampling data from the EEG sampling module in real time, perform real-time analysis on the received EEG signal sampling data, and send the real-time analysis results to the EEG storage module and the stimulation management module. The EEG storage module is used to store the EEG signal sampling data obtained by the EEG sampling module, and to store the corresponding EEG signal sampling data into the memory when the real-time analysis results indicate that the EEG signal sampling data meets the set requirements. The stimulation management module is used to control the stimulation circuit to output a first stimulation pulse when the real-time analysis results characterize the EEG signal sampling data as meeting the set requirements. The communication management module is used to receive a storage data retrieval instruction sent by the first external device and send it to the EEG storage module. The EEG storage module is also used to send the corresponding EEG signal sampling data as first feedback information to the communication management module when it receives the storage data retrieval instruction. The communication management module is also used to send the first feedback information to the first external device. The power management module is used to obtain the system working status and control the working mode of the hardware resources in the implanted closed-loop brain-computer interface according to the system working status. The system working status is used to characterize the running status of the operating system. The operating modes include: no response mode, reduced frequency operation mode, and full speed operation mode; When the operating system communicates with the first external device, the power management module controls the hardware resources to enter the full-speed operation mode; When the operating system is not communicating with the first external device, and the stimulation management module controls the stimulation circuit to output stimulation pulses, the power consumption management module controls the hardware resources to enter the frequency reduction operation mode. When the operating system is not communicating with the first external device and the stimulation management module is not controlling the stimulation circuit to output stimulation pulses, the power consumption management module controls the hardware resources to enter the unresponsive mode.

2. The operating system according to claim 1, characterized in that, When the hardware resources enter the unresponsive mode, the processor, high-speed clock, and peripherals that require the high-speed clock as a clock source are shut down, the low-speed clock and timers that use the low-speed clock are turned on, and the timers are configured so that the processor can still respond to external interrupts. When the hardware resources enter the downclocking mode, the processor and the peripherals operate at a preset clock frequency.

3. The operating system according to claim 2, characterized in that, The preset clock frequency corresponds to the task executed by the operating system.

4. The operating system according to claim 1, characterized in that, The frequency and amplitude of the first stimulation pulse are determined based on the real-time analysis results.

5. The operating system according to claim 1, characterized in that, The analysis algorithm used by the EEG analysis module to perform real-time analysis on the received EEG signal sampling data is configured through the first external device.

6. The operating system according to claim 1, characterized in that, The communication management module is also used to receive stimulation instructions sent by the first external device and send them to the stimulation management module; The stimulation management module is also used to send second feedback information to the communication management module when it receives the stimulation instruction, and control the stimulation circuit to output a second stimulation pulse corresponding to the stimulation instruction.

7. The operating system according to any one of claims 1 to 6, characterized in that, Also includes: A version management module is used for upgrading and rolling back the operating system.

8. The operating system according to claim 7, characterized in that, The operating system upgrade process executed by the version management module includes: The version management module receives the upgrade firmware package sent by the second external device from the communication management module and generates update information; The version management module performs an integrity check on the upgrade firmware package. If the check passes, the upgrade firmware package and the update information are written to the download area. The version management module resets the operating system and uses the operating system's bootloader to detect the update information. If the detection is successful, the firmware version in the running area is copied to the backup area, and the upgrade firmware package in the download area is copied to the running area. The version management module uses the operating system's bootloader to set a version rollback flag and enable the watchdog timer. Then it jumps to the runtime area, starts the operating system, and clears the version rollback flag after the second external device is successfully connected. The firmware upgrade is then complete. The rollback process of the operating system executed by the version management module includes: When the operating system crashes after the upgrade, the watchdog timer enabled in the bootloader of the operating system resets the operating system. The version management module uses the bootloader of the operating system to detect the version rollback flag. If the detection is successful, the firmware version in the backup area is copied to the running area, the version rollback flag is cleared, and the system jumps to the running area and starts the operating system.

9. The operating system according to claim 8, characterized in that, The rollback process of the operating system executed by the version management module also includes: When the operating system cannot connect to the second external device after the upgrade, the operating system is physically reset. The version management module uses the operating system's bootloader to detect the version rollback flag. If the detection is successful, the firmware version in the backup area is copied to the running area, the version rollback flag is cleared, and the system jumps to the running area and starts the operating system.

10. The operating system according to any one of claims 1 to 6, characterized in that, Also includes: Hardware Abstraction Layer; The hardware abstraction layer includes: an EEG sampling function interface and a stimulation function interface. The EEG sampling function interface is a function interface abstracted from the sampling circuit, and the stimulation function interface is a function interface abstracted from the stimulation circuit.

11. The operating system according to any one of claims 1 to 6, characterized in that, The EEG storage module is also used to receive EEG storage instructions sent by the first external device through the communication management module, and to store the EEG signal sampled data corresponding to the EEG storage instructions into the memory.

Citation Information

Patent Citations

  • Miniature wireless optical genetic stimulation brain-computer interface system capable of being implanted for long time

    CN114587371A