WO2022166683A1 - Method and device for automatically detecting epileptic seizure by implantable closed-loop system on basis of area algorithm - Google Patents

Method and device for automatically detecting epileptic seizure by implantable closed-loop system on basis of area algorithm Download PDF

Info

Publication number
WO2022166683A1
WO2022166683A1 PCT/CN2022/073769 CN2022073769W WO2022166683A1 WO 2022166683 A1 WO2022166683 A1 WO 2022166683A1 CN 2022073769 W CN2022073769 W CN 2022073769W WO 2022166683 A1 WO2022166683 A1 WO 2022166683A1
Authority
WO
WIPO (PCT)
Prior art keywords
window
detection
area
value
background
Prior art date
Application number
PCT/CN2022/073769
Other languages
French (fr)
Chinese (zh)
Inventor
曹鹏
陈新蕾
郑开
Original Assignee
杭州诺为医疗技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州诺为医疗技术有限公司 filed Critical 杭州诺为医疗技术有限公司
Publication of WO2022166683A1 publication Critical patent/WO2022166683A1/en

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61NELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
    • A61N1/00Electrotherapy; Circuits therefor
    • A61N1/18Applying electric currents by contact electrodes
    • A61N1/32Applying electric currents by contact electrodes alternating or intermittent currents
    • A61N1/36Applying electric currents by contact electrodes alternating or intermittent currents for stimulation
    • A61N1/3605Implantable neurostimulators for stimulating central or peripheral nerve system
    • A61N1/3606Implantable neurostimulators for stimulating central or peripheral nerve system adapted for a particular treatment
    • A61N1/36064Epilepsy

