A method and device for detecting electrode leads of a transcranial electrical stimulation apparatus, and a transcranial electrical stimulation system

CN122643575APending Publication Date: 2026-08-28XIAN ZHENTAI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610801850.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

然而,单一阻抗检测方式在设备输出较大直流信号或满幅方波信号时,容易因检测电压接近模数转换满量程而误判为断连,且难以区分高阻抗人体负载与实际断连状态;单一电流检测方式在微电流输出场景下,采样电流与断连状态下的电流差异不明显,导致难以准确判断是否发生断连,从而容易出现漏判或误判;现有电流与阻抗联合检测方案大多采用瞬时值阈值比较方式,难以适配经颅直流电刺激(transcranial Direct Current Stimulation,tDCS)、经颅交流电刺激(transcranialAlternating Current Stimulation,tACS)及自定义任意波形等多波形输出场景,容易因波形瞬时跳变而产生误判

Benefits of technology

[0015] The technical solution of this invention acquires the current sampling values ​​and load-side voltage sampling values ​​of each stimulation output channel at a preset sampling period. It also acquires the zero-current reference value, full-amplitude voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device. This allows for the determination of the current fluctuation degree of the stimulation output channel's current sampling value relative to the zero-current reference value, and the voltage fluctuation degree of the stimulation output channel's load-side voltage sampling value relative to the full-amplitude voltage reference value within a preset sampling data window. By determining the lead state of the electrode corresponding to the stimulation output channel based on the current fluctuation degree, voltage fluctuation degree, current fluctuation threshold, and voltage fluctuation threshold, a dual-parameter complementary joint judgment of the current sampling value and load-side voltage sampling value of the same stimulation output channel is achieved. This effectively reduces the possibility of misjudgment caused by single-parameter detection in different output scenarios and can adapt to various stimulation output scenarios such as DC, sine wave, square wave, triangular wave, and custom waveforms, thereby improving the accuracy and stability of electrode lead state detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122643575A_ABST
    Figure CN122643575A_ABST
Patent Text Reader

Abstract

The application discloses a transcranial electrical stimulation device electrode lead detection method and device and a transcranial electrical stimulation system. The stimulation output unit in the transcranial electrical stimulation device is electrically connected with the electrode through a stimulation output channel. The electrode lead detection method comprises the following steps: acquiring current sampling values and load side voltage sampling values of each stimulation output channel in real time at a preset sampling period; acquiring a zero current reference value, a voltage full amplitude reference value, a current fluctuation threshold value and a voltage fluctuation threshold value of the transcranial electrical stimulation device; determining a current fluctuation degree of the current sampling value of the stimulation output channel relative to the zero current reference value and a voltage fluctuation degree of the load side voltage sampling value of the stimulation output channel relative to the voltage full amplitude reference value in a preset sampling data window; and determining a lead state of the electrode corresponding to the stimulation output channel according to the current fluctuation degree, the voltage fluctuation degree, the current fluctuation threshold value and the voltage fluctuation threshold value. The application improves the accuracy and sensitivity of electrode lead state detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical electronics technology, and in particular to a method, device and system for detecting electrode leads in a transcranial electrical stimulation device. Background Technology

[0002] Transcranial electrical stimulation (TCS) is a non-invasive neuromodulation technique that applies a weak current to the user's scalp via electrode leads to modulate the excitability of nerves in the cerebral cortex. It is widely used in the clinical treatment of neurological diseases and cognitive enhancement. Electrode lead detachment and scalp dislodgement are high-frequency risk scenarios during device use. If disconnection is not detected promptly and accurately and safe procedures are not followed, it can easily cause safety risks such as stinging pain and electric shock to the user.

[0003] In existing transcranial electrical stimulation (TCS) devices, the detection methods for electrode lead status typically include single impedance detection, single current detection, and combined current and impedance detection. However, the single impedance detection method is prone to misjudging disconnection when the device outputs a large DC signal or a full-amplitude square wave signal because the detected voltage is close to the full scale of the analog-to-digital converter, and it is difficult to distinguish between high-impedance human body load and actual disconnection. In micro-current output scenarios, the single current detection method does not show a significant difference between the sampled current and the current in the disconnection state, making it difficult to accurately determine whether a disconnection has occurred, thus easily leading to missed or false detections. Most existing combined current and impedance detection schemes use instantaneous value threshold comparison methods, which are difficult to adapt to multi-waveform output scenarios such as transcranial direct current stimulation (tDCS), transcranial alternating current stimulation (tACS), and custom arbitrary waveforms, and are prone to misjudgment due to instantaneous waveform jumps. Summary of the Invention

[0004] This invention provides a method, device, and system for detecting electrode leads in a transcranial electrical stimulation (TCS) device. By combining current sampling values ​​and load-side voltage sampling values ​​to comprehensively detect the electrode lead status, the accuracy and sensitivity of electrode lead status detection are improved.

[0005] The first aspect of this invention provides a method for detecting electrode leads in a transcranial electrical stimulation (TCS) device. The TCS device includes a stimulation output unit, multiple stimulation output channels, and multiple electrodes. Each stimulation output channel corresponds to one electrode. The stimulation output unit is electrically connected to the electrodes through the stimulation output channels. The method for detecting electrode leads in the TCS device includes: The current sampling value and the load-side voltage sampling value of each of the stimulation output channels are obtained at a preset sampling period. The zero current reference value, full voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device are obtained. Within a preset sampling data window, determine the current fluctuation of the current sample value of the stimulation output channel relative to the zero current reference value, and the voltage fluctuation of the load-side voltage sample value of the stimulation output channel relative to the full-amplitude voltage reference value; wherein, the preset sampling data window includes sample values ​​within multiple preset sampling periods; The lead state of the electrode corresponding to the stimulation output channel is determined based on the degree of current fluctuation, the degree of voltage fluctuation, the current fluctuation threshold, and the voltage fluctuation threshold.

[0006] Optionally, the transcranial electrical stimulation device further includes a plurality of sampling resistors, each of which is electrically connected to the output terminal of each stimulation output unit. Acquire the current sampling value and load-side voltage sampling value of each of the stimulation output channels at a preset sampling period, including: The voltage drop across the sampling resistor is obtained at the preset sampling period in order to obtain the current sampling signal of the stimulation output channel corresponding to the sampling resistor; The current sampling signal of the stimulation output channel is converted from analog to digital to obtain the current sampling value of the stimulation output channel. The voltage value on the load side of the sampling resistor is obtained at the preset sampling period to obtain the voltage sampling signal of the stimulation output channel corresponding to the sampling resistor; The voltage sampling signal of the stimulation output channel is converted from analog to digital to obtain the load-side voltage sampling value of the stimulation output channel.

[0007] Optionally, obtaining the current fluctuation threshold and voltage fluctuation threshold of the transcranial electrical stimulation device includes: When each of the stimulation output units stops outputting the stimulation signal, the current sampling value of each of the stimulation output channels is obtained with the preset sampling period; Within the preset sampling data window, obtain the mean square error of the current between the current sampling value of each stimulation output channel and the zero current reference value; The product of the maximum value of the mean square error of the current in each of the stimulation output channels and the first preset coefficient is calculated to determine the current fluctuation threshold. When the leads of each electrode are disconnected, the load-side voltage sampling value of each stimulation output channel is obtained with the preset sampling period. Within the preset sampling data window, obtain the voltage mean square error between the load-side voltage sampling value of each of the stimulation output channels and the voltage full-amplitude reference value; The voltage fluctuation threshold is determined by multiplying the maximum value of the mean square error of the voltage in each of the stimulation output channels with a second preset coefficient.

[0008] Optionally, determining the current fluctuation of the current sampled value of the stimulation output channel relative to the zero current reference value and the voltage fluctuation of the load-side voltage sampled value of the stimulation output channel relative to the full-scale voltage reference value within a preset sampling data window includes: Based on the multiple current sampling values ​​of the stimulation output channel within the preset sampling window and the zero current reference value, and based on the first calculation formula, the degree of current fluctuation of the current sampling value of the stimulation output channel relative to the zero current reference value is determined. Based on the multiple load-side voltage sampling values ​​of the stimulation output channel within the preset sampling window and the full-amplitude voltage reference value, the voltage fluctuation degree of the load-side voltage sampling value of the stimulation output channel relative to the full-amplitude voltage reference value is determined according to the second calculation formula. The first calculation formula is: ; Among them, the The degree of current fluctuation, The number of sampling points within the preset sampling window. For the first The stimulation output channel is in the first The current sample value at the next sampling time. The zero current reference value; The second calculation formula is: ; Among them, the The degree of voltage fluctuation, The number of sampling points within the preset sampling window. For the first The stimulation output channel is in the first The load-side voltage sample value at the next sampling time. This is the full-amplitude reference value for the voltage.

[0009] Optionally, determining the lead state of the electrode corresponding to the stimulation output channel based on the degree of current fluctuation, the degree of voltage fluctuation, the current fluctuation threshold, and the voltage fluctuation threshold includes: Determine whether the current fluctuation level and the voltage fluctuation level meet the first preset condition; if so, determine that the electrode lead corresponding to the stimulation output channel is disconnected; wherein, the first preset condition includes the current fluctuation level being less than or equal to the current fluctuation threshold and the voltage fluctuation level being less than or equal to the voltage fluctuation threshold.

