Control method and system of external device, electronic device and storage medium

CN123010485APending Publication Date: 2026-10-30BEIJING XINZHIDA NEUROLOGICAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611021628.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0007]本申请实施例提供了一种外部设备的控制方法、系统、电子设备和存储介质,以至少解决外部设备的控制准确性低的技术问题

Benefits of technology

[0034]在本申请实施例中,一方面,考虑到按照时间周期轮流执行的动作的节律特性和周期特征,利用外部设备的执行状态,从解码模型集中确定执行状态匹配的目标解码模型,利用该目标解码模型实现对生物对象的脑电信号进行解码,以向外部设备输出控制指令,进而驱动外部设备针对执行状态对应的目标动作进行执行。由于本申请实施例将针对运动想象的多分类问题,解耦为多个解码模型,并且外部设备的不同执行状态与解码模型集中的不同解码模型匹配,从而避免采用单一多分类模型导致的难以对节律性动作的运动想象进行准确分类、动作误触发率高,以及采用二分类模型难以区分节律性动作。另一方面,本申请实施例通过将多分类模型解耦为不同解码模型,大幅度减少了单个模型需要区分的动作种类,显著降低了模型复杂度和训练难度,从而提高了模型稳定性,达到了利用执行状态匹配的解码模型,解码脑电信号的准确性的目的,进而实现了提高外部设备的控制准确性的技术效果,解决了外部设备的控制准确性低的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123010485A_ABST
    Figure CN123010485A_ABST
Patent Text Reader

Abstract

The application discloses a control method and system of an external device, an electronic device and a storage medium. The method comprises the following steps: determining a target decoding model matched with the execution state of the external device from a decoding model set, wherein the external device is used for assisting a biological object, and performs a plurality of actions in turn according to a time period, the execution state is used for representing a target action to be performed in the plurality of actions, and different execution states are matched with different decoding models in the decoding model set; inputting the electroencephalogram signal of the biological object into the target decoding model for decoding to obtain a decoding result, wherein the electroencephalogram signal is used for representing the motor imagination of the biological object, and the plurality of actions comprise actions corresponding to the motor imagination; generating a control instruction based on the decoding result; and driving the external device to perform the target action based on the control instruction. The application solves the technical problem of low control accuracy of the external device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of brain-computer interface control, and more specifically, to a control method, system, electronic device, and storage medium for an external device. Background Technology

[0002] Currently, methods for controlling external devices for brain-computer interfaces (BCIs) can classify the motor imagery of biological objects using single multi-classification and binary classification models to determine the actions that the external device needs to perform, and then control the external device to perform those actions.

[0003] Regarding the external device control methods based on the aforementioned single-classification multi-classification model, on the one hand, the motor imagery corresponding to the rhythmic movements of biological objects exhibits high homology in the brains of these objects. For example, the EEG signals triggering rhythmic movements are quite similar, and the brain regions activating these two movements are adjacent. If a single-classification multi-classification model is used, the classification boundaries for classifying the motor imagery of rhythmic movements are easily blurred, leading to decreased decoding accuracy, a high rate of false triggering, and difficulty in accurately controlling external devices. On the other hand, to capture the subtle differences in motor imagery across a large number of different movements, a large amount of high-quality training data is required to train the single-classification multi-classification model, increasing its complexity and training difficulty. Consequently, the single-classification multi-classification model suffers from poor stability and is unable to meet the requirements for precise control of external devices.

[0004] To improve classification stability, the external device control method based on the above binary classification model can simplify the action imagination classification into a binary classification problem of whether or not there is movement. However, it is difficult to distinguish rhythmic actions, and it is difficult to directly drive the external device to perform actions based on the motion imagination through a simple judgment of whether or not there is movement, which makes it difficult to meet the precise control requirements of the external device.

[0005] In summary, the technical problem of low control accuracy of external devices still exists.

[0006] There is currently no effective solution to the above problems. Summary of the Invention

[0007] This application provides a method, system, electronic device, and storage medium for controlling external devices, in order to at least solve the technical problem of low control accuracy of external devices.

[0008] According to one aspect of the embodiments of this application, a control method for an external device is provided. The method may include: determining a target decoding model matching the execution state of the external device from a set of decoding models, wherein the external device is used to assist a biological object in performing multiple actions in turn according to a time cycle, the execution state is used to characterize the target action to be performed among the multiple actions, and different execution states are matched with different decoding models in the set of decoding models; inputting the brainwave signals of the biological object into the target decoding model for decoding to obtain a decoding result, wherein the brainwave signals are used to characterize the biological object's motor imagination, and the multiple actions include actions corresponding to the motor imagination; generating a control command based on the decoding result; and driving the external device to perform the target action based on the control command.

[0009] Optionally, different execution states correspond to different target actions, and different target actions are matched with different decoding models in the decoding model set. From the decoding model set, the target decoding model matching the execution state of the external device is determined, including: determining the target action corresponding to the execution state; and selecting the target decoding model matching the target action from the decoding model set, wherein the target decoding model can determine whether the external device is in motion or in a resting state.

[0010] Optionally, the multiple actions include at least: a first action and a second action, with the external device used to assist the biological object in alternately executing the first action and the second action according to a time cycle, and determining the target action corresponding to the execution state, including: in response to the execution state indicating that the biological object has executed the first action and is about to execute the second action, determining the second action as the target action; in response to the execution state indicating that the biological object has executed the second action and is about to execute the first action, determining the first action as the target action.

[0011] Optionally, different target actions are executed by different actuators in external devices. From the set of decoding models, a target decoding model matching the target action is selected, including: in response to the target action being a second action, a first target decoding model matching the second action is selected from the set of decoding models, wherein the first target decoding model corresponds to the first actuator among the different actuators, and the first target decoding model can determine whether the first actuator is expected to be in a moving state or a resting state under motion imagination; in response to the target action switching from the second action to the first action, the first target decoding model is switched to a second target decoding model matching the first action in the set of decoding models, wherein the second target decoding model corresponds to the second actuator among the different actuators, and the second target decoding model can determine whether the second actuator is expected to be in a moving state or a resting state under motion imagination.

[0012] Optionally, the first action and the second action are either contralateral actions or ipsilateral antagonistic actions of the biological object.

[0013] Optionally, determining a target decoding model matching the execution state of an external device from the decoding model set includes: in response to the execution state being consistent with the instruction state of the decoding system, controlling the decoding system to determine a target decoding model matching the execution state from the decoding model set, wherein the instruction state is used to characterize the action that the decoding system instructs the external device to perform.

[0014] Optionally, in response to the execution state being consistent with the instruction state of the decoding system, the decoding system is controlled to determine a target decoding model matching the execution state from the decoding model set. This includes: in response to the decoding system's first operation and the execution state being consistent with the default instruction state of the decoding system, the decoding system is controlled to determine a target decoding model matching the execution state from the decoding model set, wherein the default instruction state is used to characterize the default action that the decoding system instructs the external device to perform; after the decoding system's first operation, in response to the execution state being consistent with the current instruction state of the decoding system, the decoding system is controlled to determine a target decoding model matching the execution state from the decoding model set, wherein the current instruction state is used to characterize the decoding system instructing the external device to switch from the currently executed action among multiple actions to the action that is about to be executed among multiple actions.

[0015] Optionally, the method further includes: in response to an inconsistency between the execution state and the instruction state of the decoding system, prohibiting the decoding system from determining a target decoding model matching the execution state from the set of decoding models, wherein the external device enters a safe static state.

[0016] Optionally, the decoding result includes a classification result and a confidence level. The classification result indicates whether the external device is expected to be in motion to perform the target action under motor imagery, or whether the external device is expected to be in a resting state. The confidence level indicates the reliability of the classification result. The EEG signal of the biological object is input into the target decoding model for decoding to obtain the decoding result, including: controlling the decoding system to input the EEG signal into the target decoding model for decoding to obtain the classification result and the confidence level.

[0017] Optionally, based on the decoding result, control instructions are generated, including: in response to the classification result indicating that the external device is expected to be in motion under motion imagination to perform a target action, and the confidence level is greater than a confidence level threshold, generating control instructions for driving the actuators in the external device, wherein different target actions are performed by different actuators in the external device.

[0018] Optionally, the multiple actions include at least: a first action and a second action, and the control instructions include a first control instruction and a second control instruction. The first control instruction is used to drive a first actuator among different actuators to perform the second action, and the second control instruction is used to drive a second actuator among different actuators to perform the first action among the multiple actions. Based on the control instructions, driving an external device to perform a target action includes: in response to the first control instruction, driving the first actuator to perform the second action and cooperating to drive a spinal cord stimulator in the external device to perform an activation operation on the biological object for the second action; or, in response to the second control instruction, driving the second actuator to perform the first action and cooperating to drive a spinal cord stimulator in the external device to perform an activation operation on the biological object for the first action.

[0019] Optionally, the method further includes: controlling the external device to remain stationary in response to a classification result indicating that the external device is expected to be in a resting state, and / or, if the confidence level is less than or equal to a confidence threshold.

[0020] Optionally, after driving the external device to perform the target action based on the control command, the method further includes: obtaining the target command state of the decoding system, wherein the target command state is used to characterize that after the decoding system inputs the EEG signal into the target decoding model for decoding and obtains the decoding result, the decoding system instructs the external device to switch from the currently executed action among multiple actions to the action to be executed among multiple actions; determining the target decoding model matching the target command state from the decoding model set, and returning to start executing from the following steps: inputting the EEG signal of the biological object into the target decoding model for decoding and obtaining the decoding result.

[0021] Optionally, the method further includes: obtaining the execution state after the external device performs the target action, and obtaining an updated execution state; determining a target decoding model matching the target instruction state from the decoding model set, including: in response to the updated execution state being consistent with the target instruction state, controlling the decoding system to determine a target decoding model matching the updated execution state and the target instruction state from the decoding model set.

[0022] Optionally, determining the target decoding model matching the target instruction state from the decoding model set includes: in response to the failure of the execution state after obtaining the target action from the external device, determining the target decoding model matching the target instruction state from the decoding model set.

[0023] Optionally, the external device includes different actuators for performing different actions, including a first action and a second action. The external device assists the biological object in alternately performing the first action and the second action according to a time cycle. The first actuator in the different actuators is used to perform the second action, and the second actuator in the different actuators is used to perform the first action. The method further includes: determining a first EEG signal sample corresponding to the first action, a second EEG signal sample corresponding to the second action, and a resting data sample, wherein the first EEG signal sample is used to characterize the first action corresponding to the motor imagination of the biological object sample, the second EEG signal sample is used to characterize the second action corresponding to the motor imagination of the biological object sample, and the resting data sample is an EEG signal sample used to characterize the motor imagination of the biological object when it does not produce the motor imagination corresponding to the target action, and the resting data sample is collected during the process when the first actuator or the second actuator is in a resting state; using the first EEG signal sample and the resting data sample, a second target decoding model in the decoding model set is trained, and using the second EEG signal sample and the resting data sample, a first target decoding model in the decoding model set is trained.

[0024] Optionally, the second target decoding model can determine whether the second actuator expects to be in a moving state or a resting state under the motor imagery corresponding to the input EEG signal, and the first target decoding model can determine whether the first actuator expects to be in a moving state or a resting state under the motor imagery corresponding to the input EEG signal.

[0025] Optionally, the method further includes: preprocessing the acquired EEG signals, wherein the stability of the preprocessed EEG signals is higher than that of the unprocessed EEG signals; and inputting the EEG signals of the biological object into a target decoding model for decoding to obtain a decoding result, including: inputting the preprocessed EEG signals into the target decoding model for decoding to obtain a decoding result.

[0026] According to another aspect of the embodiments of this application, another method for controlling an external device is also provided. This method may include: determining a target decoding model matching the execution state of a rehabilitation assistive device from a set of decoding models, wherein the rehabilitation assistive device is used to assist a rehabilitation training subject in performing multiple actions in turn according to a time cycle, wherein the first and second actions among the multiple actions are contralateral or ipsilateral antagonistic actions of the rehabilitation training subject, the execution state is used to characterize the target action to be performed among the multiple actions, and different execution states are matched with different decoding models in the set of decoding models; inputting the electroencephalogram (EEG) signal of the rehabilitation training subject into the target decoding model for decoding to obtain a decoding result, wherein the EEG signal is used to characterize the motor imagination of the rehabilitation training subject, and the multiple actions include actions corresponding to the motor imagination; generating a control command based on the decoding result; and driving the rehabilitation assistive device to perform the target action based on the control command.

[0027] According to another aspect of the embodiments of this application, a control system for an external device is also provided. The system may include: a dual-model management module, used to determine a target decoding model matching the execution state of the external device from a set of decoding models, wherein the external device is used to assist a biological object in performing multiple actions in turn according to a time cycle, the execution state is used to characterize the target action to be performed among the multiple actions, and different execution states are matched with different decoding models in the set of decoding models; a classification output module, used to input the brainwave signals of the biological object into the target decoding model for decoding to obtain decoding results, and to generate control commands based on the decoding results, wherein the brainwave signals are used to characterize the biological object's motor imagination, and the multiple actions include actions corresponding to the motor imagination; and a driving module, used to drive the external device to perform the target action based on the control commands.

[0028] Optionally, the system further includes at least one of the following: an EEG acquisition module for acquiring EEG signals of a biological object; an external device state feedback module for determining the execution state after the external device performs the target action, and obtaining an updated execution state; determining the updated execution state as the execution state, and returning to the execution process starting from the following steps: determining the target decoding model matching the execution state of the external device from the decoding model set; a model training module for training the decoding model in the decoding model set using different EEG signal samples corresponding to different actions and the same resting data sample, wherein the EEG signal samples are used to characterize the action that the biological object sample expects to perform among multiple actions through the actuator in the external device, and the resting data sample is used to characterize the EEG signal sample when the biological object does not produce the motor imagery corresponding to the target action, and the resting data sample is acquired during the process when the actuator is in a resting state; and a preprocessing module for preprocessing the acquired EEG signals, wherein the stability of the preprocessed EEG signals is higher than that of the EEG signals before preprocessing.

[0029] According to another aspect of the embodiments of this application, a control device for an external device is also provided. The device may include: a first determining module, configured to determine a target decoding model matching the execution state of the external device from a set of decoding models, wherein the external device is used to assist a biological object in performing multiple actions in turn according to a time cycle, the execution state is used to characterize the target action to be performed among the multiple actions, and different execution states are matched with different decoding models in the set of decoding models; a first decoding module, configured to input the brainwave signals of the biological object into the target decoding model for decoding to obtain a decoding result, wherein the brainwave signals are used to characterize the motor imagination of the biological object, and the multiple actions include actions corresponding to the motor imagination; a first generating module, configured to generate control commands based on the decoding results; and a first driving module, configured to drive the external device to perform the target action based on the control commands.

[0030] According to another aspect of the embodiments of this application, a control device for another external device is also provided. This device may include: a second determining module, configured to determine a target decoding model matching the execution state of the rehabilitation assistive device from a set of decoding models, wherein the rehabilitation assistive device assists a rehabilitation training subject in performing multiple actions in turn according to a time cycle, wherein the first and second actions among the multiple actions are contralateral or ipsilateral antagonistic actions of the rehabilitation training subject, the execution state is used to characterize the target action to be performed among the multiple actions, and different execution states are matched with different decoding models in the set of decoding models; a second decoding module, configured to input the electroencephalogram (EEG) signal of the rehabilitation training subject into the target decoding model for decoding to obtain a decoding result, wherein the EEG signal is used to characterize the motor imagination of the rehabilitation training subject, and the multiple actions include actions corresponding to the motor imagination; a second generating module, configured to generate control commands based on the decoding results; and a second driving module, configured to drive the rehabilitation assistive device to perform the target action based on the control commands.

[0031] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the embodiments of this application when it runs.

[0032] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of the embodiments of this application.

[0033] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods in various embodiments of the embodiments of this application.

[0034] In this embodiment, on the one hand, considering the rhythmic characteristics and periodic features of actions executed in turn according to a time cycle, the execution state of the external device is used to determine the target decoding model matching the execution state from the decoding model set. This target decoding model is then used to decode the EEG signals of the biological object, outputting control commands to the external device, thereby driving the external device to execute the target action corresponding to the execution state. Since this embodiment decouples the multi-classification problem of motor imagery into multiple decoding models, and different execution states of the external device are matched with different decoding models in the decoding model set, it avoids the difficulties in accurately classifying rhythmic motor imagery caused by using a single multi-classification model, the high rate of false triggering of actions, and the difficulty in distinguishing rhythmic actions using a binary classification model. On the other hand, by decoupling the multi-classification model into different decoding models, this embodiment significantly reduces the types of actions that a single model needs to distinguish, significantly reducing model complexity and training difficulty, thereby improving model stability. This achieves the goal of accurately decoding EEG signals using a decoding model matching the execution state, thus improving the control accuracy of the external device and solving the technical problem of low control accuracy of the external device. Attached Figure Description

[0035] The accompanying drawings, which are included to provide a further understanding of the embodiments of this application and constitute a part of this application, illustrate exemplary embodiments of this application and, together with their descriptions, serve to explain the embodiments of this application and do not constitute an improper limitation of the embodiments of this application. In the drawings:

[0036] Figure 1 This is a flowchart of a method for controlling an external device according to an embodiment of this application;

[0037] Figure 2 This is a flowchart of another method for controlling an external device according to an embodiment of this application;

