Movatterモバイル変換


[0]ホーム

URL:


WO2022166682A1 - Method and device for automatically detecting epilepsy by implantable closed-loop system based on line length algorithm - Google Patents

Method and device for automatically detecting epilepsy by implantable closed-loop system based on line length algorithm
Download PDF

Info

Publication number
WO2022166682A1
WO2022166682A1PCT/CN2022/073767CN2022073767WWO2022166682A1WO 2022166682 A1WO2022166682 A1WO 2022166682A1CN 2022073767 WCN2022073767 WCN 2022073767WWO 2022166682 A1WO2022166682 A1WO 2022166682A1
Authority
WO
WIPO (PCT)
Prior art keywords
window
detection
line length
register
algorithm
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.)
Ceased
Application number
PCT/CN2022/073767
Other languages
French (fr)
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 LtdfiledCriticalHangzhou Nuowei Medical Technology Co Ltd
Publication of WO2022166682A1publicationCriticalpatent/WO2022166682A1/en
Anticipated expirationlegal-statusCritical
Ceasedlegal-statusCriticalCurrent

Links

Images

Classifications

Definitions

Landscapes

Abstract

Disclosed in one or more embodiments of the present description are a method and device for automatically detecting epilepsy by an implantable closed-loop system based on a line length algorithm. The method comprises: using a hardware algorithm to collect and detect bioelectrical signals in real time, and then comparing the ratio of an average line length of a detection window to an average line length of a background window within each detection period and a preset threshold to determine whether a seizure occurs, so as to send an identification signal to trigger stimulation treatment. Therefore, real-time detection at low power consumption is realized, and integration level and detection accuracy and convenience are improved.

Description

Translated fromChinese
植入式闭环系统基于线长算法自动检测癫痫的方法和装置Method and device for automatic detection of epilepsy in implantable closed-loop system based on wire length algorithm技术领域technical field

本文件涉及医疗器件技术领域,尤其涉及一种植入式闭环系统基于线长算法自动检测癫痫的方法和装置。This document relates to the technical field of medical devices, in particular to a method and device for an implantable closed-loop system to automatically detect epilepsy based on a wire-length 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 a wire length algorithm, and to flexibly configure an integrated implantable device with a hardware algorithm to perform low-power real-time detection of epilepsy , improve the 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 a line length 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 memory and algorithm registers;

按照时序先后分别计算所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitudes of adjacent bioelectrical signals in the algorithm register respectively according to the time sequence, and send it to the accumulator;

基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和;Based on the value in the accumulator, the line length sum of the current detection window and the line length sum of the background window corresponding to the current detection window are determined respectively;

判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈 值;Judging whether the ratio of the average line length of the current detection window to the average line length 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 a wire length 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 and algorithm registers;

计算模块,按照时序先后分别计算所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器;The calculation module calculates the absolute value of the difference between the amplitudes of adjacent bioelectrical signals in the algorithm register according to the time sequence, and sends it into the accumulator;

确定模块,基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和;A determination module, based on the value in the accumulator, respectively determines the line length sum of the current detection window, and the line length sum of the background window corresponding to the current detection window;

检测模块,判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;A detection module, for judging whether the ratio of the average line length of the current detection window to the average line length 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 a line length algorithm is proposed, which at least includes: a hardware algorithm chip and other functional modules for executing the above method; wherein, the hardware algorithm chip includes: a serial peripheral interface, memory, arithmetic registers, accumulators, counters; of which,

所述串行外设接口用于配置检测参数,并传输生物电信号;其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;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 and the algorithm register are respectively used to store bioelectric signals collected in real time from the organism implanted in the detection chip, and the difference between the amplitudes of adjacent bioelectric signals in the algorithm register is calculated in sequence according to the counter. After the absolute value of , it is sent to the accumulator;

在基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和之后,检测使能端判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;After determining the line length sum of the current detection window and the line length sum of the background window corresponding to the current detection window based on the value in the accumulator, the detection enable terminal determines the average line of the current detection window Whether the ratio of the length to the average line length 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 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 memory and algorithm registers;

按照时序先后分别计算所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitudes of adjacent bioelectrical signals in the algorithm register respectively according to the time sequence, and send it to the accumulator;

基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和;Based on the value in the accumulator, the line length sum of the current detection window and the line length sum of the background window corresponding to the current detection window are determined respectively;

