CN112972891A - Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system - Google Patents

Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system Download PDF

Info

Publication number
CN112972891A
CN112972891A CN202110170231.7A CN202110170231A CN112972891A CN 112972891 A CN112972891 A CN 112972891A CN 202110170231 A CN202110170231 A CN 202110170231A CN 112972891 A CN112972891 A CN 112972891A
Authority
CN
China
Prior art keywords
window
detection
area
background
value
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110170231.7A
Other languages
Chinese (zh)
Inventor
陈新蕾
郑开
曹鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Nuowei Medical Technology Co ltd
Original Assignee
Hangzhou Nuowei Medical Technology Co ltd
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 Hangzhou Nuowei Medical Technology Co ltd filed Critical Hangzhou Nuowei Medical Technology Co ltd
Priority to CN202110170231.7A priority Critical patent/CN112972891A/en
Publication of CN112972891A publication Critical patent/CN112972891A/en
Priority to PCT/CN2022/073769 priority patent/WO2022166683A1/en
Pending legal-status Critical Current

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

Abstract

One or more embodiments of the present specification disclose a method and apparatus for automatically detecting epilepsy based on area algorithm for an implantable closed loop system, the method comprising: and acquiring and detecting the bioelectricity signals in real time by adopting a hardware algorithm, and then determining whether the epileptic seizure occurs to carry out stimulation treatment by triggering the identification signal according to the comparison of the ratio of the average area of the detection window to the average area of the background window in each detection period and a preset threshold value. Therefore, the integration level and the detection accuracy and convenience are improved by low-power consumption real-time detection.