[0010] Optionally, after determining that the current fluctuation level and the voltage fluctuation level meet the first preset condition, the method further includes: Within the next preset sampling window, obtain the current fluctuation of the current sample value of the same stimulation output channel relative to the zero current reference value, and the voltage fluctuation of the load-side voltage sample value of the same stimulation output channel relative to the full-amplitude voltage reference value. When the current fluctuation and voltage fluctuation in the next preset sampling window meet the first preset condition, it is determined that the electrode lead corresponding to the stimulation output channel is disconnected.

[0011] Optionally, the transcranial electrical stimulation device further includes a human-computer interaction unit; After determining that the electrode lead corresponding to the stimulation output channel is disconnected, the method further includes: The human-computer interaction unit is controlled to display the electrode lead disconnection status of the stimulation output channel; The stimulation output unit corresponding to the stimulation output channel is controlled to stop outputting the stimulation signal; The operating status of the aforementioned stimulus output channel is marked as an abnormal lockout state.

[0012] Optionally, the electrode lead detection method for transcranial electrical stimulation devices also includes: When the human-computer interaction unit receives a start command from any of the stimulation output units, it determines whether the operating status of each stimulation output channel has not been marked as the abnormal lock state. If so, then control the stimulation output unit to start outputting the stimulation signal.

[0013] A second aspect of the present invention provides an electrode lead detection device for a transcranial electrical stimulation device. The transcranial electrical stimulation device includes a stimulation output unit, multiple stimulation output channels, and multiple electrodes. Each stimulation output channel is configured to correspond one-to-one with each electrode. The stimulation output unit is electrically connected to the electrodes through the stimulation output channels. The electrode lead detection device of the transcranial electrical stimulation device includes: The sampling value acquisition module is used to acquire the current sampling value and the load-side voltage sampling value of each of the stimulation output channels at a preset sampling period. The reference value and fluctuation threshold acquisition module is used to acquire the zero current reference value, full voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device. The fluctuation degree determination module is used to determine the current fluctuation degree of the current sampled value of the stimulation output channel relative to the zero current reference value and the voltage fluctuation degree of the load side voltage sampled value of the stimulation output channel relative to the full voltage reference value within a preset sampling data window; wherein, the preset sampling data window includes multiple sampled values ​​within the preset sampling period; The lead state determination module is used to determine the lead state of the electrode corresponding to the stimulation output channel based on the current fluctuation level, the voltage fluctuation level, the current fluctuation threshold, and the voltage fluctuation threshold.

[0014] A third aspect of the present invention provides a transcranial electrical stimulation system, the transcranial electrical stimulation system comprising: a transcranial electrical stimulation device and a controller; The transcranial electrical stimulation device includes a stimulation output unit, multiple stimulation output channels, and multiple electrodes. Each stimulation output channel is configured to correspond one-to-one with each electrode. The stimulation output unit is electrically connected to the electrodes through the stimulation output channels. The controller is connected to the transcranial electrical stimulation device and is used to perform the electrode lead detection method of the transcranial electrical stimulation device as described above.

[0015] The technical solution of this invention acquires the current sampling values ​​and load-side voltage sampling values ​​of each stimulation output channel at a preset sampling period. It also acquires the zero-current reference value, full-amplitude voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device. This allows for the determination of the current fluctuation degree of the stimulation output channel's current sampling value relative to the zero-current reference value, and the voltage fluctuation degree of the stimulation output channel's load-side voltage sampling value relative to the full-amplitude voltage reference value within a preset sampling data window. By determining the lead state of the electrode corresponding to the stimulation output channel based on the current fluctuation degree, voltage fluctuation degree, current fluctuation threshold, and voltage fluctuation threshold, a dual-parameter complementary joint judgment of the current sampling value and load-side voltage sampling value of the same stimulation output channel is achieved. This effectively reduces the possibility of misjudgment caused by single-parameter detection in different output scenarios and can adapt to various stimulation output scenarios such as DC, sine wave, square wave, triangular wave, and custom waveforms, thereby improving the accuracy and stability of electrode lead state detection.

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

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

[0018] Figure 1 This is a schematic diagram of the transcranial electrical stimulation system provided in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the structure of a sampling resistor provided in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the structure of a current sampling unit provided in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the structure of a voltage sampling unit provided in Embodiment 1 of the present invention; Figure 5 This is a schematic flowchart of an electrode lead detection method for a transcranial electrical stimulation device provided in Embodiment 2 of the present invention; Figure 6 This is a flowchart illustrating an electrode lead detection method for a transcranial electrical stimulation device provided in Embodiment 3 of the present invention; Figure 7 This is a schematic flowchart of an electrode lead detection method for a transcranial electrical stimulation device provided in Embodiment 4 of the present invention; Figure 8 This is a comparison diagram of the human-computer interaction unit state before and after disconnection triggering provided in Embodiment 4 of the present invention; Figure 9 This is a schematic diagram of the structure of an electrode lead detection device for a transcranial electrical stimulation device provided in Embodiment 5 of the present invention; Figure 10 This is a schematic diagram of the structure of a controller for a transcranial electrical stimulation system provided in Embodiment Six of the present invention. Detailed Implementation

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

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

[0021] Example 1 Figure 1 This is a schematic diagram of the transcranial electrical stimulation system provided in Embodiment 1 of the present invention. Figure 1 As shown, the transcranial electrical stimulation system includes a transcranial electrical stimulation device 1 and a controller 2; the transcranial electrical stimulation device 1 includes a stimulation output unit 11, multiple stimulation output channels 12, and multiple electrodes 13, with each stimulation output channel 12 corresponding to each electrode 13, and the stimulation output unit 11 is electrically connected to the electrodes 13 through the stimulation output channels 12; the controller 2 is connected to the transcranial electrical stimulation device 1.

[0022] The transcranial electrical stimulation (TCS) device 1 is used to output stimulation signals applied to the user's head. TCS devices include, but are not limited to, tDCS devices, tACS devices, and transcranial pulsed current stimulation (tPCS) devices. Specifically, the TCS device 1 includes a stimulation output unit 11, multiple stimulation output channels 12, and multiple electrodes 13. The stimulation output unit 11 generates the stimulation signals required for TCS, which may include DC signals, AC signals, pulse signals, or other preset waveform signals. Each stimulation output channel 12 corresponds to one of the electrodes 13, and each stimulation output channel 12 transmits the stimulation signal output by the stimulation output unit 11 to its corresponding electrode 13. By setting multiple stimulation output channels 12, multi-electrode synergistic stimulation can be achieved, and it also helps to acquire the current and voltage signals corresponding to each stimulation output channel, thereby independently determining the lead status of different electrodes 13.

[0023] Electrode 13 is used to contact the user's scalp to apply the stimulation signal output by stimulation output unit 11 and transmitted through stimulation output channel 12 to the target area. In actual use, poor contact or disconnection of leads may occur between electrode 13 and the scalp due to loose wearing, positional misalignment, or external pulling. Therefore, it is necessary to monitor the lead status of each electrode 13 in real time, taking into account the working status of each stimulation output channel 12, to ensure the safety and stability of the stimulation process.

[0024] Optionally, the transcranial electrical stimulation device 1 also includes multiple sampling resistors, each of which is electrically connected to the output terminal of each stimulation output unit 11. Figure 2 This is a schematic diagram of a sampling resistor provided in Embodiment 1 of the present invention. Figure 2 As shown, a sampling resistor R1 is connected in series between the output terminal of the stimulation output unit 11 and the electrode 13. The stimulation signal output by the stimulation output unit 11 is transmitted to the electrode 13 after passing through the sampling resistor R1, causing a voltage drop across the sampling resistor R1 when the stimulation current flows through it. Sampling nodes R_SENSE_1 and R_SENSE_2 are respectively set at the two ends of the sampling resistor R1. R_SENSE_1 is located closer to the output terminal of the constant current source, and R_SENSE_2 is located closer to the output terminal of the electrode, i.e., closer to the load. Therefore, a current sampling signal can be obtained by sampling the voltage drop between R_SENSE_1 and R_SENSE_2; a load-side voltage sampling signal can be obtained by sampling the load-side voltage at R_SENSE_2, thus providing signal input for subsequent acquisition of current and load-side voltage sampling values.

[0025] Specifically, Figure 3 This is a schematic diagram of the structure of a current sampling unit provided in Embodiment 1 of the present invention. Figure 4 This is a schematic diagram of the structure of a voltage sampling unit provided in Embodiment 1 of the present invention. Figure 3 and Figure 4 As shown, in the current sampling unit, sampling nodes R_SENSE_1 and R_SENSE_2 are led out from the two ends of the sampling resistor, and are respectively connected to the differential input terminal of the instrumentation amplifier U4. The reference terminal of the instrumentation amplifier is connected to the reference potential REF so that the output signal of the instrumentation amplifier U4 is within the input range allowed by the analog-to-digital conversion. The output terminal of the instrumentation amplifier U4 is connected to the analog-to-digital conversion input terminal ADC_2. Thus, the controller 2 can determine the current sampling signal of the stimulation output channel 12 corresponding to the sampling resistor R1 by acquiring the voltage signal of the output terminal of the instrumentation amplifier U4, and can perform analog-to-digital conversion accordingly to obtain the current sampling value.