判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;Determine whether the ratio of the average line length of the current detection window to the average line length 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 line length of the detection window in each detection period and the background window. The ratio between the average line lengths and the preset threshold is compared to determine whether epilepsy is triggered by the identification signal to perform stimulation therapy. 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 a wire-length 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 a wire length 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是本说明书的一种植入式闭环系统基于线长算法自动检测癫痫的装置结构示意 图。Figure 5 is a schematic structural diagram of a device for automatically detecting epilepsy based on a line length 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 a line-length 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. Moreover, 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所示,为本说明书实施例提供的一种植入式闭环系统基于线长算法自动检测癫痫的方法步骤示意图,应理解,该方法应用在由芯片构成的癫痫检测装置上,且其执行主体可以是芯片的集成电路,也可以是由该芯片构成的癫痫检测装置;所述检测方法可以包括以下步骤:1 is a schematic diagram of the method steps of an implantable closed-loop system for automatically detecting epilepsy based on a line length algorithm provided in 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 The main body may be an integrated circuit of a chip, or an epilepsy detection device composed of the chip; the detection method may 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 memory and algorithm registers.

在本说明书实施例中,所述生物电信号具体可以是脑电信号,或脑深部电生理信号,或脑皮层生物电信号,或中枢神经信号等。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.

所述存储器可以是容量为40kB的Sraml存储器。The memory may be a Sraml memory with a capacity of 40kB.

步骤106:按照时序先后分别计算所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器。Step 106: Calculate the absolute value of the difference between the amplitudes of adjacent bioelectrical signals in the algorithm register according to the time sequence, and send it to the accumulator.

其中,所述累加器可以是累加每个检测窗口内线长和的累加器。应理解,这里所述生物电信号的幅值与直流偏置之比,实质上是生物电信号的幅值所包罗面积与直流偏置所包罗面积之比。Wherein, the accumulator may be an accumulator that accumulates the sum of line lengths 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 line length sum of the current detection window and the line length 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 line length 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 The sum of the line lengths of the detection window.

进一步,在计数之前,所述方法还包括:以检测窗口为基本窗口单元,确定第一个检测周期所包含的背景窗口、间隔窗口以及检测窗口中,基本窗口单元的数量N1+N2+1;相应地,Further, before counting, the method further includes: taking the detection window as the basic window unit, determining the number N1+N2+1 of the basic window unit in the background window, the interval window and the detection window included in the first detection period; 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 to the background window register, and the background window register stores the line length 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 When , the memory writes the detection window register, and the detection window register stores the line length 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 line length and reassignment of 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 line length and assignment of the current background window.

步骤110:判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值。Step 110: Determine whether the ratio of the average line length of the current detection window to the average line length 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端口配置,范围0-511。N1是背景窗 口的大小与检测窗口大小的倍数,通过SPI端口配置,范围0-255。N2是间隔窗口的大小与检测窗口大小的倍数,通过SPI端口配置,范围0-255。LIM是预设阈值,通过SPI端口配置,范围110-180。Data_H1是存储脑电信号的算法寄存器,主要用于存储前一下降沿的脑电信号。Data_H0是存储脑电信号的算法寄存器,主要用于存储后一下降沿的脑电信号。CNT1是计数检测窗口中采样点数的计数器。Q是计数第一个计算周期内检测窗口数量的变量。Sum1是累加器,用于累加每个检测窗口内线长和。Sum_background是背景窗口寄存器,用于累加背景窗口内线长和。Sum_detect是检测窗口寄存器,用于存储每个计算周期内检测窗口的线长和。Sum_L是第一临时寄存器,用于存储缓存器中最低位的取值。Sum_N是第二临时寄存器,用于存储缓存器中第N1+1位的取值。Sram1是容量为40kB的存储器。Fifo1是缓存器,双端口ram,用于计算过程中中间运算结果的存储。Sram_fifo是输出缓存器,用于癫痫脑电数据输出时的缓冲。Further, define T as the number of sampling points in the detection window, configured through the SPI port, ranging from 0 to 511. 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. Data_H1 is an algorithm register for storing EEG signals, mainly used to store the EEG signals of the previous falling edge. Data_H0 is an algorithm register for storing EEG signals, mainly used to store EEG signals of the next falling edge. CNT1 is a counter that counts the number of sampling points in the 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 sum of line lengths within each detection window. Sum_background is the background window register, which is used to accumulate the sum of the line lengths in the background window. Sum_detect is the detection window register, which is used to store the sum of the line lengths 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 memory with a capacity of 40kB. Fifo1 is a buffer, dual-port ram, used for storage of intermediate operation results in the calculation process. Sram_fifo is an output buffer, which is 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 in Sram1 and the algorithm register group.