Description

Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system
Technical Field
The document relates to the technical field of medical devices, in particular to a method and a device for automatically detecting epilepsy based on an area algorithm by an implantable closed-loop system.
Background
Epilepsy, commonly known as epilepsy, is a chronic nervous system disease caused by abnormal discharges resulting from highly synchronized activities of neurons. The epileptic disease has complex pathogenesis, numerous pathogenic factors, great harm to the health of the body and great difficulty in curing. Therefore, the study of epilepsy detection technology is an important issue in neurology.
At present, electroencephalography is mostly used for acquiring electroencephalogram data of epilepsy, offline analysis and processing are carried out on the acquired electroencephalogram data, the moment of occurrence of epilepsy is judged, the detection real-time performance is poor, and countermeasures cannot be taken timely at the moment of detecting the epilepsy. The method for detecting the epilepsy by transplanting the software algorithm program to the MCU can realize real-time performance, but the MCU needs to be operated all the time, so that the power consumption is large; meanwhile, too complicated algorithm is difficult to apply to implantable equipment, and the integration level is not high.
In view of the above, there is a need to find a new epilepsy detection scheme.
Disclosure of Invention
One or more embodiments of the present disclosure provide a method and an apparatus for automatically detecting epilepsy based on an area algorithm in an implantable closed-loop system, so as to flexibly configure an integrated implantable device with a hardware algorithm for low-power consumption real-time detection of epilepsy, thereby improving integration and detection convenience.
To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:
in a first aspect, a method for automatically detecting epilepsy based on an area algorithm by an implantable closed-loop system is provided, and is applied to an epilepsy detection device composed of a chip, the method includes:
configuring detection parameters through an SPI (serial peripheral interface), wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
collecting bioelectric signals from the organism implanted with the detection chip in real time and storing the bioelectric signals into a memory;
calculating the absolute value of the difference between the amplitude of the bioelectricity signal and the DC offset according to the time sequence, and sending the absolute value to an accumulator;
respectively determining the area sum of a current detection window and the area sum of a background window corresponding to the current detection window based on the values in the accumulator;
judging whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value or not;
and when the judgment result is greater than the preset threshold value, outputting an identification signal representing the epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
In a second aspect, an apparatus for automatically detecting epilepsy based on an area algorithm in an implantable closed-loop system is provided, which includes:
the configuration module is used for configuring detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
the acquisition and storage module is used for acquiring a bioelectricity signal from an organism implanted with the detection chip in real time and storing the bioelectricity signal into a memory;
the calculation module calculates the absolute value of the difference between the amplitude of the bioelectricity signal and the direct current bias according to time sequence and sends the absolute value to the accumulator;
the determining module is used for respectively determining the area sum of the current detection window and the area sum of the background window corresponding to the current detection window based on the values in the accumulator;
the detection module is used for judging whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value or not;
and the treatment module outputs an identification signal representing the epileptic seizure when the judgment result is greater than the preset threshold value, so as to trigger the treatment device to perform stimulation treatment on the organism.
In a third aspect, an apparatus for automatically detecting epilepsy based on area algorithm in an implantable closed-loop system is provided, which at least includes: a hardware algorithm chip for executing the method and other functional modules; wherein the hardware algorithm chip comprises: the system comprises a serial peripheral interface, a memory, an accumulator and a counter; wherein the content of the first and second substances,
the serial peripheral interface is used for configuring detection parameters and transmitting bioelectric signals; wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
the memory is used for storing bioelectricity signals collected from an organism implanted with the detection chip in real time, and the absolute values of the differences between the amplitudes of the bioelectricity signals and the direct current offset are respectively calculated according to a time sequence according to the counter and then are sent to the accumulator;
after respectively determining the area sum of a current detection window and the area sum of a background window corresponding to the current detection window based on the values in the accumulator, a detection enabling end judges whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value;
and when the judgment result is greater than the preset threshold value, the serial peripheral interface outputs an identification signal representing epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
In a fourth aspect, an electronic device is provided, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform:
configuring detection parameters through an SPI (serial peripheral interface), wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
collecting bioelectric signals from the organism implanted with the detection chip in real time and storing the bioelectric signals into a memory;
calculating the absolute value of the difference between the amplitude of the bioelectricity signal and the DC offset according to the time sequence, and sending the absolute value to an accumulator;
respectively determining the area sum of a current detection window and the area sum of a background window corresponding to the current detection window based on the values in the accumulator;
judging whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value or not;
and when the judgment result is greater than the preset threshold value, outputting an identification signal representing the epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
According to the technical scheme provided by one or more embodiments of the specification, the bioelectric signals can be acquired and detected in real time by adopting a hardware algorithm, and then whether epileptic seizure occurs or not is determined to trigger stimulation treatment through the identification signal according to the comparison of the ratio of the average area of the detection window to the average area of the background window in each detection period and a preset threshold value. Therefore, the integration level and the detection accuracy and convenience are improved by low-power consumption real-time detection.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, reference will now be made briefly to the attached drawings, which are needed in the description of one or more embodiments or prior art, and it should be apparent that the drawings in the description below are only some of the embodiments described in the specification, and that other drawings may be obtained by those skilled in the art without inventive exercise.
Fig. 1 is a schematic diagram illustrating steps of a method for automatically detecting epilepsy based on an area algorithm by an implantable closed-loop system according to an embodiment of the present disclosure.
Fig. 2 is a schematic diagram of a detection period provided in an embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of an apparatus for automatically detecting epilepsy based on an area algorithm for an implantable closed-loop system according to an embodiment of the present disclosure.
Fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Fig. 5 is a schematic structural diagram of an apparatus for automatically detecting epilepsy based on an area algorithm of an implantable closed-loop system according to the present disclosure.
Detailed Description
In order to make the technical solutions in the present specification better understood, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present specification, and it is obvious that the one or more embodiments described are only a part of the embodiments of the present specification, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments described herein without making any inventive step shall fall within the scope of protection of this document.
The embodiment of the specification provides a hardware algorithm for automatically detecting epilepsy by an implantable closed-loop system based on an area algorithm, and belongs to the fields of neuroscience and medical devices. The hardware algorithm can be written by a Verilog hardware language or other realizable hardware languages, whether the bioelectricity signal is abnormal or not can be accurately detected in real time, a Flag warning signal is pulled high when the bioelectricity signal is abnormal, at the moment, the detection enabling signal is 1, the hardware algorithm suspends detection, and the hardware algorithm detects when the detection enabling signal is 0. Specific detection criteria can refer to the following contents, so that signal data in a period (generally set to 30s) before the occurrence time of the abnormal signal and signal data in a period (generally set to 60s) after the occurrence time of the abnormal signal can be transmitted out through the serial peripheral interface SPI protocol, and the data can be stored externally for medical research. In the whole detection process, the sizes of a detection window, a background window, an interval window and a threshold value of the algorithm are adjustable for each round of detection, and the applicability is wide. And the hardware algorithm can be used as an IP core, namely an intellectual property module, and is an IC module which is verified, can be reused and has certain functions. Divided into soft IP core, fixed IP core, and hard IP core. Soft IP is a high-level language that describes the behavior of functional blocks, but does not refer to what circuits and circuit elements are used to implement the behavior, and the embodiments of the present application are soft IP. The algorithm chip is manufactured by a semiconductor process and is used for various nerve therapeutic devices. Compared with a software algorithm operated by the MCU, the power consumption is lower, and the integration level is higher.
Example one
Referring to fig. 1, a schematic diagram of steps of a method for automatically detecting epilepsy based on an area algorithm for an implantable closed-loop system provided in an embodiment of the present disclosure is shown, it should be understood that the method is applied to an epilepsy detection apparatus formed by a chip, and an execution subject of the method may be an integrated circuit of the chip or the epilepsy detection apparatus formed by the chip; the detection method may include the steps of:
step 102: configuring detection parameters through an SPI (serial peripheral interface), wherein the detection parameters at least comprise: the size of the detection window, the size of the interval window and the size of the background window in one detection period.
It should be noted that, referring to fig. 2, each detection scheme may include a plurality of detection periods, and each detection period includes a background window, an interval window, and a detection window. Also, the background window may be located at a previous period of the detection window, and the interval window is located between the background window and the detection window. The first detection cycle shown in FIG. 2 is from t0-t5, where t0-t2 are background windows, t2-t4 are interval windows, and t4-t5 are detection windows; the second detection cycle is from t1-t6, where t1-t3 are background windows, t3-t5 are gap windows, and t5-t6 are detection windows. The subsequent third detection period and the fourth detection period are similar. As can be seen from fig. 2, except for the first detection period, each detection period partially overlaps with the previous detection period, i.e., the bioelectric signal in the current detection period includes a portion of the bioelectric signal in the previous detection period.
Wherein the background window size may be N1 times the detection window size, the spacing window size is N2 times the detection window size; wherein each of N1 and N2 is a positive integer of 2 or more. It should be understood that, in the embodiments of the present specification, the values of N1 and N2 may be equal or different. 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 requirement of the detection in the current round.
Step 104: the bioelectrical signal is collected in real time from the living body in which the detection chip is implanted and stored in the memory.
In the embodiments of the present specification, the bioelectric signal may specifically be an electroencephalogram signal, or a deep brain electrophysiological signal, or a cortical bioelectric signal, or a central nerve signal, etc.
The memory may be a Sraml static random access memory with a capacity of 2kB for storing bioelectric signals.
Step 106: and calculating the absolute value of the difference between the amplitude of the bioelectricity signal and the DC offset according to the time sequence, and sending the absolute value to an accumulator.
Wherein the accumulator may be an accumulator that accumulates the product sum within each detection window. It should be understood that the ratio of the amplitude of the bioelectric signal to the dc offset is substantially the ratio of the area encompassed by the amplitude of the bioelectric signal to the area encompassed by the dc offset.
Step 108: and respectively determining the area sum of the current detection window and the area sum of the background window corresponding to the current detection window based on the values in the accumulator.
Optionally, if the current detection window belongs to the first detection period of the current detection, when the counter counts from 1 to N1, writing the value in the accumulator into a background window register until the end of counting to N1, where the background window register stores the area sum of the background window corresponding to the current detection window; and when the counter counts to N1+ N2+1, writing the value in the accumulator into a detection window register, wherein the detection window register stores the area sum of the current detection window.
Further, prior to counting, the method further comprises: determining a background window, an interval window and a detection window contained in a first detection period by taking the detection window as a basic window unit, wherein the number of the basic window units is N1+ N2+ 1; accordingly, the number of the first and second electrodes,
when the counting value of the counter is not more than N1+ N2+1 and the sampling of the current window is finished, the numerical value of the memory is written into the buffer from a low address to a high address, and the counter is increased by 1; when the counting value of the counter is less than or equal to N1 and the sampling of the current window is finished, the memory sequentially accumulates and writes the counting value into a background window register, and the background window register stores the area sum of the background window in the first detection period; and when the counting value of the counter is equal to N1+ N2+1 and the current sampling window is ended, writing the memory into a detection window register, wherein the detection window register stores the area sum of the detection windows in the first detection period.
Optionally, if the current detection window belongs to a non-first detection period of the current detection, reading a value of a lowest bit from the buffer, and writing the value into a first temporary register for temporary storage;
the buffer is shifted to the left once, the numerical value of the memory is written into an N1+ N2+1 th address, and then the value of an N1+1 th bit in the buffer is read to a second temporary register for temporary storage;
writing the values in the memory into a detection window register so as to conveniently carry out the area and reassignment on the current detection window;
and subtracting the value of the first temporary register from the value of the background window register, and adding the value of the second temporary register to serve as the area and assignment of the current background window to be written into the background window register.
Step 110: and judging whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value or not.
The preset threshold may be a standard value obtained from empirical data signals, and is used to measure whether an organism implanted in the detection chip has an epileptic condition.
Step 112: and when the judgment result is greater than the preset threshold value, outputting an identification signal representing the epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
When the implementation is realized, the identification signal can be a Flag signal, and when the Flag signal is pulled high, the epileptic seizure is indicated, and stimulation treatment can be triggered; otherwise, the epilepsy is not seized, no treatment is carried out, and further detection is continued.
The epilepsy detection scheme referred to in the present specification is described in detail below by way of specific examples. Take electroencephalogram signals as an example.
First, the algorithm signals and hardware units involved in the detection scheme are introduced.
The input ports of the hardware algorithm are: CLK1 port, CLK2 port, nRST port, MOSI port, Data _ ADC port, EN _ detect port; the output port is a MISO port and a Flag port. The communication mode of the whole scheme adopts a Serial Peripheral Interface (SPI). The SPI communication mode is that data are sent on the rising edge, and data are collected on the falling edge. The CLK1 port and the CLK2 port are two master clock ports, respectively, of the same phase. The nRST port is a reset signal port, signal output 0 is reset, and signal output 1 is normal operation. The MOSI port is an SPI communication port, and the signal direction is input into the slave machine from the output of the host machine. The Data _ ADC port is used for transmitting electroencephalogram Data with 16 bit width, and can be connected with the output of the 16-bit ADC in practical application. The EN detect port is a sense enable signal port. The MISO port is an SPI communication port, and the signal direction is input from the host computer to the slave computer. The Flag port is the epileptic seizure warning signal port. Accordingly, each port corresponds to a respective signal output.
Further, defining T as the number of sampling points of the detection window, configured by the SPI port, ranging from 32 to 1024. N1 is a multiple of the size of the background window and the size of the detection window, configured through the SPI port, ranging from 0 to 255. N2 is a multiple of the size of the separation window and the size of the detection window, configured by the SPI port, ranging from 0 to 255. LIM is a predetermined threshold, configured through the SPI port, range 110-. CNT1 is a counter that counts the number of sample points in a detection window. Q is a variable that counts the number of detection windows in the first calculation cycle. Sum1 is an accumulator for accumulating the area Sum within each detection window. Sum _ background is a background window register for accumulating the area Sum within the background window. Sum _ detect is a detection window register for storing the Sum of the areas of the detection windows in each calculation cycle. Sum _ L is a first temporary register for storing the value of the lowest order bit in the buffer. Sum _ N is a second temporary register for storing the value of the N1+1 th bit in the buffer. Sram1 is a static random access memory with a capacity of 2 kB. SramS1 is a buffer, and a dual-port ram is used for storing intermediate operation results in the calculation process. SramS2 is an output buffer, and is a dual-port ram and used for buffering epileptic brain electrical data during output.
The detection scheme in the present specification may generally include the following parts:
1. and (5) configuring algorithm parameters.
2. The brain electrical signals are stored to Sram 1.
3. And solving the difference between the amplitude of the electroencephalogram signal and the DC offset, and taking an absolute value.
4. And (3) detecting whether the epilepsy occurs. Wherein the content of the first and second substances,
(4.1) firstly, the area Sum of the length of each detection window, the area Sum of the background window, the area Sum of the write-in Sum _ background register and the area Sum of the write-in Sum _ detect register are obtained.
And (4.2) calculating the average area of the detection window, calculating the average area of the background window, judging the detection result and giving a Flag signal.
5. The process data for detecting epilepsy is output serially through the communication port.
The specific implementation process can refer to the following contents:
1. data _ ADC [15:0] electroencephalogram Data is written into the Sram1 memory at a frequency of 200 Hz.
Wherein, the input frequency can be flexibly set, and 200Hz is only an example.
2. The absolute value of the difference between the amplitude of the electroencephalogram signal and the DC offset is sequentially added to a Sum1 accumulator. The CNT1[10:0] counter counts the number of accumulations of Sum1 starting from 0, for one cycle, for the length of one detection window.
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 Sum1 value is written to SramS1 from low to high address, while Q is incremented by 1. When Q < ═ N1 and CNT1 ═ T, Sum1 is sequentially written into a Sum _ background register in an accumulated mode, and the Sum _ background register stores the area Sum of the background windows in the first detection period; when Q is N1+ N2+1 and CNT1 is T, Sum1 writes to the Sum _ detect register, i.e., the Sum _ detect register stores the detection window area Sum. According to the formula
Figure RE-GDA0002999116000000101
The Sum of the areas of the detection windows is Sum _ detect, the number of the detection windows is Td, the Sum of the areas of the background windows is defaulted to 1, the Sum of the areas of the background windows is Sum _ background, and the number of the background windows is T. The ratio of the average area of the detection window to the average area of the background window can be obtained, the ratio is compared with a preset threshold LIM, if the ratio is larger than the LIM, the epileptic seizure is indicated, and meanwhile, the Flag signal is pulled high, otherwise, the epileptic seizure is absent. The preset threshold LIM may be 400%, that is, when the ratio is less than or equal to 400%, the Flag signal is not triggered to be pulled high.
5. And after the first detection is finished, entering a second detection period.
At this time, SramS1 stores N1+ N2+1 values, the lower N1 bits of data are Sum1 values of the background window in the first calculation cycle, the next N2 bits of data are Sum1 values of the interval window in the first calculation cycle, and the highest bit is Sum1 value of the detection window. When CNT1 is equal to T, the least significant bit of SramS1 is read out to the first temporary register Sum _ L for temporary storage, SramS1 is shifted to the left once, and Sum1 is written to the N1+ N2+1 th address, and then the data of N1+1 th bit of SramS1 is read out to the second temporary register Sum _ N for temporary storage, and at the same time the Sum1 is also written to the register Sum _ detect. And currently, the Sum of the areas of the background intervals in the first calculation period is stored in the Sum _ background, and then, the Sum _ background-Sum _ L + Sum _ N is assigned to the Sum _ background, namely the Sum of the areas of the background windows in the second calculation period. And (3) obtaining the ratio of the average area of the detection interval of the second calculation period to the average area of the background window according to the formula (1), comparing the ratio with the threshold LIM, and if the ratio is greater than the threshold LIM, indicating the epileptic seizure, and simultaneously pulling up the Flag signal, otherwise, indicating the epileptic seizure.
6. The loop for the third and further detection periods continues according to the logic in 5.
7. When Flag is pulled high every time the epileptic seizure is detected, the EN _ detect end can be pulled high externally, and the detection is suspended and stimulation is carried out.
Meanwhile, in the hardware algorithm, the Sram1 read enable takes effect, and 30s of electroencephalogram data before the moment of epileptic seizure and 60s of electroencephalogram data after the moment of epileptic seizure can be read by controlling the address terminal. Because the reading frequency of the Sram1 is far less than the SPI communication frequency, data output by the Sram1 are written into the SramS2, read out from low level to high level in sequence after the data are written, and are serially output through the MISO port, and can be stored in external Flash after being output, so that the data can be used for follow-up medical research, and the data processing method has great significance for the research of neuroscience.
Therefore, according to the technical scheme, the bioelectricity signals can be acquired and detected in real time by adopting a hardware algorithm, and then whether the epileptic seizure occurs or not is determined to carry out stimulation treatment through triggering of the identification signal according to the comparison of the ratio of the average area of the detection window to the average area of the background window in each detection period and the preset threshold value. Therefore, the integration level and the detection accuracy and convenience are improved by low-power consumption real-time detection.
Example two
Referring to fig. 3, an apparatus 300 for automatically detecting epilepsy based on area algorithm for an implantable closed-loop system provided in an embodiment of the present disclosure is mainly disclosed, where the apparatus 300 mainly includes:
a configuration module 302, configured with detection parameters through the SPI serial peripheral interface, where the detection parameters at least include: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
the acquisition and storage module 304 is used for acquiring bioelectricity signals from the organism implanted with the detection chip in real time and storing the bioelectricity signals into a memory;
the calculating module 306 is used for calculating the absolute value of the difference between the amplitude of the bioelectricity signal and the DC offset according to time sequence and sending the absolute value to the accumulator;
a determining module 308, configured to determine, based on the values in the accumulator, the sum of the areas of the current detection window and the sum of the areas of the background window corresponding to the current detection window, respectively;
the detection module 310 is configured to determine whether a ratio of the average area of the current detection window to the average area of the background window is greater than a preset threshold;
and the treatment module 312 outputs an identification signal indicating the epileptic seizure when the judgment result is greater than the threshold value, so as to trigger the treatment device to perform stimulation treatment on the living body.
Optionally, as an embodiment, the background window size is N1 times the detection window size, and the interval window size is N2 times the detection window size; wherein each of N1 and N2 is a positive integer of 2 or more.
In a specific implementation manner of the embodiment of this specification, the determining module 308 is specifically configured to:
when the counter counts from 1 to N1, writing the value in the accumulator into a background window register until the counting is finished to N1, wherein the background window register stores the area sum of a background window corresponding to the current detection window;
and when the counter counts to N1+ N2+1, writing the value in the accumulator into a detection window register, wherein the detection window register stores the area sum of the current detection window.
In another specific implementation manner of the embodiment of the present specification, before counting, the determining module 308 is further configured to:
determining the number of basic window units N1+ N2+1 in a background window, an interval window and a detection window contained in a first detection period by taking the detection window as a basic window unit; accordingly, the number of the first and second electrodes,
when the counting value of the counter is not more than N1+ N2+1 and the sampling of the current window is finished, the numerical value of the memory is written into the buffer from a low address to a high address, and the counter is increased by 1;
when the counting value of the counter is less than or equal to N1 and the sampling of the current window is finished, the memory sequentially accumulates and writes the counting value into a background window register, and the background window register stores the area sum of the background window in the first detection period;
and when the counting value of the counter is equal to N1+ N2+1 and the current sampling window is ended, writing the memory into a detection window register, wherein the detection window register stores the area sum of the detection windows in the first detection period.
In another specific implementation manner of the embodiment of this specification, if the current detection window belongs to a non-first detection period of the current detection, the determining module is specifically configured to:
reading the value of the lowest order from the buffer, and writing the value into a first temporary register for temporary storage;
the buffer is shifted to the left once, the numerical value of the memory is written into an N1+ N2+1 th address, and then the value of an N1+1 th bit in the buffer is read to a second temporary register for temporary storage;
writing the values in the memory into a detection window register so as to conveniently carry out the area and reassignment on the current detection window;
and subtracting the value of the first temporary register from the value of the background window register, and adding the value of the second temporary register to serve as the area and assignment of the current background window to be written into the background window register.
In a further specific implementation manner of the embodiments of the present specification, when the living body is treated by stimulation, the apparatus further includes an output module, configured to acquire the bioelectric signal of a first period before the moment of the epileptic seizure and the bioelectric signal of a second period after the moment of the epileptic seizure, and serially output the bioelectric signals through the SPI.
Through the technical scheme, the bioelectricity signals can be acquired and detected in real time by adopting a hardware algorithm, and then whether the epileptic seizure occurs or not is determined to carry out stimulation treatment through triggering of the identification signal according to the comparison of the ratio of the average area of the detection window to the average area of the background window in each detection period and a preset threshold value. Therefore, the integration level and the detection accuracy and convenience are improved by low-power consumption real-time detection.
EXAMPLE III
Referring to fig. 5, a schematic structural diagram of an apparatus for automatically detecting epilepsy based on an area algorithm for an implantable closed-loop system provided in an embodiment of the present disclosure includes at least: a hardware algorithm chip and other functional modules for executing the method in the first embodiment; wherein the hardware algorithm chip comprises: the system comprises a serial peripheral interface, a memory, an algorithm register, an accumulator and a counter; wherein the content of the first and second substances,
the serial peripheral interface is used for configuring detection parameters and transmitting bioelectric signals; wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
the memories are respectively used for storing bioelectricity signals collected from an organism implanted into the detection chip in real time, and the bioelectricity signals are sent to the accumulator after absolute values of differences between amplitudes of the bioelectricity signals and direct current offsets are respectively calculated according to a counter in sequence;
after respectively determining the area sum of a current detection window and the area sum of a background window corresponding to the current detection window based on the values in the accumulator, a detection enabling end judges whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value;
and when the judgment result is greater than the preset threshold value, the serial peripheral interface outputs an identification signal representing epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
Other hardware unit parts can refer to the contents of the first embodiment, and are not described herein.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring to fig. 4, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the device for automatically detecting the epilepsy on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
configuring detection parameters through an SPI (serial peripheral interface), wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
collecting bioelectric signals from the organism implanted with the detection chip in real time and storing the bioelectric signals into a memory;
calculating the absolute value of the difference between the amplitude of the bioelectricity signal and the DC offset according to the time sequence, and sending the absolute value to an accumulator;
respectively determining the area sum of a current detection window and the area sum of a background window corresponding to the current detection window based on the values in the accumulator;
judging whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value or not;
and when the judgment result is greater than the preset threshold value, outputting an identification signal representing the epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
The method performed by the apparatus according to the embodiment shown in fig. 1 of the present specification may be implemented in or by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The methods, steps, and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may also execute the method of fig. 1 and implement the functions of the corresponding apparatus in the embodiment shown in fig. 1, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Through the technical scheme, the bioelectricity signals can be acquired and detected in real time by adopting a hardware algorithm, and then whether the epileptic seizure occurs or not is determined to carry out stimulation treatment through triggering of the identification signal according to the comparison of the ratio of the average area of the detection window to the average area of the background window in each detection period and a preset threshold value. Therefore, the integration level and the detection accuracy and convenience are improved by low-power consumption real-time detection.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.
The system, apparatus, module or unit illustrated in one or more of the above embodiments may be implemented by a computer chip or an entity, or by an article of manufacture with a certain functionality. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 Discs (DVD) or other optical storage, magnetic cassettes, 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, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