[0026] In the voltage sampling unit, the load-side node R_SENSE_2 of the sampling resistor R1 is connected to the first operational amplifier U1 to perform impedance transformation on the load-side signal, thereby reducing the load impact of the subsequent detection circuit on the original node and improving detection stability. The signal output from the first operational amplifier U1 is further fed into a full-wave rectifier circuit composed of a second operational amplifier U2, a first diode D1, a second diode D2, a third resistor R3, a fourth resistor R4, a sixth resistor R6, and a seventh resistor R7, converting the load-side alternating signal into a unipolar signal. The full-wave rectified signal is then fed into a low-pass filter circuit composed of a second resistor R2, a fifth resistor R5, a first capacitor C1, and a third operational amplifier U3 to filter out high-frequency components and transient waveform jumps, obtaining a smooth detection voltage that characterizes the load connection state. The output of the low-pass filter circuit is connected to the analog-to-digital converter input ADC_1. Therefore, the controller 2 can determine the voltage sampling signal of the stimulation output channel 12 corresponding to the sampling resistor R1 through the voltage signal of the output of the low-pass filter circuit, and can perform analog-to-digital conversion accordingly to obtain the load-side voltage sampling value.

[0027] The controller 2 may include a microprocessor, such as a central processing unit (CPU), and may also include other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The controller 2 is connected to the transcranial electrical stimulation device 1 so that it can comprehensively detect the lead status of the electrode 13 by combining the current sampling value and the load-side voltage sampling value. It is understood that the controller 2 in the transcranial electrical stimulation system can execute the electrode lead detection method of the transcranial electrical stimulation device provided in this embodiment of the invention, possessing the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the electrode lead detection method of the transcranial electrical stimulation device described in the following embodiments.

[0028] Example 2 Figure 5This is a flowchart illustrating an electrode lead detection method for a transcranial electrical stimulation (TCS) device according to Embodiment 2 of the present invention. This embodiment can be used to determine the lead status of electrodes in the TCS device described in the above embodiments. This method can be executed by an electrode lead detection device for the TCS device, which can be implemented in software and / or hardware and is generally integrated into the controller of the TCS system. Correspondingly, as... Figure 5 As shown, the electrode lead detection method of this transcranial electrical stimulation device may include: S101. Obtain the current sampling value and load-side voltage sampling value of each stimulation output channel with a preset sampling period.

[0029] Specifically, to determine the lead status of the electrodes corresponding to each stimulation output channel, the controller first acquires the current sampling value and the load-side voltage sampling value of each stimulation output channel at a preset sampling period. The current sampling value characterizes the actual output current state of the corresponding stimulation output channel, and the load-side voltage sampling value characterizes the load connection state of the corresponding stimulation output channel. By simultaneously acquiring the current sampling value and the load-side voltage sampling value of the same stimulation output channel, a data foundation can be provided for subsequent determination of electrode lead status based on two parameters. For example, the preset sampling period can be 1 ms.

[0030] Optionally, acquiring the current sampling value and load-side voltage sampling value of each stimulation output channel with a preset sampling period includes: acquiring the voltage drop across the sampling resistor with a preset sampling period to acquire the current sampling signal of the stimulation output channel corresponding to the sampling resistor; performing analog-to-digital conversion on the current sampling signal of the stimulation output channel to acquire the current sampling value of the stimulation output channel; acquiring the voltage value on the load side of the sampling resistor with a preset sampling period to acquire the voltage sampling signal of the stimulation output channel corresponding to the sampling resistor; and performing analog-to-digital conversion on the voltage sampling signal of the stimulation output channel to acquire the load-side voltage sampling value of the stimulation output channel.

[0031] Specifically, taking a transcranial electrical stimulation (TCS) device with four stimulation output channels as an example, the TCS device can also include four 16-bit DACs. These four 16-bit DACs are used to generate analog stimulation waveform signals corresponding to each stimulation output channel based on the digital control output from the controller. In each stimulation output channel, a 10Ω high-precision sampling resistor is connected in series at the output terminal of the constant current source, allowing the stimulation current output by the stimulation output unit to flow through the sampling resistor and form a voltage drop corresponding to the output current across the sampling resistor. This voltage drop can be acquired and conditioned by an instrumentation amplifier. The REF pin of the instrumentation amplifier is connected to a 1.5V reference voltage to apply a DC bias to the output signal, ensuring the output signal is within the 0-3V analog-to-digital conversion input range. Through this setup, a bidirectional current signal with an input range of -20mA to +20mA can be converted into a voltage signal within the 0-3V range, where -20mA corresponds to 0V, 0mA corresponds to 1.5V, and +20mA corresponds to 3V. Therefore, the controller can obtain the current sampling signal of the corresponding stimulation output channel by acquiring the voltage drop across the sampling resistor. For voltage sampling signals, the corresponding voltage value can be obtained on the load side of the sampling resistor, and after the voltage value is processed by the aforementioned voltage sampling unit, a voltage sampling signal related to the load connection state of the corresponding stimulus output channel is obtained.

[0032] Furthermore, the transcranial electrical stimulation (TCS) device may include a 16-bit ADC, which supports simultaneous sampling of 8 channels with a sampling range of 0-3V and a corresponding digital value range of 0-4095. The controller can use the ADC to perform analog-to-digital conversion on the current and voltage sampling signals of each stimulation output channel, thereby obtaining the corresponding current sampling value and load-side voltage sampling value. The ADC can be triggered to perform sampling operations through a preset sampling period. For example, an ADC event interrupt can be triggered by a 1ms timer, and a DMA request can be initiated, allowing the ADC sampling data to be transferred to a preset array in real time via DMA. For a TCS device with 4 stimulation output channels, the preset array may include 8 sampling data bits, where the first 4 sampling data bits are used to store the current sampling values ​​of the 4 stimulation output channels, and the last 4 sampling data bits are used to store the load-side voltage sampling values ​​of the 4 stimulation output channels. Transferring sampling data via DMA can reduce the data transfer burden on the controller during high-frequency sampling, improving the real-time performance and stability of the sampling process.

[0033] S102. Obtain the zero current reference value, full voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device.

[0034] Specifically, after acquiring the current sampling values ​​and load-side voltage sampling values ​​of each stimulation output channel, the controller also acquires the zero-current reference value, full-scale voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device. This provides a basis for comparison in determining the lead status of the corresponding electrodes for each stimulation output channel. The zero-current reference value characterizes the current sampling reference when there is no effective output current in the stimulation output channel. With a 16-bit ADC, a sampling range of 0-3V, and the current sampling signal biased to the middle of its range by the instrumentation amplifier, the ADC sampling value corresponding to the zero-current state can be 2048. Therefore, the controller can use 2048 as the zero-current reference value to calculate the fluctuation of the current sampling value relative to the zero-current state. The full-scale voltage reference value characterizes the voltage sampling reference when the electrode lead is disconnected. With a 16-bit ADC and a sampling range of 0-3V, the digital value range of the ADC is 0-4095. When the electrode lead is disconnected, the detection voltage corresponding to the voltage sampling signal is close to the full-scale ADC, and the load-side voltage sampling value can be close to 4095. Therefore, the controller can use 4095 as the full-amplitude voltage reference value for subsequent calculations of the fluctuation of the load-side voltage sample value relative to the disconnection state.

[0035] Furthermore, the reference value can be automatically calibrated when the device is powered on. For example, it can continuously sample for 100ms with all outputs off and take the average of the current ADC sample values ​​as the new zero current reference value. Simultaneously, it can continuously sample for 100ms with the electrode leads disconnected or in a preset open-circuit calibration state and take the average of the voltage ADC sample values ​​as the new full-amplitude voltage reference value. This can compensate for errors caused by hardware temperature drift, device offset, ADC zero-point offset, or voltage sensing link full-amplitude drift, improving the accuracy of current and voltage fluctuation calculations.

[0036] The current fluctuation threshold is used to determine whether the fluctuation of the current sampled value relative to the zero current reference value is within the allowable range. When the current fluctuation level within the preset sampling data window is less than or equal to the current fluctuation threshold, it indicates that the current sampled value of the stimulation output channel is consistently close to the zero current reference value within that window. The voltage fluctuation threshold is used to determine whether the fluctuation of the load-side voltage sampled value relative to the full-amplitude voltage reference value is within the allowable range. Therefore, by obtaining the above two reference values ​​and two fluctuation thresholds, a data foundation can be provided for subsequently determining the electrode lead status based on the combined current sampled value and the load-side voltage sampled value.