Definitions

  • This document relates to the technical field of medical devices, in particular to a method and device for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm.
  • Epilepsy commonly known as “epilepsy”
  • epilepsy is a chronic neurological disease caused by abnormal discharges formed by the highly synchronized activity of neurons.
  • the pathogenesis of epilepsy is complex, with many pathogenic factors, great harm to health and difficult to cure. Therefore, the study of epilepsy detection technology is an important topic in neuromedicine.
  • the acquisition of epilepsy EEG is mostly through the EEG machine, which analyzes and processes the collected EEG data offline and determines the moment of epilepsy. Responses.
  • the method of transplanting the software algorithm program to the microcontroller chip MCU to detect epilepsy can achieve real-time performance, but it needs to run the MCU all the time, and consumes a lot of power; at the same time, too complex algorithms are difficult to apply to implantable devices, and the integration is not high.
  • the purpose of one or more embodiments of this specification is to provide a method and device for an implantable closed-loop system to automatically detect epilepsy based on an area algorithm, and to flexibly configure an integrated implantable device with a hardware algorithm to perform low-power real-time detection of epilepsy, Improve integration and detection convenience.
  • a method for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm is proposed, which is applied to an epilepsy detection device composed of a chip, and the method includes:
  • the detection parameters are configured through the SPI serial peripheral interface, wherein the detection parameters at least include: the detection window size, the interval window size and the background window size in one detection period;
  • an implantable closed-loop system for automatically detecting epilepsy based on an area algorithm including:
  • the configuration module configures detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least include: detection window size, interval window size and background window size in one detection period;
  • the acquisition and storage module collects bioelectrical signals in real time from the organism implanted in the detection chip, and stores them in the memory;
  • the calculation module calculates the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset respectively according to the time sequence, and sends it to the accumulator;
  • the determination module based on the value in the accumulator, respectively determines the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window;
  • a detection module for judging whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold
  • the treatment module when the judgment result is greater than, outputs an identification signal representing an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
  • a device for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm which at least includes: a hardware algorithm chip for executing the above method and other functional modules; wherein, the hardware algorithm chip includes: a serial peripheral interface , memory, accumulator, counter; where,
  • the serial peripheral interface is used to configure detection parameters and transmit bioelectrical signals; wherein, the detection parameters at least include: detection window size, interval window size and background window size in one detection cycle;
  • the memory is used to store the real-time acquisition of bioelectric signals from the organism implanted in the detection chip, and after calculating the absolute value of the difference between the amplitude of the bioelectric signal and the DC offset according to the counter according to the time series, into the accumulator;
  • the detection enabling terminal After determining the area sum of the current detection window and the area sum of the background window corresponding to the current detection window respectively based on the value in the accumulator, the detection enabling terminal determines that the average area of the current detection window is the same as the total area of the current detection window. Whether the ratio of the average area of the background window is greater than a preset threshold;
  • the serial peripheral interface When the judgment result is greater than, the serial peripheral interface outputs an identification signal representing an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
  • an electronic device comprising:
  • memory arranged to store computer-executable instructions which, when executed, cause the processor to execute:
  • the detection parameters are configured through the SPI serial peripheral interface, wherein the detection parameters at least include: the detection window size, the interval window size and the background window size in one detection period;
  • a hardware algorithm can be used to collect and detect bioelectrical signals in real time, and then, according to the average area of the detection window in each detection period and the difference between the background window.
  • the comparison between the ratio between the average areas and the preset threshold value determines whether the epileptic seizure is triggered by the identification signal for stimulation treatment.
  • FIG. 1 is a schematic diagram of steps of a method for an implantable closed-loop system to automatically detect epilepsy based on an area algorithm according to an embodiment of the present specification.
  • FIG. 2 is a schematic diagram of a detection period provided by an embodiment of the present specification.
  • FIG. 3 is a schematic structural diagram of an apparatus for automatically detecting epilepsy based on an area algorithm in an implantable closed-loop system provided by an embodiment of the present specification.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present specification.
  • FIG. 5 is a schematic structural diagram of a device for automatically detecting epilepsy based on an area algorithm in an implantable closed-loop system of the present specification.
  • the embodiments of this specification propose a hardware algorithm for an implantable closed-loop system to automatically detect epilepsy based on an area algorithm, which belongs to the fields of neuroscience and medical devices.
  • the hardware algorithm can be written in Verilog hardware language or other achievable hardware language. It can accurately detect whether the bioelectrical signal is abnormal in real time, and raise the Flag warning signal when the bioelectrical signal is abnormal. At this time, the detection enable signal If it is 1, the hardware algorithm suspends detection, and the hardware algorithm performs detection when the detection enable signal is 0.
  • the specific detection standard can refer to the following content, so that the signal data of the previous period (generally set to 30s) when the abnormal signal occurs and the next period of the abnormal signal occurrence (generally can be set through the serial peripheral interface SPI protocol) 60s) signal data is sent out, and this part of the data can be saved externally for medical research.
  • the size of the detection window, background window, interval window and threshold of the algorithm can be adjusted, which has wide applicability.
  • the hardware algorithm can be used as an IP core, that is, an intellectual property module, which is an IC module that has been verified, can be reused, and has a certain function. It is divided into soft IP (soft IP core), solid IP (firm IP core) and hard IP (hard IP core).
  • Soft IP uses a certain high-level language to describe the behavior of functional blocks, but does not involve any circuits and circuit elements used to realize these behaviors, and the embodiment of the present application is soft IP.
  • the algorithm chip is made into an algorithm chip through a semiconductor process, so as to be used in various neurotherapy devices. Compared with the software algorithm running on the MCU, the power consumption is lower and the integration level is higher.
  • FIG. 1 is a schematic diagram of the method steps of an implantable closed-loop system for automatically detecting epilepsy based on an area algorithm provided by the embodiment of the present specification, it should be understood that the method is applied to an epilepsy detection device composed of a chip, and its execution body It can be an integrated circuit of a chip, or an epilepsy detection device composed of the chip; the detection method can include the following steps:
  • Step 102 Configure detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least include: a detection window size, an interval window size, and a background window size in one detection cycle.
  • each round of detection scheme may include multiple detection periods, and each detection period includes a background window, an interval window and a detection window.
  • the background window may be located in the preceding time period of the detection window, and the interval window may be located between the background window and the detection window.
  • the first detection period shown in Figure 2 is from t0-t5, where t0-t2 is the background window, t2-t4 is the interval window, and t4-t5 is the detection window;
  • the second detection period is from t1-t6 , where t1-t3 is the background window, t3-t5 is the interval window, and t5-t6 is the detection window.
  • the subsequent third detection period and fourth detection period are similar. It can be seen from FIG. 2 that, except for the first detection period, each detection period partially overlaps with the previous detection period, that is, the bioelectrical signal in the current detection period includes part of the bioelectrical signal of the previous detection period.
  • the size of the background window may be N1 times the size of the detection window, and the size of the interval window is N2 times the size of the detection window; wherein, the N1 and the N2 are both positive integers greater than or equal to 2 . It should be understood that, in the embodiments of the present specification, the values of N1 and N2 may be equal or unequal. After the size of the detection window is determined, the size of the background window and the size of the interval window can be flexibly configured according to the requirements of the current round of detection.
  • Step 104 Collect bioelectrical signals in real time from the organism implanted in the detection chip, and store them in the memory.
  • the bioelectrical signal may specifically be an electroencephalogram signal, or a deep brain electrophysiological signal, or a cerebral cortex bioelectrical signal, or a central nervous system signal, or the like.
  • the memory may be a SRAM SRAM with a capacity of 2kB for storing bioelectrical signals.
  • Step 106 Calculate the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset according to the time sequence, and send it to the accumulator.
  • the accumulator may be an accumulator that accumulates the sum of the areas in each detection window. It should be understood that the ratio of the amplitude of the bioelectrical signal to the DC offset is substantially the ratio of the area covered by the amplitude of the bioelectrical signal to the area covered by the DC offset.
  • Step 108 Based on the value in the accumulator, determine the area sum of the current detection window and the area sum of the background window corresponding to the current detection window, respectively.
  • the current detection window belongs to the first detection cycle of the current round of detection, then when the counter counts from 1 to N1, the value in the accumulator is written into the background window register, until the end of counting to N1,
  • the background window register stores the area sum of the background window corresponding to the current detection window; when the counter counts to N1+N2+1, the value in the accumulator is written into the detection window register, and the detection window register stores the current detection window. The area of the window and.
  • the method further includes: taking the detection window as a basic window unit, determining that in the background window, interval window and detection window included in the first detection period, the number of basic window units is N1+N2+1 ;
  • the value of the memory is written into the buffer from low address to high address, and the counter is incremented by 1; when the count value of the counter is less than or equal to N1 and the current When the window sampling ends, the memory is sequentially accumulated and written into the background window register, and the background window register stores the area sum of the background window in the first detection period; when the count value of the counter is equal to N1+N2+1 and the current sampling window ends , the memory writes the detection window register, and the detection window register stores the area sum of the detection window in the first detection cycle.
  • the value of the lowest bit is read from the buffer and written into the first temporary register for temporary storage;
  • the buffer is shifted to the left once, the value of the memory is written to the N1+N2+1 address, and then the value of the N1+1 bit in the buffer is read to the second temporary register for temporary storage;
  • the value of the background window register minus the value of the first temporary register, plus the value of the second temporary register, is written into the background window register as the area and assignment of the current background window.
  • Step 110 Determine whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold.
  • the preset threshold may be a standard value obtained according to an empirical data signal, and is used to measure whether the organism implanted in the detection chip has epilepsy.
  • Step 112 when the judgment result is greater than, output an identification signal indicating an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
  • the identification signal may be a Flag signal.
  • the Flag signal When the Flag signal is pulled high, it indicates an epileptic seizure, and stimulation treatment can be triggered; otherwise, if the epilepsy does not occur, no treatment is performed, and further detection is continued.
  • the input ports of the hardware algorithm are: CLK1 port, CLK2 port, nRST port, MOSI port, Data_ADC port, EN_detect port; output ports include MISO port and Flag port.
  • the communication mode of the overall scheme adopts the serial peripheral interface SPI. Among them, the SPI communication mode is to send data on the rising edge and collect data on the falling edge.
  • the CLK1 port and the CLK2 port are respectively two master clock ports with the same phase.
  • the nRST port is the reset signal port, the signal output 0 is reset, and the signal output 1 is normal operation.
  • the MOSI port is an SPI communication port, and the signal direction is output from the master and input from the slave.
  • the Data_ADC port is used to transmit 16-bit wide EEG data, and can be connected to the output of a 16-bit ADC in practical applications.
  • the EN_detect port is the detection enable signal port.
  • the MISO port is the SPI communication port, and the signal direction is input from the master and output from the slave.
  • the Flag port is the epileptic seizure warning signal port. Correspondingly, each port corresponds to a corresponding signal output.
  • T as the number of sampling points in the detection window, configured through the SPI port, ranging from 32 to 1024.
  • N1 is the multiple of the size of the background window and the size of the detection window, configured through the SPI port, the range is 0-255.
  • N2 is a multiple of the size of the interval window and the size of the detection window, configured through the SPI port, the range is 0-255.
  • LIM is the preset threshold, configured through the SPI port, in the range 110-180.
  • CNT1 is a counter that counts the number of sampling points in the detection window.
  • Q is the variable that counts the number of detection windows in the first calculation cycle.
  • Sum1 is an accumulator that accumulates the sum of the areas within each detection window.
  • Sum_background is the background window register, which is used to accumulate the sum of the area in the background window.
  • Sum_detect is the detection window register, which is used to store the area sum of the detection window in each calculation cycle.
  • Sum_L is the first temporary register, which is used to store the value of the lowest bit in the buffer.
  • Sum_N is the second temporary register for storing the value of the N1+1th bit in the buffer.
  • Sram1 is a static random access memory with a capacity of 2kB.
  • SramS1 is a buffer, dual-port ram, used for storage of intermediate operation results in the calculation process.
  • SramS2 is an output buffer, dual-port ram, used to buffer epilepsy EEG data output.
  • the detection scheme in this manual can roughly include the following parts:
  • the process data of epilepsy detection is serially output through the communication port.
  • the specific implementation process can refer to the following:
  • the input frequency can be set flexibly, and the 200Hz here is just an example.
  • the absolute value of the difference between the amplitude of the EEG signal and the DC offset is added to the Sum1 accumulator in turn.
  • the CNT1[10:0] counter starts counting the accumulation times of Sum1 from 0, and takes the length of one detection window as a cycle.
  • the value of Sum1 is written into SramS1 from low address to high address, and Q is incremented by 1 at the same time.
  • Sum_detect is the sum of the area of the detection window
  • Td is the number of detection windows
  • the default is 1
  • Sum_background is the total area of the background windows
  • T is the number of background windows.
  • the ratio of the average area of the detection window to the average area of the background window can be obtained, and the ratio is compared with the preset threshold LIM. If the ratio is greater than the LIM, it means epileptic seizures, while the Flag signal is pulled up, otherwise, epilepsy does not occur.
  • the preset threshold LIM may be 400%, that is, when the ratio is less than or equal to 400%, the Flag signal will not be triggered to pull up.
  • N1+N2+1 values are stored in SramS1
  • the data in the lower N1 bits is the Sum1 value of the background window in the first calculation cycle
  • the data in the next N2 bits is the interval window in the first calculation cycle.
  • Sum1 value the highest bit is the Sum1 value of the detection window.
  • the current Sum_background stores the area sum of the background interval in the first calculation cycle.
  • Sum_background-Sum_L+Sum_N is assigned to Sum_background, which is the background window area sum of the second calculation cycle.
  • the ratio of the average area of the detection interval of the second calculation period to the average area of the background window can be obtained, which is also compared with the threshold LIM. If it is greater than the LIM, it means an epileptic seizure, and the Flag signal is pulled high, and vice versa. , no epilepsy.
  • the Sram1 read enable in the hardware algorithm takes effect.
  • the EEG data 30s before and 60s after the epileptic seizure can be read. Since the reading frequency of Sram1 is much lower than the SPI communication frequency, the data output by Sram1 is written into the cache SramS2. After the data is written, it is read from low to high in sequence, and serially output through the MISO port. After output, it can be stored in external Flash. , which can be used for follow-up medical research and is of great significance to neuroscience research.
  • a hardware algorithm can be used to collect and detect bioelectrical signals in real time, and then, according to the comparison between the ratio between the average area of the detection window and the average area of the background window in each detection period and the preset threshold , to determine whether epileptic seizures are triggered by identifying signals for stimulation therapy.
  • real-time detection with low power consumption improves integration, detection accuracy, and convenience.
  • a device 300 for automatically detecting epilepsy by an implantable closed-loop system based on an area algorithm mainly includes:
  • the configuration module 302 configures detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least include: detection window size, interval window size and background window size in one detection period;
  • the acquisition and storage module 304 collects bioelectrical signals in real time from the organism implanted in the detection chip, and stores them in the memory;
  • the calculation module 306 respectively calculates the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset according to the time sequence, and sends it to the accumulator;
  • the determination module 308 based on the value in the accumulator, respectively determines the area sum of the current detection window and the area sum of the background window corresponding to the current detection window;
  • the detection module 310 determines whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold
  • the treatment module 312 when the judgment result is greater than, outputs an identification signal indicating an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
  • the size of the background window is N1 times the size of the detection window
  • the size of the interval window is N2 times the size of the detection window; wherein, the N1 and the N2 are both.
  • the determining module 308 is specifically configured to:
  • the value in the accumulator is written into the background window register, and the background window register stores the area sum of the background window corresponding to the current detection window until the count reaches N1;
  • the detection window register stores the area sum of the current detection window.
  • the determining module 308 is further configured to:
  • the detection window as the basic window unit, determine the number of basic window units N1+N2+1 in the background window, interval window and detection window included in the first detection period; accordingly,
  • the memory is sequentially accumulated and written into the background window register, and the background window register stores the area sum of the background window in the first detection period;
  • the memory When the count value of the counter is equal to N1+N2+1 and the current sampling window ends, the memory writes the detection window register, which stores the area sum of the detection window in the first detection cycle.
  • the determination module is specifically used for:
  • the buffer is shifted to the left once, the value of the memory is written to the N1+N2+1 address, and then the value of the N1+1 bit in the buffer is read to the second temporary register for temporary storage;
  • the value of the background window register minus the value of the first temporary register, plus the value of the second temporary register, is written into the background window register as the area and assignment of the current background window.
  • an output module when the organism is stimulated for treatment, is further included, configured to acquire the bioelectrical signal in the first period before the epilepsy time and the second time after the epilepsy time. Period of bioelectrical signal and serial output through SPI.
  • a hardware algorithm can be used to collect and detect bioelectrical signals in real time, and then, according to the comparison between the ratio between the average area of the detection window and the average area of the background window in each detection period and the preset threshold, determine whether to Epilepsy seizures are triggered by marker signals for stimulation therapy.
  • real-time detection with low power consumption improves integration, detection accuracy, and convenience.
  • a schematic structural diagram of an implantable closed-loop system for automatically detecting epilepsy based on an area algorithm includes at least: a hardware algorithm chip and other functional modules for executing the method in the above-mentioned first embodiment; wherein , the hardware algorithm chip includes: serial peripheral interface, memory, algorithm register, accumulator, counter; wherein,
  • the serial peripheral interface is used to configure detection parameters and transmit bioelectrical signals; wherein, the detection parameters at least include: detection window size, interval window size and background window size in one detection cycle;
  • the memories are respectively used to store the real-time acquisition of bioelectric signals from the organism implanted in the detection chip, and after calculating the absolute value of the difference between the amplitude of the bioelectric signal and the DC offset according to the counter in sequence, respectively , into the accumulator;
  • the detection enabling terminal After determining the area sum of the current detection window and the area sum of the background window corresponding to the current detection window respectively based on the value in the accumulator, the detection enabling terminal determines that the average area of the current detection window is the same as the total area of the current detection window. Whether the ratio of the average area of the background window is greater than the preset threshold;
  • the serial peripheral interface When the judgment result is greater than, the serial peripheral interface outputs an identification signal representing an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
  • FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present specification.
  • the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory.
  • the memory may include memory, such as high-speed random-access memory (Random-Access Memory, RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM random-Access Memory
  • non-volatile memory such as at least one disk memory.
  • the electronic equipment may also include hardware required for other services.
  • the processor, network interface and memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Component Interconnect Standard) bus. Industry Standard Architecture, extended industry standard structure) bus, etc.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one bidirectional arrow is used in FIG. 4, but it does not mean that there is only one bus or one type of bus.
  • the program may include program code, and the program code includes computer operation instructions.
  • the memory may include memory and non-volatile memory and provide instructions and data to the processor.
  • the processor reads the corresponding computer program from the non-volatile memory into the memory and runs it, forming a device for automatically detecting epilepsy at the logical level.
  • the processor executes the program stored in the memory, and is specifically used to perform the following operations:
  • the detection parameters are configured through the SPI serial peripheral interface, wherein the detection parameters at least include: the detection window size, the interval window size and the background window size in one detection period;
  • each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software.
  • the above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processor, DSP), dedicated integrated Circuit (Application Specific Integrated Circuit, ASIC), Field Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with one or more embodiments of this specification may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the electronic device can also execute the method shown in FIG. 1 , and implement the functions of the corresponding apparatus in the embodiment shown in FIG. 1 , and the embodiments of this specification will not be repeated here.
  • the electronic devices in the embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subjects of the following processing procedures are not limited to each logic A unit can also be a hardware or logic device.
  • a hardware algorithm can be used to collect and detect bioelectrical signals in real time, and then, according to the comparison between the ratio between the average area of the detection window and the average area of the background window in each detection period and the preset threshold, it is determined whether Epilepsy seizures are triggered by marker signals for stimulation therapy.
  • real-time detection with low power consumption improves integration, detection accuracy, and convenience.
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
  • Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology.
  • Information may be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