3、求相邻脑电信号幅值的差值,并取绝对值。3. Find the difference between adjacent EEG signal amplitudes 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 find the line length sum of each detection window length, write the line length sum of the background window into the Sum_background register, and write the line length sum of the detection window into the Sum_detect register.

(4.2)求检测窗口的平均线长,求背景窗口的平均线长,判断检测结果并给出Flag信号。(4.2) Find the average line length of the detection window, find the average line length 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存储器和寄存器组Data_H1[15:0],在下一个时钟的下降沿时Data_H1[15:0]中数据写入Data_H0[15:0]。1. Data_ADC[15:0] EEG data is written to Sram1 memory and register group Data_H1[15:0] at the same time at 200Hz frequency, and the data in Data_H1[15:0] is written to Data_H0[15:] at the falling edge of the next clock 0].

其中,输入频率可以灵活设置,这里的200Hz仅是举例。Among them, the input frequency can be set flexibly, and the 200Hz here is just an example.

2、Data_H1[15:0]寄存器中的数值(脑电信号的幅值)减去Data_H0[15:0]寄存器中的数值(脑电信号的幅值),求差值的绝对值,其绝对值依次累加入Sum1累加器。换言之,前一个脑电信号的幅值与相邻后一个脑电信号的幅值之差,取绝对值作为输入累加写入累加器。CNT1[10:0]计数器从0开始计数Sum1的累加次数,以一个检测窗口的长度为一个循环。2. The value in the Data_H1[15:0] register (the amplitude of the EEG signal) is subtracted from the value in the Data_H0[15:0] register (the amplitude of the EEG signal), and the absolute value of the difference is calculated. The values are sequentially added to the Sum1 accumulator. In other words, the difference between the amplitude value of the previous EEG signal and the amplitude value of the next adjacent EEG signal is taken as the input and accumulated and written into the accumulator. 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数值由低地址到高地址写入Fifo1,同时Q加1。当Q<=N1且CNT1=T时,Sum1依次累加写入Sum_background寄存器,则Sum_background寄存器存储了第一个检测周期内背景窗口的线长和;当Q=N1+N2+1且CNT1=T时,Sum1写入Sum_detect寄存器,即Sum_detect寄存器存储了检测窗口线长和。根据检测窗口的平均线长与背景窗口的平均线长的比值,该比值与预设阈值LIM比较,若大于LIM,则说明癫痫发作,同时Flag信号拉高,反之,癫痫未发作。其中,所述预设阈值LIM可以是400%,即当比值小于等于400%均不触发Flag信号拉高。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 Fifo1 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, then the Sum_background register stores the line length sum of the background window in the first detection period; when Q=N1+N2+1 and CNT1=T , Sum1 writes the Sum_detect register, that is, the Sum_detect register stores the detection window line length and sum. According to the ratio of the average line length of the detection window to the average line length of the background window, the ratio is compared with the preset threshold LIM. If it is greater than LIM, it means epileptic seizure, and the Flag signal is pulled high, 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.

此时,Fifo1中存储了N1+N2+1个数值,低N1位的数据是第一个计算周期内背景窗口的Sum1值,接下来的N2位的数据是第一个计算周期内间隔窗口的Sum1值,最高位是检测窗口的Sum1值。当CNT1=T时,先将fifo1中最低位的数据读出到第一临时寄存器Sum_L暂存,然后Fifo1向左移位一次,并向第N1+N2+1个地址写入Sum1数值,再读取Fifo1中第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 Fifo1, 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-order data in fifo1 to the first temporary register Sum_L for temporary storage, then shift Fifo1 to the left once, and write the value of Sum1 to the N1+N2+1th address, and then read Take the data of the N1+1th bit in Fifo1 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 line length 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 line length sum of the second calculation cycle. According to formula (1) again, the ratio of the average line length of the detection interval of the second calculation period to the average line length of the background window can be obtained, which is also compared with the threshold LIM. If it is greater than LIM, it means epileptic seizure, and the Flag signal is pulled high. , Conversely, epilepsy did not occur.

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输出后的数据写入缓存Sram_fifo,数据写入完成后再依次从低位到高位读出,通过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 Sram_fifo, and after the data is written, it is read out from low to high in sequence, and serially output through the MISO port, which can be stored in external Flash after output. , 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 ratio between the average line length of the detection window and the average line length of the background window in each detection period and the preset threshold By comparison, it is determined whether the epileptic seizures are triggered by the identification signal for stimulation treatment. 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 a line-length algorithm provided by an embodiment of the present specification mainly includes:

配置模块302,通过SPI串行外设接口配置检测参数,其中,所述检测参数至少包含:一个检测周期内检测窗口大小、间隔窗口大小以及背景窗口大小;Theconfiguration 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 andstorage module 304 collects bioelectrical signals in real time from the organism implanted in the detection chip, and stores them in the memory and the algorithm register;

计算模块306,按照时序先后分别计算所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器;Thecalculation module 306 calculates the absolute value of the difference between the amplitudes of adjacent bioelectrical signals in the algorithm register respectively according to the time sequence, and sends it to the accumulator;

确定模块308,基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和;Thedetermination module 308, based on the value in the accumulator, respectively determines the line length sum of the current detection window, and the line length sum of the background window corresponding to the current detection window;

检测模块310,判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;Thedetection module 310 determines whether the ratio of the average line length of the current detection window to the average line length of the background window is greater than a preset threshold;

治疗模块312,在判断结果为大于时,输出表示癫痫发作的标识信号,以触发治疗装置对生物体进行刺激治疗。Thetreatment 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 determiningmodule 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 line length 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 line length sum of the current detection window.

在本说明书实施例的再一种具体实现方式中,在计数之前,所述所述确定模块308,还用于:In yet another specific implementation of the embodiment of this specification, before counting, the determiningmodule 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 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 line length 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, and the detection window register stores the line length 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 a non-first detection period of the current round of detection, the determining module is specifically used to:

从所述缓存器中读取最低位的取值,并写入第一临时寄存器进行暂存;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 line length and reassignment of 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 line length 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, it further includes an output module for acquiring the bioelectric 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. Determining whether epileptic seizures are triggered by identifying signals triggers 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 a device for an implantable closed-loop system for automatically detecting epilepsy based on a line-length 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 memory and the algorithm register are respectively used to store bioelectric signals collected in real time from the organism implanted in the detection chip, and the difference between the amplitudes of adjacent bioelectric signals in the algorithm register is calculated according to the counter according to the time sequence. After the absolute value of , it is sent to the accumulator;

在基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗 口对应的背景窗口的线长和之后,检测使能端判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;After determining the line length sum of the current detection window and the line length sum of the background window corresponding to the current detection window based on the value in the accumulator, the detection enable terminal determines the average line of the current detection window Whether the ratio of the length to the average line length 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.

其它硬件单元部分可参照实施例一的内容,在此不作赘述。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), or 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) 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 memory and algorithm registers;

按照时序先后分别计算所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitudes of adjacent bioelectrical signals in the algorithm register respectively according to the time sequence, and send it to the accumulator;

基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和;Based on the value in the accumulator, the line length sum of the current detection window and the line length sum of the background window corresponding to the current detection window are determined respectively;

判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;Determine whether the ratio of the average line length of the current detection window to the average line length 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 a hardware integrated logic circuit in a processor or an instruction 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 module 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 line length of the detection window and the average line length of the background window in each detection period and the preset threshold, Determining whether epileptic seizures are triggered by identifying signals triggers 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 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, 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)