[0037] S103. Determine the current fluctuation of the current sample value of the stimulation output channel relative to the zero current reference value and the voltage fluctuation of the load side voltage sample value of the stimulation output channel relative to the full voltage reference value within the preset sampling data window.

[0038] The preset sampling data window includes sampled values ​​from multiple preset sampling periods.

[0039] The preset sampling data window is used to store sampling data over a continuous period of time. Specifically, a circular sampling buffer can be opened for each stimulus output channel. After each 1ms sampling, the current sampling value and the load-side voltage sampling value of the corresponding stimulus output channel are written into the circular sampling buffer. For example, the depth of the circular sampling buffer can be 500, so that the circular sampling buffer can save the sampling data within the most recent 500ms and use it as the data source for subsequent calculations of current and voltage fluctuations.

[0040] The controller can perform an electrode lead status check every 500ms. For each stimulation output channel, the controller reads multiple current sampling values ​​and multiple load-side voltage sampling values ​​within a preset sampling data window, and calculates two fluctuation characteristic values ​​respectively. The current fluctuation level characterizes the deviation of the current sampling value of the stimulation output channel from the zero current reference value, and the voltage fluctuation level characterizes the deviation of the load-side voltage sampling value of the stimulation output channel from the full-amplitude voltage reference value.

[0041] The degree of current and voltage fluctuations can be determined using the mean square error (MSE) method. By statistically analyzing the sampled data over a period of time using the MSE method, the possibility of misjudgment caused by the influence of ADC noise floor, waveform edge jumps, or short-term interference on individual instantaneous sampled values ​​can be reduced. It is understandable that when the current fluctuation of a certain stimulus output channel within a preset sampling data window is small, it indicates that multiple current sampled values ​​within that window are consistently close to the zero current reference value, suggesting that the stimulus output channel does not exhibit a significant effective output current during that time period. Similarly, when the voltage fluctuation of a certain stimulus output channel within a preset sampling data window is small, it indicates that multiple load-side voltage sampled values ​​within that window are consistently close to the full-scale voltage reference value, suggesting that the stimulus output channel exhibits a near-full-scale voltage sampling state during that time period. Therefore, by separately determining the degree of current and voltage fluctuations, a basis can be provided for subsequent comprehensive judgment of whether the electrode leads are disconnected by combining the current and voltage states.

[0042] Furthermore, the sampling period can be adjusted between 100μs and 10ms, and the judgment period can be adjusted between 100ms and 1s to adapt to the computing power and detection latency requirements of different devices. For example, a shorter period can be used when real-time requirements are high, while a longer period can be used for low-power or low-computing-power devices.

[0043] S104. Determine the lead status of the electrode corresponding to the stimulation output channel based on the degree of current fluctuation, the degree of voltage fluctuation, the current fluctuation threshold, and the voltage fluctuation threshold.

[0044] Specifically, after determining the current and voltage fluctuation levels of a given stimulus output channel, the controller can further compare the current fluctuation level with a current fluctuation threshold and the voltage fluctuation level with a voltage fluctuation threshold to determine the lead status of the corresponding electrode for that stimulus output channel. For example, the controller can determine that the electrode lead for the same stimulus output channel is disconnected if both the current fluctuation level and voltage fluctuation level are less than or equal to the current fluctuation threshold and the voltage fluctuation level are less than or equal to the voltage fluctuation threshold simultaneously. If either of these two conditions is not met, it can be determined that the electrode lead for the corresponding stimulus output channel is not disconnected.

[0045] By combining the assessment of both current and voltage fluctuations, the reliability of electrode lead status determination is improved. Understandably, in high-impedance load scenarios, a rise in load voltage may cause the sampled voltage value on the load side to approach the full-amplitude reference value. If judgment is based solely on voltage sampling results, it's easy to misjudge a high-impedance human body load as a lead disconnection. Since the stimulation output channel still has effective output current in this scenario, the current fluctuation will not meet the judgment condition corresponding to no effective output current. Therefore, the combined assessment method will not be misjudged as a lead disconnection. In micro-current output scenarios, the actual output current of the stimulation output channel is small, and the current sampling value may approach the zero-current reference value. If judgment is based solely on current sampling results, the difference between the sampled current and the current in the disconnection state is not significant, making it difficult to accurately determine whether a disconnection has occurred, thus easily leading to missed or false judgments. Since the electrode and the human body load are still in a normal connection state, the sampled voltage value on the load side will not continuously approach the full-amplitude reference value, and the voltage fluctuation will not meet the judgment condition corresponding to full-amplitude voltage. By employing a dual-condition joint judgment method, both the current sampling value and the load-side voltage sampling value must be continuously close to the zero current reference value within a preset sampling window for the corresponding electrode lead to be determined to be disconnected. It is understandable that if only one of the two conditions is met, a lead disconnection is not confirmed. In micro-current output scenarios, the electrode and the human load remain in a normal connection state, and the load-side voltage sampling value will not continuously approach the full-amplitude voltage reference value, thus avoiding misjudging normal micro-current output as a lead disconnection. For full-amplitude square wave or other large-amplitude dynamic waveform output scenarios, the load-side voltage sampling value processed by the detection circuit may approach full-amplitude in some cases. If a single voltage judgment or instantaneous threshold judgment is used, misjudgment is likely to occur. Since the current sampling value corresponding to square waves or other dynamic waveforms has significant fluctuations within the preset sampling data window, the degree of current fluctuation will not meet the judgment condition corresponding to no effective output current. Therefore, the dual-condition joint judgment method will not be misjudged as a lead disconnection.

[0046] By performing complementary joint judgment on the current sampling value and the load-side voltage sampling value of the same stimulus output channel, the possibility of misjudgment and inability to judge under different output scenarios can be reduced by single current detection, single voltage detection and instantaneous value joint detection. It can also adapt to various stimulus output scenarios such as DC, sine wave, square wave, triangle wave and custom waveform, thereby improving the accuracy and stability of electrode lead status detection.

[0047] In this embodiment, by acquiring the current sampling values ​​and load-side voltage sampling values ​​of each stimulation output channel at a preset sampling period, and by acquiring the zero current reference value, full-amplitude voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device, the degree of current fluctuation of the stimulation output channel's current sampling value relative to the zero current reference value, and the degree of voltage fluctuation of the stimulation output channel's load-side voltage sampling value relative to the full-amplitude voltage reference value, can be determined within a preset sampling data window. By determining the lead status of the electrode corresponding to the stimulation output channel based on the degree of current fluctuation, voltage fluctuation, current fluctuation threshold, and voltage fluctuation threshold, a dual-parameter complementary joint judgment of the current sampling value and load-side voltage sampling value of the same stimulation output channel is achieved. This effectively reduces the possibility of misjudgment caused by single-parameter detection in different output scenarios and can adapt to various stimulation output scenarios such as DC, sine wave, square wave, triangular wave, and custom waveforms, thereby improving the accuracy and stability of electrode lead status detection.

[0048] Example 3 Figure 6 This is a flowchart illustrating a method for detecting electrode leads in a transcranial electrical stimulation (TCS) device according to Embodiment 3 of the present invention. Based on the above embodiments, this embodiment provides a detailed description of the method for obtaining the current fluctuation threshold and voltage fluctuation threshold of the TCS device. Correspondingly, as... Figure 6 As shown, the electrode lead detection method of this transcranial electrical stimulation device may include: S201. Obtain the current sampling value and load-side voltage sampling value of each stimulation output channel with a preset sampling period.

[0049] S202. Obtain the zero current reference value and the full voltage reference value of the transcranial electrical stimulation device.

[0050] S203. When each stimulation output unit stops outputting stimulation signals, the current sampling value of each stimulation output channel is obtained with a preset sampling period.

[0051] Specifically, to determine the current fluctuation threshold, each stimulation output unit can be stopped from outputting stimulation signals, putting the transcranial electrical stimulation device into standby or no-stimulation output state. In this state, theoretically, there is no effective output current in each stimulation output channel. However, due to factors such as ADC noise floor, device offset, and environmental interference, the current sampling value may still fluctuate slightly around the zero current reference value. Therefore, when each stimulation output unit stops outputting stimulation signals, the current sampling value of each stimulation output channel can be continuously acquired at a preset sampling period.

[0052] S204. Obtain the mean square error of the current between the current sampling value of each stimulus output channel and the zero current reference value within the preset sampling data window.

[0053] Specifically, after completing current sampling in the no-output state, the controller can acquire multiple current sampling values ​​within a preset sampling data window for each stimulus output channel, and calculate the mean square error of each current sampling value relative to the zero current reference value. This mean square error is used to characterize the degree of current sampling fluctuation caused by background noise, sampling error, or hardware offset in the no-output state.

[0054] S205. Calculate the product between the maximum value of the mean square error of the current in each stimulus output channel and the first preset coefficient to determine the current fluctuation threshold.

[0055] Specifically, the controller can compare the mean square error of the current obtained by each stimulus output channel within a preset sampling data window and read the maximum value. To filter out noise fluctuations and reserve margin for hardware differences between different channels, the product of this maximum value and a first preset coefficient can be calculated to determine the current fluctuation threshold. For example, the current fluctuation threshold can be set to 1.5 times the maximum value. Thus, when the current fluctuation of a certain stimulus output channel is less than or equal to the current fluctuation threshold during subsequent actual detection, the current sampling value of that channel can be considered to be within the allowable fluctuation range under no-output conditions, thereby characterizing that the channel has no effective output current.

[0056] S206. When the leads of each electrode are disconnected, the load-side voltage sampling value of each stimulation output channel is obtained with a preset sampling period.

[0057] Specifically, to determine the voltage fluctuation threshold, each electrode can be in a disconnected state, for example, by disconnecting the electrode leads corresponding to each stimulation output channel. In this state, the load-side voltage sampling value should be close to the full-amplitude voltage reference value, but it will still fluctuate to some extent due to ADC noise, detection circuit offset, or environmental interference. Therefore, when the leads of each electrode are disconnected, the load-side voltage sampling values ​​of each stimulation output channel can be continuously acquired at a preset sampling period.

[0058] S207. Obtain the mean square error of voltage between the load-side voltage sample value and the full-amplitude voltage reference value of each stimulus output channel within the preset sampling data window.

[0059] Specifically, after completing voltage sampling in the lead-disconnected state, the controller can acquire multiple load-side voltage sample values ​​within a preset sampling data window for each stimulus output channel, and calculate the mean square error of each load-side voltage sample value relative to the full-scale voltage reference value. This mean square error is used to characterize the natural fluctuation of the load-side voltage sample value relative to the full-scale voltage reference value when the lead is disconnected.

[0060] S208. Calculate the product between the maximum value of the mean square error of the voltage of each stimulus output channel and the second preset coefficient to determine the voltage fluctuation threshold.

[0061] Specifically, the controller can compare the mean square error of the voltage obtained by each stimulus output channel within a preset sampling data window and read the maximum value. To cover the normal fluctuation range of different channels under disconnection conditions and to avoid misjudgment due to sampling noise, the product of this maximum value and a second preset coefficient can be calculated to determine the voltage fluctuation threshold. For example, the voltage fluctuation threshold can be set to 1.5 times the maximum value. Thus, when the voltage fluctuation of a stimulus output channel is less than or equal to this voltage fluctuation threshold during subsequent actual detection, the voltage sampling value on the load side of that channel can be considered to be within the allowable fluctuation range under disconnection conditions, thereby characterizing that the channel is close to full voltage amplitude.

[0062] Furthermore, after completing the initial calibration of the current fluctuation threshold and voltage fluctuation threshold, practical scenario verification can be performed. For example, all electrode leads can be connected, and a 1kΩ simulated human body load can be applied to put the transcranial electrical stimulation device in a simulated normal connection state. Subsequently, the stimulation output unit can be controlled to output different types of stimulation waveforms, such as DC waveforms, sine waveforms, square wave waveforms, triangular waveforms, or custom waveforms, and lead status detection can be performed based on the aforementioned current fluctuation threshold and voltage fluctuation threshold. If no misjudgment occurs under the above different waveform output scenarios, the current fluctuation threshold and voltage fluctuation threshold can be considered to meet the actual usage requirements, thus completing the threshold calibration.

[0063] S209. Determine the current fluctuation of the current sample value of the stimulation output channel relative to the zero current reference value and the voltage fluctuation of the load side voltage sample value of the stimulation output channel relative to the full voltage reference value within the preset sampling data window.

[0064] The preset sampling data window includes sampled values ​​from multiple preset sampling periods.

[0065] S2010. Determine the lead status of the electrode corresponding to the stimulation output channel based on the degree of current fluctuation, the degree of voltage fluctuation, the current fluctuation threshold, and the voltage fluctuation threshold.

[0066] In this embodiment, when each stimulation output unit stops outputting stimulation signals, the current sampling value of each stimulation output channel is acquired at a preset sampling period. The mean square error of the current between the current sampling value of each stimulation output channel and the zero current reference value is acquired within a preset sampling data window. The maximum value of the mean square error of the current between each stimulation output channel and the mean square error of the current between each stimulation output channel is then used to determine the current fluctuation threshold. Similarly, when the leads of each electrode are disconnected, the load-side voltage sampling value of each stimulation output channel is acquired at a preset sampling period. The mean square error of the voltage between the load-side voltage sampling value of each stimulation output channel and the full-amplitude voltage reference value is acquired within a preset sampling data window. The maximum value of the mean square error of the voltage between each stimulation output channel and the mean square error of the voltage between each stimulation output channel is then used to determine the voltage fluctuation threshold. Acquiring these two fluctuation thresholds provides a data foundation for subsequently determining the electrode lead status based on a comprehensive analysis of the current sampling value and the load-side voltage sampling value.

[0067] Example 4 Figure 7 This is a flowchart illustrating an electrode lead detection method for a transcranial electrical stimulation device according to Embodiment 4 of the present invention. Based on the previous embodiments, this embodiment provides a detailed explanation of the method for determining the current fluctuation of the current sampling value of the stimulation output channel relative to a zero current reference value within a preset sampling data window, the voltage fluctuation of the load-side voltage sampling value of the stimulation output channel relative to a full-amplitude voltage reference value, and determining the lead state of the electrode corresponding to the stimulation output channel based on the current fluctuation level, voltage fluctuation level, current fluctuation threshold, and voltage fluctuation threshold. Accordingly, as... Figure 7 As shown, the electrode lead detection method of this transcranial electrical stimulation device may include: S301. Obtain the current sampling value and load-side voltage sampling value of each stimulation output channel with a preset sampling period.

[0068] S302. Obtain the zero current reference value, full voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device.

[0069] S303. Based on the multiple current sampling values ​​of the stimulation output channel within the preset sampling window and the zero current reference value, and based on the first calculation formula, determine the degree of current fluctuation of the current sampling value of the stimulation output channel relative to the zero current reference value.

[0070] The first calculation formula is: ; in, For the degree of current fluctuation, The number of sampling points within the preset sampling window. For the first The stimulation output channel is in the first... The current sample value at the next sampling time The reference value is zero current.

[0071] Specifically, the controller first calculates the difference between each current sample value and the zero current reference value, then squares the difference, sums the squared values ​​within the preset sampling window, and takes the average to obtain the mean square error of the current. The smaller the mean square error, the more concentrated the multiple current sample values ​​within the preset sampling window are near the zero current reference value, meaning that the stimulation output channel is closer to a state of no effective output current during that time period; conversely, the larger the mean square error, the more significant the deviation of the current sample value from the zero current reference value, indicating that the stimulation output channel has an effective output current or significant current fluctuations during that time period.

[0072] S304. Based on the multiple load-side voltage sampling values ​​of the stimulation output channel within the preset sampling window and the full-amplitude voltage reference value, determine the degree of voltage fluctuation of the load-side voltage sampling value of the stimulation output channel relative to the full-amplitude voltage reference value based on the second calculation formula.

[0073] The second calculation formula is as follows: ; in, For the degree of voltage fluctuation, The number of sampling points within the preset sampling window. For the first The stimulation output channel is in the first... The load-side voltage sample value at the next sampling time. This is the full-amplitude voltage reference value.

[0074] Specifically, the controller first calculates the difference between the full-amplitude voltage reference value and each load-side voltage sample value. Then, it squares the difference and sums the squared values ​​within a preset sampling window, taking the average to obtain the voltage mean square error. The smaller the voltage mean square error, the more concentrated the multiple load-side voltage sample values ​​within the preset sampling window are near the full-amplitude voltage reference value, meaning the stimulus output channel is closer to a disconnected or open-circuit state during that time period. Conversely, the larger the voltage mean square error, the more significant the deviation of the load-side voltage sample values ​​from the full-amplitude voltage reference value, indicating that the stimulus output channel does not meet the full-amplitude voltage requirement during that time period.

[0075] Furthermore, in the actual software implementation, to reduce the computational burden on the controller, the above-mentioned mean square error calculation can be implemented using all-integer arithmetic. It is understood that since the number of sampling points N within the preset sampling window is a fixed value, the controller does not need to directly perform division operations, but instead converts the mean square error calculation into an equivalent sum of squares calculation, and synchronously multiplies the corresponding fluctuation threshold by the number of sampling points N. This method eliminates the need for floating-point operations in the embedded controller and complex calculations during high-frequency sampling, thus reducing MCU resource consumption. Using the above-mentioned all-integer arithmetic and periodic processing method, the computational power required for lead status judgment every 500ms can be less than 1% of the total MCU computational power, thereby adapting to resource-constrained embedded transcranial electrical stimulation devices. In another optional embodiment, the fixed-window sum of squares calculation can be replaced with a sliding-window incremental calculation. That is, each time a new sampling point enters, the square term corresponding to the oldest sampling point is subtracted, and the square term corresponding to the new sampling point is added, thereby updating the sum of squares in real time. This method avoids re-traversing the entire sampling window each time and can shorten the judgment delay to less than 10ms.