Landscapes

  • Health & Medical Sciences (AREA)
  • Neurosurgery (AREA)
  • Neurology (AREA)
  • Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
  • Electrotherapy Devices (AREA)

Abstract

One or more embodiments of the present description disclose a method and device for automatically detecting an epileptic seizure by an implantable closed-loop system on the basis of an area algorithm. The method comprises: acquiring and detecting bioelectrical signals in real time by means of a hardware algorithm; and then comparing the ratio of the average area of detection windows to the average area of background windows in each detection period with a preset threshold, to determine whether there is an epileptic seizure, and trigger stimulation treatment by means of an identification signal. Thus, low-power-consumption real-time detection is implemented, and the integration degree and the detection accuracy and convenience are improved.

Description

植入式闭环系统基于面积算法自动检测癫痫的方法和装置Method and device for automatic detection of epilepsy in implantable closed-loop system based on area algorithm 技术领域technical field
本文件涉及医疗器件技术领域,尤其涉及一种植入式闭环系统基于面积算法自动检测癫痫的方法和装置。This document relates to the technical field of medical devices, in particular to a method and device for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm.
背景技术Background technique
癫痫俗称“羊癫疯”,是由神经元高度同步化活动形成的异常放电导致的一种慢性神经系统疾病。癫痫疾病发病原理复杂,致病因素众多,对身体健康危害大,治愈性难度大。因此,研究癫痫检测技术是神经医学上的重要课题。Epilepsy, commonly known as "epilepsy", is a chronic neurological disease caused by abnormal discharges formed by the highly synchronized activity of neurons. The pathogenesis of epilepsy is complex, with many pathogenic factors, great harm to health and difficult to cure. Therefore, the study of epilepsy detection technology is an important topic in neuromedicine.
目前,癫痫脑电的采集大多是通过脑电图机,对已采集的脑电数据进行离线分析处理并判别癫痫发生的时刻,这种检测实时性较差,在检测出癫痫的时刻不能及时采取应对措施。软件算法程序移植到微控制芯片MCU检测癫痫的方法可以实现实时性,但需要时刻运行MCU,功耗大;同时太过复杂的算法也难以应用于植入式设备中,集成度不高。At present, the acquisition of epilepsy EEG is mostly through the EEG machine, which analyzes and processes the collected EEG data offline and determines the moment of epilepsy. Responses. The method of transplanting the software algorithm program to the microcontroller chip MCU to detect epilepsy can achieve real-time performance, but it needs to run the MCU all the time, and consumes a lot of power; at the same time, too complex algorithms are difficult to apply to implantable devices, and the integration is not high.
综上,亟需找到一种新的癫痫检测方案。In conclusion, there is an urgent need to find a new epilepsy detection scheme.
发明内容SUMMARY OF THE INVENTION
本说明书一个或多个实施例的目的是提供一种植入式闭环系统基于面积算法自动检测癫痫的方法和装置,以一种硬件算法灵活配置集成植入式设备对癫痫进行低功耗实时检测,提高集成度和检测便捷性。The purpose of one or more embodiments of this specification is to provide a method and device for an implantable closed-loop system to automatically detect epilepsy based on an area algorithm, and to flexibly configure an integrated implantable device with a hardware algorithm to perform low-power real-time detection of epilepsy, Improve integration and detection convenience.
为解决上述技术问题,本说明书一个或多个实施例是这样实现的:To solve the above technical problems, one or more embodiments of the present specification are implemented as follows:
第一方面,提出了一种植入式闭环系统基于面积算法自动检测癫痫的方法,应用在由芯片构成的癫痫检测装置上,所述方法包括:In the first aspect, a method for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm is proposed, which is applied to an epilepsy detection device composed of a chip, and the method includes:
通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The detection parameters are configured through the SPI serial peripheral interface, wherein the detection parameters at least include: the detection window size, the interval window size and the background window size in one detection period;
从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器;Collect bioelectrical signals in real time from the organism implanted in the detection chip, and store them in the memory;
按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset respectively according to the time sequence, and send it to the accumulator;
基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和;Based on the value in the accumulator, respectively determine the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window;
判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;Determine whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。When the judgment result is greater than, output an identification signal representing epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
第二方面,提出了一种植入式闭环系统基于面积算法自动检测癫痫的装置,包括:In the second aspect, an implantable closed-loop system for automatically detecting epilepsy based on an area algorithm is proposed, including:
配置模块,通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The configuration module configures detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least include: detection window size, interval window size and background window size in one detection period;
采集存储模块,从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器;The acquisition and storage module collects bioelectrical signals in real time from the organism implanted in the detection chip, and stores them in the memory;
计算模块,按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值,并送入累加器;The calculation module calculates the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset respectively according to the time sequence, and sends it to the accumulator;
确定模块,基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和;The determination module, based on the value in the accumulator, respectively determines the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window;
检测模块,判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;a detection module, for judging whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
治疗模块,在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。The treatment module, when the judgment result is greater than, outputs an identification signal representing an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
第三方面,提出了一种植入式闭环系统基于面积算法自动检测癫痫的装置,至少包括:执行上述方法的硬件算法芯片以及其它功能模块;其中,所述硬件算法芯片包含:串行外设接口,存储器,累加器,计数器;其中,In a third aspect, a device for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm is proposed, which at least includes: a hardware algorithm chip for executing the above method and other functional modules; wherein, the hardware algorithm chip includes: a serial peripheral interface , memory, accumulator, counter; where,
所述串行外设接口用于配置检测参数,并传输生物电信号;其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The serial peripheral interface is used to configure detection parameters and transmit bioelectrical signals; wherein, the detection parameters at least include: detection window size, interval window size and background window size in one detection cycle;
所述存储器,用于存储从被植入检测芯片的生物体上实时采集生物电信号,在依据计数器按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值后,送入累加器;The memory is used to store the real-time acquisition of bioelectric signals from the organism implanted in the detection chip, and after calculating the absolute value of the difference between the amplitude of the bioelectric signal and the DC offset according to the counter according to the time series, into the accumulator;
在基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和之后,检测使能端判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;After determining the area sum of the current detection window and the area sum of the background window corresponding to the current detection window respectively based on the value in the accumulator, the detection enabling terminal determines that the average area of the current detection window is the same as the total area of the current detection window. Whether the ratio of the average area of the background window is greater than a preset threshold;
在判断结果为大于时,所述串行外设接口输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。When the judgment result is greater than, the serial peripheral interface outputs an identification signal representing an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
第四方面,提出了一种电子设备,包括:In a fourth aspect, an electronic device is provided, comprising:
处理器;以及processor; and
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器 执行:memory arranged to store computer-executable instructions which, when executed, cause the processor to execute:
通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The detection parameters are configured through the SPI serial peripheral interface, wherein the detection parameters at least include: the detection window size, the interval window size and the background window size in one detection period;
从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器;Collect bioelectrical signals in real time from the organism implanted in the detection chip, and store them in the memory;
按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset respectively according to the time sequence, and send it to the accumulator;
基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和;Based on the value in the accumulator, respectively determine the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window;
判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;Determine whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。When the judgment result is greater than, output an identification signal representing epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
由以上本说明书一个或多个实施例提供的技术方案可见,通过上述技术方案,可以采用硬件算法实时采集并检测生物电信号,然后,根据每个检测周期内检测窗口的平均面积与背景窗口的平均面积之间的比值与预设阈值的比对,确定是否癫痫发来通过标识信号触发进行刺激治疗。从而,以低功耗实时检测,提高集成度和检测准确性、便捷性。It can be seen from the technical solutions provided by one or more embodiments of the present specification that through the above technical solutions, a hardware algorithm can be used to collect and detect bioelectrical signals in real time, and then, according to the average area of the detection window in each detection period and the difference between the background window. The comparison between the ratio between the average areas and the preset threshold value determines whether the epileptic seizure is triggered by the identification signal for stimulation treatment. Thus, real-time detection with low power consumption improves integration, detection accuracy, and convenience.
附图说明Description of drawings
为了更清楚地说明本说明书一个或多个实施例或现有技术中的技术方案,下面将对一个或多个实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of one or more embodiments or the prior art. It is obvious that , the drawings in the following description are only some embodiments described in this specification, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1是本说明书实施例提供的一种植入式闭环系统基于面积算法自动检测癫痫的方法步骤示意图。FIG. 1 is a schematic diagram of steps of a method for an implantable closed-loop system to automatically detect epilepsy based on an area algorithm according to an embodiment of the present specification.
图2是本说明书实施例提供的检测周期的示意图。FIG. 2 is a schematic diagram of a detection period provided by an embodiment of the present specification.
图3是本说明书实施例提供的一种植入式闭环系统基于面积算法自动检测癫痫的装置结构示意图。FIG. 3 is a schematic structural diagram of an apparatus for automatically detecting epilepsy based on an area algorithm in an implantable closed-loop system provided by an embodiment of the present specification.
图4是本说明书的一个实施例提供的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present specification.
图5是本说明书的一种植入式闭环系统基于面积算法自动检测癫痫的装置结构示意图。FIG. 5 is a schematic structural diagram of a device for automatically detecting epilepsy based on an area algorithm in an implantable closed-loop system of the present specification.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书一个或多个实施例中的附图,对本说明书一个或多个实施例中的技术方案进行清楚、完整地描述,显然,所描述的一个或多个实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的一个或多个实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本文件的保护范围。In order to make those skilled in the art better understand the technical solutions in this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of this specification. It is apparent that the described embodiment or embodiments are only some, but not all, embodiments of this specification. Based on one or more embodiments in this specification, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of this document.
本说明书实施例提出了一种植入式闭环系统基于面积算法自动检测癫痫的硬件算法,属于神经科学以及医疗器件领域。该硬件算法可以采用Verilog硬件语言或其它可实现的硬件语言编写,能够实时准确地检测生物电信号是否发生异常,并在生物电信号发生异常时拉高Flag警示信号,此时,检测使能信号为1,该硬件算法暂停检测,检测使能信号为0时该硬件算法进行检测。具体检测标准可以参照下述内容,从而,能够通过串行外设接口SPI协议将异常信号发生时刻的前一时段(一般设置为30s)信号数据以及异常信号发生时刻的后一时段(一般可以设置为60s)信号数据传出,这部分数据可以在外部进行保存以供医学研究使用。在整个检测过程中,针对每轮检测,其算法的检测窗口、背景窗口、间隔窗口以及阈值的大小都可调,适用性广。而且该硬件算法可以作为IP核,即知识产权模块,是那些己验证的、可重利用的、具有某种确定功能的IC模块。分为软IP(soft IP core)、固IP(firm IP core)和硬IP(hard IP core)。软IP是用某种高级语言来描述功能块的行为,但是并不涉及用什么电路和电路元件实现这些行为,本申请实施例为软IP。经过半导体工艺制作成算法芯片,从而用于各种神经治疗器。相比MCU运行的软件算法功耗更低,集成度更高。The embodiments of this specification propose a hardware algorithm for an implantable closed-loop system to automatically detect epilepsy based on an area algorithm, which belongs to the fields of neuroscience and medical devices. The hardware algorithm can be written in Verilog hardware language or other achievable hardware language. It can accurately detect whether the bioelectrical signal is abnormal in real time, and raise the Flag warning signal when the bioelectrical signal is abnormal. At this time, the detection enable signal If it is 1, the hardware algorithm suspends detection, and the hardware algorithm performs detection when the detection enable signal is 0. The specific detection standard can refer to the following content, so that the signal data of the previous period (generally set to 30s) when the abnormal signal occurs and the next period of the abnormal signal occurrence (generally can be set through the serial peripheral interface SPI protocol) 60s) signal data is sent out, and this part of the data can be saved externally for medical research. In the whole detection process, for each round of detection, the size of the detection window, background window, interval window and threshold of the algorithm can be adjusted, which has wide applicability. And the hardware algorithm can be used as an IP core, that is, an intellectual property module, which is an IC module that has been verified, can be reused, and has a certain function. It is divided into soft IP (soft IP core), solid IP (firm IP core) and hard IP (hard IP core). Soft IP uses a certain high-level language to describe the behavior of functional blocks, but does not involve any circuits and circuit elements used to realize these behaviors, and the embodiment of the present application is soft IP. The algorithm chip is made into an algorithm chip through a semiconductor process, so as to be used in various neurotherapy devices. Compared with the software algorithm running on the MCU, the power consumption is lower and the integration level is higher.
实施例一Example 1
参照图1所示,为本说明书实施例提供的一种植入式闭环系统基于面积算法自动检测癫痫的方法步骤示意图,应理解,该方法应用在由芯片构成的癫痫检测装置上,且其执行主体可以是芯片的集成电路,也可以是由该芯片构成的癫痫检测装置;所述检测方法可以包括以下步骤:Referring to FIG. 1, which is a schematic diagram of the method steps of an implantable closed-loop system for automatically detecting epilepsy based on an area algorithm provided by the embodiment of the present specification, it should be understood that the method is applied to an epilepsy detection device composed of a chip, and its execution body It can be an integrated circuit of a chip, or an epilepsy detection device composed of the chip; the detection method can include the following steps:
步骤102:通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小。Step 102: Configure detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least include: a detection window size, an interval window size, and a background window size in one detection cycle.
需要说明的是,参照图2所示,在每轮检测方案中可以包含多个检测周期,每个检测周期都包含一个背景窗口、一个间隔窗口和检测窗口。而且,背景窗口可以位于检测窗口的在前时间段,间隔窗口位于背景窗口和检测窗口之间。图2中所示的第一个检测周期是从t0-t5,其中,t0-t2是背景窗口,t2-t4是间隔窗口,t4-t5是检测窗口;第二个检测 周期是从t1-t6,其中,t1-t3是背景窗口,t3-t5是间隔窗口,t5-t6是检测窗口。后续第三检测周期、第四检测周期类似。由图2可知,除了第一个检测周期外,每个检测周期都会与前一检测周期部分重叠,也就是说,当前检测周期内的生物电信号包含有前一检测周期的部分生物电信号。It should be noted that, as shown in FIG. 2 , each round of detection scheme may include multiple detection periods, and each detection period includes a background window, an interval window and a detection window. Also, the background window may be located in the preceding time period of the detection window, and the interval window may be located between the background window and the detection window. The first detection period shown in Figure 2 is from t0-t5, where t0-t2 is the background window, t2-t4 is the interval window, and t4-t5 is the detection window; the second detection period is from t1-t6 , where t1-t3 is the background window, t3-t5 is the interval window, and t5-t6 is the detection window. The subsequent third detection period and fourth detection period are similar. It can be seen from FIG. 2 that, except for the first detection period, each detection period partially overlaps with the previous detection period, that is, the bioelectrical signal in the current detection period includes part of the bioelectrical signal of the previous detection period.
其中,所述背景窗口大小可以是所述检测窗口大小的N1倍,所述间隔窗口大小是所述检测窗口大小的N2倍;其中,所述N1和所述N2均为大于等于2的正整数。应理解,在本说明书实施例中,N1与N2的取值可以相等也可以不相等。所述检测窗口的大小确定后,可以根据本轮检测的需求对背景窗口大小以及间隔窗口大小进行灵活配置。Wherein, the size of the background window may be N1 times the size of the detection window, and the size of the interval window is N2 times the size of the detection window; wherein, the N1 and the N2 are both positive integers greater than or equal to 2 . It should be understood that, in the embodiments of the present specification, the values of N1 and N2 may be equal or unequal. After the size of the detection window is determined, the size of the background window and the size of the interval window can be flexibly configured according to the requirements of the current round of detection.
步骤104:从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器。Step 104: Collect bioelectrical signals in real time from the organism implanted in the detection chip, and store them in the memory.
在本说明书实施例中,所述生物电信号具体可以是脑电信号,或脑深部电生理信号,或脑皮层生物电信号,或中枢神经信号等。In the embodiments of the present specification, the bioelectrical signal may specifically be an electroencephalogram signal, or a deep brain electrophysiological signal, or a cerebral cortex bioelectrical signal, or a central nervous system signal, or the like.
所述存储器可以是容量为2kB的Sraml静态随机存储器,用于存储生物电信号。The memory may be a SRAM SRAM with a capacity of 2kB for storing bioelectrical signals.
步骤106:按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值,并送入累加器。Step 106: Calculate the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset according to the time sequence, and send it to the accumulator.
其中,所述累加器可以是累加每个检测窗口内面积和的累加器。应理解,这里所述生物电信号的幅值与直流偏置之比,实质上是生物电信号的幅值所包罗面积与直流偏置所包罗面积之比。Wherein, the accumulator may be an accumulator that accumulates the sum of the areas in each detection window. It should be understood that the ratio of the amplitude of the bioelectrical signal to the DC offset is substantially the ratio of the area covered by the amplitude of the bioelectrical signal to the area covered by the DC offset.
步骤108:基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和。Step 108: Based on the value in the accumulator, determine the area sum of the current detection window and the area sum of the background window corresponding to the current detection window, respectively.
可选地,如果当前检测窗口属于本轮检测的第一个检测周期,则当计数器从1计数至N1时,将所述累加器中的取值写入背景窗口寄存器,直至计数到N1结束,所述背景窗口寄存器存储当前检测窗口对应的背景窗口的面积和;当计数器计数至N1+N2+1,将所述累加器中的取值写入检测窗口寄存器,所述检测窗口寄存器存储当前检测窗口的面积和。Optionally, if the current detection window belongs to the first detection cycle of the current round of detection, then when the counter counts from 1 to N1, the value in the accumulator is written into the background window register, until the end of counting to N1, The background window register stores the area sum of the background window corresponding to the current detection window; when the counter counts to N1+N2+1, the value in the accumulator is written into the detection window register, and the detection window register stores the current detection window. The area of the window and.
进一步,在计数之前,所述方法还包括:以检测窗口为基本窗口单元,确定第一个检测周期所包含的背景窗口、间隔窗口以及检测窗口中,基本窗口单元的数量为N1+N2+1;相应地,Further, before counting, the method further includes: taking the detection window as a basic window unit, determining that in the background window, interval window and detection window included in the first detection period, the number of basic window units is N1+N2+1 ;Correspondingly,
当计数器的计数取值不大于N1+N2+1且当前窗口采样结束时,存储器的数值由低地址到高地址写入缓存器,同时计数器加1;当计数器的计数取值小于等于N1且当前窗口采样结束时,存储器依次累加写入背景窗口寄存器,所述背景窗口寄存器存储第一个检测周期内背景窗口的面积和;当计数器的计数取值等于N1+N2+1且当前采样窗口结束时,存储器 写入检测窗口寄存器,所述检测窗口寄存器存储第一个检测周期内检测窗口的面积和。When the count value of the counter is not greater than N1+N2+1 and the current window sampling ends, the value of the memory is written into the buffer from low address to high address, and the counter is incremented by 1; when the count value of the counter is less than or equal to N1 and the current When the window sampling ends, the memory is sequentially accumulated and written into the background window register, and the background window register stores the area sum of the background window in the first detection period; when the count value of the counter is equal to N1+N2+1 and the current sampling window ends , the memory writes the detection window register, and the detection window register stores the area sum of the detection window in the first detection cycle.
可选地,如果当前检测窗口属于本轮检测的非第一个检测周期,则从所述缓存器中读取最低位的取值,并写入第一临时寄存器进行暂存;Optionally, if the current detection window belongs to the non-first detection cycle of the current round of detection, the value of the lowest bit is read from the buffer and written into the first temporary register for temporary storage;
所述缓存器向左移位一次,向第N1+N2+1个地址写入存储器的数值,再读取所述缓存器中第N1+1位的取值到第二临时寄存器暂存;The buffer is shifted to the left once, the value of the memory is written to the N1+N2+1 address, and then the value of the N1+1 bit in the buffer is read to the second temporary register for temporary storage;
将存储器中取值写入检测窗口寄存器以便于为当前检测窗口的面积和重新赋值;Write the value in the memory into the detection window register so as to reassign the area and the current detection window;
将所述背景窗口寄存器的取值减去第一临时寄存器的取值,再加上第二临时寄存器的取值,作为当前背景窗口的面积和赋值写入背景窗口寄存器。The value of the background window register minus the value of the first temporary register, plus the value of the second temporary register, is written into the background window register as the area and assignment of the current background window.
步骤110:判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值。Step 110: Determine whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold.
其中,所述预设阈值可以是根据经验数据信号得到的标准值,用于衡量被植入检测芯片的生物体是否发生癫痫病症。Wherein, the preset threshold may be a standard value obtained according to an empirical data signal, and is used to measure whether the organism implanted in the detection chip has epilepsy.
步骤112:在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。Step 112 : when the judgment result is greater than, output an identification signal indicating an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
在具体是实现时,所述标识信号可以是Flag信号,当Flag信号拉高,表示癫痫发作,可以触发进行刺激治疗;反之,癫痫未发作,不做处理,继续进一步检测。In specific implementation, the identification signal may be a Flag signal. When the Flag signal is pulled high, it indicates an epileptic seizure, and stimulation treatment can be triggered; otherwise, if the epilepsy does not occur, no treatment is performed, and further detection is continued.
下面通过具体的实例对本说明书所涉及的癫痫检测方案进行详述。以脑电信号为例。The epilepsy detection scheme involved in this specification will be described in detail below through specific examples. Take EEG signals as an example.
首先,介绍检测方案所涉及到的算法信号及硬件单元。First, the algorithm signals and hardware units involved in the detection scheme are introduced.
该硬件算法的输入端口有:CLK1端口,CLK2端口,nRST端口,MOSI端口,Data_ADC端口,EN_detect端口;输出端口有MISO端口,Flag端口。整体方案的通讯模式采用串行外设接口SPI。其中,SPI通讯模式是上升沿发送数据,下降沿采集数据。CLK1端口和CLK2端口分别是两个相位相同的主时钟端口。nRST端口是复位信号端口,信号输出0为复位,信号输出1为正常工作。MOSI端口是SPI通讯端口,信号方向主机输出从机输入。Data_ADC端口用于传输16位位宽的脑电数据,实际应用中可以接16位ADC的输出。EN_detect端口是检测使能信号端口。MISO端口是SPI通讯端口,信号方向主机输入从机输出。Flag端口是癫痫发作警示信号端口。相应地,每个端口对应有相应的信号输出。The input ports of the hardware algorithm are: CLK1 port, CLK2 port, nRST port, MOSI port, Data_ADC port, EN_detect port; output ports include MISO port and Flag port. The communication mode of the overall scheme adopts the serial peripheral interface SPI. Among them, the SPI communication mode is to send data on the rising edge and collect data on the falling edge. The CLK1 port and the CLK2 port are respectively two master clock ports with the same phase. The nRST port is the reset signal port, the signal output 0 is reset, and the signal output 1 is normal operation. The MOSI port is an SPI communication port, and the signal direction is output from the master and input from the slave. The Data_ADC port is used to transmit 16-bit wide EEG data, and can be connected to the output of a 16-bit ADC in practical applications. The EN_detect port is the detection enable signal port. The MISO port is the SPI communication port, and the signal direction is input from the master and output from the slave. The Flag port is the epileptic seizure warning signal port. Correspondingly, each port corresponds to a corresponding signal output.
进一步,定义T是检测窗口采样点数,通过SPI端口配置,范围32-1024。N1是背景窗口的大小与检测窗口大小的倍数,通过SPI端口配置,范围0-255。N2是间隔窗口的大小与检测窗口大小的倍数,通过SPI端口配置,范围0-255。LIM是预设阈值,通过SPI端口配置,范围110-180。CNT1是计数检测窗口中采样点数的计数器。Q是计数第一个计算 周期内检测窗口数量的变量。Sum1是累加器,用于累加每个检测窗口内面积和。Sum_background是背景窗口寄存器,用于累加背景窗口内面积和。Sum_detect是检测窗口寄存器,用于存储每个计算周期内检测窗口的面积和。Sum_L是第一临时寄存器,用于存储缓存器中最低位的取值。Sum_N是第二临时寄存器,用于存储缓存器中第N1+1位的取值。Sram1是容量为2kB的静态随机存储器。SramS1是缓存器,双端口ram,用于计算过程中中间运算结果的存储。SramS2是输出缓存器,双端口ram,用于癫痫脑电数据输出时的缓冲。Further, define T as the number of sampling points in the detection window, configured through the SPI port, ranging from 32 to 1024. N1 is the multiple of the size of the background window and the size of the detection window, configured through the SPI port, the range is 0-255. N2 is a multiple of the size of the interval window and the size of the detection window, configured through the SPI port, the range is 0-255. LIM is the preset threshold, configured through the SPI port, in the range 110-180. CNT1 is a counter that counts the number of sampling points in the detection window. Q is the variable that counts the number of detection windows in the first calculation cycle. Sum1 is an accumulator that accumulates the sum of the areas within each detection window. Sum_background is the background window register, which is used to accumulate the sum of the area in the background window. Sum_detect is the detection window register, which is used to store the area sum of the detection window in each calculation cycle. Sum_L is the first temporary register, which is used to store the value of the lowest bit in the buffer. Sum_N is the second temporary register for storing the value of the N1+1th bit in the buffer. Sram1 is a static random access memory with a capacity of 2kB. SramS1 is a buffer, dual-port ram, used for storage of intermediate operation results in the calculation process. SramS2 is an output buffer, dual-port ram, used to buffer epilepsy EEG data output.
本说明书中检测方案大致可以包括以下几个部分:The detection scheme in this manual can roughly include the following parts:
1、配置算法参数。1. Configure the algorithm parameters.
2、将脑电信号存储到Sram1。2. Store the EEG signal to Sram1.
3、求脑电信号幅值与直流偏置之间的差值,并取绝对值。3. Find the difference between the amplitude of the EEG signal and the DC offset, and take the absolute value.
4、检测癫痫是否发生的计算过程。其中,4. The calculation process to detect the occurrence of epilepsy. in,
(4.1)首先求每个检测窗口长度的面积和,背景窗口的面积和写入Sum_background寄存器,检测窗口的面积和写入Sum_detect寄存器。(4.1) First calculate the area sum of the length of each detection window, write the area sum of the background window into the Sum_background register, and write the area sum of the detection window into the Sum_detect register.
(4.2)求检测窗口的平均面积,求背景窗口的平均面积,判断检测结果并给出Flag信号。(4.2) Find the average area of the detection window, find the average area of the background window, judge the detection result and give the Flag signal.
5、检测癫痫的过程数据通过通讯端口串行输出。5. The process data of epilepsy detection is serially output through the communication port.
具体实现过程可参照以下内容:The specific implementation process can refer to the following:
1、Data_ADC[15:0]脑电数据以200Hz频率写入Sram1存储器。1. Data_ADC[15:0] EEG data is written into Sram1 memory at 200Hz frequency.
其中,输入频率可以灵活设置,这里的200Hz仅是举例。Among them, the input frequency can be set flexibly, and the 200Hz here is just an example.
2、脑电信号的幅值与直流偏置之差的绝对值,其绝对值依次累加入Sum1累加器。CNT1[10:0]计数器从0开始计数Sum1的累加次数,以一个检测窗口的长度为一个循环。2. The absolute value of the difference between the amplitude of the EEG signal and the DC offset is added to the Sum1 accumulator in turn. The CNT1[10:0] counter starts counting the accumulation times of Sum1 from 0, and takes the length of one detection window as a cycle.
3、第一个计算周期:寄存器Q记录第一个计算周期内检测窗口的个数,Q>=0且Q<=N1+N2+2。当Q<=N1+N2+1且CNT1=T(当前检测窗口结束,与之相邻的下一个检测窗口开始)时,Sum1数值由低地址到高地址写入SramS1,同时Q加1。当Q<=N1且CNT1=T时,Sum1依次累加写入Sum_background寄存器,则Sum_background寄存器存储了第一个检测周期内背景窗口的面积和;当Q=N1+N2+1且CNT1=T时,Sum1写入Sum_detect寄存器,即Sum_detect寄存器存储了检测窗口面积和。根据公式3. The first calculation cycle: the register Q records the number of detection windows in the first calculation cycle, Q>=0 and Q<=N1+N2+2. When Q<=N1+N2+1 and CNT1=T (the current detection window ends, and the next detection window adjacent to it starts), the value of Sum1 is written into SramS1 from low address to high address, and Q is incremented by 1 at the same time. When Q<=N1 and CNT1=T, Sum1 is successively written to the Sum_background register, and the Sum_background register stores the area sum of the background window in the first detection period; when Q=N1+N2+1 and CNT1=T, Sum1 is written to the Sum_detect register, that is, the Sum_detect register stores the sum of the detection window area. According to the formula
Figure PCTCN2022073769-appb-000001
Figure PCTCN2022073769-appb-000001
其中,Sum_detect为检测窗口的面积长和,Td为检测窗口个数,默认为1, Sum_background为背景窗口总面积和,T为背景窗口个数。可得到检测窗口的平均面积与背景窗口的平均面积的比值,该比值与预设阈值LIM比较,若大于LIM,则说明癫痫发作,同时Flag信号拉高,反之,癫痫未发作。其中,所述预设阈值LIM可以是400%,即当比值小于等于400%均不触发Flag信号拉高。Among them, Sum_detect is the sum of the area of the detection window, Td is the number of detection windows, the default is 1, Sum_background is the total area of the background windows, and T is the number of background windows. The ratio of the average area of the detection window to the average area of the background window can be obtained, and the ratio is compared with the preset threshold LIM. If the ratio is greater than the LIM, it means epileptic seizures, while the Flag signal is pulled up, otherwise, epilepsy does not occur. The preset threshold LIM may be 400%, that is, when the ratio is less than or equal to 400%, the Flag signal will not be triggered to pull up.
5、第一次检测结束后,进入第二个检测周期。5. After the first detection, enter the second detection cycle.
此时,SramS1中存储了N1+N2+1个数值,低N1位的数据是第一个计算周期内背景窗口的Sum1值,接下来的N2位的数据是第一个计算周期内间隔窗口的Sum1值,最高位是检测窗口的Sum1值。当CNT1=T时,先将SramS1中最低位的数据读出到第一临时寄存器Sum_L暂存,然后SramS1向左移位一次,并向第N1+N2+1个地址写入Sum1数值,再读取SramS1中第N1+1位的数据到第二临时寄存器Sum_N暂存,与此同时Sum1的数值也写入寄存器Sum_detect。当前Sum_background存储第一个计算周期内背景区间的面积和,这时,Sum_background-Sum_L+Sum_N再赋值给Sum_background,即为第二个计算周期的背景窗口面积和。再次根据公式(1),可得到第二个计算周期检测区间的平均面积与背景窗口的平均面积的比值,同样与阈值LIM比较,若大于LIM,则说明癫痫发作,同时Flag信号拉高,反之,癫痫未发作。At this point, N1+N2+1 values are stored in SramS1, the data in the lower N1 bits is the Sum1 value of the background window in the first calculation cycle, and the data in the next N2 bits is the interval window in the first calculation cycle. Sum1 value, the highest bit is the Sum1 value of the detection window. When CNT1=T, first read the lowest bit data in SramS1 to the first temporary register Sum_L for temporary storage, then SramS1 is shifted to the left once, and the value of Sum1 is written to the N1+N2+1th address, and then read Take the data of the N1+1th bit in SramS1 to the second temporary register Sum_N for temporary storage, and at the same time, the value of Sum1 is also written into the register Sum_detect. The current Sum_background stores the area sum of the background interval in the first calculation cycle. At this time, Sum_background-Sum_L+Sum_N is assigned to Sum_background, which is the background window area sum of the second calculation cycle. According to formula (1) again, the ratio of the average area of the detection interval of the second calculation period to the average area of the background window can be obtained, which is also compared with the threshold LIM. If it is greater than the LIM, it means an epileptic seizure, and the Flag signal is pulled high, and vice versa. , no epilepsy.
6、按照5中的逻辑继续第三个以及更多检测周期的循环。6. Continue the loop for the third and more detection cycles according to the logic in 5.
7、每次检测到癫痫发作,Flag拉高时,这时外部可拉高EN_detect端,检测暂停,进行刺激。7. Every time an epileptic seizure is detected, when the Flag is pulled high, the EN_detect terminal can be pulled up externally, the detection is suspended, and the stimulation is performed.
同时硬件算法中Sram1读使能生效,通过控制地址端,可读取癫痫发作时刻前30s脑电数据以及后60s脑电数据。由于Sram1读取频率远小于SPI通信频率,故Sram1输出后的数据写入缓存SramS2,数据写入完成后再依次从低位到高位读出,通过MISO端口串行输出,输出后可存储到外部Flash,可供后续医学研究使用,对神经科学的研究具有重大意义。At the same time, the Sram1 read enable in the hardware algorithm takes effect. By controlling the address terminal, the EEG data 30s before and 60s after the epileptic seizure can be read. Since the reading frequency of Sram1 is much lower than the SPI communication frequency, the data output by Sram1 is written into the cache SramS2. After the data is written, it is read from low to high in sequence, and serially output through the MISO port. After output, it can be stored in external Flash. , which can be used for follow-up medical research and is of great significance to neuroscience research.
由此,通过上述技术方案,可以采用硬件算法实时采集并检测生物电信号,然后,根据每个检测周期内检测窗口的平均面积与背景窗口的平均面积之间的比值与预设阈值的比对,确定是否癫痫发来通过标识信号触发进行刺激治疗。从而,以低功耗实时检测,提高集成度和检测准确性、便捷性。Therefore, through the above technical solution, a hardware algorithm can be used to collect and detect bioelectrical signals in real time, and then, according to the comparison between the ratio between the average area of the detection window and the average area of the background window in each detection period and the preset threshold , to determine whether epileptic seizures are triggered by identifying signals for stimulation therapy. Thus, real-time detection with low power consumption improves integration, detection accuracy, and convenience.
实施例二Embodiment 2
参照图3所示,为本说明书实施例提供的一种植入式闭环系统基于面积算法自动检测癫痫的装置300,该装置300主要包括:Referring to FIG. 3 , a device 300 for automatically detecting epilepsy by an implantable closed-loop system based on an area algorithm provided in an embodiment of the present specification mainly includes:
配置模块302,通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The configuration module 302 configures detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least include: detection window size, interval window size and background window size in one detection period;
采集存储模块304,从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器;The acquisition and storage module 304 collects bioelectrical signals in real time from the organism implanted in the detection chip, and stores them in the memory;
计算模块306,按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值,并送入累加器;The calculation module 306 respectively calculates the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset according to the time sequence, and sends it to the accumulator;
确定模块308,基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和;The determination module 308, based on the value in the accumulator, respectively determines the area sum of the current detection window and the area sum of the background window corresponding to the current detection window;
检测模块310,判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;The detection module 310 determines whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
治疗模块312,在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。The treatment module 312, when the judgment result is greater than, outputs an identification signal indicating an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
可选地,作为一个实施例,所述背景窗口大小是所述检测窗口大小的N1倍,所述间隔窗口大小是所述检测窗口大小的N2倍;其中,所述N1和所述N2均为大于等于2的正整数。Optionally, as an embodiment, the size of the background window is N1 times the size of the detection window, and the size of the interval window is N2 times the size of the detection window; wherein, the N1 and the N2 are both. A positive integer greater than or equal to 2.
在本说明书实施例的一种具体实现方式中,所述确定模块308,具体用于:In a specific implementation manner of the embodiment of this specification, the determining module 308 is specifically configured to:
当计数器从1计数至N1时,将所述累加器中的取值写入背景窗口寄存器,直至计数到N1结束,所述背景窗口寄存器存储当前检测窗口对应的背景窗口的面积和;When the counter counts from 1 to N1, the value in the accumulator is written into the background window register, and the background window register stores the area sum of the background window corresponding to the current detection window until the count reaches N1;
当计数器计数至N1+N2+1,将所述累加器中的取值写入检测窗口寄存器,所述检测窗口寄存器存储当前检测窗口的面积和。When the counter counts to N1+N2+1, the value in the accumulator is written into the detection window register, and the detection window register stores the area sum of the current detection window.
在本说明书实施例的再一种具体实现方式中,在计数之前,所述所述确定模块308,还用于:In yet another specific implementation of the embodiment of the present specification, before counting, the determining module 308 is further configured to:
以检测窗口为基本窗口单元,确定第一个检测周期所包含的背景窗口、间隔窗口以及检测窗口中,基本窗口单元的数量N1+N2+1;相应地,Taking the detection window as the basic window unit, determine the number of basic window units N1+N2+1 in the background window, interval window and detection window included in the first detection period; accordingly,
当计数器的计数取值不大于N1+N2+1且当前窗口采样结束时,存储器的数值由低地址到高地址写入缓存器,同时计数器加1;When the count value of the counter is not greater than N1+N2+1 and the sampling of the current window is over, the value of the memory is written into the buffer from low address to high address, and the counter is incremented by 1;
当计数器的计数取值小于等于N1且当前窗口采样结束时,存储器依次累加写入背景窗口寄存器,所述背景窗口寄存器存储第一个检测周期内背景窗口的面积和;When the count value of the counter is less than or equal to N1 and the sampling of the current window ends, the memory is sequentially accumulated and written into the background window register, and the background window register stores the area sum of the background window in the first detection period;
当计数器的计数取值等于N1+N2+1且当前采样窗口结束时,存储器写入检测窗口寄存器,所述检测窗口寄存器存储第一个检测周期内检测窗口的面积和。When the count value of the counter is equal to N1+N2+1 and the current sampling window ends, the memory writes the detection window register, which stores the area sum of the detection window in the first detection cycle.
在本说明书实施例的再一种具体实现方式中,如果当前检测窗口属于本轮检测的非第 一个检测周期,则所述确定模块具体用于:In yet another specific implementation of the embodiment of this specification, if the current detection window belongs to the non-first detection cycle of the current round of detection, the determination module is specifically used for:
从所述缓存器中读取最低位的取值,并写入第一临时寄存器进行暂存;Read the value of the lowest bit from the buffer, and write it into the first temporary register for temporary storage;
所述缓存器向左移位一次,向第N1+N2+1个地址写入存储器的数值,再读取所述缓存器中第N1+1位的取值到第二临时寄存器暂存;The buffer is shifted to the left once, the value of the memory is written to the N1+N2+1 address, and then the value of the N1+1 bit in the buffer is read to the second temporary register for temporary storage;
将存储器中取值写入检测窗口寄存器以便于为当前检测窗口的面积和重新赋值;Write the value in the memory into the detection window register to reassign the area and the current detection window;
将所述背景窗口寄存器的取值减去第一临时寄存器的取值,再加上第二临时寄存器的取值,作为当前背景窗口的面积和赋值写入背景窗口寄存器。The value of the background window register minus the value of the first temporary register, plus the value of the second temporary register, is written into the background window register as the area and assignment of the current background window.
在本说明书实施例的再一种具体实现方式中,在所述生物体被刺激治疗时,还包括输出模块,用于获取癫痫发作时刻前第一时段的生物电信号以及癫痫发作时刻后第二时段的生物电信号,并通过SPI串行输出。In yet another specific implementation of the embodiment of the present specification, when the organism is stimulated for treatment, an output module is further included, configured to acquire the bioelectrical signal in the first period before the epilepsy time and the second time after the epilepsy time. Period of bioelectrical signal and serial output through SPI.
通过上述技术方案,可以采用硬件算法实时采集并检测生物电信号,然后,根据每个检测周期内检测窗口的平均面积与背景窗口的平均面积之间的比值与预设阈值的比对,确定是否癫痫发来通过标识信号触发进行刺激治疗。从而,以低功耗实时检测,提高集成度和检测准确性、便捷性。Through the above technical solution, a hardware algorithm can be used to collect and detect bioelectrical signals in real time, and then, according to the comparison between the ratio between the average area of the detection window and the average area of the background window in each detection period and the preset threshold, determine whether to Epilepsy seizures are triggered by marker signals for stimulation therapy. Thus, real-time detection with low power consumption improves integration, detection accuracy, and convenience.
实施例三Embodiment 3
参照图5所示,为本说明书实施例提供的一种植入式闭环系统基于面积算法自动检测癫痫的装置结构示意图,至少包括:执行上述实施例一中方法的硬件算法芯片以及其它功能模块;其中,所述硬件算法芯片包含:串行外设接口,存储器,算法寄存器,累加器,计数器;其中,Referring to FIG. 5 , a schematic structural diagram of an implantable closed-loop system for automatically detecting epilepsy based on an area algorithm provided in an embodiment of the present specification includes at least: a hardware algorithm chip and other functional modules for executing the method in the above-mentioned first embodiment; wherein , the hardware algorithm chip includes: serial peripheral interface, memory, algorithm register, accumulator, counter; wherein,
所述串行外设接口用于配置检测参数,并传输生物电信号;其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The serial peripheral interface is used to configure detection parameters and transmit bioelectrical signals; wherein, the detection parameters at least include: detection window size, interval window size and background window size in one detection cycle;
所述存储器,分别用于存储从被植入检测芯片的生物体上实时采集生物电信号,在依据计数器按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值后,送入累加器;The memories are respectively used to store the real-time acquisition of bioelectric signals from the organism implanted in the detection chip, and after calculating the absolute value of the difference between the amplitude of the bioelectric signal and the DC offset according to the counter in sequence, respectively , into the accumulator;
在基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和之后,检测使能端判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;After determining the area sum of the current detection window and the area sum of the background window corresponding to the current detection window respectively based on the value in the accumulator, the detection enabling terminal determines that the average area of the current detection window is the same as the total area of the current detection window. Whether the ratio of the average area of the background window is greater than the preset threshold;
在判断结果为大于时,所述串行外设接口输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。When the judgment result is greater than, the serial peripheral interface outputs an identification signal representing an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
其它硬件单元部分可参照实施例一的内容,在此不作赘述。For other hardware unit parts, reference may be made to the content of the first embodiment, which will not be repeated here.
实施例四Embodiment 4
图4是本说明书的一个实施例电子设备的结构示意图。请参考图4,在硬件层面,该电子设备包括处理器,可选地还包括内部总线、网络接口、存储器。其中,存储器可能包含内存,例如高速随机存取存储器(Random-Access Memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少1个磁盘存储器等。当然,该电子设备还可能包括其他业务所需要的硬件。FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present specification. Referring to FIG. 4 , at the hardware level, the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory. The memory may include memory, such as high-speed random-access memory (Random-Access Memory, RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Of course, the electronic equipment may also include hardware required for other services.
处理器、网络接口和存储器可以通过内部总线相互连接,该内部总线可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(Extended Industry Standard Architecture,扩展工业标准结构)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图4中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。The processor, network interface and memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Component Interconnect Standard) bus. Industry Standard Architecture, extended industry standard structure) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one bidirectional arrow is used in FIG. 4, but it does not mean that there is only one bus or one type of bus.
存储器,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可以包括内存和非易失性存储器,并向处理器提供指令和数据。memory for storing programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include memory and non-volatile memory and provide instructions and data to the processor.
处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,在逻辑层面上形成自动检测癫痫的装置。处理器,执行存储器所存放的程序,并具体用于执行以下操作:The processor reads the corresponding computer program from the non-volatile memory into the memory and runs it, forming a device for automatically detecting epilepsy at the logical level. The processor executes the program stored in the memory, and is specifically used to perform the following operations:
通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The detection parameters are configured through the SPI serial peripheral interface, wherein the detection parameters at least include: the detection window size, the interval window size and the background window size in one detection period;
从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器;Collect bioelectrical signals in real time from the organism implanted in the detection chip, and store them in the memory;
按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset respectively according to the time sequence, and send it to the accumulator;
基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和;Based on the value in the accumulator, respectively determine the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window;
判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;Determine whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。When the judgment result is greater than, output an identification signal representing epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
上述如本说明书图1所示实施例揭示的装置执行的方法可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上 述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本说明书一个或多个实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本说明书一个或多个实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。The above-mentioned method performed by the apparatus disclosed in the embodiment shown in FIG. 1 of this specification may be applied to a processor, or implemented by a processor. A processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software. The above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processor, DSP), dedicated integrated Circuit (Application Specific Integrated Circuit, ASIC), Field Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logic block diagram disclosed in one or more embodiments of this specification can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with one or more embodiments of this specification may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
该电子设备还可执行图1的方法,并实现相应装置在图1所示实施例的功能,本说明书实施例在此不再赘述。The electronic device can also execute the method shown in FIG. 1 , and implement the functions of the corresponding apparatus in the embodiment shown in FIG. 1 , and the embodiments of this specification will not be repeated here.
当然,除了软件实现方式之外,本说明书实施例的电子设备并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Of course, in addition to software implementations, the electronic devices in the embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subjects of the following processing procedures are not limited to each logic A unit can also be a hardware or logic device.
通过上述技术方案,可以采用硬件算法实时采集并检测生物电信号,然后,根据每个检测周期内检测窗口的平均面积与背景窗口的平均面积之间的比值与预设阈值的比对,确定是否癫痫发来通过标识信号触发进行刺激治疗。从而,以低功耗实时检测,提高集成度和检测准确性、便捷性。Through the above technical solution, a hardware algorithm can be used to collect and detect bioelectrical signals in real time, and then, according to the comparison between the ratio between the average area of the detection window and the average area of the background window in each detection period and the preset threshold, it is determined whether Epilepsy seizures are triggered by marker signals for stimulation therapy. Thus, real-time detection with low power consumption improves integration, detection accuracy, and convenience.
总之,以上所述仅为本说明书的较佳实施例而已,并非用于限定本说明书的保护范围。凡在本说明书的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本说明书的保护范围之内。In a word, the above descriptions are only preferred embodiments of the present specification, and are not intended to limit the protection scope of the present specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the protection scope of this specification.
上述一个或多个实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules or units described in one or more of the above embodiments may be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技 术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology. Information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device comprising a series of elements includes not only those elements, but also Other elements not expressly listed, or which are inherent to such a process, method, article of manufacture, or apparatus are also included. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article of manufacture, or device that includes the element.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

Claims (10)

  1. 一种植入式闭环系统基于面积算法自动检测癫痫的方法,其特征在于,应用在由芯片构成的癫痫检测装置上,所述方法包括:A method for an implantable closed-loop system to automatically detect epilepsy based on an area algorithm, characterized in that it is applied to an epilepsy detection device composed of a chip, and the method includes:
    通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The detection parameters are configured through the SPI serial peripheral interface, wherein the detection parameters at least include: the detection window size, the interval window size and the background window size in one detection period;
    从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器;Collect bioelectrical signals in real time from the organism implanted in the detection chip, and store them in the memory;
    按照时序先后分别计算所述生物电信号的幅值与直流偏置之比的绝对值,并送入累加器;Calculate the absolute value of the ratio of the amplitude of the bioelectrical signal to the DC offset respectively according to the time sequence, and send it to the accumulator;
    基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和;Based on the value in the accumulator, respectively determine the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window;
    判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;Determine whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
    在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。When the judgment result is greater than, output an identification signal representing epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
  2. 如权利要求1所述的植入式闭环系统基于面积算法自动检测癫痫的方法,其特征在于,所述背景窗口大小是所述检测窗口大小的N1倍,所述间隔窗口大小是所述检测窗口大小的N2倍;其中,所述N1和所述N2均为大于等于2的正整数。The method for automatically detecting epilepsy by an implantable closed-loop system based on an area algorithm according to claim 1, wherein the size of the background window is N1 times the size of the detection window, and the size of the interval window is the size of the detection window N2 times the size; wherein, both the N1 and the N2 are positive integers greater than or equal to 2.
  3. 如权利要求2所述的植入式闭环系统基于面积算法自动检测癫痫的方法,其特征在于,如果当前检测窗口属于本轮检测的第一个检测周期,则基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和,具体包括:The method for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm according to claim 2, wherein if the current detection window belongs to the first detection cycle of the current round of detection, then based on the value in the accumulator , respectively determine the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window, specifically including:
    当计数器从1计数至N1时,将所述累加器中的取值写入背景窗口寄存器,直至计数到N1结束,所述背景窗口寄存器存储当前检测窗口对应的背景窗口的面积和;When the counter counts from 1 to N1, the value in the accumulator is written into the background window register, and the background window register stores the area sum of the background window corresponding to the current detection window until the count reaches N1;
    当计数器计数至N1+N2+1,将所述累加器中的取值写入检测窗口寄存器,所述检测窗口寄存器存储当前检测窗口的面积和。When the counter counts to N1+N2+1, the value in the accumulator is written into the detection window register, and the detection window register stores the area sum of the current detection window.
  4. 如权利要求3所述的植入式闭环系统基于面积算法自动检测癫痫的方法,其特征在于,在计数之前,所述方法还包括:The method for automatically detecting epilepsy by an implantable closed-loop system based on an area algorithm according to claim 3, wherein, before counting, the method further comprises:
    以检测窗口为基本窗口单元,确定第一个检测周期所包含的背景窗口、间隔窗口以及检测窗口中,基本窗口单元的数量为N1+N2+1;相应地,Taking the detection window as the basic window unit, it is determined that in the background window, interval window and detection window included in the first detection period, the number of basic window units is N1+N2+1; accordingly,
    当计数器的计数取值不大于N1+N2+1且当前窗口采样结束时,存储器的数值由低地址 到高地址写入缓存器,同时计数器加1;When the count value of the counter is not greater than N1+N2+1 and the sampling of the current window ends, the value of the memory is written into the buffer from low address to high address, and the counter is incremented by 1;
    当计数器的计数取值小于等于N1且当前窗口采样结束时,存储器依次累加写入背景窗口寄存器,所述背景窗口寄存器存储第一个检测周期内背景窗口的面积和;When the count value of the counter is less than or equal to N1 and the sampling of the current window ends, the memory is sequentially accumulated and written into the background window register, and the background window register stores the area sum of the background window in the first detection period;
    当计数器的计数取值等于N1+N2+1且当前采样窗口结束时,存储器写入检测窗口寄存器,所述检测窗口寄存器存储第一个检测周期内检测窗口的面积和。When the count value of the counter is equal to N1+N2+1 and the current sampling window ends, the memory writes the detection window register, which stores the area sum of the detection window in the first detection cycle.
  5. 如权利要求4所述的植入式闭环系统基于面积算法自动检测癫痫的方法,其特征在于,如果当前检测窗口属于本轮检测的非第一个检测周期,则基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和,具体包括:The method for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm according to claim 4, wherein if the current detection window belongs to a non-first detection period of the current round of detection, then based on the value obtained in the accumulator value, respectively determine the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window, specifically including:
    从所述缓存器中读取最低位的取值,并写入第一临时寄存器进行暂存;Read the value of the lowest bit from the buffer, and write it into the first temporary register for temporary storage;
    所述缓存器向左移位一次,向第N1+N2+1个地址写入存储器的数值,再读取所述缓存器中第N1+1位的取值到第二临时寄存器暂存;The buffer is shifted to the left once, the value of the memory is written to the N1+N2+1 address, and then the value of the N1+1 bit in the buffer is read to the second temporary register for temporary storage;
    将存储器中取值写入检测窗口寄存器以便于为当前检测窗口的面积和重新赋值;Write the value in the memory into the detection window register so as to reassign the area and the current detection window;
    将所述背景窗口寄存器的取值减去第一临时寄存器的取值,再加上第二临时寄存器的取值,作为当前背景窗口的面积和赋值写入背景窗口寄存器。The value of the background window register minus the value of the first temporary register, plus the value of the second temporary register, is written into the background window register as the area and assignment of the current background window.
  6. 如权利要求1所述的植入式闭环系统基于面积算法自动检测癫痫的方法,其特征在于,在所述生物体被刺激治疗时,所述方法还包括:The method for automatically detecting epilepsy by an implantable closed-loop system based on an area algorithm according to claim 1, wherein when the organism is stimulated for treatment, the method further comprises:
    获取癫痫发作时刻前第一时段的生物电信号以及癫痫发作时刻后第二时段的生物电信号,并通过SPI串行输出。Obtain the bioelectrical signal in the first period before the epileptic seizure time and the bioelectrical signal in the second period after the epileptic seizure time, and output them serially through SPI.
  7. 一种植入式闭环系统基于面积算法自动检测癫痫的装置,其特征在于,包括:A device for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm, characterized in that it includes:
    配置模块,通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The configuration module configures detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least include: detection window size, interval window size and background window size in one detection period;
    采集存储模块,从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器;The acquisition and storage module collects bioelectrical signals in real time from the organism implanted in the detection chip, and stores them in the memory;
    计算模块,按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值,并送入累加器;The calculation module calculates the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset respectively according to the time sequence, and sends it to the accumulator;
    确定模块,基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和;The determination module, based on the value in the accumulator, respectively determines the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window;
    检测模块,判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;a detection module, for judging whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
    治疗模块,在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。The treatment module, when the judgment result is greater than, outputs an identification signal representing an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
  8. 一种植入式闭环系统基于面积算法自动检测癫痫的装置,其特征在于,至少包括:执行上述权利要求1-6任一项所述方法的硬件算法芯片以及其它功能模块;其中,所述硬件算法芯片包含:串行外设接口,存储器,累加器,计数器;其中,A device for automatically detecting epilepsy in an implantable closed-loop system based on an area algorithm, characterized in that it at least includes: a hardware algorithm chip and other functional modules for executing the method according to any one of the preceding claims 1-6; wherein, the hardware algorithm The chip contains: serial peripheral interface, memory, accumulator, counter; among them,
    所述串行外设接口用于配置检测参数,并传输生物电信号;其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The serial peripheral interface is used to configure detection parameters and transmit bioelectrical signals; wherein, the detection parameters at least include: detection window size, interval window size and background window size in one detection cycle;
    所述存储器,用于存储从被植入检测芯片的生物体上实时采集生物电信号,在依据计数器按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值后,送入累加器;The memory is used to store the real-time acquisition of bioelectric signals from the organism implanted in the detection chip, and after calculating the absolute value of the difference between the amplitude of the bioelectric signal and the DC offset according to the counter according to the time series, into the accumulator;
    在基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和之后,检测使能端判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;After determining the area sum of the current detection window and the area sum of the background window corresponding to the current detection window respectively based on the value in the accumulator, the detection enabling terminal determines that the average area of the current detection window is the same as the total area of the current detection window. Whether the ratio of the average area of the background window is greater than a preset threshold;
    在判断结果为大于时,所述串行外设接口输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。When the judgment result is greater than, the serial peripheral interface outputs an identification signal representing an epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
  9. 如权利要求8所述的植入式闭环系统基于面积算法自动检测癫痫的装置,其特征在于,在所述生物体被刺激治疗时,所述SPI还用于获取癫痫发作时刻前第一时段的生物电信号以及癫痫发作时刻后第二时段的生物电信号,并串行输出。The device for automatically detecting epilepsy by an implantable closed-loop system based on an area algorithm according to claim 8, wherein when the organism is stimulated for treatment, the SPI is further used to obtain the first time period before the epileptic seizure moment. The bioelectrical signal and the bioelectrical signal of the second period after the epileptic seizure are outputted serially.
  10. 一种电子设备,包括:An electronic device comprising:
    处理器;以及processor; and
    被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行:memory arranged to store computer-executable instructions which, when executed, cause the processor to perform:
    通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;The detection parameters are configured through the SPI serial peripheral interface, wherein the detection parameters at least include: the detection window size, the interval window size and the background window size in one detection period;
    从被植入检测芯片的生物体上实时采集生物电信号,并存入存储器;Collect bioelectrical signals in real time from the organism implanted in the detection chip, and store them in the memory;
    按照时序先后分别计算所述生物电信号的幅值与直流偏置之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitude of the bioelectrical signal and the DC offset respectively according to the time sequence, and send it to the accumulator;
    基于所述累加器中的取值,分别确定当前检测窗口的面积和,以及所述当前检测窗口对应的背景窗口的面积和;Based on the value in the accumulator, respectively determine the area sum of the current detection window, and the area sum of the background window corresponding to the current detection window;
    判断所述当前检测窗口的平均面积与所述背景窗口的平均面积的比值是否大于预设阈值;Determine whether the ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
    在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。When the judgment result is greater than, output an identification signal representing epileptic seizure, so as to trigger the treatment device to perform stimulation treatment on the living body.