Translated fromChinese
一种植入式闭环系统基于线长算法自动检测癫痫的方法,其特征在于,应用在由芯片构成的癫痫检测装置上,所述方法包括:A method for automatically detecting epilepsy in an implantable closed-loop system based on a line-length 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 memory and algorithm registers;按照时序先后分别计算记录在所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitudes of adjacent bioelectrical signals recorded in the algorithm register respectively according to the time sequence, and send it to the accumulator;基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和;Based on the value in the accumulator, the line length sum of the current detection window and the line length sum of the background window corresponding to the current detection window are determined respectively;判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;Determine whether the ratio of the average line length of the current detection window to the average line length 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所述的植入式闭环系统基于线长算法自动检测癫痫的方法,其特征在于,所述背景窗口大小是所述检测窗口大小的N1倍,所述间隔窗口大小是所述检测窗口大小的N2倍;其中,所述N1和所述N2均为大于等于2的正整数。The method for automatically detecting epilepsy by an implantable closed-loop system based on a line length 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 window size; wherein, both the N1 and the N2 are positive integers greater than or equal to 2.如权利要求2所述的植入式闭环系统基于线长算法自动检测癫痫的方法,其特征在于,如果当前检测窗口属于本轮检测的第一个检测周期,则基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和,具体包括:The method for automatically detecting epilepsy in an implantable closed-loop system based on a line-length 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 obtained in the accumulator value, respectively determine the line length sum of the current detection window, and the line length 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 line length 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 line length sum of the current detection window.如权利要求3所述的植入式闭环系统基于线长算法自动检测癫痫的方法,其特征在于,在计数之前,所述方法还包括:The method for automatically detecting epilepsy by an implantable closed-loop system based on a line length algorithm according to claim 3, wherein, before counting, the method further comprises:以检测窗口为基本窗口单元,确定第一个检测周期所包含的背景窗口、间隔窗口以及检测窗口中,基本窗口单元的数量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 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 line length 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, and the detection window register stores the line length sum of the detection window in the first detection cycle.如权利要求4所述的植入式闭环系统基于线长算法自动检测癫痫的方法,其特征在于,如果当前检测窗口属于本轮检测的非第一个检测周期,则基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和,具体包括:The method for automatically detecting epilepsy in an implantable closed-loop system based on a line-length 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, respectively determine the line length sum of the current detection window, and the line length 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 line length and reassignment of 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 line length and assignment of the current background window.如权利要求1所述的植入式闭环系统基于线长算法自动检测癫痫的方法,其特征在于,在所述生物体被刺激治疗时,所述方法还包括:The method for automatically detecting epilepsy by an implantable closed-loop system based on a line length 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.一种植入式闭环系统基于线长算法自动检测癫痫的装置,其特征在于,包括:A device for automatically detecting epilepsy in an implantable closed-loop system based on a line length 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 and algorithm registers;计算模块,按照时序先后分别计算所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器;The calculation module calculates the absolute value of the difference between the amplitudes of adjacent bioelectrical signals in the algorithm register according to the time sequence, and sends it into the accumulator;确定模块,基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和;A determination module, based on the value in the accumulator, respectively determines the line length sum of the current detection window, and the line length sum of the background window corresponding to the current detection window;检测模块,判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;A detection module, for judging whether the ratio of the average line length of the current detection window to the average line length 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.一种植入式闭环系统基于线长算法自动检测癫痫的装置,其特征在于,至少包括:执行上述权利要求1-6任一项所述方法的硬件算法芯片以及其它功能模块;其中,所述硬件算法芯片包含:串行外设接口,存储器,算法寄存器,累加器,计数器;其中,A device for automatically detecting epilepsy in an implantable closed-loop system based on a line length 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 The algorithm chip includes: serial peripheral interface, memory, algorithm register, 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 and the algorithm register are respectively used to store bioelectric signals collected in real time from the organism implanted in the detection chip, and the difference between the amplitudes of adjacent bioelectric signals in the algorithm register is calculated in sequence according to the counter. After the absolute value of , it is sent to the accumulator;在基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和之后,检测使能端判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;After determining the line length sum of the current detection window and the line length sum of the background window corresponding to the current detection window based on the value in the accumulator, the detection enable terminal determines the average line of the current detection window Whether the ratio of the length to the average line length 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.如权利要求8所述的植入式闭环系统基于线长算法自动检测癫痫的装置,其特征在于,在所述生物体被刺激治疗时,所述SPI还用于获取癫痫发作时刻前第一时段的生物电信号以及癫痫发作时刻后第二时段的生物电信号,并串行输出。The device for automatically detecting epilepsy by an implantable closed-loop system based on a line length algorithm according to claim 8, wherein when the organism is stimulated for treatment, the SPI is further used to obtain the first period before the moment of the epileptic seizure The bioelectrical signal and the bioelectrical signal of the second period after the epileptic seizure are outputted serially.一种电子设备,包括: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 memory and algorithm registers;按照时序先后分别计算所述算法寄存器中相邻生物电信号的幅值之差的绝对值,并送入累加器;Calculate the absolute value of the difference between the amplitudes of adjacent bioelectrical signals in the algorithm register respectively according to the time sequence, and send it to the accumulator;基于所述累加器中的取值,分别确定当前检测窗口的线长和,以及所述当前检测窗口对应的背景窗口的线长和;Based on the value in the accumulator, the line length sum of the current detection window and the line length sum of the background window corresponding to the current detection window are determined respectively;判断所述当前检测窗口的平均线长与所述背景窗口的平均线长的比值是否大于预设阈值;Determine whether the ratio of the average line length of the current detection window to the average line length 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/0737672021-02-052022-01-25Method and device for automatically detecting epilepsy by implantable closed-loop system based on line length algorithmCeasedWO2022166682A1 (en)