[0076] It is also understandable that transcranial electrical stimulation devices can include a power management module. This module is used for battery power acquisition and power management, and can provide existing periodic timing tasks. For example, the device can be pre-programmed with 200ms cycle tasks for battery power detection, Bluetooth status detection, or system status detection. The controller can reuse this existing 200ms cycle timing task as a clock source for disconnection detection status checks or safety protection checks, without needing to allocate new timer resources separately for the electrode lead detection process. This reduces timer resource consumption and software scheduling complexity, making the lead detection method more suitable for embedded medical devices with limited computing power, storage space, and peripheral resources.

[0077] S305. Determine whether the current fluctuation level and voltage fluctuation level meet the first preset condition; if so, determine that the electrode lead corresponding to the stimulation output channel is disconnected.

[0078] The first preset condition includes the current fluctuation level being less than or equal to the current fluctuation threshold and the voltage fluctuation level being less than or equal to the voltage fluctuation threshold.

[0079] Specifically, after obtaining the current and voltage fluctuation levels of a certain stimulus output channel, the controller can compare the current fluctuation level with a current fluctuation threshold and the voltage fluctuation level with a voltage fluctuation threshold to determine whether the stimulus output channel meets the first preset condition. If the same stimulus output channel simultaneously meets the conditions that the current fluctuation level is less than or equal to the current fluctuation threshold and the voltage fluctuation level is less than or equal to the voltage fluctuation threshold, it can be considered that the stimulus output channel is in a state of no effective output current and is simultaneously in a load state close to disconnection or open circuit. Then, the controller determines that the corresponding electrode lead of the stimulus output channel is disconnected. By using the dual-condition judgment method of no effective output current and voltage close to full amplitude, the risk of misjudgment by single current detection in micro-current output scenarios can be reduced, as can the risk of misjudgment by single voltage detection in high-impedance load or large waveform output scenarios, thereby improving the accuracy and stability of electrode lead disconnection detection.

[0080] Optionally, after determining that the current fluctuation level and voltage fluctuation level meet the first preset condition, the method further includes: obtaining the current fluctuation level of the current sampling value of the same stimulation output channel relative to the zero current reference value and the voltage fluctuation level of the load side voltage sampling value of the same stimulation output channel relative to the full voltage reference value within the next preset sampling window; and determining that the electrode lead corresponding to the stimulation output channel is disconnected when the current fluctuation level and voltage fluctuation level meet the first preset condition within the next preset sampling window.

[0081] Specifically, a de-jitter counter can be set for each stimulus output channel. When a stimulus output channel meets the first preset condition in a preset sampling window, the controller increments the de-jitter counter corresponding to that stimulus output channel. When the stimulus output channel fails to meet the first preset condition in a subsequent preset sampling window, the controller can reset or decrement the de-jitter counter. Only when the de-jitter counter reaches a preset threshold number of times is the electrode lead corresponding to that stimulus output channel finally confirmed as disconnected. For example, the preset threshold number of times can be 2, meaning that the electrode lead corresponding to that stimulus output channel is confirmed as disconnected only when two consecutive 500ms judgments meet the disconnection condition. Through disconnection de-jitter processing, short-term misjudgments caused by instantaneous power supply interference, electrostatic discharge interference, instantaneous connector jitter, or sampling abnormalities can be avoided, thereby further improving the reliability of lead disconnection detection.

[0082] Optionally, the transcranial electrical stimulation device also includes a human-machine interface unit; after determining that the electrode lead corresponding to the stimulation output channel is disconnected, it further includes: controlling the human-machine interface unit to display the disconnection status of the electrode lead of the stimulation output channel; controlling the stimulation output unit corresponding to the stimulation output channel to stop outputting stimulation signals; and marking the operating status of the stimulation output channel as an abnormal lockout state.

[0083] The human-computer interaction unit, implemented using a graphics library, displays information such as the stimulation status of the transcranial electrical stimulation device, the channel current of each stimulation output channel, and lead dislodgement alerts. It also receives user-input commands, such as start, pause, or continue commands. By implementing this human-computer interaction unit, users can intuitively understand the operating status of each stimulation output channel and the lead status of the corresponding electrodes, and perform corresponding operations based on the interface prompts.

[0084] Specifically, when a disconnection of electrode leads is detected in any enabled stimulation output channel, the controller can pause the overall stimulation countdown timer, delete or terminate all running rise, fall, and intermittent phase timers to terminate the current stimulation process. Simultaneously, the controller can directly set the output of each DAC channel to zero, stop the waveform generator output, and switch the waveform state of each stimulation output channel to a stopped state. Furthermore, the controller can switch the stimulation state of the transcranial electrical stimulation device to a paused state and set an abnormal trigger lock flag to prevent repeated execution of the pause logic and subsequent system abnormalities when the lead disconnection persists. Through these methods, the transcranial electrical stimulation device can directly and hard-stop the stimulation output upon detecting a lead disconnection, thereby reducing the risk of stinging or electric shock caused by a sudden decrease in contact area and an increase in current density when leads detach, and improving the safety of the device.

[0085] While triggering an emergency pause, the controller can also perform single-channel-level display linkage on the human-machine interface unit. For stimulation output channels identified as having lead disconnection, the controller can control the human-machine interface unit to hide the corresponding current value label and current unit label, and display a lead detachment prompt for that stimulation output channel. For stimulation output channels where lead disconnection has not occurred, the controller can control the human-machine interface unit to maintain its original display state. Thus, users can quickly locate the specific channel where lead detachment has occurred through the human-machine interface unit without having to check each electrode or stimulation output channel individually.

[0086] For example, Figure 8 This is a comparison diagram of the human-computer interaction unit state before and after the disconnection trigger provided in Embodiment 4 of the present invention. For example... Figure 8 As shown, Figure 8(a) This represents the human-computer interface when the transcranial electrical stimulation device is in normal stimulation output mode. The real-time current value corresponding to each stimulation output channel can be displayed at the top of the interface. For example, the current value corresponding to CH1 and CH2 is 2.0mA. The middle area displays the channel number CH1, CH2, CH3, CH4, and the corresponding stimulation mode, such as tACS, stimulation frequency, such as 10Hz, electrode layout information, such as 1×1 (1,2), and remaining stimulation time, such as 29min49s. The bottom of the interface displays operation buttons, such as the "pause" button and the "end" button, so that the user can perform pause or termination operations during stimulation. Figure 8 (b) indicates an abnormal display state after the transcranial electrical stimulation device detects a disconnection in the electrode leads. In this state, the channel with the disconnected lead no longer displays the normal current value, but instead displays a disconnection indicator icon at the corresponding channel location to alert the user that the electrode connection in that channel is abnormal. Simultaneously, the stimulation output is paused, with the remaining time displayed as 30 minutes and 00 seconds. The operation button at the bottom of the interface switches from "Pause" to "Continue," allowing the user to initiate a resumption operation after reconnecting the electrodes. The "End" button remains used to terminate the current stimulation process. Through these interface state switching, the human-computer interaction unit can display operating information such as current, mode, frequency, electrode layout, and remaining time in real time during normal stimulation, and display the abnormal state at the channel level when a lead is disconnected, enabling the user to quickly locate the disconnected channel, thereby improving the efficiency of abnormal handling and the safety of use.

[0087] Furthermore, the controller can be configured with multiple threshold levels to classify the electrode lead status, such as establishing two processing levels: poor contact warning and emergency suspension due to disconnection. When the sampled characteristics reach the lower threshold level, the controller can prompt the user to adjust the electrode leads in advance via the human-machine interface. When the disconnection threshold level is reached, emergency suspension protection is then executed.

[0088] Optionally, the electrode lead detection method of the transcranial electrical stimulation device further includes: when the human-computer interaction unit receives the start command of any stimulation output unit, determining whether the operating status of each stimulation output channel is not marked as an abnormal lock-up state; if so, controlling the stimulation output unit to start outputting stimulation signals.

[0089] Specifically, when the human-machine interface unit receives a start or continue command from any stimulation output unit, the controller does not directly restore the stimulation output. Instead, it first checks whether the operating status of each stimulation output channel is not marked as abnormally locked. If any enabled stimulation output channel is still marked as abnormally locked, the controller rejects the restoration request and maintains the current pause state and the lead detachment warning on the human-machine interface unit. If all enabled stimulation output channels are in a normal connection state, the controller can hide the lead detachment warning on the human-machine interface unit, restore the current display of the corresponding channel, clear the abnormal trigger lock flag or abnormal lock state, and restart the gradual rise process and stimulation countdown to restore the stimulation output. The full-channel re-check and abnormal lock logic before restoration can prevent accidental restoration of stimulation output when the lead is still in a detached state, thus forming a complete safety closed loop from disconnection detection, emergency pause, abnormal warning to restoration re-check.

[0090] In this embodiment, based on multiple current sampling values ​​of the stimulation output channel within a preset sampling window and a zero-current reference value, and using a first calculation formula, the current fluctuation degree of the current sampling value of the stimulation output channel relative to the zero-current reference value is determined. Similarly, based on multiple load-side voltage sampling values ​​of the stimulation output channel within the preset sampling window and a full-amplitude voltage reference value, the voltage fluctuation degree of the load-side voltage sampling value of the stimulation output channel relative to the full-amplitude voltage reference value is determined using a second calculation formula. This allows for the determination of electrode lead disconnection for the stimulation output channel when both the current fluctuation degree and voltage fluctuation degree are less than or equal to a current fluctuation threshold. This dual-condition judgment method, involving no effective output current and voltage close to full amplitude, reduces the risk of misjudgment in low-current output scenarios using single current detection, and also reduces the risk of misjudgment in high-impedance load or large-waveform output scenarios using single voltage detection, thereby improving the accuracy and stability of electrode lead disconnection detection.

[0091] Example 5 Figure 9 This is a schematic diagram of the structure of an electrode lead detection device for a transcranial electrical stimulation (TCS) device according to Embodiment 5 of the present invention. This device can implement the electrode lead detection method for the TCS device provided in this embodiment of the invention. The device can be implemented by software and / or hardware, and is generally integrated into the controller of the TCS system. Figure 9 As shown, the device includes: a sample value acquisition module 401, a reference value and fluctuation threshold acquisition module 402, a fluctuation degree determination module 403, and a lead status determination module 404. The specific structure of the device is as follows: The sampling value acquisition module 401 is used to acquire the current sampling value and the load-side voltage sampling value of each stimulation output channel at a preset sampling period.

[0092] The reference value and fluctuation threshold acquisition module 402 is used to acquire the zero current reference value, full voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device.

[0093] The fluctuation degree determination module 403 is used to determine the current fluctuation degree of the current sample value of the stimulation output channel relative to the zero current reference value and the voltage fluctuation degree of the load side voltage sample value of the stimulation output channel relative to the full voltage reference value within the preset sampling data window; wherein, the preset sampling data window includes sampling values ​​within multiple preset sampling periods.

[0094] The lead state determination module 404 is used to determine the lead state of the electrode corresponding to the stimulation output channel based on the degree of current fluctuation, the degree of voltage fluctuation, the current fluctuation threshold, and the voltage fluctuation threshold.

[0095] In an optional embodiment of the present invention, the sampling value acquisition module 401 may further be used to: acquire the voltage drop across the sampling resistor at a preset sampling period to acquire the current sampling signal of the stimulation output channel corresponding to the sampling resistor; perform analog-to-digital conversion on the current sampling signal of the stimulation output channel to acquire the current sampling value of the stimulation output channel; acquire the voltage value on the load side of the sampling resistor at a preset sampling period to acquire the voltage sampling signal of the stimulation output channel corresponding to the sampling resistor; and perform analog-to-digital conversion on the voltage sampling signal of the stimulation output channel to acquire the load side voltage sampling value of the stimulation output channel.

[0096] In an optional embodiment of the present invention, the reference value and fluctuation threshold acquisition module 402 may further be used to: acquire the current sampling value of each stimulation output channel at a preset sampling period when each stimulation output unit stops outputting stimulation signals; acquire the mean square error of the current between the current sampling value of each stimulation output channel and the zero current reference value within a preset sampling data window; calculate the product between the maximum value of the mean square error of the current of each stimulation output channel and a first preset coefficient to determine the current fluctuation threshold; acquire the load-side voltage sampling value of each stimulation output channel at a preset sampling period when the leads of each electrode are disconnected; acquire the mean square error of the voltage between the load-side voltage sampling value of each stimulation output channel and the full-amplitude voltage reference value within a preset sampling data window; calculate the product between the maximum value of the mean square error of the voltage of each stimulation output channel and a second preset coefficient to determine the voltage fluctuation threshold.

[0097] In an optional embodiment of the present invention, the fluctuation degree determination module 403 may further be used to: determine the current fluctuation degree of the current sample value of the stimulation output channel relative to the zero current reference value based on a first calculation formula, according to multiple current sample values ​​of the stimulation output channel within a preset sampling window and a zero current reference value; and determine the voltage fluctuation degree of the load-side voltage sample value of the stimulation output channel relative to the voltage full-amplitude reference value based on a second calculation formula, according to multiple load-side voltage sample values ​​of the stimulation output channel within a preset sampling window and a voltage full-amplitude reference value; wherein, the first calculation formula is: ; in, For the degree of current fluctuation, The number of sampling points within the preset sampling window. For the first The stimulation output channel is in the first... The current sample value at the next sampling time The reference value is zero current. The second calculation formula is: ; in, For the degree of voltage fluctuation, The number of sampling points within the preset sampling window. For the first The stimulation output channel is in the first... The load-side voltage sample value at the next sampling time. This is the full-amplitude voltage reference value.

[0098] In an optional embodiment of the present invention, the lead state determination module 404 may also be used to: determine whether the current fluctuation degree and the voltage fluctuation degree meet the first preset condition; if so, determine that the electrode lead corresponding to the stimulation output channel is disconnected; wherein, the first preset condition includes the current fluctuation degree being less than or equal to the current fluctuation threshold and the voltage fluctuation degree being less than or equal to the voltage fluctuation threshold.

[0099] In an optional embodiment of the present invention, the lead state determination module 404 may further be used to: after determining that the current fluctuation level and the voltage fluctuation level meet the first preset condition, obtain the current fluctuation level of the current sampling value of the same stimulation output channel relative to the zero current reference value and the voltage fluctuation level of the load side voltage sampling value of the same stimulation output channel relative to the full voltage reference value within the next preset sampling window; and determine that the electrode lead corresponding to the stimulation output channel is disconnected when the current fluctuation level and the voltage fluctuation level meet the first preset condition within the next preset sampling window.

[0100] In an optional embodiment of the present invention, the lead status determination module 404 may also be used to: after determining that the electrode lead corresponding to the stimulation output channel is disconnected, control the human-computer interaction unit to display the electrode lead disconnection status of the stimulation output channel; control the stimulation output unit corresponding to the stimulation output channel to stop outputting stimulation signals; and mark the operating status of the stimulation output channel as an abnormal lockout state.

[0101] In an optional embodiment of the present invention, the lead state determination module 404 may also be used to: when the human-computer interaction unit receives a start command from any stimulus output unit, determine whether the operating state of each stimulus output channel is not marked as an abnormal lock state; if so, control the stimulus output unit to start outputting a stimulus signal.

[0102] The electrode lead detection device of the aforementioned transcranial electrical stimulation device can execute the electrode lead detection method of the transcranial electrical stimulation device provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the electrode lead detection method based on the transcranial electrical stimulation device provided in any embodiment of the present invention.

[0103] Since the electrode lead detection device of the transcranial electrical stimulation device described above is a device capable of executing the electrode lead detection method of the transcranial electrical stimulation device in the embodiments of the present invention, those skilled in the art can understand the specific implementation and various variations of the electrode lead detection device of the transcranial electrical stimulation device in this embodiment based on the electrode lead detection method of the transcranial electrical stimulation device described in the embodiments of the present invention. Therefore, how the electrode lead detection device of the transcranial electrical stimulation device implements the electrode lead detection method of the transcranial electrical stimulation device in the embodiments of the present invention will not be described in detail here. Any device used by those skilled in the art to implement the electrode lead detection method of the transcranial electrical stimulation device in the embodiments of the present invention falls within the scope of protection of this application.

[0104] Example 6 Figure 10 A schematic diagram of a controller for implementing the electrode lead detection method of a transcranial electrical stimulation (TCS) device according to embodiments of the present invention is shown. The controller can take various forms to suit the environment and requirements of the TCS system, such as embedded controllers, microcontrollers, medical device control terminals, TCS device main control modules, and portable neuromodulation device control units. These devices are specifically designed to determine the lead status of each electrode based on the degree of current and voltage fluctuations, thereby improving the accuracy and safety of electrode lead status detection during TCS. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

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

[0106] Multiple components in the controller 10 are connected to the I / O interface 15, including: an input unit 16, such as a touch button, physical button, touch screen, or parameter setting unit; an output unit 17, such as a display screen, indicator light, buzzer, or voice prompt unit; a storage unit 18, such as a flash memory, non-volatile memory, or memory card; and a communication unit 19, such as a Bluetooth communication module, a wireless communication module, or a USB communication interface. The communication unit 19 allows the controller 10 to exchange information / data with other functional modules, host computers, mobile terminals, or medical management terminals in the transcranial electrical stimulation device via wired or wireless communication.

[0107] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the electrode lead detection method of a transcranial electrical stimulation device.

[0108] In some embodiments, the electrode lead detection method of the transcranial electrical stimulation device can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed onto the transcranial electrical stimulation system of the above embodiments via a ROM and / or a communication unit. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the electrode lead detection method of the transcranial electrical stimulation device described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the electrode lead detection method of the transcranial electrical stimulation device by any other suitable means (e.g., by means of firmware).