Claims (10)

1. A method for automatically detecting epilepsy based on an area algorithm by an implantable closed loop system is applied to an epilepsy detection device composed of a chip, and the method comprises the following steps:
configuring detection parameters through an SPI (serial peripheral interface), wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
collecting bioelectric signals from the organism implanted with the detection chip in real time and storing the bioelectric signals into a memory;
calculating the absolute value of the ratio of the amplitude of the bioelectricity signal to the direct current bias according to the time sequence, and sending the absolute value to an accumulator;
respectively determining the area sum of a current detection window and the area sum of a background window corresponding to the current detection window based on the values in the accumulator;
judging whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value or not;
and when the judgment result is greater than the preset threshold value, outputting an identification signal representing the epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
2. The implantable closed-loop system, area-algorithm-based method for automatically detecting epilepsy as in claim 1, wherein the background window size is N1 times the detection window size, and the interval window size is N2 times the detection window size; wherein each of N1 and N2 is a positive integer of 2 or more.
3. The method according to claim 2, wherein if the current detection window belongs to a first detection period of the current detection, respectively determining the sum of the areas of the current detection window and the sum of the areas of the background windows corresponding to the current detection window based on the value in the accumulator, specifically comprises:
when the counter counts from 1 to N1, writing the value in the accumulator into a background window register until the counting is finished to N1, wherein the background window register stores the area sum of a background window corresponding to the current detection window;
and when the counter counts to N1+ N2+1, writing the value in the accumulator into a detection window register, wherein the detection window register stores the area sum of the current detection window.
4. The implantable closed-loop system of claim 3, wherein prior to counting, the method for automatically detecting epilepsy based on area algorithms further comprises:
determining a background window, an interval window and a detection window contained in a first detection period by taking the detection window as a basic window unit, wherein the number of the basic window units is N1+ N2+ 1; accordingly, the number of the first and second electrodes,
when the counting value of the counter is not more than N1+ N2+1 and the sampling of the current window is finished, the numerical value of the memory is written into the buffer from a low address to a high address, and the counter is increased by 1;
when the counting value of the counter is less than or equal to N1 and the sampling of the current window is finished, the memory sequentially accumulates and writes the counting value into a background window register, and the background window register stores the area sum of the background window in the first detection period;
and when the counting value of the counter is equal to N1+ N2+1 and the current sampling window is ended, writing the memory into a detection window register, wherein the detection window register stores the area sum of the detection windows in the first detection period.
5. The method according to claim 4, wherein if the current detection window belongs to a non-first detection period of the current detection, respectively determining the sum of the areas of the current detection window and the sum of the areas of the background windows corresponding to the current detection window based on the value in the accumulator, specifically comprises:
reading the value of the lowest order from the buffer, and writing the value into a first temporary register for temporary storage;
the buffer is shifted to the left once, the numerical value of the memory is written into an N1+ N2+1 th address, and then the value of an N1+1 th bit in the buffer is read to a second temporary register for temporary storage;
writing the values in the memory into a detection window register so as to conveniently carry out the area and reassignment on the current detection window;
and subtracting the value of the first temporary register from the value of the background window register, and adding the value of the second temporary register to serve as the area and assignment of the current background window to be written into the background window register.
6. The implantable closed-loop system of claim 1, a method for automatically detecting epilepsy based on an area algorithm, wherein when the organism is treated by stimulation, the method further comprises:
and acquiring the bioelectrical signal of a first time interval before the moment of the epileptic seizure and the bioelectrical signal of a second time interval after the moment of the epileptic seizure, and serially outputting the bioelectrical signals through the SPI.
7. An apparatus for automatically detecting epilepsy based on area algorithm for an implantable closed loop system, comprising:
the configuration module is used for configuring detection parameters through the SPI serial peripheral interface, wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
the acquisition and storage module is used for acquiring a bioelectricity signal from an organism implanted with the detection chip in real time and storing the bioelectricity signal into a memory;
the calculation module calculates the absolute value of the difference between the amplitude of the bioelectricity signal and the direct current bias according to time sequence and sends the absolute value to the accumulator;
the determining module is used for respectively determining the area sum of the current detection window and the area sum of the background window corresponding to the current detection window based on the values in the accumulator;
the detection module is used for judging whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value or not;
and the treatment module outputs an identification signal representing the epileptic seizure when the judgment result is greater than the preset threshold value, so as to trigger the treatment device to perform stimulation treatment on the organism.
8. An apparatus for automatically detecting epilepsy based on area algorithm for implantable closed loop system, comprising at least: a hardware algorithm chip for performing the method of any one of claims 1 to 6 and other functional modules; wherein the hardware algorithm chip comprises: the system comprises a serial peripheral interface, a memory, an accumulator and a counter; wherein the content of the first and second substances,
the serial peripheral interface is used for configuring detection parameters and transmitting bioelectric signals; wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
the memory is used for storing bioelectricity signals collected from an organism implanted with the detection chip in real time, and the absolute values of the differences between the amplitudes of the bioelectricity signals and the direct current offset are respectively calculated according to a time sequence according to the counter and then are sent to the accumulator;
after respectively determining the area sum of a current detection window and the area sum of a background window corresponding to the current detection window based on the values in the accumulator, a detection enabling end judges whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value;
and when the judgment result is greater than the preset threshold value, the serial peripheral interface outputs an identification signal representing epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
9. The implantable closed-loop system apparatus for automatically detecting epilepsy based on area algorithm as claimed in claim 8, wherein said SPI is further configured to obtain and serially output the bioelectrical signal of the first period before the moment of the epileptic seizure and the bioelectrical signal of the second period after the moment of the epileptic seizure when said living being is treated by stimulation.
10. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform:
configuring detection parameters through an SPI (serial peripheral interface), wherein the detection parameters at least comprise: detecting the size of a window, the size of an interval window and the size of a background window in a detection period;
collecting bioelectric signals from the organism implanted with the detection chip in real time and storing the bioelectric signals into a memory;
calculating the absolute value of the difference between the amplitude of the bioelectricity signal and the DC offset according to the time sequence, and sending the absolute value to an accumulator;
respectively determining the area sum of a current detection window and the area sum of a background window corresponding to the current detection window based on the values in the accumulator;
judging whether the ratio of the average area of the current detection window to the average area of the background window is larger than a preset threshold value or not;
and when the judgment result is greater than the preset threshold value, outputting an identification signal representing the epileptic seizure so as to trigger the treatment device to perform stimulation treatment on the organism.
CN202110170231.7A 2021-02-05 2021-02-05 Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system Pending CN112972891A (en)