[0038] Figure 3 This is a flowchart of a brain-controlled exoskeleton control method based on dual-model switching according to an embodiment of this application;

[0039] Figure 4 This is a schematic diagram of a brain-controlled exoskeleton control structure based on dual-model switching according to an embodiment of this application;

[0040] Figure 5 This is a schematic diagram of a control system for an external device according to an embodiment of this application;

[0041] Figure 6 This is a schematic diagram of a control device for an external device according to an embodiment of this application;

[0042] Figure 7This is a schematic diagram of a control device for another external device according to an embodiment of this application;

[0043] Figure 8 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

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

[0045] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of the embodiments of this application 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 embodiments of the present application 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 device that includes 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 devices.

[0046] According to an embodiment of this application, a method for controlling an external device is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0047] Figure 1 This is a flowchart of a method for controlling an external device according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps.

[0048] Step S102: Determine the target decoding model that matches the execution state of the external device from the decoding model set.

[0049] In the technical solution provided in step S102 of this application, the external device assists the biological object in performing multiple actions in turn according to a time cycle. The execution state is used to characterize the target action to be performed among the multiple actions. Different execution states are matched with different decoding models in the decoding model set.

[0050] In this embodiment, if it is necessary to control an external device, a target decoding model that matches the execution state of the external device can be determined from the decoding model set. Optionally, the current execution state of the external device for the target action to be executed can be obtained; based on the mapping relationship between the execution state and different decoding models in the decoding model set, a target decoding model matching the execution state can be determined.

[0051] Optionally, during the acquisition of the execution status of the external device, the current execution status of the external device can be determined by monitoring its current physical position, joint angle, or the stage of action it is currently performing. The aforementioned external device can refer to a hardware device used to assist a biological object in performing actions in turn according to a time cycle, and can be simply referred to as a peripheral device. If the aforementioned external device is applied to the field of rehabilitation training for a biological object, the external device can be a rehabilitation assistive device, such as a rehabilitation training device. Optionally, the aforementioned rehabilitation training device can include, but is not limited to, any one or more combinations of: exoskeleton systems (e.g., lower limb exoskeleton systems, upper limb exoskeleton systems), pneumatic gloves, spinal cord stimulators, and functional electrical stimulators. The lower limb exoskeleton system is used to assist the lower limbs of the biological object in rehabilitation training or movement assistance; the upper limb exoskeleton system is used to assist the upper limbs of the biological object in rehabilitation training or movement assistance; the aforementioned spinal cord stimulators and functional electrical stimulators can apply electrical stimulation to the biological object to stimulate the muscles of the biological object to produce movement. Generally, the sensation of electrical stimulation is delayed, meaning that by the time the electrical stimulation is felt, the current is already quite strong, which can lead to a missynchronization between the intention to step and the stimulation current. However, combining brain control can help biological subjects synchronize.

[0052] The aforementioned execution state can be used to characterize the target action to be performed among various actions of a biological object, and can be referred to as the peripheral state. The execution state can include motion state information corresponding to the device type of the external device. Specifically, if the external device is a mechanical execution device, the motion state information can include position, joint angle, velocity, and motion stage. If the external device is an electrical stimulation device, the motion state information can include stimulation state, stimulation parameters, stimulation phase, and stimulation period.

[0053] The aforementioned biological object can refer to a subject that generates electroencephalogram (EEG) signals through motor imagery and requires external equipment to complete motor functions. For example, the aforementioned biological object can refer to a patient who needs rehabilitation training or motor assistance.

[0054] The aforementioned multiple actions can refer to various types of actions that need to be performed in turn according to a time cycle. The time cycle can refer to the temporal pattern of multiple actions (action sequences) repeating in a fixed order when an external device assists a biological object in performing actions, such as a gait cycle or a joint flexion-extension cycle. Different types of actions can encompass different movement patterns that the biological object can produce. Each of the aforementioned multiple actions can refer to an action that the biological object can control the external device to perform through motor imagination. For example, multiple actions can include contralateral actions; optionally, the contralateral actions can be stepping with the left leg, stepping with the right leg, etc. Each of the aforementioned multiple actions can also include antagonistic actions; for example, the antagonistic actions are ipsilateral antagonistic actions, such as flexion and extension. For example, if the aforementioned external device is used to assist the biological object in flexing and extending its elbow, the corresponding multiple types of actions to be performed in turn according to the time cycle can be elbow flexion and elbow extension.

[0055] The aforementioned target action can refer to the action determined from a variety of actions executed in turn according to a time cycle, based on the execution state, and which is about to be executed by an external device. For example, if the external device is in the execution state of left leg support, then according to the gait logic in the time cycle, the target action to be executed at this time is a right leg step.

[0056] For example, multidimensional operational feedback data from an external device can be acquired. By analyzing this multidimensional operational feedback data, the movement stage of the external device and its kinematic parameters within that stage can be obtained. Based on the movement stage and kinematic parameters, the execution state of the external device can be determined. The multidimensional operational feedback data may include, but is not limited to, at least one of the following: kinematic parameters, dynamic / tactile parameters, and temporal parameters. The kinematic parameters may be the real-time angles, angular velocities, and accelerations of each driven joint of the external device; the dynamic / tactile parameters may be the torque, pressure, or electrical stimulation intensity at the limb contact interface between the external device and the biological object; and the temporal parameters may be the time consumed by the external device to perform the current action, or the time progress calculated based on a time period.

[0057] Optionally, different execution states are matched with different decoding models in the decoding model set. These different decoding models are designed for different types (categories) of actions and are used to distinguish between these types of actions and resting states. In determining the target decoding model from the decoding model set, after obtaining the execution state, a decoding model that has a mapping relationship with the execution state can be determined from the decoding model set as the target decoding model based on a preset mapping relationship between the execution state and the decoding model set. Determining the decoding model through this mapping relationship eliminates the possibility of confusion between the target action and other unrelated actions. The aforementioned decoding model set can refer to a collection containing multiple decoding models. Each decoding model is used to classify EEG signals for a specific motor intention subtask of an external device. The aforementioned motor intention subtask (which can be a binary classification subtask) is a binary classification problem obtained by decomposing a multi-classification problem for different execution states. The aforementioned motor intention subtask can be used to represent the process of performing a binary classification judgment between a target action and a resting state when the external device is in a corresponding execution state. That is, the aforementioned binary classification subtask is used to distinguish between motor states and resting states.

[0058] In this embodiment, the method described above transforms the complex multi-classification problem, which originally required distinguishing multiple actions simultaneously (e.g., stepping with the left leg, stepping with the right leg, etc.), into a binary classification problem based on execution state. Different execution states are matched with different decoding models in the decoding model set. By using the execution state to represent the target action to be executed among multiple actions, the problem of blurred classification boundaries caused by similar EEG features between different types of actions is effectively avoided.

[0059] Step S104: Input the EEG signal of the biological object into the target decoding model for decoding to obtain the decoding result.

[0060] In the technical solution provided in step S104 of this application, electroencephalogram (EEG) signals are used to characterize the motor imagination of a biological object. Various actions include those corresponding to the motor imagination. After determining a target decoding model from the decoding model set that matches the execution state of the external device, the EEG signals of the biological object can be input into the target decoding model for decoding to obtain the decoding result.

[0061] The aforementioned electroencephalogram (EEG) signals can be neural electrical activity signals obtained from the brain of a biological subject, and can be acquired using EEG acquisition equipment. These EEG signals can be used to characterize the subject's motor imagery. After preprocessing and feature extraction, neural signal features reflecting the corresponding motor intentions are formed. Motor imagery refers to the mental process by which a biological subject simulates and performs actions in the brain without actually moving its limbs. The biological subject generates EEG signals with specific spatiotemporal distribution and spectral characteristics through motor imagery. These EEG signals correspond to actions performed with the assistance of external devices; for example, imagining taking a step with the left leg corresponds to the action of taking a step with the left leg.

[0062] For example, one of the following methods can be used to acquire brain signals from a biological subject: electroencephalography (EEG), electrocorticography (ECoG), and spike mapping. EEG can acquire brain signals using electrodes on the scalp. ECoG involves placing an electrode array directly on the surface of the cerebral cortex (e.g., subdural or epidural). Spike mapping can be used to record discrete action potentials generated by single neurons or a small number of neurons in a biological subject using microelectrodes.

[0063] The decoding result obtained by decoding the EEG signal using the target decoding model refers to the discrimination information output by the target decoding model after processing the input EEG signal. This decoding result can be used to characterize whether the biological object is currently in a target motor imagery state. This target motor imagery state refers to the process by which the biological object simulates and performs a target action in its brain that matches the current execution state of an external device. The decoding result is used to quantify the degree of matching between the biological object's motor intention and the target action.

[0064] For example, the aforementioned discrimination information may include action category labels (referred to as action labels) and corresponding confidence levels. The action category label refers to the output of the target decoding model after performing binary classification on the EEG signal, indicating the category of the motor intention to which the current EEG signal belongs. For instance, the action category label may include two categories: the motor state of performing the target action and the resting state. The confidence level refers to an indicator that quantifies the certainty of the action category label, reflecting the degree of matching or similarity between the EEG signal and the action category label. A higher confidence level indicates a greater likelihood that the biological object will generate the target motor imagery state.

[0065] This embodiment utilizes a target decoding model to decode the electroencephalogram (EEG) signals of a biological object in order to identify the object's motor intention. The process may include: inputting EEG signals representing motor imagery into a target decoding model that matches the execution state; decoding the EEG signals using the target decoding model to obtain the decoding result, thereby completing the conversion from EEG signals to motor intention.

[0066] Optionally, during the decoding of EEG signals using the target decoding model, the EEG signals can be calculated using the pre-defined classification boundaries and weight parameters of the target decoding model to obtain the decoding results. During the calculation of EEG signals based on the classification boundaries and weight parameters, the target decoding model can be used to perform linear or nonlinear mapping operations on the feature vectors of the EEG signals in the feature space with the aforementioned weight parameters to calculate the decision values ​​or probability distributions for different categories of actions in the feature space. The calculated decision values ​​are compared with the classification boundaries of different categories of actions, or the probability distributions are normalized to determine the confidence levels of different categories of actions. If the decision values ​​exceed the classification boundaries, or the confidence level of a certain action is high, it can be determined that the biological object is in a state of target motor imagery. Action category labels and confidence levels can be generated based on the decision values ​​or confidence levels. These action category labels and confidence levels are then used as the decoding results. Conversely, if the decision values ​​do not exceed the classification boundaries, or there is no case of high confidence levels, a resting state can be determined.

[0067] In this embodiment, EEG signals are used to characterize the motor imagination of a biological object, and various actions include actions corresponding to motor imagination. The aforementioned motor imagination action can be the target action, that is, the action imagined by the physiological object through its brain is precisely the action to be executed by the external device. Using a target decoding model that matches the target action can effectively distinguish similar EEG features between different actions, avoiding confusion between multiple categories of actions. By inputting EEG signals into the target decoding model for decoding, the accuracy of decoding can be improved. This ensures that the decoding result accurately reflects whether the biological object has generated motor imagination, thereby ensuring that the external device executes the corresponding action when the biological object generates the correct motor intention, significantly improving the reliability of external device control and the experience of the biological object.

[0068] Step S106: Based on the decoding result, generate control instructions.

[0069] In the technical solution provided in step S106 of this application, the control instruction can refer to a digital signal or logic signal generated based on the decoding result, used to drive an external device to perform a target action. The control instruction is used to instruct the external device to perform a target action matching the current execution state; for example, it can be used to drive the exoskeleton joint movement of the external device or to initiate spinal cord stimulation. The control instruction may include an action type identifier and a trigger signal. The action type identifier can be used to identify the target action to be performed. The trigger signal is used to instruct the external device to perform the target action corresponding to the action type identifier. The trigger signal can be a specific level transition (e.g., a high-level pulse), a logic high signal, or a specific communication data packet flag, used to activate the external device's drive module or actuator, causing the external device to switch from a standby state or current state to an action execution state, thereby responding to the movement intention of the biological object.

[0070] In this embodiment, after decoding the EEG signals of a biological object using a target decoding model and obtaining the decoding result, control commands can be generated based on the decoding result. This embodiment converts the decoding result output by the decoding model into control commands for execution by an external device. The process may include: validating the decoding result to determine whether the biological object has indeed generated a motor intention to perform the target action; and converting the valid decoding result into control commands.

[0071] Optionally, the decoding result includes an action category label and its corresponding confidence level. During the validity verification of the biological object's motion intention based on the decoding result, the aforementioned confidence level can be compared with a confidence threshold. If the decoding result indicates that the biological object is in a target motion imaginary state, and the confidence level is higher than the preset confidence threshold, then the decoding result is deemed to have passed the validity verification, confirming that the biological object's motion intention is consistent with the target action corresponding to the current execution state of the external device, and a control command is generated to drive the external device to execute the target action; if the confidence level is lower than the aforementioned confidence threshold, specific abnormal situation handling is performed. If the decoding result indicates a resting state, a control command is generated to drive the external device to remain stationary.

[0072] Optionally, during the process of converting the valid decoding result into a control command, the action category label of the target action indicated in the decoding result can be extracted. Based on the action category label and the preset mapping relationship, a control command is generated. The mapping relationship can be used to represent the association between the action category label and the corresponding control command to be executed.

[0073] In this embodiment, the method of generating control commands based on decoding results ensures that the actions of the external device are controlled by the movement intentions of the biological object. By introducing a confidence threshold, the method effectively filters out false triggering signals, avoiding unexpected actions caused by noise in EEG signals or misclassification of movement intentions, thus significantly improving the safety of external device control. Simultaneously, by transforming the abstract decoding results into specific control commands, precise synchronization between the biological object's movement intentions and the physical actions of the external device is achieved, ensuring the continuity and effectiveness of external device control and enhancing the biological object's control perception experience.

[0074] Step S108: Based on the control command, drive the external device to perform the target action.

[0075] In the technical solution provided by step S108 of this application, after generating control instructions based on the decoding results, the external device can be driven to perform a target action based on the control instructions. This embodiment transforms the control instructions at the logical level into mechanical actions or electrical stimulation actions at the physical level for the external device, realizing the physical response of the external device to the movement intention of the biological object. The above process may include: parsing the action category label in the control instructions; transforming the control instructions into an execution signal for performing the target action; and driving the external device to perform the target action matching the current execution state according to the execution signal.

[0076] Optionally, during the parsing of control commands, the action category labels contained in the control commands can be parsed. Since the above action category labels clearly indicate the target action indicated by the biological object's operational intention, such as exoskeleton stepping or spinal cord electrical stimulation activation, by parsing the above action type labels, the target action that needs to be executed can be determined, which is convenient for providing a basis for generating the corresponding execution signal.

[0077] Optionally, during the process of driving an external device to perform a target action based on control commands, the corresponding drive module of the external device to be invoked, along with the execution signal corresponding to the drive module, can be determined based on the parsed action category label. For example, for an exoskeleton, the drive module controls a motor or hydraulic device to generate torque, driving the joint to execute a preset motion trajectory; for a spinal cord stimulator, the drive module controls a current generator to output pulsed current to a specific electrode channel. The corresponding drive module can be driven to execute the target action according to the aforementioned execution signal. Through the aforementioned drive mechanism of the external device, the external device can execute a target action that matches the current execution state, such as performing a right leg stepping action while the left leg is supporting the body, or applying electrical stimulation when a specific muscle group needs to be activated, thereby realizing the physical representation of the biological object's movement intention.

[0078] In steps S102 to S108 of this application, on the one hand, considering the rhythmic characteristics and periodic features of actions executed in turn according to a time cycle, the execution state of the external device is used to determine the target decoding model matching the execution state from the decoding model set. This target decoding model is then used to decode the EEG signals of the biological object, outputting control commands to the external device, thereby driving the external device to execute the target action corresponding to the execution state. Since this application decouples the multi-classification problem of motor imagery into multiple decoding models, and different execution states of the external device are matched with different decoding models in the decoding model set, it avoids the difficulties in accurately classifying rhythmic motor imagery caused by using a single multi-classification model, the high rate of false triggering of actions, and the difficulty in distinguishing rhythmic actions using a binary classification model. On the other hand, by decoupling the multi-classification model into different decoding models, this application significantly reduces the types of actions that a single model needs to distinguish, significantly reducing model complexity and training difficulty, thereby improving model stability. This achieves the goal of accurately decoding EEG signals using a decoding model matching the execution state, thus improving the technical effect of improving the control accuracy of the external device and solving the technical problem of low control accuracy of the external device.

[0079] The method described in this embodiment will be further described below.

[0080] As an optional implementation, different execution states correspond to different target actions, and different target actions are matched with different decoding models in the decoding model set. Step S102, from the decoding model set, determines the target decoding model that matches the execution state of the external device, including: determining the target action corresponding to the execution state; selecting the target decoding model that matches the target action from the decoding model set, wherein the target decoding model can determine whether the external device is in motion or in rest.

[0081] In this embodiment, during the process of determining the target decoding model that matches the execution state of the external device from the decoding model set, the target action corresponding to the execution state can be determined. A target decoding model matching the target action can be selected from the decoding model set. Different execution states correspond to different target actions. Different target actions are matched with different decoding models in the decoding model set. The aforementioned target decoding model can refer to a model constructed based on a preset binary classification algorithm, used to map EEG signals to decoding results of motor or resting states. For example, the aforementioned target decoding model can be a binary classification (action vs. resting) model, which can be used to distinguish whether the external device needs to be in a motor or resting state. The aforementioned target decoding model can be obtained through offline training. During training, the EEG signals corresponding to specific target actions and resting data shared with each target action are used to ensure the consistency of the decoding model on the resting baseline. For example, if the action is action one, the decoding model corresponding to action one can be a binary classification (action one vs. resting) model. If the action is action two, the decoding model corresponding to action two can be a binary classification (action two vs. resting) model.