[0109] Optionally, a method for detecting electrode leads in a transcranial electrical stimulation (TCS) device may include: acquiring current sampling values ​​and load-side voltage sampling values ​​for each stimulation output channel at a preset sampling period; acquiring a zero-current reference value, a full-amplitude voltage reference value, a current fluctuation threshold, and a voltage fluctuation threshold for the TCS device; determining, within a preset sampling data window, the degree of current fluctuation of the current sampling value of the stimulation output channel relative to the zero-current reference value, and the degree of voltage fluctuation of the load-side voltage sampling value of the stimulation output channel relative to the full-amplitude voltage reference value; wherein the preset sampling data window includes sampling values ​​within multiple preset sampling periods; and determining the lead status of the electrode corresponding to the stimulation output channel based on the degree of current fluctuation, the degree of voltage fluctuation, the current fluctuation threshold, and the voltage fluctuation threshold.

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

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

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

[0113] To provide interaction with the user, the systems and techniques described herein can be implemented on a controller having: an in-vehicle display device (e.g., an LCD screen, a touch screen) for displaying information to the user; and an in-vehicle keyboard and pointing device (e.g., touch buttons, physical buttons, a touch screen, or a parameter setting unit) through which the user can provide input to the controller. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or haptic feedback); and input from the user can be received in any form (including sound input, voice input, or haptic input).

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

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

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

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

Claims

1. A method for detecting electrode leads in a transcranial electrical stimulation device, characterized in that, The transcranial electrical stimulation device includes a stimulation output unit, multiple stimulation output channels, and multiple electrodes. Each stimulation output channel is configured to correspond one-to-one with each electrode. The stimulation output unit is electrically connected to the electrodes through the stimulation output channels. The electrode lead detection method of the transcranial electrical stimulation device includes: The current sampling value and the load-side voltage sampling value of each of the stimulation output channels are obtained at a preset sampling period. The zero current reference value, full voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device are obtained. Within a preset sampling data window, determine the current fluctuation of the current sample value of the stimulation output channel relative to the zero current reference value, and the voltage fluctuation of the load-side voltage sample value of the stimulation output channel relative to the full-amplitude voltage reference value; wherein, the preset sampling data window includes sample values ​​within multiple preset sampling periods; The lead state of the electrode corresponding to the stimulation output channel is determined based on the degree of current fluctuation, the degree of voltage fluctuation, the current fluctuation threshold, and the voltage fluctuation threshold.

2. The electrode lead detection method for a transcranial electrical stimulation device according to claim 1, characterized in that, The transcranial electrical stimulation device also includes multiple sampling resistors, each of which is electrically connected to the output terminal of each stimulation output unit. Acquire the current sampling value and load-side voltage sampling value of each of the stimulation output channels at a preset sampling period, including: The voltage drop across the sampling resistor is obtained at the preset sampling period in order to obtain the current sampling signal of the stimulation output channel corresponding to the sampling resistor; The current sampling signal of the stimulation output channel is converted from analog to digital to obtain the current sampling value of the stimulation output channel. The voltage value on the load side of the sampling resistor is obtained at the preset sampling period to obtain the voltage sampling signal of the stimulation output channel corresponding to the sampling resistor; The voltage sampling signal of the stimulation output channel is converted from analog to digital to obtain the load-side voltage sampling value of the stimulation output channel.

3. The electrode lead detection method for a transcranial electrical stimulation device according to claim 1, characterized in that, Obtaining the current fluctuation threshold and voltage fluctuation threshold of the transcranial electrical stimulation device includes: When each of the stimulation output units stops outputting the stimulation signal, the current sampling value of each of the stimulation output channels is obtained with the preset sampling period; Within the preset sampling data window, obtain the mean square error of the current between the current sampling value of each stimulation output channel and the zero current reference value; The product of the maximum value of the mean square error of the current in each of the stimulation output channels and the first preset coefficient is calculated to determine the current fluctuation threshold. When the leads of each electrode are disconnected, the load-side voltage sampling value of each stimulation output channel is obtained with the preset sampling period. Within the preset sampling data window, obtain the voltage mean square error between the load-side voltage sampling value of each of the stimulation output channels and the voltage full-amplitude reference value; The voltage fluctuation threshold is determined by multiplying the maximum value of the mean square error of the voltage in each of the stimulation output channels with a second preset coefficient.

4. The electrode lead detection method for a transcranial electrical stimulation device according to claim 1, characterized in that, Determining the current fluctuation of the current sampled value of the stimulation output channel relative to the zero current reference value and the voltage fluctuation of the load-side voltage sampled value of the stimulation output channel relative to the full-scale voltage reference value within a preset sampling data window includes: Based on the multiple current sampling values ​​of the stimulation output channel within the preset sampling window and the zero current reference value, and based on the first calculation formula, the degree of current fluctuation of the current sampling value of the stimulation output channel relative to the zero current reference value is determined. Based on the multiple load-side voltage sampling values ​​of the stimulation output channel within the preset sampling window and the full-amplitude voltage reference value, the voltage fluctuation degree of the load-side voltage sampling value of the stimulation output channel relative to the full-amplitude voltage reference value is determined according to the second calculation formula. The first calculation formula is: ; Among them, the The degree of current fluctuation, The number of sampling points within the preset sampling window. For the first The stimulation output channel is in the first The current sample value at the next sampling time. The zero current reference value; The second calculation formula is: ; Among them, the The degree of voltage fluctuation, The number of sampling points within the preset sampling window. For the first The stimulation output channel is in the first The load-side voltage sample value at the next sampling time. This is the full-amplitude reference value for the voltage.

5. The electrode lead detection method for a transcranial electrical stimulation device according to claim 1, characterized in that, Based on the degree of current fluctuation, the degree of voltage fluctuation, the current fluctuation threshold, and the voltage fluctuation threshold, the lead state of the electrode corresponding to the stimulation output channel is determined, including: Determine whether the current fluctuation level and the voltage fluctuation level meet the first preset condition; if so, determine that the electrode lead corresponding to the stimulation output channel is disconnected; wherein, the first preset condition includes the current fluctuation level being less than or equal to the current fluctuation threshold and the voltage fluctuation level being less than or equal to the voltage fluctuation threshold.

6. The electrode lead detection method for a transcranial electrical stimulation device according to claim 5, characterized in that, After determining that the current fluctuation level and the voltage fluctuation level meet the first preset condition, the method further includes: Within the next preset sampling window, obtain the current fluctuation of the current sample value of the same stimulation output channel relative to the zero current reference value, and the voltage fluctuation of the load-side voltage sample value of the same stimulation output channel relative to the full-amplitude voltage reference value. When the current fluctuation and voltage fluctuation in the next preset sampling window meet the first preset condition, it is determined that the electrode lead corresponding to the stimulation output channel is disconnected.

7. The electrode lead detection method for a transcranial electrical stimulation device according to claim 4, characterized in that, The transcranial electrical stimulation device also includes a human-computer interaction unit; After determining that the electrode lead corresponding to the stimulation output channel is disconnected, the method further includes: The human-computer interaction unit is controlled to display the electrode lead disconnection status of the stimulation output channel; The stimulation output unit corresponding to the stimulation output channel is controlled to stop outputting the stimulation signal; The operating status of the aforementioned stimulus output channel is marked as an abnormal lockout state.

8. The electrode lead detection method for a transcranial electrical stimulation device according to claim 7, characterized in that, Also includes: When the human-computer interaction unit receives a start command from any of the stimulation output units, it determines whether the operating status of each stimulation output channel has not been marked as the abnormal lock state. If so, then control the stimulation output unit to start outputting the stimulation signal.

9. An electrode lead detection device for a transcranial electrical stimulation device, characterized in that, The transcranial electrical stimulation device includes a stimulation output unit, multiple stimulation output channels, and multiple electrodes. Each stimulation output channel is configured to correspond one-to-one with each electrode. The stimulation output unit is electrically connected to the electrodes through the stimulation output channels. The electrode lead detection device of the transcranial electrical stimulation device includes: The sampling value acquisition module is used to acquire the current sampling value and the load-side voltage sampling value of each of the stimulation output channels at a preset sampling period. The reference value and fluctuation threshold acquisition module is used to acquire the zero current reference value, full voltage reference value, current fluctuation threshold, and voltage fluctuation threshold of the transcranial electrical stimulation device. The fluctuation degree determination module is used to determine the current fluctuation degree of the current sampled value of the stimulation output channel relative to the zero current reference value and the voltage fluctuation degree of the load side voltage sampled value of the stimulation output channel relative to the full voltage reference value within a preset sampling data window; wherein, the preset sampling data window includes multiple sampled values ​​within the preset sampling period; The lead state determination module is used to determine the lead state of the electrode corresponding to the stimulation output channel based on the current fluctuation level, the voltage fluctuation level, the current fluctuation threshold, and the voltage fluctuation threshold.

10. A transcranial electrical stimulation system, characterized in that, include: Transcranial electrical stimulation equipment and controller; The transcranial electrical stimulation device includes a stimulation output unit, multiple stimulation output channels, and multiple electrodes. Each stimulation output channel is configured to correspond one-to-one with each electrode. The stimulation output unit is electrically connected to the electrodes through the stimulation output channels. The controller is connected to the transcranial electrical stimulation device and is used to perform the electrode lead detection method of the transcranial electrical stimulation device as described in any one of claims 1-8.