PCT/CN2022/073769 2021-02-05 2022-01-25 Method and device for automatically detecting epileptic seizure by implantable closed-loop system on basis of area algorithm WO2022166683A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110170231.7A CN112972891A (en) 2021-02-05 2021-02-05 Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system
CN202110170231.7 2021-02-05

Publications (1)

Publication Number Publication Date
WO2022166683A1 true WO2022166683A1 (en) 2022-08-11

Family

ID=76349206

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/073769 WO2022166683A1 (en) 2021-02-05 2022-01-25 Method and device for automatically detecting epileptic seizure by implantable closed-loop system on basis of area algorithm

Country Status (2)

Country Link
CN (1) CN112972891A (en)
WO (1) WO2022166683A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112972891A (en) * 2021-02-05 2021-06-18 杭州诺为医疗技术有限公司 Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130096391A1 (en) * 2011-10-14 2013-04-18 Flint Hills Scientific, L.L.C. Seizure detection methods, apparatus, and systems using a short term average/long term average algorithm
CN109965870A (en) * 2019-02-27 2019-07-05 杭州诺为医疗技术有限公司 A kind of method of automatic detection and stimulation therapy epilepsy
CN112972891A (en) * 2021-02-05 2021-06-18 杭州诺为医疗技术有限公司 Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130096391A1 (en) * 2011-10-14 2013-04-18 Flint Hills Scientific, L.L.C. Seizure detection methods, apparatus, and systems using a short term average/long term average algorithm
CN109965870A (en) * 2019-02-27 2019-07-05 杭州诺为医疗技术有限公司 A kind of method of automatic detection and stimulation therapy epilepsy
CN112972891A (en) * 2021-02-05 2021-06-18 杭州诺为医疗技术有限公司 Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system

