An interactive acupuncture therapy brain-computer interface model training system and method

By breaking down the acupuncture and physiotherapy process into event segments and recognizing EEG response fragments, a structured training sample set is generated, which solves the problem of inaccurate EEG signal processing in existing technologies and improves the stability and recognition accuracy of model training.

CN122153470BActive Publication Date: 2026-07-10山东海天智能工程有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
山东海天智能工程有限公司
Filing Date
2026-05-09
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In the process of acupuncture and physiotherapy, the existing EEG signal processing technology lacks detailed processing of the boundary of stimulus events, the range of response windows, and the distribution of candidate response fragments, resulting in unclear training sample boundaries, confused attribution, and distorted labels, which affects the stability of model training and recognition accuracy.

Method used

The brain-computer interface model is trained by using a stimulus semantic segmentation module, an EEG response fluctuation arrangement module, a misalignment inheritance table generation module, an attribution adjudication and sample re-editing module, and an inheritance constraint training module. By performing event-based decomposition, EEG response fragment recognition, and inheritance type determination on acupuncture operation record data, a structured training sample set is generated.

Benefits of technology

It improves the accuracy of EEG response recognition and the stability of model training during acupuncture and physiotherapy, reduces the impact of misaligned labels and abnormal boundaries, and enhances the consistency of model output in interactive acupuncture and physiotherapy scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122153470B_ABST
    Figure CN122153470B_ABST
Patent Text Reader

Abstract

The application discloses an interactive acupuncture and physiotherapy-oriented brain-computer interface model training system and method, relates to the technical field of brain-computer interface data processing and intelligent training, and comprises a stimulation semantic segmenting module, an electroencephalogram response fluctuation programming module, a misplacement accommodating table generating module, an attribution adjudication and sample reprogramming module and an accommodating constraint training module; in the same acupoint corresponding operation fragment set, the first needle insertion operation is taken as the stimulation starting basis, and whether the subsequent operation fragment still belongs to the same acupoint and whether the adjacent interval reaches the disconnection condition are combined to continuously merge or split the stimulation process, so that a stimulation event sequence comprising a stimulation starting point, a stimulation extension segment and a stimulation convergence point is formed. In this way, the starting position, continuous process and ending boundary of each acupuncture stimulation can be more clear, multiple adjacent micro-motions are avoided from being mixedly written as a continuous record without boundaries, and motion fragments belonging to the same stimulation process are also avoided from being split.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of brain-computer interface data processing and intelligent training technology, specifically to a brain-computer interface model training system and method for interactive acupuncture and physiotherapy. Background Technology

[0002] In interactive acupuncture therapy scenarios, specifically regarding the technical object of training the correspondence between acupuncture operations and EEG responses, existing methods typically involve directly extracting EEG data within a fixed time window based on the moment the stimulation occurs, or simply aligning the EEG signals using the stimulation start point as a label anchor. These methods have significant shortcomings: firstly, EEG changes after acupuncture stimulation often do not occur synchronously at the stimulation start point, but rather with a certain lag; secondly, adjacent stimulation events are often accompanied by continuous lifting, twisting, or acupoint switching, causing the EEG responses to overlap, continue, or span segments in time.

[0003] The existing training process lacks detailed processing of stimulus event boundaries, response window range, candidate response fragment distribution, and succession type. As a result, it is easy to mislabel EEG responses that should belong to the previous stimulus event to the next stimulus event, or to directly write local fluctuations that have not yet formed a complete fluctuation structure into the training sample, resulting in unclear training sample boundaries, confusion in attribution, and label distortion.

[0004] The aforementioned shortcomings mainly stem from the inherent characteristics of acupuncture therapy: continuous operation, multi-stage stimulation, and delayed EEG responses. Multiple micro-movements at the same acupoint may occur consecutively within a short period, and rapid switching may occur between different acupoints. Furthermore, EEG signals exhibit baseline drift, local oscillations, tail-end regression, and cross-stimulus extension. If a fixed window and single-time alignment approach is still used, it becomes difficult to accurately identify whether a response segment begins within a stimulus segment, ends after the stimulus, or has already entered the range of the next stimulus event. Once these problems enter the model training phase, they lead to issues such as misaligned concatenation, duplicate attribution, unsplitting contentious segments, and the inclusion of invalid segments in the sample set. Consequently, the model learns not the correspondence between the true stimulus category and the true EEG response, but rather distorted samples mixed with misaligned labels and abnormal boundaries. This ultimately results in poor training stability, blurred boundaries in identifying similar stimuli, and significant fluctuations in model output during therapeutic interactions. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a brain-computer interface model training system and method for interactive acupuncture therapy, solving the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solution: a brain-computer interface model training system for interactive acupuncture and physiotherapy, including a stimulus semantic segmentation module, an EEG response fluctuation arrangement module, a misalignment assignment table generation module, an attribution decision and sample re-editing module, and an assignment constraint training module.

[0007] The stimulus semantic segmentation module reads the operation record data during the acupuncture and physiotherapy interaction process, and performs event-based decomposition of the physiotherapy process according to the time sequence of acupoint selection operation, needle insertion operation, lifting and twisting operation and needle withdrawal operation, generating a sequence of stimulus events arranged in chronological order.

[0008] The EEG response fluctuation arrangement module is based on the stimulus event sequence. It extracts the corresponding EEG segment before and after the start time of each stimulus event unit, performs baseline correction and continuous fluctuation segmentation processing, identifies and forms continuous rising segments, swing segments and falling segments, and generates EEG response fragment chains in the order of appearance.

[0009] The misaligned succession table generation module is based on the EEG response fragment chain. Based on the distribution of candidate response fragments in the window corresponding to each stimulus event, it performs backflow correction processing to obtain the backflow corrected response window table and the corresponding response fragment chain.

[0010] The attribution decision and sample re-editing module selects response segments with a start time later than the start time as candidate successors for each stimulus event unit based on the response window table and the corresponding response segment chain. It also determines the succession type of the response segment based on the relative positional relationship between the start time of the response segment and the start and end times of the stimulus event, and generates a misaligned succession table containing the stimulus event number, response segment number, response delay interval, and succession type.

[0011] The constraint training module performs attribution decisions on the response fragments corresponding to each stimulus event based on the misalignment assignment table, generates a structured training sample set, and trains the brain-computer interface model based on the structured training sample set.

[0012] Preferably, the stimulus semantic segmentation module includes an operation record consolidation unit and an event skeleton arrangement unit;

[0013] The operation record organization unit reads operation records from the operation record data during the acupuncture and physiotherapy interaction process, and extracts the timestamp, operation category, target acupoint number, operation duration and operation execution order identifier corresponding to each operation record;

[0014] All operation records are sorted sequentially according to a unified time benchmark, and then the sorted operation records are divided into multiple acupoint operation sequences according to the target acupoint number. Each acupoint operation sequence includes the acupoint selection operation, needle insertion operation, lifting and thrusting operation, twisting operation, needle retention and maintenance operation, and needle withdrawal operation corresponding to the target acupoint.

[0015] For operation records with start and end times, the start time is written to the start time of the operation segment, and the end time is written to the end time of the operation segment.

[0016] For operation records that only have a trigger time, the trigger time is written to the start time and end time of the operation segment;

[0017] An operation segment set is generated based on the start and end times of each operation record in the operation sequence of each acupoint; each operation segment in the operation segment set includes at least: operation category, target acupoint number, operation duration and operation execution order identifier;

[0018] The event skeleton arrangement unit searches for operation segments of the same acupoint in the operation segment set according to time sequence. The found needle insertion operation segment is recorded as the starting segment of the current stimulation event, and the start time of the starting segment is recorded as the start time of the current stimulation event.

[0019] From the set of operation segments corresponding to the same acupoint, continue to read subsequent operation segments in the order after the starting segment. When the subsequent operation segment still belongs to the same acupoint and the interval between it and the previous operation segment does not meet the disconnection condition, the subsequent operation segment is merged into the current stimulation event and forms the stimulation extension segment of the current stimulation event.

[0020] When a needle withdrawal operation is detected, or when the interval between two consecutive operation segments is longer than a fixed duration, or when the end of the operation segment set corresponding to the same acupoint has been read, the current stimulation event will end, and the end position will be used as the stimulation termination point of the current stimulation event; where the fixed duration is greater than zero.

[0021] The current stimulus event is written into the stimulus event sequence. The same processing is then performed on the subsequent unprocessed operation segments. The stimulus event sequence is divided using the interval between adjacent operations as the event boundary to obtain multiple structured stimulus event units.

[0022] Preferably, the EEG response fluctuation arrangement module includes an EEG segment extraction and correction unit and a fluctuation structure arrangement unit;

[0023] The EEG segment extraction and correction unit uses the start time of the stimulus event unit as the boundary, extracts the first fixed-cycle segment before the start time as the reference segment and the second fixed-cycle segment after the start time as the response search segment, and generates the EEG segment corresponding to the current stimulus event unit; wherein, the duration of the first fixed cycle is shorter than the duration of the second fixed cycle;

[0024] Stable segments are identified in the anterior reference time period of the extracted EEG segments. The segments with smooth fluctuations within the reference time period are identified as the baseline reference segments corresponding to the current stimulus event unit. The average potential level corresponding to the baseline reference segments is used as the correction benchmark. The current EEG segment is subjected to baseline translation processing to transform the EEG segment into a corrected EEG segment that expands around a unified benchmark, thereby obtaining the set of corrected EEG segments corresponding to the event.

[0025] Preferably, the undulating structure arrangement unit is based on the event-corresponding corrected EEG segment set, and reads the waveform changes point by point along the time sequence for each corrected EEG segment;

[0026] The segment in which the direction of potential change changes at least twice in three or more consecutive sampling points is identified as the swing segment;

[0027] Identify the segment where the potential continuously decreases and approaches the baseline reference segment as the fall-off segment;

[0028] Identify the segment where the potential continuously decreases and approaches the baseline as the fall-off segment;

[0029] Based on this, the location where the waveform changes direction is switched is used as the segment boundary, and the continuous rising segment, swinging segment and falling segment in the same corrected EEG segment are arranged in sequence.

[0030] When there is no direction change between two adjacent local waveform segments and there is no lag interval exceeding the allowable length in between, the adjacent segments are merged into the same response segment.

[0031] When the direction reverses between two adjacent local waveform segments, or when there is a stagnant segment in the middle that is sufficient to interrupt the continuous fluctuation relationship, the subsequent segment is divided into a new response segment.

[0032] Finally, a chain of EEG response fragments is generated in chronological order.

[0033] Preferably, the misaligned acceptance table generation module includes a candidate distribution callback unit and a backflow recompilation stability judgment unit;

[0034] The candidate distribution callback unit is based on the EEG response fragment chain, reads the start time, end time and corresponding response window range of the current stimulus event one by one, and then searches for candidate response fragments corresponding to the time position of the stimulus event within the current response window range.

[0035] The retrieved candidate response fragments are subjected to distribution discrimination, and the discrimination method is as follows:

[0036] When candidate response fragments are concentrated in the local early segment, local middle segment, or continuously clustered in a short segment of the current response window, and no new candidate response fragment fluctuations begin to form in the later segment of the window, the current distribution state is recorded as a local concentrated distribution.

[0037] If there is no complete response segment in the candidate response segment that simultaneously contains a continuous rising segment, a swing segment, and a falling segment, or if the time interval between any two adjacent candidate response segments is greater than 0.5 seconds, then the current distribution state is recorded as an insufficient response distribution.

[0038] Upon completion of the discrimination, window boundary trimming is performed based on the distribution status to obtain the updated window range set;

[0039] The window boundary trimming process is as follows: When the candidate response fragments corresponding to the current stimulus event show a local concentrated distribution, the rear boundary of the response window corresponding to the current stimulus event is contracted, and the rear boundary is brought closer to the tail of the currently identified candidate response fragments.

[0040] When the number of candidate response fragments corresponding to the current stimulus event is insufficient or a complete response segment is not formed, the rear range of the response window corresponding to the current stimulus event is expanded, and the rear boundary is extended to the area to be investigated to continue to accommodate the delayed response.

[0041] Preferably, the backflow recompilation and stabilization unit sends the updated window range set to the EEG response fluctuation arrangement module, and re-executes segment extraction and fluctuation segmentation processing for the EEG segment corresponding to the stimulus event that has undergone window correction, so as to obtain a corrected response fragment chain consistent with the updated window range.

[0042] Based on the corrected response fragment chain, the number, distribution, and connection of candidate response fragments within the window corresponding to each stimulus event are re-statistically analyzed, and the current distribution status of the corrected response fragment chain is compared with the distribution status before the previous round of window adjustment.

[0043] When candidate response fragments in the corrected response fragment chain still show local over-aggregation, obvious response loss, or the updated window boundary still needs to continue to shrink or expand, the current stimulus event is sent back to the candidate distribution callback unit to continue the next round of window trimming.

[0044] When the distribution of candidate response fragments corresponding to the corrected response fragment chain has become stable, and the current window boundary has not changed substantially in two consecutive rounds of processing, or the set of corrected response fragments is consistent with the previous round, the current stimulus event is recorded as having reached the stability condition.

[0045] After all stimulus events have been reflowed, reprogrammed, and stabilized, a reflow-trimmed response window table and a corresponding response fragment chain are generated.

[0046] The response window table after backflow trimming should at least include: stimulus event number, final window start point, final window end point, number of backflow trimmings, and final distribution state; the corresponding response fragment chain should at least include: fragment number, corresponding stimulus event number, fluctuation start point, fluctuation end point, and fragment internal fluctuation structure information.

[0047] Preferably, the attribution decision and sample re-editing module includes a candidate acceptance screening unit and an acceptance type determination table building unit;

[0048] The candidate acceptance screening unit calls the response window table and the corresponding response fragment chain, and retrieves response fragments that meet all of the following conditions as candidate acceptance objects for the current stimulus event from the corresponding response fragment chain; the conditions are as follows:

[0049] The first condition is that the starting point of the fluctuation of the response fragment is within the response window range corresponding to the current stimulus event;

[0050] Condition two is that the starting point of the fluctuation in the response fragment is later than the starting point of the current stimulus event;

[0051] Condition 3 is that the response fragment was not identified as the uniquely assigned fragment by the previous stimulus event within its final stabilization window;

[0052] After the search is completed, the response fragments that meet the criteria are arranged in chronological order of the starting points of the fluctuations to form a candidate set of responses corresponding to the current stimulus event.

[0053] Preferably, the table building unit for determining the type of acceptance performs positional relationship determination on each response fragment in the candidate acceptance set corresponding to the current stimulus event;

[0054] When the starting point of a response fragment is located after the start time of the stimulus event and before the end time of the stimulus event, the response fragment is determined to be an intra-segment continuation fragment.

[0055] When the starting point of a response fragment is after the end of the stimulus event, but is still within the response window corresponding to the current stimulus event, the response fragment is determined to be a tail-following fragment.

[0056] When the starting point of a response segment is later than the starting point of the current stimulus event, but the main fluctuation segment has already entered the starting range of the subsequent stimulus event, the response segment is judged as a cross-segment continuation segment.

[0057] When the same stimulus event corresponds to multiple candidate response segments, and the multiple candidate response segments unfold consecutively in time, the succession order is determined according to the order in which the response segments start.

[0058] After the judgment is completed, the start time of the current stimulus event and the start point of the fluctuation of the corresponding response segment are read, and the time difference between the two is extracted as the response delay interval corresponding to the current candidate response segment.

[0059] Subsequently, the stimulus event number, response fragment number, response delay interval, and succession type are written into the structured table entries, and a staggered succession table is generated according to the stimulus event number and the starting point of the candidate response fragment.

[0060] Preferably, the constraint training module includes a home reprogramming unit and a constraint sample training unit;

[0061] The attribution re-editing unit reads the misaligned attribution table entry corresponding to the current stimulus event and performs attribution determination on the response fragment corresponding to the current stimulus event based on the misaligned attribution table entry; the attribution determination method is as follows:

[0062] When a response fragment forms an intra-segment continuation or post-terminal continuation with only a single stimulus event, and is not simultaneously marked as a cross-segment contention object by the subsequent stimulus event, the response fragment is determined to be a stable continuation fragment and directly assigned to the stimulus event.

[0063] When the same response fragment appears simultaneously in the misaligned succession entries corresponding to two consecutive stimulus events, and at least one of the entries is marked as cross-segment succession, the response fragment is determined to be a cross-stimulus contention fragment.

[0064] For cross-stimulus contention segments, first read the corresponding succession order and the time overlap position with adjacent stimulus events, and then perform splitting processing on the response segments according to the succession order and the fluctuation and turning positions within the segment;

[0065] When there is no clear boundary within the contention fragment that can be used to distinguish the succession of the preceding and following fragments, or when the length of the local fragments formed after splitting is insufficient to maintain the complete response structure, the contention fragment will be removed from the training sample set.

[0066] After processing, each stimulus event and the response fragments belonging to it are rearranged into sample records and written into the structured training sample set.

[0067] The constrained sample training unit performs training processing on the brain-computer interface model based on the structured training sample set to obtain the trained brain-computer interface model;

[0068] The specific method is as follows: Read the target acupoint number, operation category, start time, end time, belonging response segment number, response delay interval and succession type corresponding to each stimulus event, and pair and organize the stimulus event side information with the response segment side information to form training sample entries;

[0069] The training sample entries are input into the brain-computer interface model for training, so that the model can read the connection relationship markers between the response fragments and the stimulus events while reading the response fragment features.

[0070] For sample records that are determined to be directly assigned samples, they will participate in training according to their original assignment type;

[0071] For sample records obtained by splitting cross-stimulus contention fragments, they are used in training according to the new assignment results after the splitting;

[0072] For sample records that are marked as to be removed, they will not be written into the training input for this round;

[0073] During training, not all response fragments are treated as ordinary classification samples. Instead, based on the connection type and delay interval in the structured training sample set, the "stimulus category" and "connection relationship features" are written into the sample organization process as training constraints. This allows the model to learn the EEG pattern corresponding to a certain type of acupuncture stimulation while also learning the attribution state of the EEG pattern appearing within the stimulation segment, after the stimulation tail, or after cross-segment contention.

[0074] Finally, the constrained training model is output, and the sample batch number and training sample source number corresponding to the current model are recorded for subsequent use.

[0075] A brain-computer interface model training method for interactive acupuncture therapy includes the following steps:

[0076] Step 1: The stimulus semantic segmentation module reads the operation record data during the acupuncture and physiotherapy interaction process. Based on the time sequence of acupoint selection operation, needle insertion operation, lifting and twisting operation and needle withdrawal operation, the physiotherapy process is broken down into events to generate a sequence of stimulus events arranged in chronological order.

[0077] Step 2: The EEG response fluctuation arrangement module, based on the stimulus event sequence, extracts the corresponding EEG segments before and after the start time of each stimulus event unit, performs baseline correction and continuous fluctuation segmentation processing, identifies and forms continuous rising segments, swinging segments and falling segments, and generates EEG response fragment chains in the order of appearance.

[0078] Step 3: The misaligned succession table generation module is based on the EEG response fragment chain. Based on the distribution of candidate response fragments in the window corresponding to each stimulus event, it performs backflow correction processing to obtain the backflow corrected response window table and the corresponding response fragment chain.

[0079] Step 4: The attribution decision and sample re-editing module selects response segments whose starting point is later than the start time as candidate successors for each stimulus event unit based on the response window table and the corresponding response segment chain. It also determines the succession type of the response segment based on the relative positional relationship between the start time of the response segment and the start and end times of the stimulus event, and generates a misaligned succession table.

[0080] Step 5: The assignment constraint training module performs attribution decisions on the response fragments corresponding to each stimulus event based on the misalignment assignment table, generates a structured training sample set, and trains the brain-computer interface model based on the structured training sample set.

[0081] This invention provides a brain-computer interface model training system and method for interactive acupuncture therapy, which has the following beneficial effects:

[0082] (1) During system operation, in the set of operation segments corresponding to the same acupoint, the first needle insertion operation is used as the basis for stimulation initiation. Combined with whether subsequent operation segments still belong to the same acupoint and whether the adjacent intervals meet the disconnection conditions, the stimulation process is continuously merged or split to form a stimulation event sequence containing the stimulation initiation point, stimulation extension segment, and stimulation termination point. This makes the starting position, duration, and termination boundary of each acupuncture stimulation clearer, avoids mixing multiple adjacent micro-movements into a continuous record without boundaries, and also avoids splitting action segments that belong to the same stimulation process.

[0083] By using the interval between adjacent operations as one of the event boundaries, the division of stimulus events no longer relies solely on a single operation type, but rather combines the sequence of operations, acupoint affiliation, and interval status to jointly determine the stimulus event unit. This allows the division of stimulus events to better align with the actual operational rhythm during physiotherapy, mitigating the problems of ambiguous stimulus boundaries and inconsistent event granularity in existing treatment methods.

[0084] (2) Through the processing chain of "candidate distribution discrimination - window boundary trimming - re-editing - re-stabilization judgment", the response window before the generation of the misaligned acceptance table undergoes self-correction before entering the subsequent acceptance judgment and sample re-editing process. Therefore, it is more conducive to the corresponding background problems such as temporal misalignment between acupuncture stimulation and EEG response, overlapping of adjacent stimulus responses, and unclear classification of training samples. In other words, the subsequent misaligned acceptance table is not based on the initial fragment in the rough window, but on the stable fragment object after re-editing.

[0085] (3) Based on the relative positional relationship between the starting point of the response segment and the starting and ending times of the stimulus event, candidate response segments are divided into intra-segment continuation, post-terminal continuation, and cross-segment continuation, and the continuation order of multiple candidate response segments unfolding continuously under the same stimulus event is determined. This allows the EEG response after acupuncture stimulation to no longer be judged solely on "whether it appears after stimulation," but to distinguish whether the response occurs during stimulation, after stimulation ends, or has already entered the scope of the next stimulus event, which is more in line with the actual situation in the background where there is lag and overlap between acupuncture stimulation and EEG response.

[0086] (4) After completing the attribution decision, the stimulus events and attribution response segments are rearranged into a structured training sample set. Then, the acupoint identifiers, operation type combinations, stimulus start time, stimulus end time, attribution response segment numbers, response delay intervals, and succession types are organized into training sample items. This allows the model to learn not only the correspondence between stimulus categories and EEG segments during training, but also the succession relationship markers between the response segment and the stimulus event. This makes the sample information on which the model is based more complete and more in line with the actual situation of continuous stimulation, delayed response, and cross-segment overlap in interactive acupuncture and physiotherapy scenarios. Attached Figure Description

[0087] Figure 1 This is a schematic diagram of the block flow of a brain-computer interface model training system for interactive acupuncture and physiotherapy according to the present invention.

[0088] Figure 2 This is a schematic diagram illustrating the steps of a brain-computer interface model training method for interactive acupuncture and physiotherapy according to the present invention.

[0089] Figure 3 This is a schematic diagram of the acceptance type determination process of the present invention;

[0090] Figure 4 This is a schematic diagram of the attribution determination and training sample generation process of the present invention. Detailed Implementation

[0091] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0092] Example 1: This invention provides a brain-computer interface model training system for interactive acupuncture therapy. Please refer to [link / reference]. Figures 1 to 4 It includes a stimulus semantic segmentation module, an EEG response fluctuation arrangement module, a misaligned inheritance table generation module, an attribution adjudication and sample re-editing module, and an inheritance constraint training module.

[0093] The stimulus semantic segmentation module reads the operation record data during the acupuncture and physiotherapy interaction process, and performs event-based decomposition of the physiotherapy process according to the time sequence of acupoint selection operation, needle insertion operation, lifting and twisting operation and needle withdrawal operation, generating a sequence of stimulus events arranged in chronological order.

[0094] The EEG response fluctuation arrangement module is based on the stimulus event sequence. It extracts the corresponding EEG segment before and after the start time of each stimulus event unit, performs baseline correction and continuous fluctuation segmentation processing, identifies and forms continuous rising segments, swing segments and falling segments, and generates EEG response fragment chains in the order of appearance.

[0095] The misaligned succession table generation module is based on the EEG response fragment chain. Based on the distribution of candidate response fragments in the window corresponding to each stimulus event, it performs backflow correction processing to obtain the backflow corrected response window table and the corresponding response fragment chain.

[0096] The attribution decision and sample re-editing module selects response segments whose starting point is later than the start time as candidate successors for each stimulus event unit based on the response window table and the corresponding response segment chain. It also determines the succession type of the response segment based on the relative positional relationship between the starting point of the response segment and the start and end times of the stimulus event, and generates a misaligned succession table.

[0097] The constraint training module performs attribution decisions on the response fragments corresponding to each stimulus event based on the misalignment assignment table, generates a structured training sample set, and trains the brain-computer interface model based on the structured training sample set.

[0098] In this embodiment, the acupoint selection, needle insertion, lifting and thrusting, twisting, and needle withdrawal operations during acupuncture and physiotherapy are first broken down into events, generating a sequence of stimulation events arranged chronologically, instead of treating the entire physiotherapy process as a single stimulation segment. This approach makes the start, extension, and end boundaries of the stimulation side clearer, allowing subsequent EEG response analysis to focus on specific stimulation events, thus reducing the problem of ambiguous stimulation boundaries in traditional fixed-time-point labeling methods.

[0099] This approach extracts corresponding EEG segments before and after the onset of each stimulus event unit, and performs baseline correction and continuous fluctuation segmentation processing to organize the EEG changes into a chain of response segments consisting of continuous rising segments, swinging segments, and falling segments. Compared with directly extracting raw EEG segments, this processing method can first eliminate the interference of baseline drift at different time periods on interpretation, and then decompose the continuous response process into response segments with internal structure, making it easier to distinguish between true stimulus responses and local scattered fluctuations.

[0100] Based on the EEG response fragment chain, a backflow adjustment process is introduced. Instead of fixing the response window all at once, the response window is shrunk or expanded according to the distribution of candidate response fragments within the window corresponding to each stimulus event, and then sent back to the EEG response fluctuation arrangement module to regenerate a corrected response fragment chain. This allows the response window boundary to be adjusted according to the distribution of candidate fragments, which is more suitable for handling situations where the EEG response after acupuncture stimulation is delayed, locally clustered, or insufficient, and reduces the problems of incorrect or missed reception caused by a fixed window that is too wide or too narrow.

[0101] After the response window stabilizes, candidate recipients are selected for each stimulus event. Based on the relative position of the start point of the response segment to the start and end times of the stimulus event, intra-segment recipients, post-stress recipients, and cross-segment recipients are distinguished, generating a misaligned recipient table. This process ensures that the EEG response is no longer simply attached to the vicinity of the stimulus start point, but clearly distinguishes whether the response occurs during the stimulus process, after the stimulus ends, or has already crossed into the range of the next stimulus event. This helps to solve the problem of inaccurate labeling when there is a temporal misalignment between acupuncture stimulation and the EEG response.

[0102] The assignment of response fragments is determined based on the misalignment succession table. Stable succession fragments are directly assigned, while fragments competing across stimuli are split based on succession order and internal fluctuations / transitions. Fragments that cannot be clearly demarcated or whose splitting results in an incomplete response structure are discarded. This makes the boundaries of samples entering the training phase clearer, avoids the same response fragment being repeatedly occupied by preceding and following stimuli, and prevents fragments with unclear boundaries or incomplete structures from being mixed into the training samples.

[0103] In the training phase, instead of simply writing stimulus categories into the training samples, the model organizes stimulus event-side information, response segment-side information, response delay intervals, and connection types into a structured training sample set before training the brain-computer interface model. This allows the model to learn not only "which type of stimulus corresponds to which EEG segment," but also "what kind of connection exists between the EEG segment and the stimulus event." Therefore, it is more suitable for the training needs of interactive acupuncture and physiotherapy scenarios where continuous stimulation, delayed responses, and overlapping adjacent events coexist.

[0104] Example 2, please refer to Figure 1 Specifically: the stimulus semantic segmentation module includes an operation record consolidation unit and an event skeleton arrangement unit;

[0105] The operation record organization unit reads operation records from the operation record data during the acupuncture and physiotherapy interaction process, and extracts the timestamp, operation category, target acupoint number, operation duration and operation execution order identifier corresponding to each operation record;

[0106] All operation records are sorted sequentially according to a unified time benchmark, and then the sorted operation records are divided into multiple acupoint operation sequences according to the target acupoint number. Each acupoint operation sequence includes the acupoint selection operation, needle insertion operation, lifting and thrusting operation, twisting operation, needle retention and maintenance operation, and needle withdrawal operation corresponding to the target acupoint.

[0107] For operation records with start and end times, the start time is written to the start time of the operation segment, and the end time is written to the end time of the operation segment.

[0108] For operation records that only have a trigger time, the trigger time is written to the start time and end time of the operation segment;

[0109] An operation segment set is generated based on the start and end times of each operation record in the operation sequence of each acupoint; each operation segment in the operation segment set includes at least: operation category, target acupoint number, operation duration and operation execution order identifier;

[0110] The event skeleton arrangement unit searches for operation segments of the same acupoint in the operation segment set according to time sequence. The found needle insertion operation segment is recorded as the starting segment of the current stimulation event, and the start time of the starting segment is recorded as the start time of the current stimulation event.

[0111] From the set of operation segments corresponding to the same acupoint, continue to read subsequent operation segments in the order after the starting segment. When the subsequent operation segment still belongs to the same acupoint and the interval between it and the previous operation segment does not meet the disconnection condition, the subsequent operation segment is merged into the current stimulation event and forms the stimulation extension segment of the current stimulation event.

[0112] When a needle withdrawal operation is detected, or when the interval between two consecutive operation segments is longer than a fixed duration, or when the end of the operation segment set corresponding to the same acupoint has been read, the current stimulation event will end, and the end position will be used as the stimulation termination point of the current stimulation event.

[0113] The current stimulus event is written into the stimulus event sequence. The same processing is then performed on the subsequent unprocessed operation segments. The stimulus event sequence is divided using the interval between adjacent operations as the event boundary to obtain multiple structured stimulus event units.

[0114] The EEG response fluctuation arrangement module includes an EEG segment extraction and correction unit and a fluctuation structure arrangement unit;

[0115] The EEG segment extraction and correction unit reads the event number, start time, end time and acupoint identifier corresponding to each stimulus event unit in the stimulus event sequence. Taking the start time of the stimulus event unit as a reference, it extracts a preset reference time period forward and a response to be checked time period backward, and extracts the EEG segment corresponding to the current stimulus event unit from the continuous EEG signal data.

[0116] Stable segments are identified in the anterior reference time period of the extracted EEG segments. The segments with smooth fluctuations within the reference time period are identified as the baseline reference segments corresponding to the current stimulus event unit. The average potential level corresponding to the baseline reference segments is used as the correction benchmark. The current EEG segment is subjected to baseline translation processing to transform the EEG segment into a corrected EEG segment that expands around a unified benchmark, thereby obtaining the set of corrected EEG segments corresponding to the event.

[0117] The fluctuating structure arrangement unit is based on the event-corresponding corrected EEG segment set, and reads the waveform changes point by point along the time sequence for each corrected EEG segment.

[0118] The segment in which the direction of potential change changes at least twice in three or more consecutive sampling points is identified as the swing segment;

[0119] Identify the segment where the potential continuously decreases and approaches the baseline reference segment as the fall-off segment;

[0120] Identify the segment where the potential continuously decreases and approaches the baseline as the fall-off segment;

[0121] Based on this, the location where the waveform changes direction is switched is used as the segment boundary, and the continuous rising segment, swinging segment and falling segment in the same corrected EEG segment are arranged in sequence.

[0122] When there is no direction change between two adjacent local waveform segments and there is no lag interval exceeding the allowable length in between, the adjacent segments are merged into the same response segment.

[0123] When the direction reverses between two adjacent local waveform segments, or when there is a stagnant segment in the middle that is sufficient to interrupt the continuous fluctuation relationship, the subsequent segment is divided into a new response segment.

[0124] Finally, a chain of EEG response fragments is generated in chronological order.

[0125] In this embodiment, the operation records of acupoint selection, needle insertion, lifting and thrusting, twisting, needle retention, and needle withdrawal in the interactive acupuncture and physiotherapy interface are first uniformly organized and then generated into a set of operation segments according to time sequence and acupoint affiliation. This avoids directly using discrete logs from the physiotherapy process as the basis for subsequent training. This allows the originally scattered interface operations to be organized into structured records with time boundaries and acupoint affiliation, facilitating subsequent continuous analysis around a single stimulation process.

[0126] Within the set of manipulation segments corresponding to the same acupoint, the first needle insertion is used as the starting point for stimulation. This is combined with whether subsequent manipulation segments still belong to the same acupoint and whether adjacent intervals meet the break-off condition. The stimulation process is then continuously merged or broken down to form a sequence of stimulation events containing the stimulation initiation point, stimulation extension segment, and stimulation termination point. This makes the starting position, duration, and termination boundary of each acupuncture stimulation clearer, avoiding the mixing of multiple adjacent micro-movements into a boundless continuous record, and also preventing the separation of movement segments belonging to the same stimulation process.

[0127] By using the interval between adjacent operations as one of the event boundaries, the division of stimulus events no longer relies solely on a single operation type, but rather combines the sequence of operations, acupoint affiliation, and interval status to jointly determine the stimulus event unit. This allows the division of stimulus events to better align with the actual operational rhythm during physiotherapy, mitigating the problems of ambiguous stimulus boundaries and inconsistent event granularity in existing treatment methods.

[0128] For each stimulus event unit, corresponding EEG segments are extracted before and after the initial moment, rather than creating a uniform slice of the entire EEG signal. This ensures a one-to-one correspondence between the EEG analysis object and the specific stimulus event. The preceding reference time period can be used to observe the pre-stimulation background state, while the subsequent response investigation time period can accommodate hysteretic changes after stimulation, facilitating subsequent identification of whether a particular EEG fluctuation is indeed related to the current stimulus event. After extracting the EEG segments, segments with gentle fluctuations are first identified from the preceding reference time period as baseline reference segments. Then, baseline shifting is performed on the current EEG segment, ensuring that the EEG segments corresponding to each event unfold around a unified benchmark. This reduces the impact of EEG background drift across different time periods on response interpretation, avoids mistaking natural fluctuations that are not part of the stimulus response as valid changes due to inconsistent baseline levels, and also facilitates cross-sectional comparisons of EEG segments between different stimulus events.

[0129] During the arrangement of undulating structures, local waveform segments that have not undergone direction switching and do not have long lag intervals are merged, while local waveform segments that have reversed direction or have interrupted lag intervals are segmented. This makes the formation rules of response segments clearer, avoids over-fragmenting the continuous response process, and avoids incorrectly merging interrupted waveform changes into the same response segment.

[0130] Example 3, please refer to Figure 1 Specifically: the misalignment acceptance table generation module includes a candidate distribution callback unit and a backflow recompilation stability judgment unit;

[0131] The candidate distribution callback unit is based on the EEG response fragment chain, reads the start time, end time and corresponding response window range of the current stimulus event one by one, and then searches for candidate response fragments corresponding to the time position of the stimulus event within the current response window range.

[0132] The retrieved candidate response fragments are subjected to distribution discrimination, and the discrimination method is as follows:

[0133] When candidate response fragments are concentrated in the local early segment, local middle segment, or continuously clustered in a short segment of the current response window, and no new candidate response fragment fluctuations begin to form in the later segment of the window, the current distribution state is recorded as a local concentrated distribution.

[0134] If no complete response fragment exists that simultaneously contains a continuous rising segment, a swing segment, and a falling segment, then the current distribution state is recorded as an insufficient response distribution.

[0135] Upon completion of the discrimination, window boundary trimming is performed based on the distribution status to obtain the updated window range set;

[0136] The window boundary trimming process is as follows: When the candidate response fragments corresponding to the current stimulus event show a local concentrated distribution, the rear boundary of the response window corresponding to the current stimulus event is contracted, and the rear boundary is brought closer to the tail of the currently identified candidate response fragments.

[0137] When the number of candidate response fragments corresponding to the current stimulus event is insufficient or a complete response segment is not formed, the rear range of the response window corresponding to the current stimulus event is expanded, and the rear boundary is extended to the area to be investigated to continue to accommodate the delayed response.

[0138] The backflow reconstruction and stability judgment unit sends the updated window range set to the EEG response fluctuation arrangement module, and re-executes segment extraction and fluctuation segmentation processing for the EEG segments corresponding to the stimulus events that have undergone window correction, to obtain a corrected response fragment chain consistent with the updated window range.

[0139] Based on the corrected response fragment chain, the number, distribution, and connection of candidate response fragments within the window corresponding to each stimulus event are re-statistically analyzed, and the current distribution status of the corrected response fragment chain is compared with the distribution status before the previous round of window adjustment.

[0140] When candidate response fragments in the corrected response fragment chain still show local over-aggregation, obvious response loss, or the updated window boundary still needs to continue to shrink or expand, the current stimulus event is sent back to the candidate distribution callback unit to continue the next round of window trimming.

[0141] When the distribution of candidate response fragments corresponding to the corrected response fragment chain has become stable, and the current window boundary has not changed substantially in two consecutive rounds of processing, or the set of corrected response fragments is consistent with the previous round, the current stimulus event is recorded as having reached the stability condition.

[0142] After all stimulus events have been reflowed, reprogrammed, and stabilized, a reflow-trimmed response window table and a corresponding response fragment chain are generated.

[0143] In this embodiment, instead of using a fixed response window to capture the EEG signal after acupuncture stimulation all at once, the current window is first judged to be appropriate based on the distribution of candidate response fragments within the window. Then, the window's rear boundary is contracted or expanded. Therefore, the response search range can be adjusted for different situations such as local aggregation, delayed appearance, and insufficient response. This is more suitable for the problem of incorrect or missed detection caused by a fixed window that is too wide or too narrow in the corresponding background.

[0144] After window adjustment, the updated window range is sent back to the EEG response fluctuation arrangement module. Segment extraction and fluctuation segmentation are then re-executed for the corresponding EEG segments to form a corrected response fragment chain consistent with the new window. The response fragment results formed under the old window are no longer used. This ensures that the response window boundary and the response fragment boundary are consistent, reducing the correspondence confusion caused by the fragment objects still using the old results due to window changes.

[0145] This scheme does not end immediately after the initial adjustment. Instead, it continues to statistically analyze the quantity, distribution, and connection of candidate response fragments based on the corrected response fragment chain, comparing this data with the previous round's state. Only when the distribution of candidate response fragments tends to stabilize, the window boundaries do not undergo substantial changes for two consecutive rounds, or the set of corrected response fragments remains consistent, is the current stimulus event recorded as having reached a stable condition. This provides a clearer boundary basis for the final output response window table and response fragment chain, reducing the randomness introduced by a single decision.

[0146] Through a processing chain of "candidate distribution discrimination—window boundary trimming—re-encoding—re-stabilization," the response window before generating the misaligned acceptance table undergoes self-correction before entering the subsequent acceptance judgment and sample re-encoding process. This is more effective in addressing issues such as temporal misalignment between acupuncture stimulation and EEG responses, overlapping responses to adjacent stimuli, and unclear training sample attribution in the corresponding background. In other words, the subsequent misaligned acceptance table is based not on the initial fragment in the coarse window, but on a stable fragment object after re-processing.

[0147] Example 4, please refer to Figure 3 Specifically: the attribution decision and sample re-editing module includes a candidate acceptance screening unit and an acceptance type determination table building unit;

[0148] The candidate acceptance screening unit calls the response window table and the corresponding response fragment chain, and retrieves response fragments that meet all of the following conditions as candidate acceptance objects for the current stimulus event from the corresponding response fragment chain; the conditions are as follows:

[0149] The first condition is that the starting point of the fluctuation of the response fragment is within the response window range corresponding to the current stimulus event;

[0150] Condition two is that the starting point of the fluctuation in the response fragment is later than the starting point of the current stimulus event;

[0151] Condition 3 is that the response fragment was not identified as the uniquely assigned fragment by the previous stimulus event within its final stabilization window;

[0152] After the search is completed, the response fragments that meet the criteria are arranged in chronological order of the starting points of the fluctuations to form a candidate set of responses corresponding to the current stimulus event.

[0153] The table-building unit for determining the type of acceptance performs positional relationship determination on each response fragment in the candidate acceptance set corresponding to the current stimulus event;

[0154] When the starting point of a response fragment is located after the start time of the stimulus event and before the end time of the stimulus event, the response fragment is determined to be an intra-segment continuation fragment.

[0155] When the start point of a response fragment is after the end time of the stimulus event, but is still within the response window corresponding to the current stimulus event, the response fragment is determined to be a tail-following fragment.

[0156] When the starting point of a response segment is later than the starting time of the current stimulus event, but the main fluctuation segment has already entered the starting range of the subsequent stimulus event, the response segment is judged as a cross-segment continuation segment.

[0157] When the same stimulus event corresponds to multiple candidate response segments, and the multiple candidate response segments unfold consecutively in time, the succession order is determined according to the order in which the response segments start.

[0158] After the judgment is completed, the start time of the current stimulus event and the start point of the fluctuation of the corresponding response segment are read, and the time difference between the two is extracted as the response delay interval corresponding to the current candidate response segment.

[0159] Subsequently, the stimulus event number, response fragment number, response delay interval, and succession type are written into the structured table entries, and a staggered succession table is generated according to the stimulus event number and the starting point of the candidate response fragment.

[0160] In this embodiment, instead of directly and roughly assigning all response fragments within the response window, a screening condition is first set that the starting point of the fluctuation is within the current response window, later than the start time of the current stimulus event, and not uniquely occupied by the previous stimulus event. The response fragments that are truly related to the current stimulus event are separated from the overall response fragment chain and then a candidate successor set is formed. This can reduce the problem of response fragments mixing between adjacent stimulus events.

[0161] This scheme further classifies candidate response segments into intra-segment continuation, post-stimulus continuation, and cross-segment continuation based on the relative positional relationship between the start point of the response segment and the start and end times of the stimulus event. It also determines the continuation order of multiple candidate response segments that unfold consecutively under the same stimulus event. This allows the EEG response after acupuncture stimulation to be judged not only by whether it occurs after the stimulus, but also to distinguish whether the response occurs during the stimulus, after the stimulus ends, or has already entered the range of the next stimulus event, which better reflects the actual situation in the context where there is lag and overlap between acupuncture stimulation and EEG response.

[0162] After determining the assignment type, the stimulus event number, response segment number, response delay interval, and assignment type are written into a structured table entry to generate a misaligned assignment table. This transforms the originally scattered time correspondence into a callable and traceable structured result, providing a unified basis for subsequent attribution decisions, sample re-encoding, and model training, and alleviating the problems of unclear label boundaries and chaotic sample attribution in existing processing methods.

[0163] Example 5, please refer to Figure 4 Specifically: the constraint training module includes the assignment recompilation unit and the constraint sample training unit;

[0164] The attribution re-editing unit reads the misaligned attribution table entry corresponding to the current stimulus event and performs attribution determination on the response fragment corresponding to the current stimulus event based on the misaligned attribution table entry; the attribution determination method is as follows:

[0165] When a response fragment forms an intra-segment continuation or post-terminal continuation with only a single stimulus event, and is not simultaneously marked as a cross-segment contention object by the subsequent stimulus event, the response fragment is determined to be a stable continuation fragment and directly assigned to the stimulus event.

[0166] When the same response fragment appears simultaneously in the misaligned succession entries corresponding to two consecutive stimulus events, and at least one of the entries is marked as cross-segment succession, the response fragment is determined to be a cross-stimulus contention fragment.

[0167] For cross-stimulus contention segments, first read the corresponding succession order and the time overlap position with adjacent stimulus events, and then perform splitting processing on the response segments according to the succession order and the fluctuation and turning positions within the segment;

[0168] When there is no clear boundary within the contention fragment that can be used to distinguish the succession of the preceding and following fragments, or when the length of the local fragments formed after splitting is insufficient to maintain the complete response structure, the contention fragment will be removed from the training sample set.

[0169] After processing, each stimulus event and the response fragments belonging to it are rearranged into sample records and written into the structured training sample set.

[0170] The constrained sample training unit performs training processing on the brain-computer interface model based on the structured training sample set to obtain the trained brain-computer interface model;

[0171] The specific method is as follows: Read the target acupoint number, operation category, start time, end time, belonging response segment number, response delay interval and succession type corresponding to each stimulus event, and pair and organize the stimulus event side information with the response segment side information to form training sample entries;

[0172] The training sample entries are input into the brain-computer interface model for training, so that the model can read the connection relationship markers between the response fragments and the stimulus events while reading the response fragment features.

[0173] For sample records that are determined to be directly assigned samples, they will participate in training according to their original assignment type;

[0174] For sample records obtained by splitting cross-stimulus contention fragments, they are used in training according to the new assignment results after the splitting;

[0175] For sample records that are marked as to be removed, they will not be written into the training input for this round;

[0176] Finally, the constrained training model is output, and the sample batch number and training sample source number corresponding to the current model are recorded for subsequent use.

[0177] In this embodiment, instead of directly writing the response segments from the misalignment table into the training process as a whole, the response segments are first classified based on the results of table entries such as intra-segment classification, post-terminal classification, and cross-segment classification. Segments that form a stable correspondence with only a single stimulus event are directly classified, while cross-stimulus contention segments that involve both preceding and following stimulus events are identified separately. This makes the source of samples entering the training phase clearer and reduces the problem of sample classification confusion caused by the misalignment of stimulus and EEG response in the background.

[0178] This approach does not simply retain or discard cross-stimulus contention fragments. Instead, it performs splitting based on succession order, temporal overlap, and internal fluctuations / transitions within the fragment. Fragments whose preceding and following attributions are unclear, or whose splitting fails to maintain a complete response structure, are then removed from the training sample set. This makes the boundaries of the training samples clearer, reduces the likelihood of the same response fragment being repeatedly labeled as preceding or following stimulus events, and minimizes interference with model learning caused by fragments with unclear boundaries or incomplete structures entering the training process.

[0179] After the attribution decision is made, the stimulus events and attribution response segments are rearranged into a structured training sample set. Then, acupoint identifiers, operation type combinations, stimulus start time, stimulus end time, attribution response segment numbers, response delay intervals, and succession types are organized into training sample items. This allows the model to learn not only the correspondence between stimulus categories and EEG segments during training, but also the succession markers between the response segment and the stimulus event. This makes the sample information used for model training more complete and more closely reflects the actual situation of continuous stimulation, delayed responses, and cross-segment overlap in interactive acupuncture therapy scenarios.

[0180] From an overall perspective, this embodiment enables backend model training to no longer be based on coarse alignment or single-class labels, but on a processing chain of "first determining the attribution, then cleaning up contention, and finally organizing and constraining samples". This ensures that the training sample set has completed boundary cleanup, attribution screening, and abnormal fragment elimination before entering the model. Therefore, it is more suitable for addressing the problems of label distortion, unclear sample boundaries, cross-stimulus aliasing, and large fluctuations in training results mentioned in the background section.

[0181] Example 6: A brain-computer interface model training method for interactive acupuncture therapy. Please refer to... Figure 2 Specifically, it includes the following steps:

[0182] Step 1: The stimulus semantic segmentation module reads the operation record data during the acupuncture and physiotherapy interaction process. Based on the time sequence of acupoint selection operation, needle insertion operation, lifting and twisting operation and needle withdrawal operation, the physiotherapy process is broken down into events to generate a sequence of stimulus events arranged in chronological order.

[0183] Step 2: The EEG response fluctuation arrangement module, based on the stimulus event sequence, extracts the corresponding EEG segments before and after the start time of each stimulus event unit, performs baseline correction and continuous fluctuation segmentation processing, identifies and forms continuous rising segments, swinging segments and falling segments, and generates EEG response fragment chains in the order of appearance.

[0184] Step 3: The misaligned succession table generation module is based on the EEG response fragment chain. Based on the distribution of candidate response fragments in the window corresponding to each stimulus event, it performs backflow correction processing to obtain the backflow corrected response window table and the corresponding response fragment chain.

[0185] Step 4: The attribution decision and sample re-editing module selects response segments whose starting point is later than the start time as candidate successors for each stimulus event unit based on the response window table and the corresponding response segment chain. It also determines the succession type of the response segment based on the relative positional relationship between the start time of the response segment and the start and end times of the stimulus event, and generates a misaligned succession table.

[0186] Step 5: The assignment constraint training module performs attribution decisions on the response fragments corresponding to each stimulus event based on the misalignment assignment table, generates a structured training sample set, and trains the brain-computer interface model based on the structured training sample set.

[0187] In this embodiment, the method does not simply align the acupuncture procedure time with the EEG signal in a fixed manner. Instead, it sequentially goes through five steps: stimulus event decomposition, EEG fluctuation segmentation, response window backflow correction, misalignment table construction, and constraint training. This organizes the originally scattered operation records, continuous EEG waveforms, and subsequent training samples into a coherent processing chain. This allows the acupuncture stimulation process to be divided into clearly defined stimulus events, and the corresponding EEG changes to be organized into response segments with continuous rising, oscillating, and falling structures. Furthermore, the backflow correction makes the response window closer to the actual response distribution, reducing the problems of misrecognition and omission caused by a fixed window.

[0188] By using a misaligned continuation table to distinguish between intra-segment continuation, post-continuation continuation, and cross-segment continuation, and then performing attribution adjudication, splitting, or removal on competing segments, the boundaries and attribution relationships of samples entering model training become clearer. Overall, this method is more suitable for addressing issues such as unclear stimulus boundaries, delayed EEG responses, overlapping adjacent stimuli, and distorted training sample labels in interactive acupuncture and physiotherapy scenarios in the corresponding background section. It allows model training to be based on structured and traceable continuation relationships, rather than on coarse time-point markings.

[0189] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended technical solutions and their equivalents.

Claims

1. A brain-computer interface model training system for interactive acupuncture and physiotherapy, characterized in that: It includes a stimulus semantic segmentation module, an EEG response fluctuation arrangement module, a backflow correction module, a misalignment continuation table generation module, and a continuation constraint training module; The stimulus semantic segmentation module reads the operation record data during the acupuncture and physiotherapy interaction process, and performs event-based decomposition of the physiotherapy process according to the time sequence of acupoint selection operation, needle insertion operation, lifting and twisting operation and needle withdrawal operation, generating a sequence of stimulus events arranged in chronological order. The EEG response fluctuation arrangement module is based on the stimulus event sequence. It extracts the corresponding EEG segment before and after the start time of each stimulus event unit, performs baseline correction and continuous fluctuation segmentation processing, identifies and forms continuous rising segments, swing segments and falling segments, and generates EEG response fragment chains in the order of appearance. The reflow trimming module is based on the EEG response fragment chain. It performs reflow trimming based on the distribution of candidate response fragments in the window corresponding to each stimulus event, and obtains the reflow trimmed response window table and the corresponding response fragment chain. The backflow trimming module includes a candidate distribution callback unit and a backflow recompilation stability judgment unit; The candidate distribution callback unit is based on the EEG response fragment chain, reads the start time, end time and corresponding response window range of the current stimulus event one by one, and then searches for candidate response fragments corresponding to the time position of the stimulus event within the current response window range. The retrieved candidate response fragments are subjected to distribution discrimination, and the discrimination method is as follows: When candidate response fragments are concentrated in the local early segment, local middle segment, or continuously clustered in a short segment of the current response window, and no new candidate response fragment fluctuations begin to form in the later segment of the window, the current distribution state is recorded as a local concentrated distribution. If no complete response fragment exists that simultaneously contains a continuous rising segment, a swing segment, and a falling segment, then the current distribution state is recorded as an insufficient response distribution. Upon completion of the discrimination, window boundary trimming is performed based on the distribution status to obtain the updated window range set; The window boundary trimming process is as follows: When the candidate response fragments corresponding to the current stimulus event show a local concentrated distribution, the rear boundary of the response window corresponding to the current stimulus event is contracted, and the rear boundary is brought closer to the tail of the currently identified candidate response fragments. When the number of candidate response fragments corresponding to the current stimulus event is insufficient or a complete response segment is not formed, the rear range of the response window corresponding to the current stimulus event is expanded, and the rear boundary is extended to the area to be investigated to continue to accommodate the delayed response. The backflow reconstruction and stability judgment unit sends the updated window range set to the EEG response fluctuation arrangement module, and re-executes segment extraction and fluctuation segmentation processing for the EEG segments corresponding to the stimulus events that have undergone window correction, to obtain a corrected response fragment chain consistent with the updated window range. Based on the corrected response fragment chain, the number, distribution, and connection of candidate response fragments within the window corresponding to each stimulus event are re-statistically analyzed, and the current distribution status of the corrected response fragment chain is compared with the distribution status before the previous round of window adjustment. When candidate response fragments in the corrected response fragment chain still show local over-aggregation, obvious response loss, or the updated window boundary still needs to continue to shrink or expand, the current stimulus event is sent back to the candidate distribution callback unit to continue the next round of window trimming. When the distribution of candidate response fragments corresponding to the corrected response fragment chain has become stable, and the current window boundary has not changed substantially in two consecutive rounds of processing, or the set of corrected response fragments is consistent with the previous round, the current stimulus event is recorded as having reached the stability condition. After all stimulus events have been reflowed, reprogrammed, and stabilized, a reflow-trimmed response window table and a corresponding response fragment chain are generated. The misaligned acceptance table generation module selects response segments whose starting point is later than the start time as candidate acceptance objects for each stimulus event unit based on the response window table and the corresponding response segment chain. It also determines the acceptance type of the response segment based on the relative positional relationship between the starting point of the response segment and the start and end times of the stimulus event, and generates a misaligned acceptance table. The misaligned acceptance table generation module includes a candidate acceptance screening unit and an acceptance type determination table building unit; The candidate acceptance screening unit calls the response window table and the corresponding response fragment chain, and retrieves response fragments that meet all of the following conditions as candidate acceptance objects for the current stimulus event from the corresponding response fragment chain; the conditions are as follows: The first condition is that the starting point of the fluctuation of the response fragment is within the response window range corresponding to the current stimulus event; Condition two is that the starting point of the fluctuation in the response fragment is later than the starting point of the current stimulus event; Condition 3 is that the response fragment was not identified as the uniquely assigned fragment by the previous stimulus event within its final stabilization window; After the search is completed, the response fragments that meet the criteria are arranged in order of the starting point of the fluctuation to form the candidate succession set corresponding to the current stimulus event. The table-building unit for determining the type of acceptance performs positional relationship determination on each response fragment in the candidate acceptance set corresponding to the current stimulus event; When the starting point of a response fragment is located after the start time of the stimulus event and before the end time of the stimulus event, the response fragment is determined to be an intra-segment continuation fragment. When the starting point of a response fragment is after the end of the stimulus event, but is still within the response window corresponding to the current stimulus event, the response fragment is determined to be a tail-following fragment. When the starting point of a response segment is later than the starting point of the current stimulus event, but the main fluctuation segment has already entered the starting range of the subsequent stimulus event, the response segment is judged as a cross-segment continuation segment. When the same stimulus event corresponds to multiple candidate response segments, and the multiple candidate response segments unfold consecutively in time, the succession order is determined according to the order in which the response segments start. After the judgment is completed, the start time of the current stimulus event and the start point of the fluctuation of the corresponding response segment are read, and the time difference between the two is extracted as the response delay interval corresponding to the current candidate response segment. Subsequently, the stimulus event number, response fragment number, response delay interval, and succession type are written into the structured table entries, and a staggered succession table is generated according to the stimulus event number and the starting point of the candidate response fragment. The constraint training module performs attribution decisions on the response fragments corresponding to each stimulus event based on the misalignment assignment table, generates a structured training sample set, and trains the brain-computer interface model based on the structured training sample set.

2. The brain-computer interface model training system for interactive acupuncture and physiotherapy according to claim 1, characterized in that: The stimulus semantic segmentation module includes an operation record consolidation unit and an event skeleton arrangement unit; The operation record organization unit reads operation records from the operation record data during the acupuncture and physiotherapy interaction process, and extracts the timestamp, operation category, target acupoint number, operation duration and operation execution order identifier corresponding to each operation record; All operation records are sorted sequentially according to a unified time benchmark, and then the sorted operation records are divided into multiple acupoint operation sequences according to the target acupoint number. Each acupoint operation sequence includes the acupoint selection operation, needle insertion operation, lifting and thrusting operation, twisting operation, needle retention and maintenance operation, and needle withdrawal operation corresponding to the target acupoint. For operation records with start and end times, the start time is written to the start time of the operation segment, and the end time is written to the end time of the operation segment. For operation records that only have a trigger time, the trigger time is written to the start time and end time of the operation segment; An operation segment set is generated based on the start and end times of each operation record in the operation sequence of each acupoint; each operation segment in the operation segment set includes at least: operation category, target acupoint number, operation duration and operation execution order identifier; The event skeleton arrangement unit searches for operation segments of the same acupoint in the operation segment set according to time sequence. The found needle insertion operation segment is recorded as the starting segment of the current stimulation event, and the start time of the starting segment is recorded as the start time of the current stimulation event. From the set of operation segments corresponding to the same acupoint, continue to read subsequent operation segments in the order after the starting segment. When the subsequent operation segment still belongs to the same acupoint and the interval between it and the previous operation segment does not meet the disconnection condition, the subsequent operation segment is merged into the current stimulation event and forms the stimulation extension segment of the current stimulation event. When a needle withdrawal operation is detected, or when the interval between two consecutive operation segments is longer than a fixed duration, or when the end of the operation segment set corresponding to the same acupoint has been read, the current stimulation event will end, and the end position will be used as the stimulation termination point of the current stimulation event. The current stimulus event is written into the stimulus event sequence. The same processing is then performed on the subsequent unprocessed operation segments. The stimulus event sequence is divided using the interval between adjacent operations as the event boundary to obtain multiple structured stimulus event units.

3. The brain-computer interface model training system for interactive acupuncture and physiotherapy according to claim 2, characterized in that: The EEG response fluctuation arrangement module includes an EEG segment extraction and correction unit and a fluctuation structure arrangement unit; The EEG segment extraction and correction unit uses the start time of the stimulus event unit as the boundary, extracts the first fixed-cycle segment before the start time as the reference segment and the second fixed-cycle segment after the start time as the response search segment, and generates the EEG segment corresponding to the current stimulus event unit. Stable segments are identified in the reference time periods of the extracted EEG segments. Segments with gentle fluctuations within the reference time periods are identified as the baseline reference segments corresponding to the current stimulus event units. The average potential level corresponding to the baseline reference segments is used as the correction benchmark. The entire current EEG segment is subjected to baseline translation processing to transform the EEG segment into a corrected EEG segment that expands around a unified benchmark, thereby obtaining the set of corrected EEG segments corresponding to the event.

4. The brain-computer interface model training system for interactive acupuncture and physiotherapy according to claim 3, characterized in that: The fluctuating structure arrangement unit is based on the event-corresponding corrected EEG segment set, and reads the waveform changes point by point along the time sequence for each corrected EEG segment. Identify the segment where the potential rises continuously without reversal as the continuous rising segment; The segment in which the direction of potential change changes at least twice in three or more consecutive sampling points is identified as the swing segment; Identify the segment where the potential continuously decreases and approaches the baseline reference segment as the fall-off segment; Based on this, the location where the waveform changes direction is switched is used as the segment boundary, and the continuous rising segment, swinging segment and falling segment in the same corrected EEG segment are arranged in sequence. When there is no direction change between two adjacent local waveform segments and there is no lag interval exceeding the allowable length in between, the adjacent segments are merged into the same response segment. When the direction reverses between two adjacent local waveform segments, or when there is a stagnant segment in the middle that is sufficient to interrupt the continuous fluctuation relationship, the subsequent segment is divided into a new response segment. Finally, a chain of EEG response fragments is generated in chronological order.

5. The brain-computer interface model training system for interactive acupuncture and physiotherapy according to claim 4, characterized in that: The constraint training module includes the assignment reprogramming unit and the constraint sample training unit; The attribution re-editing unit reads the misaligned attribution table entry corresponding to the current stimulus event and performs attribution determination on the response fragment corresponding to the current stimulus event based on the misaligned attribution table entry; the attribution determination method is as follows: When a response fragment forms an intra-segment continuation or post-terminal continuation with only a single stimulus event, and is not simultaneously marked as a cross-segment contention object by the subsequent stimulus event, the response fragment is determined to be a stable continuation fragment and directly assigned to the stimulus event. When the same response fragment appears simultaneously in the misaligned succession entries corresponding to two consecutive stimulus events, and at least one of the entries is marked as cross-segment succession, the response fragment is determined to be a cross-stimulus contention fragment. For cross-stimulus contention segments, first read the corresponding succession order and the time overlap position with adjacent stimulus events, and then perform splitting processing on the response segments according to the succession order and the fluctuation and turning positions within the segment; When there is no clear boundary within the contention fragment that can be used to distinguish the succession of the preceding and following fragments, or when the length of the local fragments formed after splitting is insufficient to maintain the complete response structure, the contention fragment will be removed from the training sample set. After processing, each stimulus event and the response fragments belonging to it are rearranged into sample records and written into the structured training sample set. The constrained sample training unit performs training processing on the brain-computer interface model based on the structured training sample set to obtain the trained brain-computer interface model; The specific method is as follows: Read the target acupoint number, operation category, start time, end time, belonging response segment number, response delay interval and succession type corresponding to each stimulus event, and pair and organize the stimulus event side information with the response segment side information to form training sample entries; The training sample entries are input into the brain-computer interface model for training, so that the model can read the connection relationship markers between the response fragments and the stimulus events while reading the response fragment features. For sample records that are determined to be directly assigned samples, they will participate in training according to their original assignment type; For sample records obtained by splitting cross-stimulus contention fragments, they are used in training according to the new assignment results after the splitting; For sample records that are marked as to be removed, they will not be written into the training input for this round; Finally, the constrained training model is output, and the sample batch number and training sample source number corresponding to the current model are recorded for subsequent use.

6. A brain-computer interface model training method for interactive acupuncture and physiotherapy, applied to the brain-computer interface model training system for interactive acupuncture and physiotherapy as described in any one of claims 1 to 5, characterized in that: Includes the following steps: Step 1: The stimulus semantic segmentation module reads the operation record data during the acupuncture and physiotherapy interaction process. Based on the time sequence of acupoint selection operation, needle insertion operation, lifting and twisting operation and needle withdrawal operation, the physiotherapy process is broken down into events to generate a sequence of stimulus events arranged in chronological order. Step 2: The EEG response fluctuation arrangement module, based on the stimulus event sequence, extracts the corresponding EEG segments before and after the start time of each stimulus event unit, performs baseline correction and continuous fluctuation segmentation processing, identifies and forms continuous rising segments, swinging segments and falling segments, and generates EEG response fragment chains in the order of appearance. Step 3: The reflow trimming module is based on the EEG response fragment chain and performs reflow trimming based on the distribution of candidate response fragments in the window corresponding to each stimulus event, to obtain the reflow trimmed response window table and the corresponding response fragment chain. Step 4: The misaligned acceptance table generation module selects response segments whose starting point is later than the start time as candidate acceptance objects for each stimulus event unit based on the response window table and the corresponding response segment chain. It also determines the acceptance type of the response segment based on the relative positional relationship between the starting point of the response segment and the start and end times of the stimulus event, and generates a misaligned acceptance table. Step 5: The assignment constraint training module performs attribution decisions on the response fragments corresponding to each stimulus event based on the misalignment assignment table, generates a structured training sample set, and trains the brain-computer interface model based on the structured training sample set.