[0082] For example, if the target action is determined to be a right leg step, the target decoding model can be a binary classification model of "right leg step vs. resting". If the target action is determined to be a left leg step, the target decoding model can be a binary classification model of "left leg step vs. resting". By configuring corresponding target decoding models for different target actions, the complex multi-classification problem can be decomposed into multiple simple binary classification sub-tasks, thereby reducing the overlap of feature information (such as EEG signals) of different actions in the feature space and improving the accuracy and robustness of decoding EEG signals.

[0083] This embodiment establishes a dynamic mapping relationship between the execution state of an external device and the target decoding model. The process may include: parsing the real-time execution state of the external device to determine the target action to be performed; and retrieving and locking the target decoding model from the decoding model set based on the target action. Through the above-mentioned decoding model selection mechanism based on execution state constraints, the multi-classification problem is simplified to a binary classification problem. The target decoding model can be used to determine whether the external device is in motion to perform the target action, or whether the external device is in a resting state. The motion state can refer to the EEG feature classification result corresponding to when a biological object generates a motor imagery of the target action. The motion state can be used to characterize a high degree of matching between the neural activity pattern of the biological object and the motor imagery of the target action.

[0084] In this embodiment, the motion state refers to the motion visualization state of the target action that matches the current execution state of the external device. For example, when the external device is in the "left leg supporting" execution state, the motion state can refer to the motion visualization state of "right leg stepping"; when the external device is in the "right leg supporting" execution state, the motion state can refer to the motion visualization state of "left leg stepping". The aforementioned resting state can refer to the EEG characteristic classification result corresponding to when the biological object has not generated motion visualization of the target action and is in a relatively relaxed or neutral neural activity state.

[0085] Optionally, in determining the target action corresponding to the execution state, since the execution state of the external device reflects its current physical position, movement stage, or preset control mode (e.g., the exoskeleton's "left leg support state" or "right leg swing state"), the execution state of the external device is converted into the corresponding target action according to a preset mapping relationship (state-action mapping rule). For example, when the external device is in the left leg support state, the determined target action is a right leg step; when the external device is in the right leg support state, the determined target action is a left leg step. Through this process, the movement intention that the current biological object needs to generate can be clearly defined.

[0086] Optionally, in the process of selecting the target decoding model to match the target action from the decoding model set, since the decoding model set pre-stores multiple decoding models trained for different actions, there is a one-to-one mapping relationship between each action and the decoding model in the decoding model set. For example, the action of "stepping with the left leg" matches the binary classification model of "stepping with the left leg vs. resting", and the action of "stepping with the right leg" matches the binary classification model of "stepping with the right leg vs. resting". After determining the target action, the decoding model set is searched according to the target action, and the decoding model that has a mapping relationship with the target action is directly extracted and loaded as the target decoding model.

[0087] In this embodiment, the method described above achieves synchronization and coupling between the decoding task of EEG signals and the execution state of the external device by determining the target action based on the execution state and selecting a matching target decoding model. This mechanism effectively decomposes the high-dimensional, complex multi-classification problem into a low-dimensional, simple binary sub-problem for different types of actions. Since the distribution and spectrum of EEG signals corresponding to different actions may overlap, the execution state can activate the target decoding model related to the current movement stage, significantly reducing confusion between different actions and lowering the probability of false triggering. Furthermore, compared to general multi-classification models, the binary classification model has higher classification boundary clarity and decoding accuracy for corresponding types of actions, thereby improving the stability, robustness, and user experience of the external device control.

[0088] As an optional implementation, the multiple actions include at least: a first action and a second action, with an external device used to assist the biological object in alternately executing the first action and the second action according to a time cycle, and determining the target action corresponding to the execution state, including: in response to the execution state indicating that the biological object has executed the first action and is about to execute the second action, determining the second action as the target action; in response to the execution state indicating that the biological object has executed the second action and is about to execute the first action, determining the first action as the target action.

[0089] In this embodiment, during the process of determining the target action corresponding to the execution state, if the execution state indicates that the biological object has performed a first action and is about to perform a second action, the second action can be determined as the target action. If the execution state indicates that the biological object has performed a second action and is about to perform a first action, the first action can be determined as the target action. The first action can refer to the first of two alternating target actions that the biological object needs to perform according to a predetermined sequence in a periodic movement task. For example, in rehabilitation or assisted control scenarios, the first action can correspond to a specific half-cycle phase in the limb movement cycle. For example, in a lower limb gait control scenario, the first action can be represented as a "right leg step" action; in an upper limb antagonistic movement control scenario, the first action can be represented as an "elbow extension" or "hand grasping" action. The first and second actions constitute a complete movement cycle, and while they differ significantly in neural characteristics, they have a periodic alternation relationship. If the external device determines that the target action is the first action, the corresponding target decoding model is used to determine whether the biological object has generated a movement intention to perform the first action. The first action can also be referred to as Action One.

[0090] The aforementioned second action can refer to another type of action that a biological object needs to perform in a periodic movement task, alternating with the first action according to a predetermined sequence. The second action and the first action are antagonistic or alternating, together forming a complete time cycle (motor cycle). For example, in a lower limb gait control scenario, if the first action is "right leg stepping," then the second action is represented as "left leg stepping"; if the first action is "elbow extension," then the second action is represented as "elbow flexion." When the external device determines that the target action is the second action, it switches to the corresponding second action target decoding model to decode the EEG signal to identify whether the biological object has the intention to perform the second action. The aforementioned second action can also be called action two.

[0091] This embodiment dynamically determines the target action corresponding to the current moment based on the execution state of the external device during periodic movement. The process may include: identifying the current movement stage of the external device (i.e., the execution status of the previous action and the preparation status of the next action); mapping the periodically alternating first and second actions to the target action that needs to be decoded. Through this temporal state-based determination mechanism, it is ensured that the decoding task of the EEG signal remains synchronized with the actual movement requirements of the external device.

[0092] Optionally, during the process of determining the second action as the target action, if the execution status feedback from the external device shows that the first action (e.g., a right leg step) has been completed, and the external device has entered a support or transition phase, preparing to execute the second action (e.g., a left leg step), it can be determined that the intention of the biological object to generate motion imagination at the current moment is for the second action. At this time, in order to capture the biological object's upcoming left leg step intention, the second action can be set as the current target action. The above determination logic utilizes the temporal pattern of the motion cycle, that is, after the right leg step is completed, the next natural motion intention can be a left leg step, thereby locking the corresponding decoding task in advance. Among them, the execution status of having executed the first action and about to execute the second action can refer to the state identifier of the external device's current physical position or motion phase being in the state that the first action has been completed and is preparing to enter the execution phase of the second action. For example, in an exoskeleton gait assistance scenario, this execution status can be represented as "left leg support state". At this time, the exoskeleton's left leg is in the support position, and the right leg is in the swing preparation position or the suspended position, and the second action of the right leg step is determined as the next action to be executed.

[0093] Optionally, during the process of determining the first action as the target action, if the execution status feedback from the external device indicates that the second action (e.g., a left leg step) has been completed, and the external device enters a support or transition phase, preparing to execute the first action (e.g., a right leg step), it can be determined that the intention of the biological object to generate motion imagination at the current moment is for the first action. At this time, in order to capture the biological object's upcoming right leg step intention, the first action can be set as the current target action. The above determination logic also utilizes the symmetry of the motion cycle, that is, after the left leg step is completed, the next natural motion intention can be a right leg step, thereby ensuring that the decoding model can be activated for the correct motion intention. Among them, the execution status of having executed the second action and about to execute the first action can refer to the current physical position or motion phase of the external device being in a state where the second action has been completed and is preparing to enter the execution phase of the first action. For example, in an exoskeleton gait assistance scenario, this execution status can be represented as "right leg support state". At this time, the right leg of the exoskeleton is in a support position, and the left leg is in a swing preparation position or a suspended position, and the first action of the left leg step is determined as the next action to be executed.

[0094] In this embodiment, the method dynamically determines the target action based on the execution state of the external device, achieving tight coupling between decoding control and the movement of the external device. The determination method based on the alternating execution logic of time cycles effectively utilizes the temporal characteristics of action sequences (multiple actions executed alternately within a time cycle) (e.g., the alternation of left and right legs in a gait cycle), simplifying the multi-classification problem that originally required simultaneously distinguishing multiple action intentions into a binary classification problem targeting the next action to be executed. This not only significantly reduces the classification difficulty and computational complexity of the decoding model but also effectively avoids false triggers caused by action confusion, improving the accuracy and real-time performance of external device control.

[0095] As an optional implementation, different target actions are executed by different actuators in an external device. From the set of decoding models, a target decoding model matching the target action is selected, including: in response to the target action being a second action, selecting a first target decoding model matching the second action from the set of decoding models, wherein the first target decoding model corresponds to a first actuator among the different actuators, and the first target decoding model can determine whether the first actuator is expected to be in a moving state or a resting state under motion imagination; in response to the target action switching from a second action to a first action, switching the first target decoding model to a second target decoding model matching the first action in the set of decoding models, wherein the second target decoding model corresponds to a second actuator among the different actuators, and the second target decoding model can determine whether the second actuator is expected to be in a moving state or a resting state under motion imagination.

[0096] The aforementioned actuators can refer to physical components in external devices used to drive limb movements or generate assistive forces in biological objects. For example, in rehabilitation medicine or motion assistance scenarios, these actuators may include, but are not limited to: joint drive modules of exoskeletons, electric actuators, hydraulic cylinders or motors, and neuromodulation devices such as functional electrical stimulators or spinal cord stimulators. There is a mapping relationship between actuators and different types of actions; that is, different actuators are used to perform different actions.

[0097] In this embodiment, during the process of selecting a target decoding model matching the target action from the decoding model set, if the target action is a second action, a first target decoding model matching the second action can be selected from the decoding model set. If the target action changes from a second action to a first action, the first target decoding model can be switched to a second target decoding model matching the first action from the decoding model set. The aforementioned execution mechanism may include a first execution mechanism and a second execution mechanism. Through the alternating operation of the first and second execution mechanisms, continuous assistance from external devices to the periodic movement intentions of biological objects is achieved.

[0098] The aforementioned first actuator can refer to a physical drive component in an external device used to perform the second action. That is, the first actuator drives the biological object to perform the second action after receiving the motion state command output by the first target decoding model. For example, in a periodic alternating action scenario, the first actuator can correspond to the limb drive device on the currently non-supporting side or the side to be moved. As another example, in a lower limb gait assistance scenario, if the second action is "stepping with the right leg," then the first actuator is a motor or hydraulic device that drives the movement of the right leg exoskeleton joint; if the second action is "hand grasping," then the first actuator is an electric motor that drives the glove to close.

[0099] The aforementioned second actuator can refer to a physical drive component in an external device used to perform the first action. For example, in a periodic alternating action scenario, the second actuator could correspond to a limb drive device on the current support side or the previous action side. As the action cycle progresses, the action performed by the second actuator switches to the first action. As another example, in a lower limb gait assistance scenario, if the first action is "stepping with the left leg," then the second actuator is a motor or hydraulic device that drives the movement of the exoskeleton joint of the left leg. The second actuator is used to drive the biological object to perform the first action after receiving the motion state command output by the second target decoding model.

[0100] This embodiment establishes a dynamic mapping relationship between the target action, the execution mechanism, and the decoding model, enabling adaptive switching of the decoding model. The process may include: retrieving and loading a matching target decoding model from the decoding model set based on the currently determined target action; and synchronously switching the corresponding decoding model when the target action switches during periodic motion to ensure that the decoding task remains consistent with the currently required action and its corresponding execution mechanism. Through this "action-model-execution mechanism" linkage mechanism, the complex multi-classification problem is transformed into a simple binary classification problem based on execution state.

[0101] Optionally, during the process of selecting the first target decoding model matching the second action from the decoding model set, if the execution state of the external device determines that the second action needs to be performed, the first target decoding model pre-bound and associated with the second action can be searched from the decoding model set. Here, the aforementioned first target decoding model can refer to a binary classification model in the decoding model set used to identify motor imagery related to the second action. The aforementioned first target decoding model has a mapping relationship with the first actuator; that is, the decoding result output by the first target decoding model is associated with the generation of control commands by the first actuator. The first target decoding model is used to determine whether the EEG signal indicates that the biological object expects the first actuator to be in a moving state to perform the second action, or expects the first actuator to be in a resting state. The aforementioned first target decoding model can also be called Model B. For example, if the target action is determined to be the second action (such as stepping with the right leg), Model B is activated to determine whether the biological object has generated a motor imagery of stepping with the right leg.

[0102] Optionally, during the process of switching from the first target decoding model to the second target decoding model, if the execution status display of the external device enters the next stage, that is, the target action changes from the second action to the first action, a switching operation is triggered to switch the decoding model from the first target decoding model to the second target decoding model. At this time, the currently used first target decoding model for the second action is removed, and a second target decoding model matching the first action is loaded from the decoding model set. The aforementioned second target decoding model can refer to a binary classification model in the decoding model set used to identify motor imagery related to the first action. The aforementioned second target decoding model has a mapping relationship with the second actuator; that is, the decoding result output by the second target decoding model is associated with the generation of control commands by the second actuator. The second target decoding model is used to determine whether the EEG signal indicates that the biological object expects the second actuator to be in a moving state to perform the first action, or expects the second actuator to be in a resting state. The aforementioned second target decoding model can also be called Model A. For example, if the target action changes from the second action to the first action (e.g., stepping with the left leg), Model A is activated to determine whether the biological object has generated a motor imagery of stepping with the left leg.

[0103] Optionally, by switching between the first target decoding model and the second target decoding model, it is possible to adapt to the needs of different actuators working alternately under the periodic motion (rhythmic action) that is executed in turn within the time period, and ensure that each actuator can obtain accurate intent decoding at the corresponding stage.

[0104] In this embodiment, the method described above achieves precise coordination between the decoding logic and the action to be executed by the external device by simultaneously selecting or switching the first target decoding model and the second target decoding model based on the dynamic switching of the target action. Since the first and second target decoding models are optimized and trained for specific action features, they have higher classification boundary clarity and decoding specificity compared to general single multi-classification models, thereby significantly reducing confusion between different actions and improving the accuracy and robustness of EEG signal decoding.

[0105] As an alternative implementation, the first action and the second action are opposite or antagonistic actions of the biological object.

[0106] In this embodiment, the aforementioned contralateral action can refer to two alternating movements in the limb movement of a biological object, involving opposite sides of the body or the same limb in spatial position. In tasks involving periodic movement, contralateral actions can manifest as the alternating execution of the left and right limbs, such as "stepping with the left leg" and "stepping with the right leg" when walking, or "pulling the left arm back" and "pulling the right arm back" when rowing. Since contralateral actions involve the alternating activation of the contralateral motor cortex in terms of neural control, the EEG signals of the biological object exhibit high symmetry or similarity in the distribution and spectrum of the feature space, making it difficult to clearly distinguish them in a single multi-classification model. In this embodiment, by treating two contralateral actions as the first and second actions respectively, and using the execution state of an external device for constraint, binary classification decoding models are constructed to effectively solve the classification ambiguity problem caused by contralateral actions.

[0107] Optionally, in the contralateral action scenario, the first action and the second action correspond to the alternating movement of the left and right limbs of the biological object, respectively. Since the EEG activation areas corresponding to stepping with the left and right legs are symmetrical but have similar features, traditional multi-classification models struggle to distinguish them. This embodiment dynamically determines whether the next action is a "left leg step" or a "right leg step" based on the current state of the external device ("left leg support" or "right leg support"), and calls the corresponding binary classification model accordingly, thereby achieving accurate decoding even with highly symmetrical spatial features.

[0108] The aforementioned ipsilateral antagonistic actions refer to two opposing and opposite movements within the same limb or joint of a biological object. For example, in rehabilitation training or motor assistance scenarios, ipsilateral antagonistic actions can manifest as alternating flexion and extension of joints or alternating contraction and relaxation of muscles, such as "elbow flexion" and "elbow extension," or "knee flexion" and "knee extension," and "fist clenching" and "fist opening" of the hand. Since ipsilateral antagonistic actions are controlled by the same motor unit group, the corresponding EEG signals activate adjacent brain regions, such as the primary motor cortex M1 and the primary somatosensory cortex S1, which have highly similar spectral characteristics and are prone to confusion. In the embodiments of this application, the two ipsilateral antagonistic actions are respectively designated as the first action and the second action. The corresponding decoding model is dynamically selected based on the execution state of the external device (e.g., the stage of the joint), simplifying the complex identification of ipsilateral antagonistic actions into a binary classification problem, thereby improving the decoding accuracy of the motor intention of ipsilateral antagonistic actions.

[0109] Optionally, in ipsilateral antagonistic action scenarios, the first action and the second action correspond to opposite movements of the same limb joint. Since antagonistic actions are controlled by adjacent brain regions, there is significant overlap in EEG signals. In this embodiment, by utilizing the current execution state of the external device—whether it is in the "flexion phase" or "extension phase"—the system identifies whether the current movement intention to be recognized is "flexion" or "extension" and switches to the corresponding binary classification model, effectively reducing action confusion caused by muscle co-activation.

[0110] In this embodiment, the first and second actions are defined as either contralateral or ipsilateral antagonistic actions, specifically addressing two typical decoding challenges in brain-computer interface applications. For contralateral actions, the spatial ambiguity of left and right movement intentions is eliminated through execution state constraints, utilizing the symmetry of body structure and the alternation of movement cycles. For ipsilateral antagonistic actions, the temporal sequence of movement phases is utilized to separate highly overlapping antagonistic signals into independent binary classification tasks through state switching. Both of these approaches significantly reduce decoding complexity and improve the accuracy of movement intention recognition.

[0111] As an optional implementation, determining a target decoding model matching the execution state of an external device from a set of decoding models includes: in response to the execution state being consistent with the instruction state of the decoding system, controlling the decoding system to determine a target decoding model matching the execution state from the set of decoding models, wherein the instruction state is used to characterize the action that the decoding system instructs the external device to perform.

[0112] In this embodiment, during the process of determining the target decoding model matching the execution state of the external device from the decoding model set, if the execution state is consistent with the instruction state of the decoding system, the decoding system can be controlled to determine the target decoding model matching the execution state from the decoding model set. The aforementioned decoding system can refer to a software or hardware processing unit used to receive and process EEG signals generated by a biological object, and to convert the EEG signals into control commands for motor intentions using a preset decoding model. The decoding system integrates a set of decoding models. The functions of the decoding system can include: receiving raw or pre-processed EEG signals from the EEG acquisition device; dynamically selecting or switching the matching target decoding model from the decoding model set according to the execution state of the external device and its own instruction state; classifying and judging the features of the EEG signals using the target decoding model, outputting the identified motor intention (decoding result); and converting the identified motor intention into control commands and sending them to the external device. The aforementioned decoding system can be decoding software.

[0113] Optionally, the aforementioned instruction state can be used to represent, at the current moment, the logical control signal generated and output by the decoding system based on the decoding result, to instruct the external device to perform a response action. This instruction state can characterize the type of target action corresponding to the current motion imagery generated by the biological object, as determined by the decoding system; that is, the action the decoding system expects the external device to perform. For example, if the decoding system identifies that the biological object has a "right leg stepping" intention, the instruction state can be represented as "right leg stepping." The instruction state is compared with the actual execution state of the external device to verify the accuracy of the decoding result and the synchronization of the decoding system's operation, ensuring that the biological object's motion intention is consistent with the physical action of the external device, and preventing control conflicts caused by decoding errors or communication anomalies.

[0114] This embodiment aims to ensure the security and accuracy of external device control through a dual verification mechanism: a consistency comparison between the execution state and the instruction state, and a decoding model selection verification based on the execution state. The process may include: acquiring the real-time execution state of the external device and the instruction state generated by the decoding system based on EEG signals; performing a consistency comparison between the execution state and the instruction state; when the execution state matches the instruction state, determining the reliability of the current decoding system, and selecting a target decoding model that matches the execution state from the decoding model set.

[0115] Optionally, during the process of determining the target decoding model matching the execution state from the decoding model set, the execution state of the external device can be obtained. Simultaneously, the instruction state of the decoding system can be obtained. The execution state and instruction state are compared to determine if they are consistent in terms of action intent. When the execution state and instruction state are consistent, it indicates that the biological object's movement intent is synchronized with the expected action to be performed by the external device, and no execution failure or decoding error has occurred. Under this premise, the decoding system searches the decoding model set for a target decoding model that matches the current execution state. For example, if both the execution state and instruction state point to "stepping with the right leg," the decoding system determines the first target decoding model associated with the action "stepping with the right leg" as the target decoding model. This method ensures that the action intent is confirmed... Figure 1 Provided that the operation is performed normally, the decoding model optimized for the above actions is activated.

[0116] Optionally, the above embodiment of comparing the execution state with the instruction state of the decoding system can serve as a precondition for determining the target action based on the execution state and then determining the target decoding model that matches the target action. That is, if the execution state of the external device matches the instruction state of the decoding system, the target decoding model can also be determined. The specific process for determining the target decoding model involves determining the target action based on the execution state and then determining the target decoding model that matches the target action.

[0117] In this embodiment, the method establishes a closed-loop verification mechanism by determining the target decoding model only when the execution state matches the instruction state of the decoding system. This mechanism effectively prevents the decoding system from using an incorrect decoding model in abnormal situations such as decoding errors, communication delays, or execution failures, which could lead to confusion in the control of external devices or dangerous actions. This improves the accuracy of motion intent recognition, thereby enhancing the biological object's confidence in controlling the auxiliary device and improving the user experience.

[0118] As an optional implementation, in response to the execution state being consistent with the instruction state of the decoding system, the decoding system is controlled to determine a target decoding model matching the execution state from the decoding model set. This includes: in response to the decoding system's first operation and the execution state being consistent with the default instruction state of the decoding system, the decoding system is controlled to determine a target decoding model matching the execution state from the decoding model set, wherein the default instruction state is used to characterize the default action that the decoding system instructs the external device to perform; after the decoding system's first operation, in response to the execution state being consistent with the current instruction state of the decoding system, the decoding system is controlled to determine a target decoding model matching the execution state from the decoding model set, wherein the current instruction state is used to characterize the decoding system instructing the external device to switch from the currently executed action among multiple actions to the action that is about to be executed among multiple actions.

[0119] In this embodiment, during the process of controlling the decoding system to determine the target decoding model matching the execution state from the decoding model set, if the decoding system is running for the first time and its execution state is consistent with the default instruction state of the decoding system, then the decoding system can be controlled to determine the target decoding model matching the execution state from the decoding model set. The aforementioned default instruction state can refer to the preset instruction information used by the decoding system during its first run (initial startup phase) to initialize the control logic and establish the mapping relationship between the external device and the decoding model. The default instruction state can characterize the initial default action that the decoding system instructs the external device to perform, corresponding to the starting action in periodic motion or the first action in a fixed sequence. For example, in a lower limb exoskeleton gait assistance scenario, if the decoding system sets the initial action to a right leg step, then the default instruction state is represented by the instruction information "right leg step". The existence of the default instruction state is to provide a definite logical starting point when the decoding system has not yet accumulated decoding results and it is difficult to determine the dynamic current instruction state. This ensures that the decoding system can correctly load the corresponding target decoding model based on the execution state of the external device (e.g., starting from right leg support by default), thereby achieving synchronous alignment when the decoding system starts.

[0120] Optionally, if the execution state matches the current instruction state of the decoding system after its initial run, the decoding system can be controlled to determine the target decoding model with the matching execution state from the set of decoding models. The aforementioned current instruction state can refer to the instruction state generated and updated in real-time by the decoding system after its initial run, based on the decoding results of the previous motion cycle, motion task logic, or preset gait trajectory, used to indicate a new action that the external device is about to execute. This current instruction state can represent the decoding system instructing the external device to switch from the currently executed action to the next action to be executed in the action sequence. The current instruction state can include dynamic tracking of the motion cycle; for example, when the external device is in the "left leg support" phase, the current instruction state represents the instruction information indicating that the exoskeleton is "about to step out with its right leg."

[0121] This embodiment aims to dynamically and accurately determine the target decoding model by distinguishing the operational phases of the decoding system (the initial operation phase and subsequent operation phases after the initial operation) and combining the consistency verification between the real-time execution state of external devices and the corresponding instruction state (default instruction state or current instruction state). The process may include: determining whether the decoding system is in its initial operation phase; if the decoding system is in its initial operation phase, comparing the execution state with the default instruction state; if the decoding system is not in its initial operation phase, comparing the execution state with the real-time updated current instruction state. If the execution state matches the instruction state of the corresponding phase, a matching target decoding model is determined from the decoding model set.

[0122] Optionally, during the initial run of the decoding system, when the execution state is consistent with the default instruction state, in the process of determining the target decoding model, since the decoding system has not yet generated control instructions based on the real-time motion intent of the biological object at the initial startup stage, the default instruction state can be used as the initial verification basis. The current execution state of the external device is obtained, for example, the exoskeleton is in a "left leg support" physical state and is preparing to execute "right leg step"; the default instruction state of the decoding system is obtained, for example, the preset initial instruction of the decoding system is "right leg step"; it is then determined whether the execution state is consistent with the default instruction state. When the execution state is consistent with the default instruction state, it indicates that the initial position of the external device matches the preset starting control logic of the decoding system. At this time, the decoding system determines the target decoding model matching the default action "right leg step" from the decoding model set. This method solves the decoding model initialization problem when the decoding system is first started, ensuring that a correct decoding mapping relationship (corresponding to "default instruction state - default action - target decoding model") can be established during the first run.

[0123] Optionally, after the decoding system runs for the first time, the execution state is consistent with the current instruction state. During the process of determining the target decoding model, the control logic shifts from static default to dynamic current after the decoding system enters the continuous running phase. This process may include: acquiring the real-time execution state of the external device, for example, the exoskeleton has completed its right leg step and is currently in a "right leg support" state, preparing to execute the "left leg step"; acquiring the current instruction state generated by the decoding system based on the completion of previous actions and the motion logic, i.e., the instruction to "left leg step"; and determining whether the execution state is consistent with the current instruction state. When they are consistent, it indicates that the biological object's motion intention (reflected by the decoding system) is synchronized in real time with the motion stage of the external device. At this point, the decoding system determines the target decoding model from the decoding model set that matches the action to be executed, "left leg step." This method achieves dynamic loading of the corresponding target decoding model as the execution state changes during continuous motion, ensuring the accuracy of action intention recognition at each motion stage.

[0124] In this embodiment, the method effectively solves the problem of initial synchronization and dynamic switching in external device control by distinguishing between the initial run and subsequent runs, and using the default instruction state and the current instruction state and execution state for consistency verification respectively. During the initial run, the default instruction state is used to ensure the correctness of the model selection when the system starts, avoiding decoding deviations caused by unclear initial states. In subsequent runs after the initial movement, the current instruction state is used to track the progress of the movement cycle in real time, ensuring that the decoded model is dynamically updated with the transition of the action stage, realizing a precise mapping of "state-action-model".

[0125] As an optional implementation, the method further includes: in response to an inconsistency between the execution state and the instruction state of the decoding system, prohibiting the decoding system from determining a target decoding model matching the execution state from the set of decoding models, wherein the external device enters a safe static state.

[0126] In this embodiment, if the execution state is inconsistent with the instruction state of the decoding system, the decoding system can be prevented from determining a target decoding model matching the execution state from the decoding model set. In this situation, the external device can enter a safe static state. This safe static state refers to a controlled, non-motion operating mode entered by the external device when an inconsistency is detected between its execution state and the instruction state of the decoding system. This safe static state indicates that the external device stops performing its actions and maintains its current position or a preset safe stop position, no longer responding to control commands output by the decoding system. Switching to the safe static state can serve as an exception handling mechanism to prevent conflicts between the external device's actions and the biological object's movement intentions caused by decoding errors, communication delays, or execution failures, thereby avoiding potential harm to the biological object. In the safe static state, the external device's execution state can be locked until it re-establishes consistency with the decoding system's instruction state, or until a clear reset command is received. Afterward, it can exit the safe static state and resume the normal decoding process.

[0127] This embodiment aims to establish an anomaly handling and safety protection mechanism during the control of external devices. The process may include: real-time monitoring of the execution state of the external device and the instruction state of the decoding system, and comparing their consistency; if an inconsistency is detected between the execution state and the instruction state, an anomaly is identified, and safety protection logic is triggered. This safety protection logic may include two aspects: firstly, prohibiting the decoding system from determining the target decoding model from the decoding model set to block subsequent erroneous decoding and control command generation; secondly, forcing the external device into a safe static state to ensure that the external device stops moving. This process, by combining the prohibition of determining the decoding model with entering a safe static state, effectively prevents external device control chaos due to decoding errors or execution deviations, thus ensuring the safety of biological objects.

[0128] Optionally, during the process of prohibiting the determination of the target decoding model from the decoding model set, the execution status of the external device and the instruction status of the decoding system can be obtained and compared. When the comparison result shows that the two are inconsistent, it indicates that there is a deviation between the current motion intention and the actual action of the external device, or that there are abnormal situations such as communication delays or execution failures. In this case, the process of controlling the decoding system to select the target decoding model from the decoding model set is suspended; that is, the decoding system is prohibited from determining the target decoding model based on the current inconsistent execution status. This means that the decoding system will no longer output control instructions for the current abnormal situation, thereby cutting off the source of erroneous control instructions at the software logic level and preventing the decoding system from continuing to output control instructions, which could lead to action conflicts or dangerous control signals.

[0129] Optionally, during the process of controlling the external device to enter a safe static state, the external device can be controlled to stop all its actions and its current mechanical position can be locked, or the external device can be moved to a preset safe position. For example, if the exoskeleton detects an inconsistency between the execution state and the command state during a step, the exoskeleton will immediately stop joint drive, maintain the current leg posture, or slowly stop until the abnormal situation is resolved. The above method, through physical static control, ensures that in abnormal situations, the external device will not exert uncontrollable mechanical forces or movements on the biological object, thereby avoiding injury to the biological object or damage to the external device.

[0130] In this embodiment, by preventing the determination of the target decoding model in response to the inconsistency between the execution state and the instruction state of the decoding system, and by putting the external device into a safe static state, the security and robustness of the external device control are significantly improved.

[0131] As an optional implementation, the decoding result includes a classification result and a confidence level. The classification result is used to indicate whether the external device is expected to be in motion to perform the target action under motor imagination, or whether the external device is expected to be in a resting state. The confidence level is used to indicate the reliability of the classification result. The EEG signal of the biological object is input into the target decoding model for decoding to obtain the decoding result, including: controlling the decoding system to input the EEG signal into the target decoding model for decoding to obtain the classification result and the confidence level.

[0132] In this embodiment, during the process of inputting the EEG signals of a biological object into the target decoding model for decoding, the decoding system can be controlled to input the EEG signals into the target decoding model for decoding, obtaining classification results and confidence levels. The classification results can be used to represent discrete label information of the biological object's current movement intention, indicating whether the user expects an external device to be in motion to perform a target action under motor imagination, or whether they expect the external device to be in a resting state. The classification results can be action labels (i.e., action category labels), such as specific categories like "left leg movement," "right leg movement," or "resting." The confidence level refers to the numerical index output by the target decoding model while obtaining the classification result, representing the reliability or probability of the classification result. The confidence level can be used to quantify the degree of certainty the decoding system has regarding the classification result. The confidence level can be a value within a range (e.g., between 0 and 1).

[0133] This embodiment aims to perform real-time analysis of electroencephalogram (EEG) signals of biological objects using a target decoding model, generating decoding results that include intent category and reliability. The process may include: inputting EEG signals (e.g., preprocessed EEG signals from raw EEG signals) into the target decoding model; extracting neural features from the EEG signals using the target decoding model's classification algorithm; mapping these neural features to corresponding action spaces; and determining the similarity between the neural features and the action features of various actions in the action space. Classification results and confidence levels can be determined based on the similarity. The target decoding model can then output the classification results and confidence levels.

[0134] Optionally, during the process of inputting EEG signals into the target decoding model for decoding and obtaining classification results, the original EEG signals of the biological object can be acquired and preprocessed to obtain preprocessed EEG signals. These preprocessed EEG signals are then input into the target decoding model. The target decoding model is used to calculate the matching probability between the EEG signals and different action categories (e.g., left leg movement, right leg movement, resting). Alternatively, in the action space, the neural features of the EEG signals and the distance (representing similarity) between them and the action features of different action categories can be determined, and the matching probability or distance can be used as the calculation result. Based on the calculation result, a classification result representing the expectation that an external device will be in motion to perform the target action under motor imagination, or the expectation that an external device will be in a resting state, is output. For example, if the calculation result indicates that the EEG signal is close to the action category of "left leg movement," then the classification result is an action label indicating left leg movement.

[0135] Optionally, in determining the confidence level using the target decoding model, a numerical metric can be generated based on the classification results. This metric can represent the reliability of the classification results. The confidence level can be defined as this metric. A higher confidence level indicates a clearer EEG signal that better matches the neural pattern of the target action, and a more reliable classification result. A lower confidence level indicates potential noise interference or unclear action intent in the EEG signal.

[0136] In this embodiment, the method described above inputs EEG signals into the target decoding model through a control decoding system, simultaneously obtaining classification results and confidence levels, thereby achieving accurate identification and reliability assessment of the biological object's movement intentions. This dual-output mechanism not only improves the accuracy of external device control but also significantly enhances the robustness of the decoding system, effectively reducing the risk of misoperation caused by EEG signal fluctuations or noise interference, thus improving the stability and safety of the biological object when using external devices.

[0137] As an optional implementation, based on the decoding result, control instructions are generated, including: in response to the classification result indicating that the external device is expected to be in motion under motion imagination to perform a target action, and the confidence level is greater than a confidence level threshold, generating control instructions for driving the actuators in the external device, wherein different target actions are performed by different actuators in the external device.

[0138] In this embodiment, during the process of generating control commands based on the decoding results, if the classification result indicates that the external device is expected to be in motion to perform the target action under motion imagination, and the confidence level is greater than the confidence level threshold, a control command can be generated to drive the actuator in the external device to perform the target action. The aforementioned confidence level threshold can be used to determine whether the decoding result is qualified to trigger the external device to perform the target action. For example, the aforementioned confidence level threshold can be a pre-set default value (e.g., 0.5), or it can be determined by engineers through on-site debugging; no specific limitation is made here.

[0139] This embodiment aims to convert the decoding results output by the decoding system into control commands for external devices. The process may include: jointly determining the classification result and confidence level in the decoding result to obtain a determination result; if the determination result indicates that the classification result suggests the external device is in motion, and the confidence level exceeds a preset confidence threshold, a control command generation mechanism can be triggered. Based on the target action indicated by the execution state, it is mapped to the corresponding actuator in the external device, generating control commands to drive the actuator's action. This method ensures that, when the motion intention is clear and reliable, the external device executes the corresponding target action, achieving a precise and safe mapping from the motion intention of a biological object to the mechanical action of the external device.

[0140] Optionally, during the generation of control commands, the classification result output by the decoding system can be obtained, and it can be determined whether the classification result indicates that, under motion visualization, the external device is expected to be in motion to perform the target action, rather than in a resting state. Alternatively, the confidence level output by the decoding system can be obtained and compared with a preset confidence threshold. When the classification result indicates that the external device is in motion and the confidence level is greater than the confidence threshold, the conditions for generating control commands are deemed met. At this point, the target action corresponding to the classification result is determined, and the actuator in the external device that needs to be driven is determined based on the target action.

[0141] Optionally, during the generation of control commands for driving the actuators in the external device, the actuator in the external device used to perform the target action can be located based on the determined target action. This is because different target actions are performed by different actuators in the external device; for example, a left leg step is performed by a left leg drive motor, and a right leg step is performed by a right leg drive motor. Corresponding control commands are then generated for each actuator. These control commands are sent to the corresponding control interface of the external device to drive the corresponding actuator to perform the target action, thereby enabling the control of the external device by the imagined movement of the biological object.

[0142] In this embodiment, the method described above, in response to the classification result representing a motor imagery, anticipates that the external device will be in motion to perform a target action, and the confidence level is greater than a confidence threshold. This generates control commands to drive the actuators in the external device, significantly improving the accuracy, safety, and efficiency of external device control. This control logic, based on dual conditions (intent category + confidence level), maximizes the user experience of the external device and the effectiveness of rehabilitation training while ensuring the safety of the biological object.

[0143] As an optional implementation, the multiple actions include at least: a first action and a second action, and control instructions include a first control instruction and a second control instruction. The first control instruction is used to drive a first actuator among different actuators to perform the second action, and the second control instruction is used to drive a second actuator among different actuators to perform the first action among the multiple actions. Based on the control instructions, driving an external device to perform a target action includes: responding to the first control instruction, driving the first actuator to perform the second action and cooperating in driving a spinal cord stimulator in the external device to perform an activation operation on the biological object for the second action; or, responding to the second control instruction, driving the second actuator to perform the first action and cooperating in driving a spinal cord stimulator in the external device to perform an activation operation on the biological object for the first action.

[0144] In this embodiment, during the process of driving an external device to perform a target action based on control commands, in response to the first control command, the first actuator of the external device can be driven to perform a second action, and the spinal cord stimulator in the external device can be driven in concert to perform the activation operation of the second action on the biological object. In response to the second control command, the second actuator can be driven to perform the first action, and the spinal cord stimulator can be driven in concert to perform the activation operation of the first action on the biological object.

[0145] The aforementioned spinal cord stimulator can refer to a neuromodulation device deployed in an external device to apply electrical pulse signals to the spinal cord region of a biological subject. This spinal cord stimulator transmits electrical signals to the spinal cord region via an electrode array, aiming to activate damaged or dormant neural pathways through electrical stimulation, promote neural plasticity reconstruction, and assist the biological subject in generating or enhancing muscle contraction responses related to the target movement. The aforementioned activation operation can refer to the process by which the spinal cord stimulator, based on control commands, performs electrical stimulation on the biological subject for a target movement. This activation operation can characterize the application of electrical stimulation parameters conforming to the neurophysiological characteristics of the movement to the biological subject simultaneously with or within a specific time window of the external device's mechanical drive to execute the target movement. The activation operation aims to strengthen the neural connection between motor intention and muscle response through electrical stimulation, assisting the biological subject in completing the target movement, improving the synchronicity and effectiveness of motor control, thereby achieving coordinated drive from the neural to the muscle level.

[0146] Optionally, upon receiving a first control command, the first actuator can be controlled to perform a second action (e.g., a right leg step). Simultaneously with or within a specific time window, a stimulation signal is sent to a spinal cord stimulator in an external device. The spinal cord stimulator is then controlled to apply electrical stimulation to the biological object. This stimulation targets the neurophysiological characteristics of the second action, aiming to activate neural pathways or muscle groups associated with the second action, thereby assisting the biological object in completing the second action and achieving temporal coordination between mechanical movement and neural stimulation.

[0147] Optionally, upon receiving a second control command, the second actuator can be controlled to perform a first action (e.g., a left leg step). Simultaneously with or within a specific time window, a stimulation signal is sent to a spinal cord stimulator in an external device. The spinal cord stimulator is then controlled to apply electrical stimulation to the biological object, targeting the neurophysiological characteristics of the first action and aiming to activate neural pathways or muscle groups associated with it, thereby assisting the biological object in completing the first action and achieving temporal coordination between mechanical movement and neural stimulation.

[0148] In this embodiment, the method, in response to a first control command or a second control command, drives the corresponding actuator to perform a second action or a first action, and collaboratively drives the spinal cord stimulator to perform an activation operation for the corresponding action, thus achieving a deep integration of external device control and neuromodulation therapy. This collaborative mechanism not only provides precise motion trajectory guidance through the mechanical actuator but also provides immediate neural feedback through the spinal cord stimulator, which helps to rebuild the neural connection between motor intention and muscle response.

[0149] As an optional implementation, the method further includes: controlling the external device to remain stationary in response to a classification result indicating that the external device is expected to be in a resting state, and / or, if the confidence level is less than or equal to a confidence threshold.

[0150] In this embodiment, if the classification result indicates that the external device is expected to be in a resting state, and / or the confidence level is less than or equal to a confidence threshold, the external device can be controlled to remain in a resting state. Here, the resting state can refer to the non-motion operating mode maintained by the external device when it receives a classification result indicating that it is expected to be in a resting state, or detects that the decoding confidence level is less than or equal to the confidence threshold. In the resting state, the actuators in the external device stop active driving, maintain their current mechanical position or are at zero position, and do not generate displacement or torque output. The resting state can be a safety and energy-saving mechanism designed to respond to the lack of motion intent or low-confidence signals from the biological object, prevent malfunctions of the external device, and ensure the safety of the biological object during training or assistance.

[0151] This embodiment aims to establish a safety protection and quiescent maintenance mechanism for an external device control system. The process may include: determining, through real-time monitoring of the classification result and confidence level in the decoding results, whether the biological object expects the external device to remain quiescent, or whether the reliability of the current decoding result (assessed by the magnitude between the confidence level and a confidence threshold) is insufficient. When at least one of the following conditions is met—that the classification result indicates an expectation of the external device being quiescent, or that the confidence level is less than or equal to the confidence threshold—the external device is controlled to maintain its current quiescent state, ceasing any active driving actions to ensure biological safety and prevent misoperation.

[0152] Optionally, during the process of keeping the external device stationary, the classification result output by the decoding system can be obtained, and it can be determined whether the classification result indicates that the external device is expected to be in a resting state under motion imagination. At the same time, the confidence level output by the decoding system can be obtained, and the confidence level can be compared with a preset confidence threshold. If the classification result indicates that the external device is expected to be in a resting state, or the confidence level is less than or equal to the confidence threshold, then a resting condition is triggered. In response to triggering the resting condition, a stop command or a hold command is sent to the actuator of the external device, so that the actuator stops active driving, locks the joint position or maintains a zero position, thereby controlling the external device to remain stationary and not perform the target action.

[0153] In this embodiment, the method described above controls the external device to remain stationary in response to the classification result indicating a desired resting state, and / or a confidence level less than or equal to a confidence threshold. This significantly improves the security and robustness of the external device control system. By utilizing both classification results and confidence levels, the method ensures that actions are triggered only when the intention to move is clear and highly reliable, and immediately stops or maintains stillness when the intention is resting or the signal is unreliable. This effectively avoids accidental movement caused by EEG signal noise, misjudgment, or fatigue of the biological object.

[0154] As an optional implementation, after driving the external device to perform the target action based on the control command, the method further includes: obtaining the target command state of the decoding system, wherein the target command state is used to characterize that after the decoding system inputs the EEG signal into the target decoding model for decoding and obtains the decoding result, the decoding system instructs the external device to switch from the currently executed action among multiple actions to the action to be executed among multiple actions; determining the target decoding model matching the target command state from the decoding model set, and returning to start executing from the following steps: inputting the EEG signal of the biological object into the target decoding model for decoding and obtaining the decoding result.

[0155] In this embodiment, after driving the external device to execute the target action based on control commands, the target command state of the decoding system can be obtained. A target decoding model matching the target command state can be determined from the decoding model set, and the step of inputting the EEG signal of the biological object into the target decoding model for decoding can be returned. The target command state refers to the state information representing the current execution logic and movement phase switching intention of the external device after the decoding system generates the control commands. The target command state can be used to indicate that the decoding system has switched from the currently executed action phase to the target action phase to be executed, thereby providing the correct model selection basis for the next EEG signal decoding. In periodic or phased motion control, the target command state can ensure the synchronization of the decoding model with the actual movement sequence of the external device, for example, switching from a "left leg support" state to a "right leg stepping" decoding preparation state, to achieve adaptive switching between decoding models of different actions.

[0156] This embodiment aims to achieve closed-loop feedback and dynamic adaptive switching of the decoding model during the control process of external devices. The process may include: after the external device completes the current target action, the next action stage to be executed is determined by acquiring the target instruction state generated by the decoding system. Based on the target instruction state, the corresponding target decoding model is selected from the decoding model set, and the process is returned to the decoding step. The newly determined target decoding model is then used to perform a new round of decoding on the EEG signal of the biological object, thereby completing a smooth transition and continuous control from the current action to the next action.

[0157] Optionally, in the process of obtaining the target instruction state of the decoding system and determining the target decoding model that matches the target instruction state from the decoding model set, after driving the external device to execute the target action based on the control command, the target instruction state of the decoding system can be obtained; based on the obtained target instruction state, a search and match can be performed in the pre-built decoding model set to determine the target decoding model corresponding to the action that is about to be executed.

[0158] Optionally, in the process of inputting the EEG signal of the biological object into the target decoding model corresponding to the target instruction state for decoding, and generating a new control command based on the decoding result to drive the external device to perform the next target action, the EEG signal of the biological object collected in real time can be input into the target decoding model; the target decoding model is used to extract features and classify the input EEG signal to obtain a decoding result containing the type of movement intention and confidence level; based on the decoding result, a new control command is generated according to the preset control logic; through this "decoding-control-action-state update-re-decoding" cyclic mechanism, continuous and precise control of the movement process of the external device can be achieved.

[0159] In this embodiment, the method described above obtains the target instruction state of the decoding system, determines the target decoding model that matches the target instruction state, and returns to execute the decoding steps, thereby achieving dynamic adaptation and closed-loop optimization of the external device control strategy. Using the target instruction state as an index for decoding model switching ensures synchronization between the decoding model and the actual movement stage of the external device, avoiding decoding errors caused by decoding model mismatch.

[0160] As an optional implementation, the method further includes: obtaining the execution state after the external device performs the target action, and obtaining an updated execution state; determining a target decoding model matching the target instruction state from the decoding model set, including: in response to the updated execution state being consistent with the target instruction state, controlling the decoding system to determine a target decoding model matching the updated execution state and the target instruction state from the decoding model set.

[0161] In this embodiment, the execution state after the external device performs the target action can be obtained to obtain an updated execution state. During the process of determining the target decoding model from the decoding model set, if the updated execution state matches the target instruction state, the decoding system can be controlled to determine a target decoding model that matches both the updated execution state and the target execution state from the decoding model set. The updated execution state refers to the actual physical motion state or position information that the external device feeds back to the decoding system in real time after completing the target action. This updated execution state can be used to characterize the current motion stage of the external device (e.g., left leg support, right leg stepping, etc.) and compared with the target instruction state predicted by the decoding system.

[0162] This embodiment aims to verify the execution of control commands through physical state feedback, and to achieve precise switching of the decoding model based on the aforementioned execution status. The process may include: after the external device performs the target action, acquiring the actual physical state of the external device to form an updated execution state; comparing the updated execution state with the target command state generated by the decoding system; when the two match, confirming that the motor phase switching is normal, and selecting a target decoding model from the decoding model set that matches the current actual state and the expected command, providing a correct model basis for the next round of EEG signal decoding.

[0163] Optionally, during the process of acquiring the update execution status of the external device, after the external device has completed the target action driven by the control command, motion state parameters such as the current physical position, joint angle, or robotic arm pose of the external device can be collected through the external device's built-in state sensors (such as encoders, posture sensors, etc.) or communication interface. The collected physical quantities are then converted into standardized state description information and determined as the update execution status. The update execution status can be used to characterize the exact physical position or motion stage of the external device after completing the previous stage of action, such as the actual position when switching from the left leg support stage to the right leg stepping stage.

[0164] Optionally, in the process of determining the target decoding model that matches the updated execution state and the target instruction state, the obtained updated execution state can be numerically or logically compared with the target instruction state predetermined by the decoding system; it can be determined whether the updated execution state matches the target instruction state to verify whether the external device has accurately executed the expected action instruction without communication delay or execution deviation; when it is determined that the updated execution state matches the target instruction state, the decoding system is controlled to access the decoding model set, and the target decoding model for training for the above-mentioned motion stage is selected according to the current motion stage indicated by the updated execution state.

[0165] In this embodiment, the method described above obtains the updated execution state by acquiring the execution state after the external device performs the target action, and determines the matching target decoding model when the updated execution state matches the target instruction state, significantly improving the reliability and security of external device control. Introducing the updated execution state as a feedback verification mechanism effectively solves the problem of state synchronization between the issuance of control instructions and the actual execution of the target action by the external device, preventing decoding model switching errors caused by external device failure, communication loss, or execution deviation.

[0166] As an optional implementation, determining the target decoding model matching the target instruction state from the decoding model set includes: in response to obtaining the execution state failure after the external device executes the target action, determining the target decoding model matching the target instruction state from the decoding model set.

[0167] In this embodiment, during the process of determining the target decoding model matching the target instruction state from the decoding model set, if the execution state of the external device after executing the target action fails, a target decoding model matching the target instruction state can be determined from the decoding model set. The above method proposes a degradation control scheme when the external device lacks execution state feedback capability or when execution state feedback fails. When the execution state of the external device after executing the target action fails, the above process abandons the state verification mechanism based on execution state feedback and instead relies on the target instruction state generated internally by the decoding system as the basis for stage switching. By directly determining the corresponding target decoding model from the decoding model set based on the target instruction state, the transition between different motion stages is achieved, ensuring the continuity of the control flow.

[0168] Optionally, in the process of obtaining the execution status after the external device has executed the target action, the execution status can be obtained through the status sensor or communication interface of the external device after the external device has executed the target action based on the control command. If it is difficult to obtain the execution status signal reflecting the actual physical motion state of the external device due to reasons such as the external device lacking status feedback capability, communication link interruption, sensor failure, or data parsing error, it is determined that obtaining the execution status after the external device has executed the target action has failed. The above-mentioned execution status failure indicates that the robust control path based on physical feedback is unavailable, and a backup control path based on command status can be switched to.

[0169] Optionally, in the process of determining the target decoding model that matches the target instruction state from the decoding model set, after determining that the execution state acquisition failed, the target instruction state generated by the decoding system can be read directly; there is no need to update the consistency comparison between the execution state and the target instruction state, and the mapping search can be performed directly in the decoding model set based on the content of the target instruction state; the target decoding model that matches the target instruction state can be determined; the determined target decoding model can be used as the currently used decoding model to continue decoding the EEG signal of the biological object, thereby completing the transition of the motor stage.

[0170] In this embodiment, the method enhances the versatility and adaptability of the external device control strategy by determining the target decoding model matching the target instruction state from the decoding model set in response to the failure of the execution state after the external device performs the target action. This makes the control method applicable not only to high-end external devices with complete state feedback capabilities, but also to low-end external devices with basic driving capabilities but no state feedback, or to simplified hardware scenarios.

[0171] In this embodiment, a control method for external devices that does not rely on real-time execution status feedback from external devices is also provided. This method can be applied to external devices that lack status feedback functionality, or as a degraded operating mode of a control method based on the execution status feedback of external devices. The core of this method lies in using the state inference mechanism within the encoding system to determine the current motion sub-stage, and dynamically selecting the corresponding decoding model for the motion sub-stage based on the inference, rather than simply using a single hybrid model for decoding.

[0172] Optionally, if the decoding system is being started for the first time, a default startup phase (e.g., "hip lift") is set according to preset rules; if the decoding system is running continuously, the current motion sub-state is inferred based on the decoding output of previous moments and the preset motion state machine logic. For example, the decoding system can maintain an internal motion state machine, and combine the motion intention tags from historical decoding outputs (e.g., "step") with preset time sequences or timers to determine the current motion sub-stage (e.g., progressing from the "hip lift" stage to the "leg swing" stage).

[0173] Optionally, based on the inferred current motion sub-state, a target decoding model matching the current sub-state is selected from a pre-stored decoding model set. In this embodiment, the decoding model set may include dedicated sub-models trained separately for each motion sub-stage (e.g., a "hip lift vs. resting" model, a "leg swing vs. resting" model, etc.). By selecting a dedicated sub-model corresponding to the current inferred sub-state, the decoding can be optimized for the neural features of the specific motion sub-stage, rather than using a generalized binary classification model that mixes various motion intentions.

[0174] Optionally, the selected target decoding model is used to decode the real-time acquired EEG signals to determine whether the biological object is in a target motor intention state. If the decoding result is determined to be "movement" and the confidence level is higher than or equal to the confidence level threshold, a corresponding control command can be generated to drive the external device to execute the current sub-stage action (e.g., drive the external device to perform hip raising) and update the internal state machine to prepare for entering the next motor stage; if the decoding result is "resting" or the confidence level is less than the self-confidence threshold, the current state can be maintained or the action can be paused, waiting for the next motor intention to be triggered.

[0175] In this embodiment, the control logic of "determining the motion sub-state based on the decoded output / default state -> selecting the decoding model of the sub-state -> outputting control commands" is implemented through the above method. Compared with a single large model trained using mixed motion data and resting data, the above method can still achieve refined decoding for specific sub-stages through internal state inference without relying on external state feedback. This improves the control accuracy and robustness under feedback-free conditions and ensures the versatility and usability of the decoding system under different hardware configurations (with or without external state feedback) and different biological object capability levels.

[0176] It should be noted that, in the embodiments of this application, although the preferred solution is to simultaneously utilize the real-time execution status feedback from the external device and perform dual verification with the current instruction status of the decoding system to switch the decoding model, this is not a necessary condition for implementation. If the external device does not have status feedback capability, the decoding system can still rely on preset state machine logic, action sequence, or historical decoding results to infer the current motion stage and switch the decoding model. Although the above alternative solutions may increase the risk of state synchronization errors when facing communication anomalies or execution delays due to the lack of closed-loop verification of the execution status, thereby reducing the robustness and security of external device control, they can still ensure the basic operation of the decoding system, demonstrating the compatibility of the solution under different hardware conditions.

[0177] As an optional implementation, the external device includes different actuators for performing different actions, including a first action and a second action. The external device assists the biological object in alternately performing the first action and the second action according to a time cycle. The first actuator in the different actuators is used to perform the second action, and the second actuator in the different actuators is used to perform the first action. The method further includes: determining a first EEG signal sample corresponding to the first action, a second EEG signal sample corresponding to the second action, and a resting data sample, wherein the first EEG signal sample is used to characterize the first action corresponding to the motor imagination of the biological object sample, the second EEG signal sample is used to characterize the second action corresponding to the motor imagination of the biological object sample, and the resting data sample is an EEG signal sample used to characterize the motor imagination of the biological object sample when the biological object does not produce the motor imagination corresponding to the target action, and the resting data sample is collected during the process when the first actuator or the second actuator is in a resting state; using the first EEG signal sample and the resting data sample, a second target decoding model in the decoding model set is trained, and using the second EEG signal sample and the resting data sample, a first target decoding model in the decoding model set is trained.

[0178] In this embodiment, a first EEG signal sample corresponding to a first action, a second EEG signal sample corresponding to a second action, and a resting data sample can be determined. The first EEG signal sample and the resting data sample can be used to train a second target decoding model in the decoding model set. Alternatively, the second EEG signal sample and the resting data sample can be used to train a first target decoding model in the decoding model set. The first EEG signal sample can refer to the EEG signal data collected from the biological object sample during the imaginary first action. The first EEG signal sample can be used to characterize the neural activity features generated by the biological object in response to the target action corresponding to the first actuator, serving as a positive sample for training the first target decoding model to establish a mapping relationship between the intention of the first action and a specific EEG pattern.

[0179] The aforementioned second EEG signal sample refers to the EEG signal data collected from the biological object sample during the second motor imagery action. This second EEG signal sample can be used to characterize the neural activity features generated by the biological object in response to the target action corresponding to the second actuator, serving as a positive sample for training the second target decoding model to establish a mapping relationship between the second action intention and a specific EEG pattern. The aforementioned resting data sample can be the EEG signal sample used to characterize the biological object when it does not generate the motor imagery corresponding to the target action, and is collected during the resting state of the first and second actuators. The aforementioned resting data sample (hereinafter referred to as resting data) refers to the EEG signal data collected when the biological object is in a relaxed state without specific motor imagery. The aforementioned resting data sample is associated with the first or second actuator being in a resting state. The aforementioned resting data sample serves as a common sample for training the first and second target decoding models, aiming to ensure that different decoding models have unified and stable baseline characteristics in the resting state, thereby reducing the risk of resting misjudgment caused by decoding model switching and improving the overall robustness of decoding.

[0180] This embodiment aims to construct a dual-decoding model training system for periodically alternating actions. Through explicit sample allocation and corresponding model training, it ensures accurate matching between the decoding model and the executed action. The process may include: collecting first EEG signal samples representing the first action, second EEG signal samples representing the second action, and resting data samples representing the resting state, respectively, to establish a basic training dataset; employing a corresponding training strategy, that is, using the first EEG signal samples and resting data samples to train the second target decoding model corresponding to the first action, and using the second EEG signal samples and resting data samples to train the first target decoding model corresponding to the second action. Through the above sample allocation and model training based on the logic of time-period alternation, it ensures that each decoding model can accurately identify its corresponding specific action and share a unified resting benchmark, thereby improving the robustness of decoding.

[0181] Optionally, in the process of determining the first EEG signal sample corresponding to the first action, the biological object sample can be guided to perform motor imagery of the first action, wherein the first action can be performed by a second actuator; during the process of the biological object sample performing the motor imagery, the raw EEG signal is synchronously recorded by the EEG acquisition device; the acquired raw EEG signal is preprocessed, such as by filtering, denoising and feature extraction, to obtain the first EEG signal sample representing the first action corresponding to the motor imagery of the biological object sample.

[0182] Optionally, in the process of determining the second EEG signal sample corresponding to the second action, the biological object sample can be guided to perform motor imagery of the second action, wherein the second action is performed by the first actuator; during the process of the biological object sample performing the motor imagery, the original EEG signal is recorded synchronously by the EEG acquisition device; the acquired original EEG signal is preprocessed, such as by filtering, denoising and feature extraction, to obtain the second EEG signal sample representing the second action corresponding to the motor imagery of the biological object sample.

[0183] Optionally, during the process of determining the resting data sample, the biological object sample can be guided into a resting state, at which time either the second actuator or the first actuator is in a resting state; while the biological object sample remains in a resting state, the raw EEG signal is recorded by an EEG acquisition device; the acquired raw EEG signal is preprocessed to obtain the resting data sample.

[0184] Optionally, during the training of the second target decoding model using the first EEG signal sample and resting data sample, the first EEG signal sample and resting data sample can be input into the training algorithm of the second target decoding model. The first EEG signal sample represents the first action. By adjusting the parameters of the second target decoding model, it can learn the feature boundaries that distinguish the first action from the resting state based on the first EEG signal sample and resting data sample. This process ensures that the second target decoding model is specifically optimized for the first action performed by the second actuator, while providing a unified resting reference benchmark using the resting data sample.

[0185] Optionally, during the training of the first target decoding model using the second EEG signal sample and resting data sample, the second EEG signal sample and resting data sample can be input into the training algorithm of the first target decoding model. The second EEG signal sample represents the second action. By adjusting the parameters of the first target decoding model, it can learn the feature boundaries that distinguish the second action from the resting state based on the second EEG signal sample and resting data sample. This process ensures that the first target decoding model is specifically optimized for the second action performed by the first actuator, while providing a unified resting reference benchmark using the resting data sample.

[0186] In this embodiment, by separately determining a first EEG signal sample, a second EEG signal sample, and a resting data sample, and training a second target decoding model using the first EEG signal sample and the resting data sample, while simultaneously training a first target decoding model using the second EEG signal sample and the resting data sample, an efficient and robust decoding model for periodic alternating movements is achieved. Using a unified resting data sample in the training of different decoding models ensures that the judgment benchmarks of each decoding model are consistent in the resting state, eliminating fluctuations in resting-state misjudgments caused by model switching.

[0187] As an optional implementation, the second target decoding model can determine whether the second actuator expects to be in a moving state or a resting state under the motor imagery corresponding to the input EEG signal, and the first target decoding model can determine whether the first actuator expects to be in a moving state or a resting state under the motor imagery corresponding to the input EEG signal.

[0188] In this embodiment, the aforementioned second target decoding model can determine whether the second actuator of the external device is expected to be in an operational state to execute the first action under the motor imagery corresponding to the input EEG signal, and can also determine whether the second actuator is in a resting state. Conversely, the aforementioned first target decoding model can determine whether the first actuator is expected to be in an operational state to execute the second action under the motor imagery corresponding to the input EEG signal, and can also determine whether the first actuator is in a resting state.

[0189] The aforementioned second-target decoding model can determine whether the second actuator, under the influence of the input EEG signal corresponding to motor imagery, desires to be in a state of motion to execute the first action, or desires the second actuator to be in a resting state. This second-target decoding model can be trained and used to determine the first action to be executed by the second actuator. During the decision-making process, the second-target decoding model receives the EEG signal input from the biological subject and determines whether the motor intention reflected in the EEG signal corresponds to the first action. If the determination result is a state of motion, it means the biological subject desires the second actuator to execute the first action; if the determination result is a resting state, it means the biological subject desires the second actuator to remain still. This second-target decoding model can monitor whether the biological subject has generated the intention to execute the first action at the stage before the first action is to be executed, without simultaneously distinguishing other irrelevant actions.

[0190] The aforementioned first target decoding model can determine whether a first actuator, under the influence of motor imagery corresponding to the input EEG signal, desires to be in a moving state to execute a second action, or desires the first actuator to be in a resting state. This first target decoding model can be trained and used to determine the second action executed by the first actuator. During the decision-making process, the first target decoding model receives the EEG signal input from the biological subject and determines whether the motor intention reflected in the EEG signal corresponds to the second action. If the determination result is a moving state, it means the biological subject desires the first actuator to execute the second action; if the determination result is a resting state, it means the biological subject desires the first actuator to remain still. Through this first target decoding model, it is possible to monitor whether the biological subject has generated the intention to execute the second action at the stage when the second action is about to be executed, thereby achieving independent and accurate identification of the motor intentions of different actuators of external devices under the logic of alternating time cycles.

[0191] In this embodiment, the method described above achieves decoupling and precise mapping between the actuator and the decoding logic. By defining the first target decoding model and the second target decoding model in a decoupled manner, the complex multi-action classification problem is transformed into a binary classification problem (movement vs. resting) for a specific actuator, greatly reducing the classification boundary complexity and training difficulty of a single decoding model. Simultaneously, since each decoding model focuses on the state of its corresponding actuator, mutual interference and confusion between the action features of different actuators are effectively avoided, significantly improving the accuracy and real-time performance of EEG signal decoding, and ensuring the smoothness and safety of external devices when assisting biological objects in performing periodic alternating movements.

[0192] As an optional implementation, the method further includes: preprocessing the acquired EEG signals, wherein the stability of the preprocessed EEG signals is higher than that of the unprocessed EEG signals; and inputting the EEG signals of the biological object into a target decoding model for decoding to obtain a decoding result, including: inputting the preprocessed EEG signals into the target decoding model for decoding to obtain a decoding result.

[0193] In this embodiment, the acquired EEG signals can be preprocessed. During the process of inputting the EEG signals of the biological object into the target decoding model for decoding, the preprocessed EEG signals can be input into the target decoding model for decoding to obtain the decoding result. This embodiment aims to improve the stability (quality) of EEG signals through signal preprocessing and utilize the preprocessed EEG signals for decoding, thereby ensuring the accuracy and reliability of the decoding result. The above process may include: performing preprocessing operations on the acquired raw EEG signals to eliminate noise interference and extract stable features, obtaining preprocessed EEG signals with significantly higher stability than the original signals; inputting the preprocessed EEG signals into the currently selected target decoding model, where the target decoding model performs feature analysis and classification judgment on the preprocessed EEG signals, and finally outputs a decoding result representing the biological object's movement intention or resting state.

[0194] Optionally, during the preprocessing of the acquired EEG signals, the raw EEG signals obtained through the EEG acquisition device can be received; filtering operations can be performed on the raw EEG signals to remove irrelevant signal components such as power frequency interference, electromyographic noise, and baseline drift; and the signals can be segmented or resampled to form a fixed-length data window suitable for model input, resulting in the final preprocessed EEG signal. Through the above processing, random noise and artifact interference in the raw EEG signals are reduced, making the signal feature distribution more concentrated and stable, thus obtaining the preprocessed EEG signal. The preprocessed EEG signal exhibits better signal-to-noise ratio and feature consistency than the unprocessed EEG signal, providing a high-quality data foundation for subsequent decoding.

[0195] Optionally, during the process of inputting the preprocessed EEG signal into the target decoding model for decoding, a target decoding model applicable at the current moment can be obtained, and the preprocessed EEG signal can be sent to the target decoding model as input data. The target decoding model uses its internal parameters to perform feature extraction and pattern matching on the preprocessed EEG signal, calculating the probability or confidence level of the biological object being in a moving or resting state, and obtaining the calculation result. Based on the above calculation result, a decoding result representing the current movement intention is generated. This decoding result can be used to indicate the target action that the biological object intends to perform or to remain in a resting state.

[0196] In this embodiment, the above method preprocesses the acquired EEG signals to obtain more stable preprocessed EEG signals, and inputs the preprocessed EEG signals into the target decoding model for decoding. This effectively filters out environmental noise and physiological artifacts, and reduces the interference of EEG signal fluctuations on the decoding model. Decoding based on high-quality preprocessed EEG signals can more accurately identify the movement intentions of biological objects, reducing false triggers and missed detections.

[0197] Figure 2 This is a flowchart of another method for controlling an external device according to an embodiment of this application, such as... Figure 2 As shown, the method may include the following steps.

[0198] Step S202: Determine the target decoding model matching the execution state of the rehabilitation assistive device from the decoding model set.

[0199] In the technical solution provided in step S202 of this application, the rehabilitation assistive device is used to assist the rehabilitation training subject in performing multiple actions in turn according to a time cycle. The first and second actions among the multiple actions are either contralateral or ipsilateral antagonistic actions of the rehabilitation training subject. The execution state is used to characterize the target action to be performed among the multiple actions. Different execution states are matched with different decoding models in the decoding model set.

[0200] The aforementioned rehabilitation assistive device refers to an external execution device used to assist rehabilitation trainees in restoring motor function. Its core feature is the presence of multiple execution mechanisms capable of performing various movements (e.g., a first movement and a second movement) in turn according to a time cycle. The first and second movements are either contralateral (e.g., stepping with the left and right legs) or ipsilateral antagonistic (e.g., flexion and extension). The rehabilitation assistive device can receive control commands from a decoding model to precisely execute corresponding target movements, thereby providing mechanical assistance or neuromodulation support during rehabilitation training. The aforementioned rehabilitation trainees can refer to individuals with motor dysfunction due to neurological damage (e.g., stroke, spinal cord injury) who require rehabilitation training through brain-computer interface technology. These trainees possess the ability to imagine movement and can transmit motor control commands to external devices by generating specific EEG signals (e.g., imagining movement for the first or second movement) to assist or drive the rehabilitation assistive device in performing corresponding periodic alternating movements, thereby achieving active participatory neural function reconstruction and rehabilitation training.

[0201] In this embodiment, if it is necessary to control the rehabilitation assistive device, a target decoding model that matches the execution state of the rehabilitation assistive device can be determined from the decoding model set.

[0202] Step S204: Input the EEG signal of the rehabilitation training subject into the target decoding model for decoding to obtain the decoding result.

[0203] In the technical solution provided in step S204 of this application, electroencephalogram (EEG) signals are used to characterize the motor imagination of the rehabilitation training subject. Multiple movements include those corresponding to the motor imagination.

[0204] In this embodiment, after determining the target decoding model that matches the execution state of the rehabilitation assistive model, the EEG signal of the rehabilitation training subject can be input into the target decoding model for decoding to obtain the decoding result.

[0205] Step S206: Based on the decoding result, generate control instructions.

[0206] In the technical solution provided in step S206 of this application, after decoding the EEG signal using the target decoding model and obtaining the decoding result, control commands can be generated based on the decoding result.

[0207] Step S208: Based on the control command, drive the rehabilitation assistive device to perform the target action.

[0208] In the technical solution provided by step S208 of this application, after generating control instructions for controlling the rehabilitation assistive device based on the decoding result, the rehabilitation assistive device can be driven to perform the target action by the aforementioned control instructions.

[0209] The following example illustrates the above technical solution of this application embodiment using a brain-controlled exoskeleton control strategy based on dual-model switching.

[0210] Currently, with the development of BCI technology in the field of rehabilitation medicine, the control of external devices (including exoskeletons, electrical stimulation, etc.) based on electroencephalogram (EEG / ECoG / Spike) signals is gradually becoming an important means of restoring motor function in patients with stroke, spinal cord injury, etc., and such rehabilitation training often has the characteristics of periodicity and repetition. In related technologies, the control of external devices can be achieved by decoding the EEG motor imagery task signals of biological subjects and classifying the output. However, the above-mentioned related technologies have the following key problems in practical applications: the motor imagery EEG signals corresponding to contralateral movements (such as stepping with the left leg and stepping with the right leg) and ipsilateral antagonistic movements (such as elbow extension / flexion or fist clenching / opening) are highly similar in spatial distribution and spectral characteristics, and the activated brain regions are adjacent (such as the primary motor cortex M1 and the primary somatosensory cortex S1), resulting in blurred classification boundaries; biological subjects have large individual differences and unstable signal quality, further increasing the decoding difficulty; single multi-classification models (such as left / right / resting three-class classification) are difficult to balance accuracy and robustness.

[0211] Therefore, in external device control scenarios, problems such as low classification accuracy, high false trigger rate, and poor user experience of biological objects often occur, which seriously affect the rehabilitation training effect.

[0212] One related technique proposes a multi-class decoding method (left / right / resting three-class classification) to classify multiple action intentions using a single model. Common methods include Common Spatial Patterns (CSP), Linear Discriminant Analysis (LDA), and deep learning models. These deep learning models can be Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), etc. However, these techniques suffer from the following drawbacks: severe overlap of inter-class features (especially for contralateral or antagonistic actions); complex classification boundaries; poor model generalization ability; and high dependence on the quality and quantity of training data.

[0213] Another related technique proposes a binary classification method (motion / resting), which simplifies the task into a binary classification problem of "whether there is movement," thus improving classification stability to some extent. However, the aforementioned related techniques have the following drawbacks: difficulty in distinguishing contralateral actions; difficulty in distinguishing antagonistic actions; and a limited number of output categories, making them difficult to directly use for external device control.

[0214] Another related technology proposes a threshold- or rule-based method for triggering external devices, which can be controlled by combining peripheral device status or sensor signals. However, the aforementioned related technologies suffer from the following drawbacks: they rely on manual rules and lack adaptability; they also struggle to fully utilize the intention information of brain signals.

[0215] In summary, the technical solutions mentioned above are difficult to distinguish due to the high similarity of neural features, and a single model cannot balance accuracy and stability. Furthermore, they do not make full use of the prior information of periodicity in rehabilitation training, ultimately resulting in high training costs and poor user experience for biological subjects.

[0216] To address the aforementioned issues, this application proposes a dual-model dynamic switching brain-computer interface external device control strategy, applicable to various execution systems such as upper and lower limb exoskeletons, pneumatic gloves, spinal cord stimulation, and functional electrical stimulation. This method combines peripheral device state information with neural decoding results to achieve adaptive switching of the decoding model between different task-related motion states, thereby improving classification accuracy and system robustness.

[0217] The methods of the embodiments of this application will be further illustrated below.

[0218] In this embodiment, two models (machine learning or deep learning models) are constructed to model binary sub-problems related to different tasks. For example, contralateral movements are classified with resting states, or antagonistic movements are classified with resting states. This decomposes the originally complex multi-class motion decoding problem into multiple binary sub-tasks, thereby significantly improving decoding accuracy and enhancing the biological object's control perception. Combining the peripheral device state (e.g., support / swing phase, joint movement phase, or execution mode) and the decoding software's output instructions, the decoding software automatically selects the corresponding model for decoding and classification, and outputs the corresponding motion or resting state and confidence level. When a corresponding motion category is found and the confidence level is higher than a threshold, motion instructions are output to the external device to complete the task (e.g., joint actuation, half-cycle motion execution, electrical stimulation on / off, etc.). Simultaneously, the current peripheral device state is updated to prepare for the next task, forming a stable closed-loop control system for the external EEG device. By using the same resting data to train both models, it is ensured that the same resting strategy can be used in any state during the biological object's use. Since the model switching is completed automatically by the system, biological objects do not require additional training or operation to ensure continuous and natural use of external devices, thus achieving a seamless switching strategy.

[0219] By employing the aforementioned control strategy, the temporal structure and motor priors (such as gait cycles and joint antagonism) in rehabilitation training can be fully utilized to effectively reduce confusion between different movement categories. By transforming a complex multi-classification problem into multiple binary classification problems, model complexity is reduced and the risk of false triggering is decreased, thereby significantly improving the robustness and stability of the system. Furthermore, the unified resting-state modeling strategy reduces the control burden on the biological object, enabling effective control without distinguishing between multiple motor intentions. This method ultimately achieves efficient brain control under constrained implantation conditions and enhances the functional effectiveness of rehabilitation training and the experience of the biological object.

[0220] In this embodiment, the biological subject wears an EEG signal acquisition device and a lower limb exoskeleton system, and performs rehabilitation training or motor-assisted control in conjunction with spinal cord electrical stimulation. When the biological subject performs motor imagery (e.g., stepping with the left leg or the right leg), the EEG acquisition device acquires the biological subject's EEG signals in real time and inputs the EEG signals into the decoding system for processing. The acquired EEG signals are preprocessed, including filtering and data window segmentation, to obtain stable EEG signal features as model input.

[0221] Simultaneously, the system acquires real-time status information of the exoskeleton and spinal cord stimulator, including the current supporting leg (left or right leg) and stimulation mode (left side on, right side on). When the exoskeleton status matches the current command status, such as when the exoskeleton is currently supporting the left leg and about to step out with the right leg, the decoding system automatically calls the first binary classification model (right leg step vs. resting) corresponding to the right leg step to classify the model input. When the classification result is a movement state, the system outputs a control command to drive the exoskeleton to perform the right leg step, and simultaneously drives the spinal cord stimulator to perform right leg step stimulation and store the current control command status.

[0222] Similarly, when the device is currently in a state of right leg support and about to step out with the left leg, the decoding system automatically switches to the second binary classification model (left leg step vs. rest) corresponding to the left leg step to classify the model input. When the classification result is a movement state and the confidence level is higher than the threshold, a control command is output to drive the exoskeleton to perform the left leg step movement, and at the same time, the spinal cord stimulator is driven to perform left leg step stimulation and store the current control command state. Otherwise, the output is a resting state, keeping the exoskeleton still. If the external device state and the current command state do not match, the abnormal state handling module is entered. The device will stop the action in a safe state, check the external devices and connections, avoid uncontrollable movement states, and protect the safety of the biological object.

[0223] In the above process, model switching is automatically completed by the system based on the exoskeleton state, without the biological object needing to perceive or intervene, thus achieving seamless switching. After the exoskeleton performs an action, the system further acquires the updated exoskeleton state information and feeds this state information back to the decoding system for model selection and control decisions at the next moment, thereby forming a closed-loop control process between EEG signal decoding and exoskeleton motion control. In this way, the multi-class problem that originally required distinguishing between the left leg, right leg, and resting state is decomposed into two binary classification problems based on gait state constraints, effectively reducing feature overlap between different motor images and improving decoding accuracy and system stability.

[0224] The model employs offline training. For two binary classification models, EEG data corresponding to the actions and the same resting data are selected for training respectively, ensuring that the same resting strategy can be used regardless of gait state during the biological subject's use. This allows the biological subject to achieve natural alternating control of the exoskeleton and electrical stimulator with lower cognitive burden, thereby improving rehabilitation training effectiveness and user experience.

[0225] Based on the aforementioned lower limb gait control example, the method described in this application is also applicable to upper limb exoskeleton and antagonistic movement control scenarios. In this scenario, the subject wears an EEG acquisition device and an upper limb exoskeleton system, combined with functional electrical stimulation (FES) or other neuromodulation devices for assisted training or motor control. When the subject performs different types of motor imagery (e.g., antagonistic movements such as elbow extension and flexion, hand grasping and opening), the decoding system analyzes the EEG signals in real time based on the same signal processing flow.

[0226] Optionally, for antagonistic action pairs (e.g., elbow extension vs. elbow flexion, fist clenching vs. fist opening), corresponding binary classification models (action A vs. resting, action B vs. resting) are constructed respectively. During actual control, the best-matching decoding model is dynamically selected for discrimination based on the current state of external devices (e.g., joint movement stage, current execution mode, or stimulation channel configuration). When a target action is detected and the confidence level exceeds a set threshold, a control command is output to drive the upper limb exoskeleton to perform the corresponding joint movement, while simultaneously triggering functional electrical stimulation to synergistically activate the corresponding muscle groups, thereby achieving integrated control of neural modulation and mechanical execution.

[0227] Similar to lower limb control, the peripheral state information is updated after each action and fed back to the decoding module for model selection and control decisions in the next stage, thus forming a closed-loop regulation mechanism suitable for antagonistic action control. By decomposing the complex task of distinguishing multiple action categories into multiple binary classification problems based on task state constraints, feature aliasing between different actions is effectively reduced, improving decoding accuracy and control stability.

[0228] The method described in this application embodiment is also applicable to the control logic of remote external devices in non-rehabilitation scenarios. In this scenario, the biological subject wears an EEG acquisition device and remotely controls a robotic arm, robotic dog, or humanoid robot. When the biological subject performs tasks on the external device (for example, external device execution state one, external device execution state two, and the above two execution states have periodic characteristics), the decoding system performs real-time analysis of the EEG signals based on the same signal processing flow.

[0229] Optionally, for periodic control of external devices (e.g., clenching / opening a fist when using a brain-controlled robotic arm to grasp an object), a matching decoding model is dynamically selected for discrimination based on the current execution state. When the confidence level of a specific execution state exceeds a set threshold, the corresponding external device control command is output, which can effectively reduce feature aliasing between different execution states and achieve precise periodic control of external devices.

[0230] Figure 3 This is a flowchart of a brain-controlled exoskeleton control method based on dual-model switching according to an embodiment of this application, such as... Figure 3 As shown, the method may include the following steps.

[0231] Step S301: Collect EEG signals.

[0232] In this embodiment, an EEG acquisition device worn on the head of the biological object is used to acquire the raw EEG signals of the biological object when it is imagining movement in real time, providing a basic data source for subsequent signal processing and decoding.

[0233] Step S302: Preprocess the EEG signal.

[0234] In this embodiment, the acquired raw EEG signals are processed by filtering, denoising, and segmentation to eliminate artifact interference and extract stable EEG signal features, generating high-quality preprocessed EEG signals suitable for the input of the decoding model.

[0235] Step S303: Obtain the peripheral device status and compare it with the decoding software.

[0236] In this embodiment, if the peripheral device state is inconsistent with the current instruction state of the decoding software, step S310 can be executed; otherwise, step S304 can be executed.

[0237] Optionally, the current execution status of the rehabilitation assistive device can be acquired in real time and compared with the current instruction status generated by the decoding software based on the EEG decoding results to determine whether the system control flow is synchronized and consistent, thereby ensuring the safety and accuracy of the control logic.

[0238] Step S304: Determine the status of the peripheral device.

[0239] In this embodiment, based on the comparison result of step S303, if the peripheral state is consistent with the instruction state, the specific motion stage of the current peripheral (such as state 1 or state 2) is further identified so as to select the corresponding decoding model for subsequent processing. If the peripheral state is state 1, step S305 can be executed; otherwise, if the peripheral state is state 2, step S311 can be executed.

[0240] Step S305: Select Model A.

[0241] In this embodiment, when it is determined that the external device is currently in state 1, the system automatically switches from the decoding model set and loads the target decoding model A that matches state 1. This model is specifically designed to identify the motion intent corresponding to state 1.

[0242] Step S306: Classify movement and resting states.

[0243] In this embodiment, the preprocessed EEG signal is input into the currently selected target decoding model (model A or model B), and the model calculates and determines whether the biological object is currently in the motion state or resting state of the target action, and generates the corresponding classification confidence score.

[0244] Step S307: Output control commands.

[0245] In this embodiment, when the classification result determines that the biological object is in motion and the confidence level is higher than a preset threshold, the system outputs corresponding control commands to external devices to drive the rehabilitation assistive device to perform corresponding actions, thereby realizing brain-controlled closed-loop control.

[0246] Step S308, status feedback.

[0247] In this embodiment, the status of the peripheral device can be fed back synchronously, and the system can return to step S304. That is, after performing an action, the rehabilitation assistive device feeds back the updated actual execution status to the decoding system. The system receives the feedback information, updates the current status, and then returns to step S304 to enter the status judgment of the next control cycle.

[0248] Step S309: Select the same resting data to train model A and model B respectively.

[0249] In this embodiment, after completing step S302, training of model A and model B can be completed offline.

[0250] Optionally, during the offline training phase, model A and model B are trained using motion data collected for specific actions and the same resting data, respectively, to ensure that different models have a unified benchmark in the resting state and reduce the risk of false triggering.

[0251] Step S310, abnormal state handling.

[0252] In this embodiment, when the actual state of the external device is detected to be inconsistent with the state of the decoding software instructions, the system determines it to be an abnormal state, immediately stops subsequent control actions, and enters a safety protection mode to prevent external device malfunctions or damage to biological objects caused by state asynchrony.

[0253] Step S311, select model B.

[0254] In this embodiment, after executing step S311, step S306 can be executed, that is, using model B to perform motion and rest classification. Specifically, when it is determined that the external device is currently in state 2, the system automatically switches from the decoding model set and loads the target decoding model B that matches state 2. This model is specifically used to identify the motion intent corresponding to state 2, and then proceeds to the classification step.

[0255] Figure 4 This is a schematic diagram of a brain-controlled exoskeleton control structure based on dual-model switching according to an embodiment of this application, as shown below. Figure 4 As shown, the above structure may include an EEG acquisition module 41, a preprocessing module 42, a model training module 43, a dual-model management module 44, a classification output module 45, and an external device status feedback module 46. The preprocessing module 42 is used to filter and segment the EEG signals acquired by the EEG acquisition module 41. The dual-model management module 44 can be used to manage model A and model B. The classification output module 45 is used to generate action labels and confidence scores, and to issue control commands based on the confidence scores. The external device status feedback module 46 is used to receive the control commands and monitor the release / execution status (e.g., whether the task is completed).

[0256] like Figure 4 As shown, the EEG acquisition module 41 is worn on the head of the biological object to capture the raw EEG signals generated by the biological object during motor imagery in real time, and transmits the raw EEG signals to the preprocessing module 42. The preprocessing module 42 receives the raw EEG signals from the EEG acquisition module 41, and performs processing operations such as filtering and denoising, baseline correction, and data window segmentation to eliminate environmental interference and artifacts, and extract stable EEG signals with a high signal-to-noise ratio. The model training module 43 is used to work offline, using the acquired specific action EEG data and uniform resting data to train and optimize the parameters of model A and model B respectively, ensuring that different models have a consistent baseline response in the resting state, thereby improving the overall classification robustness of the system.

[0257] like Figure 4 As shown, the dual-model management module 44 dynamically manages and switches the activation states of Model A and Model B based on the current execution status of the external device of the rehabilitation assistive device, ensuring that the target decoding model matching the current motor stage is always invoked, thus achieving adaptive adjustment of the decoding scenario. The classification output module 45 inputs the preprocessed EEG signal into the currently activated target decoding model, performs binary classification judgment of motor and resting states, generates a decoding result containing action labels and confidence levels, and issues corresponding control commands to the external device when the confidence level exceeds a threshold. The peripheral device status feedback module 46 receives control commands from the classification output module to drive the rehabilitation assistive device to perform actions, while simultaneously monitoring and providing feedback on the actual execution status of the external device (such as task completion or current joint position) in real time, and sending the status information back to the system to support the next round of model switching and status synchronization verification.

[0258] In this embodiment, two methods can be used: multi-class decoding and binary decoding. Multi-class decoding directly classifies the motion intentions corresponding to different motion stages, for example, identifying multiple categories such as motion state 1, motion state 2, and resting state. Theoretically, multi-class decoding can identify motion intentions at different stages. However, since the neural activity patterns of different motion stages may overlap, and increasing the number of categories increases the difficulty of model training and recognition, the overall decoding accuracy and stability may be affected. Binary decoding can distinguish between motion states and resting states, where motion states include multiple motion stages. Binary decoding reduces classification complexity, but since the motion intentions corresponding to different motion stages are uniformly classified into the same category, it is difficult to fully utilize the differences in neural activity between stages, thus limiting its application in motion stage recognition and fine control.

[0259] In contrast, the embodiments of this application preferably combine the current state information of the external device for decoding. Since the possible motion stages can be determined in advance, the corresponding decoding model can be called for specific stages or the range of categories to be identified can be narrowed, thereby reducing the decoding difficulty and improving decoding accuracy and system stability.

[0260] In this embodiment, both current instruction information and peripheral device status information are used for model selection and decoding control, but their simultaneous existence is not a necessary condition. The current instruction information is generated by the decoding system and can therefore be reliably obtained in principle. Regarding peripheral device status information, in a preferred embodiment, the external device can provide feedback on its current execution status to the decoding system, serving as the basis for model switching and decoding judgment. In some implementation scenarios, if the external device lacks status feedback capability, it can still operate normally. In this case, the decoding system output, preset state machine, or action execution time can be used as the basis for stage switching, thereby completing the transition between different motion stages. However, due to the lack of feedback verification of the actual execution status of the external device, the system cannot confirm whether the external device has accurately completed the corresponding action. Therefore, in cases of external device communication abnormalities, action execution failures, or execution delays, the probability of state synchronization errors may increase, thus affecting overall control stability. Therefore, peripheral device status feedback is not a necessary condition for the implementation of this patent, but as a preferred implementation, it can further improve system reliability, security, and action control accuracy.

[0261] It should be noted that the biological object information (including but not limited to biological object device information, biological object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the biological object or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for the biological object to choose to authorize or refuse.

[0262] According to another aspect of the embodiments of this application, corresponding to the embodiments of the external device control method described above, this specification also provides a control system for an external device. Figure 5 This is a schematic diagram of a control system for an external device according to an embodiment of this application, such as... Figure 5 As shown, the control system 50 of the external device may include: a dual-model management module 51, a classification output module 52, and a drive module 53.

[0263] The dual-model management module 51 is used to determine the target decoding model that matches the execution state of the external device from the decoding model set. The external device is used to assist the biological object in performing multiple actions in turn according to a time cycle. The execution state is used to represent the target action to be performed among the multiple actions. Different execution states are matched with different decoding models in the decoding model set.

[0264] In this embodiment, the dual-model management module is used to dynamically select and activate a matching target decoding model from a preset decoding model set based on the current execution state of the external device (i.e., the current target action stage to be executed). By utilizing the periodic characteristics of the external device's actions, the complex multi-classification problem is decomposed into specific binary sub-tasks, thereby reducing the decoding difficulty and improving the recognition accuracy.

[0265] The classification output module 52 is used to input the EEG signal of the biological object into the target decoding model for decoding, obtain the decoding result, and generate control commands based on the decoding result. The EEG signal is used to characterize the motor imagination of the biological object, including various actions, including the actions corresponding to the motor imagination.

[0266] In this embodiment, the classification output module receives the preprocessed EEG signal and inputs it into the currently activated target decoding model for real-time decoding to determine whether the biological object is in the corresponding motor imagination state. When the decoding result (such as confidence level) meets the preset conditions, it generates and sends specific control instructions to the drive module to realize the conversion from motor intention to control signal.

[0267] The driver module 53 is used to drive external devices to perform target actions based on control commands.

[0268] In this embodiment, the driving module receives control instructions from the classification output module, directly drives external devices (such as exoskeletons or electrical stimulators) to perform corresponding target actions, completes the physical execution of the biological object's movement intention, and assists in forming a closed-loop control mechanism between EEG decoding and external device actions.

[0269] The above embodiments are explained optionally below.

[0270] As an optional implementation, the system further includes at least one of the following: an EEG acquisition module for acquiring EEG signals of a biological object; an external device state feedback module for determining the execution state after the external device performs a target action, and obtaining an updated execution state; determining the updated execution state as the execution state, and returning to the execution process starting from the following steps: determining a target decoding model matching the execution state of the external device from a decoding model set; a model training module for training a decoding model in the decoding model set using different EEG signal samples corresponding to different actions and the same resting data sample, wherein the EEG signal samples are used to characterize the action that the biological object sample expects to perform among multiple actions through the actuator in the external device, and the resting data sample is an EEG signal sample used to characterize the biological object when it does not generate the motor imagery corresponding to the target action, and the resting data sample is acquired during the process when the actuator is in a resting state; and a preprocessing module for preprocessing the acquired EEG signals, wherein the stability of the preprocessed EEG signals is higher than that of the EEG signals before preprocessing.

[0271] In this embodiment, the EEG acquisition module is worn on the head of the biological object to collect raw EEG signals reflecting the object's motor imagination in real time. These raw EEG signals are then transmitted to the preprocessing module, serving as the basic data input source for the entire control system's intention recognition and decoding. The peripheral device status feedback module monitors and acquires the actual execution status of the external device after performing the target action (e.g., joint position, gait phase), and feeds the updated status back to the dual-model management module. This supports the system in accurately selecting the matching target decoding model in the next time cycle, ensuring state synchronization and control continuity.

[0272] The aforementioned model training module operates offline, using specific EEG signal samples collected for different actions and uniform resting data samples to train various decoding models in the decoding model set. This ensures that different models have the same baseline response characteristics in the resting state, thereby improving the robustness and stability of the system when switching between different actions. The preprocessing module performs filtering, denoising, segmentation, and feature extraction on the raw EEG signals acquired by the EEG acquisition module. This eliminates artifact interference and enhances the effective neural features in the signal, outputting a preprocessed EEG signal with higher stability and a better signal-to-noise ratio to meet the decoding model's requirements for input data quality.

[0273] According to another aspect of the embodiments of this application, and the above... Figure 1 Corresponding to the embodiments of the control method for the external device shown, this specification also provides a control device for the external device. Figure 6 This is a schematic diagram of a control device for an external device according to an embodiment of this application, such as... Figure 6 As shown, the control device 60 of the external device may include: a first determining module 61, a first decoding module 62, a first generating module 63, and a first driving module 64.

[0274] The first determining module 61 is used to determine the target decoding model matching the execution state of the external device from the decoding model set. The external device is used to assist the biological object in performing multiple actions in turn according to a time cycle. The execution state is used to characterize the target action to be performed among the multiple actions. Different execution states are matched with different decoding models in the decoding model set.

[0275] The first decoding module 62 is used to input the EEG signal of the biological object into the target decoding model for decoding to obtain the decoding result. The EEG signal is used to characterize the motor imagination of the biological object, including various actions, including the actions corresponding to the motor imagination.

[0276] The first generation module 63 is used to generate control instructions based on the decoding results.

[0277] The first drive module 64 is used to drive external devices to perform target actions based on control commands.

[0278] According to another aspect of the embodiments of this application, and the above... Figure 2 Corresponding to the embodiments of the control method for the external device shown, this specification also provides a control device for the external device. Figure 7 This is a schematic diagram of a control device for another external device according to an embodiment of this application, such as... Figure 7 As shown, the control device 70 of the external device may include: a second determining module 71, a second decoding module 72, a second generating module 73, and a second driving module 74.

[0279] The second determining module 71 is used to determine the target decoding model matching the execution state of the rehabilitation assistive device from the decoding model set. The rehabilitation assistive device is used to assist the rehabilitation training object to perform multiple actions in turn according to a time cycle. The first and second actions among the multiple actions are the opposite side actions or ipsilateral antagonistic actions of the rehabilitation training object. The execution state is used to represent the target action to be performed among the multiple actions. Different execution states are matched with different decoding models in the decoding model set.

[0280] The second decoding module 72 is used to input the electroencephalogram (EEG) signal of the rehabilitation training subject into the target decoding model for decoding to obtain the decoding result. The EEG signal is used to characterize the motor imagination of the rehabilitation training subject, including various actions such as the actions corresponding to the motor imagination.

[0281] The second generation module 73 is used to generate control commands based on the decoding results.

[0282] The second drive module 74 is used to drive the rehabilitation assistive device to perform target actions based on control commands.

[0283] According to another aspect of the embodiments of this application, an electronic device is also provided. Figure 8 This is a structural block diagram of an electronic device according to an embodiment of this application, such as... Figure 8 As shown, the electronic device 80 may include: a memory 81 storing an executable program; and a processor 82 for running the program, wherein the program executes the methods in various embodiments of this application when it runs.

[0284] This application also provides a computer-readable storage medium, which includes a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to execute the methods of various embodiments of this application.

[0285] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods in various embodiments of this application.

[0286] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0287] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0288] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0289] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0290] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0291] The above description is only a preferred embodiment of the present application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present application embodiments, and these improvements and modifications should also be considered as the protection scope of the present application embodiments.

Claims

1. A method for controlling an external device, characterized in that, include: From the set of decoding models, a target decoding model matching the execution state of an external device is determined, wherein the external device is used to assist a biological object in performing multiple actions in turn according to a time cycle, and the execution state is used to characterize the target action to be performed among the multiple actions, and different execution states are matched with different decoding models in the set of decoding models; The EEG signal of the biological object is input into the target decoding model for decoding to obtain the decoding result. The EEG signal is used to characterize the motor imagination of the biological object, and the multiple actions include the actions corresponding to the motor imagination. Based on the decoding results, control commands are generated; Based on the control command, the external device is driven to perform the target action.

2. The method according to claim 1, characterized in that, Different execution states correspond to different target actions, and different target actions are matched with different decoding models in the decoding model set. Determining the target decoding model matching the execution state of the external device from the decoding model set includes: Determine the target action corresponding to the execution state; From the set of decoding models, a target decoding model matching the target action is selected, wherein the target decoding model is able to determine whether the external device is in motion or at rest.

3. The method according to claim 2, characterized in that, The multiple actions include at least: a first action and a second action, the external device is used to assist the biological object in alternately executing the first action and the second action according to the time period, and determining the target action corresponding to the execution state includes: In response to the execution state indicating that the biological object has performed the first action and is about to perform the second action, the second action is determined as the target action; In response to the execution state indicating that the biological object has performed the second action and is about to perform the first action, the first action is determined as the target action.

4. The method according to claim 3, characterized in that, Different target actions are executed by different actuators in the external device. Selecting the target decoding model matching the target action from the decoding model set includes: In response to the target action being the second action, a first target decoding model matching the second action is selected from the decoding model set, wherein the first target decoding model corresponds to a first actuator among different actuators, and the first target decoding model can determine whether the first actuator is expected to be in motion or in rest under the motion imagination; In response to the target action being switched from the second action to the first action, the first target decoding model is switched to the second target decoding model in the decoding model set that matches the first action. The second target decoding model corresponds to the second actuator in the different actuators. The second target decoding model can determine whether the second actuator is expected to be in motion or in rest under the motion imagination.

5. The method according to claim 3, characterized in that, The first action and the second action are opposite or antagonistic actions of the biological object.

6. The method according to claim 1, characterized in that, The step of determining the target decoding model matching the execution state of the external device from the decoding model set includes: In response to the execution state being consistent with the instruction state of the decoding system, the decoding system is controlled to determine the target decoding model matching the execution state from the set of decoding models, wherein the instruction state is used to characterize the action that the decoding system instructs the external device to perform.

7. The method according to claim 6, characterized in that, The step of controlling the decoding system to determine the target decoding model matching the execution state from the decoding model set in response to the execution state being consistent with the instruction state of the decoding system includes: In response to the first operation of the decoding system, and the execution state being consistent with the default instruction state of the decoding system, the decoding system is controlled to determine the target decoding model matching the execution state from the set of decoding models, wherein the default instruction state is used to characterize the default action that the decoding system instructs the external device to perform; After the decoding system runs for the first time, in response to the execution state being consistent with the current instruction state of the decoding system, the decoding system is controlled to determine the target decoding model matching the execution state from the set of decoding models. The current instruction state is used to indicate that the decoding system instructs the external device to switch from the currently executed action among the multiple actions to the action to be executed among the multiple actions.

8. The method according to claim 6, characterized in that, The method further includes: In response to the inconsistency between the execution state and the instruction state of the decoding system, the decoding system is prohibited from determining the target decoding model matching the execution state from the set of decoding models, wherein the external device enters a safe static state.

9. The method according to claim 6, characterized in that, The decoding result includes a classification result and a confidence score. The classification result indicates whether the external device is expected to be in motion to perform the target action under the motor imagery, or whether the external device is expected to be in a resting state. The confidence score indicates the reliability of the classification result. The step of inputting the EEG signal of the biological object into the target decoding model for decoding to obtain the decoding result includes: The decoding system is controlled to input the EEG signal into the target decoding model for decoding, thereby obtaining the classification result and the confidence level.

10. The method according to claim 9, characterized in that, The step of generating control instructions based on the decoding result includes: In response to the classification result indicating that the external device is expected to be in the motion state under the motion imagination to perform the target action, and the confidence level is greater than the confidence level threshold, the control command for driving the actuator in the external device is generated, wherein different target actions are performed by different actuators in the external device.

11. The method according to claim 10, characterized in that, The multiple actions include at least: a first action and a second action; the control instructions include a first control instruction and a second control instruction; the first control instruction is used to drive a first actuator among the different actuators to execute the second action; the second control instruction is used to drive a second actuator among the different actuators to execute the first action among the multiple actions; and driving the external device to execute the target action based on the control instructions includes: In response to the first control command, the first actuator is driven to perform the second action, and in conjunction with the spinal cord stimulator in the external device, an activation operation is performed on the biological object in response to the second action; or, In response to the second control command, the second actuator is driven to perform the first action, and the spinal cord stimulator in the external device is driven in concert to perform an activation operation on the biological object in response to the first action.

12. The method according to claim 10, characterized in that, The method further includes: In response to the classification result indicating that the external device is expected to be in the resting state, and / or the confidence level is less than or equal to the confidence level threshold, the external device is controlled to remain in the resting state.

13. The method according to claim 1, characterized in that, After driving the external device to perform the target action based on the control command, the method further includes: The target instruction state of the decoding system is obtained, wherein the target instruction state is used to characterize that after the decoding system inputs the EEG signal into the target decoding model for decoding and obtains the decoding result, the decoding system instructs the external device to switch from the currently executed action among the multiple actions to the action to be executed among the multiple actions; From the set of decoding models, determine the target decoding model that matches the target instruction state, and return to the step of execution starting from the following steps: The electroencephalogram (EEG) signal of the biological object is input into the target decoding model for decoding to obtain the decoding result.

14. The method according to claim 13, characterized in that, The method further includes: Obtain the execution status after the external device performs the target action, and update the execution status; Determining the target decoding model that matches the target instruction state from the decoding model set includes: In response to the update execution state being consistent with the target instruction state, the decoding system is controlled to determine the target decoding model that matches the update execution state and the target instruction state from the decoding model set.

15. The method according to claim 13, characterized in that, Determining the target decoding model that matches the target instruction state from the decoding model set includes: In response to the failure of the execution status after the external device performs the target action, the target decoding model matching the target instruction status is determined from the decoding model set.

16. The method according to any one of claims 1 to 15, characterized in that, The external device includes different actuators for performing different actions, including a first action and a second action. The external device assists the biological object in alternately performing the first action and the second action according to the time period. The first actuator among the different actuators is used to perform the second action, and the second actuator among the different actuators is used to perform the first action. The method further includes: A first EEG signal sample corresponding to the first action, a second EEG signal sample corresponding to the second action, and a resting data sample are determined respectively. The first EEG signal sample is used to characterize the first action corresponding to the motor imagination of the biological object sample, the second EEG signal sample is used to characterize the second action corresponding to the motor imagination of the biological object sample, and the resting data sample is used to characterize the EEG signal sample when the biological object does not generate the motor imagination corresponding to the target action. The resting data sample is collected during the process when the first actuator or the second actuator is in a resting state. Using the first EEG signal sample and the resting data sample, a second target decoding model in the decoding model set is trained, and using the second EEG signal sample and the resting data sample, a first target decoding model in the decoding model set is trained.

17. The method according to claim 16, characterized in that, The second target decoding model can determine whether the second actuator expects to be in a moving state or a resting state under the motor imagery corresponding to the input EEG signal, and the first target decoding model can determine whether the first actuator expects to be in a moving state or a resting state under the motor imagery corresponding to the input EEG signal.

18. The method according to any one of claims 1 to 15, characterized in that, The method further includes: The acquired EEG signals are preprocessed, and the stability of the preprocessed EEG signals is higher than that of the unprocessed EEG signals. The step of inputting the electroencephalogram (EEG) signal of the biological object into the target decoding model for decoding to obtain the decoding result includes: The preprocessed EEG signal is input into the target decoding model for decoding to obtain the decoding result.

19. A method for controlling an external device, characterized in that, include: From the set of decoding models, a target decoding model matching the execution state of the rehabilitation assistive device is determined. The rehabilitation assistive device is used to assist the rehabilitation training object to perform multiple actions in turn according to a time cycle. The first action and the second action among the multiple actions are opposite or antagonistic actions of the rehabilitation training object. The execution state is used to characterize the target action to be performed among the multiple actions. Different execution states are matched with different decoding models in the set of decoding models. The electroencephalogram (EEG) signal of the rehabilitation training subject is input into the target decoding model for decoding to obtain the decoding result. The EEG signal is used to characterize the motor imagination of the rehabilitation training subject, and the multiple actions include the actions corresponding to the motor imagination. Based on the decoding results, control commands are generated; Based on the control commands, the rehabilitation assistive device is driven to perform the target action.

20. A control system for an external device, characterized in that, include: The dual-model management module is used to determine the target decoding model that matches the execution state of the external device from the decoding model set. The external device is used to assist the biological object in performing multiple actions in turn according to a time cycle. The execution state is used to characterize the target action to be performed among the multiple actions. Different execution states are matched with different decoding models in the decoding model set. The classification output module is used to input the EEG signal of the biological object into the target decoding model for decoding to obtain the decoding result, and to generate control commands based on the decoding result. The EEG signal is used to characterize the motor imagination of the biological object, and the multiple actions include the actions corresponding to the motor imagination. The driving module is used to drive the external device to perform the target action based on the control command.

21. The system according to claim 20, characterized in that, The system also includes at least one of the following: An electroencephalogram (EEG) acquisition module is used to acquire the EEG signals of the biological object. The peripheral device status feedback module is used to determine the execution status after the external device performs the target action, and obtain an updated execution status; the updated execution status is determined as the execution status, and execution returns to start from the following steps: From the set of decoding models, determine the target decoding model that matches the execution state of the external device; The model training module is used to train a decoding model in the decoding model set using different EEG signal samples corresponding to different actions and the same resting data sample. The EEG signal samples are used to characterize the biological object sample's expectation to perform one of the multiple actions through the actuator in the external device. The resting data sample is an EEG signal sample used to characterize the biological object when it does not generate the motor imagery corresponding to the target action. The resting data sample is collected during the process when the actuator is in a resting state. The preprocessing module is used to preprocess the acquired EEG signals, wherein the stability of the preprocessed EEG signals is higher than that of the unprocessed EEG signals.

22. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the method according to any one of claims 1 to 19.

23. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the storage medium is located to perform the method according to any one of claims 1 to 19.

24. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 19.