Also Published As

Publication number Publication date
CN112972891A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
Page et al. Wearable seizure detection using convolutional neural networks with transfer learning
US20180020953A1 (en) Method and device for identifying human movement state
Hsu et al. A 48.6-to-105.2 µW machine learning assisted cardiac sensor SoC for mobile healthcare applications
JP2021506421A (en) Atrial fibrillation signal identification method, devices and equipment
WO2022166683A1 (en) Method and device for automatically detecting epileptic seizure by implantable closed-loop system on basis of area algorithm
CN107595245A (en) A kind of dormancy management method, system and terminal device
WO2022166682A1 (en) Method and device for automatically detecting epilepsy by implantable closed-loop system based on line length algorithm
Deepu et al. An ECG-on-chip for wearable cardiac monitoring devices
EP3602240B1 (en) Ultra-low power mode for a low-cost force-sensing device
WO2018098719A1 (en) Sleep monitoring method, apparatus and terminal
CN112749013B (en) Thread load detection method and device, electronic equipment and storage medium
WO2014117340A1 (en) Method and device for measuring state of charge of mobile terminal
WO2019137110A1 (en) Method for monitoring status of wearable apparatus, device, and wearable apparatus
CN105249927A (en) Snoring sound identification method and anti-snoring device
CN106681619B (en) Method and device for controlling energy consumption of electronic equipment
CN106821336A (en) Sleep monitor method and system
WO2023142380A1 (en) On-vehicle human body information obtaining method and apparatus, and vehicle
Imtiaz et al. A low power system with EEG data reduction for long-term epileptic seizures monitoring
Grützmacher et al. Towards energy efficient sensor nodes for online activity recognition
WO2022166684A1 (en) Adaptive closed-loop detection method and system for implantable electrical stimulation device
CN114451900B (en) Sleep quality determination method and system based on electroencephalogram and storage medium
CN114034313B (en) Step counting method and device
CN116763267A (en) Drunk detection method and device, wearable equipment and storage medium
CN110151182B (en) Apnea type identification method and device
CN113974575B (en) Sleep staging method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22748962

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22748962

Country of ref document: EP

Kind code of ref document: A1