Applications Claiming Priority (2)

Application NumberPriority DateFiling DateTitle
CN202110170234.0ACN112972892B (en)2021-02-052021-02-05 Method and device for automatically detecting epilepsy based on wire length algorithm in implantable closed-loop system
CN202110170234.02021-02-05

Publications (1)

Publication NumberPublication Date
WO2022166682A1true WO2022166682A1 (en)2022-08-11

Family

ID=76349205

Family Applications (1)

Application NumberTitlePriority DateFiling Date
PCT/CN2022/073767CeasedWO2022166682A1 (en)2021-02-052022-01-25Method and device for automatically detecting epilepsy by implantable closed-loop system based on line length algorithm

Country Status (2)

CountryLink
CN (1)CN112972892B (en)
WO (1)WO2022166682A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112972892B (en)*2021-02-052024-12-27杭州诺为医疗技术有限公司 Method and device for automatically detecting epilepsy based on wire length algorithm in implantable closed-loop system

Citations (3)

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

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5179689A (en)*1987-03-131993-01-12Texas Instruments IncorporatedDataprocessing device with instruction cache
CN105611269B (en)*2015-12-182017-09-29华中科技大学Real-time disparity computation system based on FPGA
DE102017200456A1 (en)*2017-01-122018-07-12Robert Bosch Gmbh Arithmetic unit and operating method for this
CN109646796A (en)*2019-01-172019-04-19浙江大学Channel wireless radio multi closed loop stimulation system for epilepsy therapy
CN109567797B (en)*2019-01-302021-10-01浙江强脑科技有限公司Epilepsy early warning method and device and computer readable storage medium
CN111772585B (en)*2020-07-132021-06-04清华大学 Data extraction method of abnormal group activity in epilepsy in intercranial EEG signals

Patent Citations (3)

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

Also Published As

Publication numberPublication date
CN112972892B (en)2024-12-27
CN112972892A (en)2021-06-18

Similar Documents

PublicationPublication DateTitle
US10856777B2 (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
WO2022166682A1 (en)Method and device for automatically detecting epilepsy by implantable closed-loop system based on line length algorithm
US20190187776A1 (en)Ultra-Low Power Mode for a Low-Cost Force-Sensing Device
CN103544129B (en)SPI interface and the serial communication method via SPI interface
WO2022166683A1 (en)Method and device for automatically detecting epileptic seizure by implantable closed-loop system on basis of area algorithm
WO2018098719A1 (en)Sleep monitoring method, apparatus and terminal
CN111985438A (en)Static face processing method, device and equipment
US20180034749A1 (en)System and method for distributing and replaying trigger packets via a variable latency bus interconnect
CN109870172B (en) Pedometer detection method, device, equipment and storage medium
CN115792331A (en)Voltage tracking method, control equipment and UPS system
CN106821336A (en)Sleep monitor method and system
US20240057923A1 (en)Pace pulse detection in cardiac signals
TWI500946B (en) Logic analyzer to read and write its memory method
WO2023142380A1 (en)On-vehicle human body information obtaining method and apparatus, and vehicle
CN102403008B (en)Method and system, the fifo controller of data stream breakpoint continued access in audio frequency broadcasting
CN109497994B (en) A method, device and computer readable medium for detecting R wave of ECG signal
CN109497995B (en) Method, device and computer readable medium for detecting R wave of ECG signal
CN106955100A (en)Electrocardio noise detecting method and device
CN117892218A (en)Frequency acquisition method and device of pressure sensor, computer equipment and medium
CN112774033B (en)Method, device and system for determining detection parameters of implanted closed-loop system
CN105955823A (en)Method and system for determining operation frequency of computing resource
TWI727555B (en)Step counting device and method
CN113679340B (en)Sleep monitoring device and method
CN109009003A (en)A kind of control method of pulse signal detection

Legal Events

DateCodeTitleDescription
121Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number:22748961

Country of ref document:EP

Kind code of ref document:A1

NENPNon-entry into the national phase

Ref country code:DE

122Ep: pct application non-entry in european phase

Ref document number:22748961

Country of ref document:EP

Kind code of ref document:A1


[8]ページ先頭

©2009-2025 Movatter.jp