Priority Applications (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
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

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN112972891A true CN112972891A (en) 2021-06-18

Family

ID=76349206

Family Applications (1)

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

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022166683A1 (en) * 2021-02-05 2022-08-11 杭州诺为医疗技术有限公司 Method and device for automatically detecting epileptic seizure by implantable closed-loop system on basis of area algorithm

Citations (2)

* 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

Family Cites Families (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

Patent Citations (2)

* 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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022166683A1 (en) * 2021-02-05 2022-08-11 杭州诺为医疗技术有限公司 Method and device for automatically detecting epileptic seizure by implantable closed-loop system on basis of area algorithm

Also Published As

Publication number Publication date
WO2022166683A1 (en) 2022-08-11

Similar Documents

Publication Publication Date Title
US20180020953A1 (en) Method and device for identifying human movement state
CN104197952B (en) A kind of user&#39;s walking step-recording method, device and mobile terminal
JP2021506421A (en) Atrial fibrillation signal identification method, devices and equipment
US9746833B2 (en) Electronic device and smart method for controlling alarm
CN106618560B (en) Method and device for processing brain wave signals
WO2022021707A1 (en) Sleep monitoring method and apparatus, and smart wearable device and readable storage medium
CN112972891A (en) Method and device for automatically detecting epilepsy based on area algorithm for implanted closed-loop system
CN112972892A (en) Method and device for automatically detecting epilepsy based on line length algorithm for implanted closed-loop system
CN108937866A (en) Dormant monitoring method and device
CN108139998A (en) Resistance to electricity fast transient input/output(I/O)Communication system
WO2019055919A1 (en) Heart rate measurement for fitness exercises using video
CN109431467A (en) Atrial fibrillation method for detecting, device and wearable device and computer equipment
CN106772165A (en) The determination method and device of amide proton transfer effect
Imtiaz et al. A low power system with EEG data reduction for long-term epileptic seizures monitoring
CN106821336A (en) Sleep monitor method and system
WO2023142380A1 (en) On-vehicle human body information obtaining method and apparatus, and vehicle
CN105115592B (en) Cranial cavity method for detecting vibration and device
US9268845B1 (en) Audio matching using time alignment, frequency alignment, and interest point overlap to filter false positives
CN110236532A (en) Processing of bioelectric signals method, apparatus, computer equipment and storage medium
CN110151182B (en) Apnea type identification method and device
CN112774036A (en) Multi-channel electric signal processing method and device for implanted closed-loop system
US11707208B2 (en) Method and system for tremor assessment using photoplethysmography (PPG)
Aktaruzzaman et al. Parametric estimation of sample entropy for physical activity recognition
CN109345258B (en) Safe payment method and device and intelligent wearable device
CN111006683A (en) Step counting device and step counting method thereof, controller and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination