Taijiquan whole-process state perception and stage rectification method and system based on finite state machine
By using a finite state machine-based Tai Chi training system, the system generates process identifiers and segment checkpoints, solving the problems of process state control and data object binding in Tai Chi training systems. This enables the traceability and recoverability of training progress, improving the system's reliability and the accuracy of data association.
Patent Information
- Application Number
- CN202611119815.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-11-27
AI Technical Summary
Existing intelligent training systems for Tai Chi Chuan suffer from several problems: difficulty in uniformly controlling process status, difficulty in binding data objects across different systems, difficulty in tracing correction outputs by segment, and difficulty in restoring training progress after interruption.
A finite state machine-based approach is used to maintain the state of Tai Chi practice. A state transition mechanism is used to generate practice process identifiers and form segment checkpoints. The process state and checkpoints are persisted in the recording state to achieve unified organization of data objects and generation of segment-level deviation records, supporting the recovery of practice progress.
It achieves a traceable and recoverable closed-loop process for Tai Chi practice, reducing the risk of data loss due to disordered data processing and interruptions, and improving the reliability of the training system and the accuracy of data correlation.
Smart Images

Figure CN123182286A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of human motion data processing and training feedback control technology in intelligent sports training, and particularly to a method and system for full-process state perception and phased correction of Tai Chi Chuan based on finite state machines. Background Technology
[0002] The practice of Tai Chi typically includes preparation, movement execution, form transitions, analysis and feedback, debriefing, and data retention. With the development of cameras, inertial sensors, and human posture recognition algorithms, existing training systems can collect human movement data and compare user movements with standard movements. While these systems have some value in movement posture evaluation, they still have the following shortcomings in engineering applications.
[0003] 1. Existing training systems mostly process motion segments or phases, lacking state-based control over the entire Tai Chi practice process. While the system can identify a movement posture at a specific moment, it struggles to clearly define the current state within the Tai Chi practice process, such as recording, analysis, feedback, review, or archiving. The lack of executable state transition constraints between the acquisition, analysis, and feedback stages easily leads to chaotic data processing order.
[0004] 2. Existing training systems typically store video files, sensor configurations, segmented indexes, skeletal data, scoring results, and correction reports separately. There is a lack of a unified identifier generated and continuously linked between these different data objects at the start of training. During subsequent review or auditing, the system needs to rely on filenames, timestamps, or manual selection for association, resulting in weak traceability of the data loop.
[0005] 3. Existing training systems often output corrections as scores for the entire set of movements or overall suggestions. Even if the system internally segments the movements, it may not necessarily convert the boundaries of the movement segments into persistent segment checkpoints. The analysis and feedback processes struggle to consistently retrieve data using the same segment index, resulting in an unclear causal relationship between periodic correction information and specific movement segments.
[0006] 4. On mobile devices, wearable devices, or in environments with weak network conditions, the practice process may be interrupted due to application exit, network interruption, or device switching. If the system does not persist the current process state and the most recent segment checkpoint, upon restarting, it can usually only re-enter standby or re-record, and completed moves and corresponding data are difficult to reliably recover.
[0007] Therefore, a technical solution is urgently needed to unify the Tai Chi practice process, practice data objects, movement segment boundaries, deviation analysis results, and interruption recovery mechanism. This solution should enable the system to form a traceable, recoverable, and error-correction-segment-based closed-loop process at the computer execution level. Summary of the Invention
[0008] The purpose of this invention is to provide a method for full-process state perception and phased correction in Tai Chi Chuan based on finite state machines, as well as a system for implementing this method. This method and system address the problems in existing intelligent Tai Chi Chuan training systems, such as difficulty in unified control of process states, difficulty in binding data objects across different stages, difficulty in tracing correction outputs by segment, and difficulty in restoring practice progress after interruption.
[0009] To achieve the above-mentioned objectives, the technical solution provided by this invention includes: A method for full-process state perception and phased correction in Tai Chi Chuan based on finite state machines includes: Run a finite state machine to maintain the Tai Chi Chuan practice process state, which includes at least a recording state, an analysis state, and a feedback state, and transition between states based on event triggers. Responding to the practice start event, it enters the recording state, generates a practice process identifier, and associates it with the data object of this practice session; In recording mode, update the segment progress variable based on the move segment boundary and form a segment checkpoint; After entering the analysis state or triggering the analysis task, a paragraph-level deviation record is generated according to the paragraph checkpoint and paragraph index. In the feedback state, phased correction information is generated based on the paragraph-level deviation record; If the recording is interrupted, persist the current process state and the most recent paragraph checkpoint, and restore the practice progress after restarting.
[0010] Preferably, the data object includes at least two of the following: original video file, sensor configuration snapshot, segment index, skeletal data, segment-level deviation record, scoring details, and correction report, and the training process identifier is written into the metadata or index field of the data object.
[0011] Preferably, when the finite state machine is triggered to enter the recording state, the sensor configuration is solidified to form a sensor configuration snapshot associated with the exercise process identifier, and the segment progress variable and the storage space for storing the segment checkpoints are initialized.
[0012] Preferably, the paragraph checkpoint includes a paragraph number, a time boundary, a move name, and a training process identifier, and is persistently stored when a move paragraph completion event is detected.
[0013] Preferably, the boundary of the move segment is identified by one or more of the following methods: posture sequence matching, posture stillness threshold, and preset move template matching.
[0014] Preferably, generating the paragraph-level deviation record includes: extracting skeletal key point data by paragraph index, and determining paragraph deviation data based on at least one of joint angle, posture similarity, center of gravity shift, or temporal deviation.
[0015] Preferably, generating the phased correction information includes: outputting at least one of the following according to the move segment: graphic prompts, voice prompts, video highlighting prompts, or augmented reality prompts; and reviewing or archiving historical practice data, current practice data, and standard demonstration data based on the practice process identifier.
[0016] This invention also discloses a Tai Chi Chuan full-process state perception and staged correction system based on finite state machines, including: A finite state machine engine is used to maintain the state of Tai Chi practice process, which includes at least recording state, analysis state, and feedback state, and to transition between states based on event triggering. A state admission action executor is used to generate a practice process identifier when entering recording mode; The data binding module is used to associate the practice process identifier with the data object generated in this practice session. The paragraph checkpoint storage module is used to update the paragraph progress variable based on the move paragraph boundary and form paragraph checkpoints. The paragraph analysis module is used to generate paragraph-level deviation records based on the paragraph checkpoints and paragraph indexes after entering the analysis state or triggering the analysis task. A phased feedback module is used to generate phased correction information based on the paragraph-level deviation records; The interruption recovery module is used to persist the current process state and the most recent segment checkpoint when the recording is interrupted, and to restore the practice progress after restarting.
[0017] Beneficial effects 1. This invention uses a finite state machine to maintain the state of the Tai Chi practice process and incorporates the recording, analysis, and feedback stages into an event-triggered state transition model, ensuring that video acquisition, data analysis, feedback generation, and progress recovery run in an executable sequence. Compared to processing methods that only identify motion phases or single action postures, this invention elevates the controlled object to the level of the practice application process, reducing the risk of disconnection between the acquisition, analysis, and feedback stages.
[0018] 2. At the state transition node upon entering recording mode, a training process identifier is generated and written to the data object for this training session. This ensures that the original video, sensor configuration snapshots, segment indexes, skeletal data, segment-level deviation records, and correction reports all share a common traceability entry point. Subsequent review, archiving, and anomaly recovery can retrieve relevant data based on this identifier, reducing association errors caused by reliance on filenames or manual selection.
[0019] 3. During recording, segment checkpoints are generated, and the analysis task uses these checkpoints to generate segment-level deviation records by segment index, establishing a stable data source relationship between periodic correction information and specific move segments. This mechanism prevents the overall score from masking the deviation of a particular move segment and allows highlighted text, audio, video, or augmented reality prompts to point to replayable data segments.
[0020] 4. When recording is interrupted, the system persists the current process state and the most recent segment checkpoint, and resumes the practice progress after restarting. The system can distinguish between completed segments and segments to be continued, reducing data loss caused by weak network conditions, application exits, or device malfunctions, and improving the reliability of the practice process on mobile or wearable devices. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating a preferred embodiment of the Tai Chi Chuan practice process state perception and phased correction method based on a finite state machine provided by the present invention. Figure 2 This is a schematic diagram of a Tai Chi Chuan full-process state perception and phased correction system based on a finite state machine provided in a preferred embodiment of the present invention. Detailed Implementation
[0022] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. The specific sensors, thresholds, storage structures, and display methods used in each embodiment are used to illustrate the feasible path of the technical solution and do not constitute a limitation on the scope of protection. Unless the context clearly indicates otherwise, the term "system" as used below can be deployed in a mobile terminal, wearable device, training terminal, edge computing device, or a combined system of the above devices and a server.
[0023] Example 1 like Figure 1 As shown, this embodiment provides a method for full-process state perception and phased correction of Tai Chi Chuan based on finite state machines. This method uses a finite state machine to maintain the state of the Tai Chi Chuan practice process and forms an executable closed loop between data acquisition, segment recording, analysis and processing, feedback output, and interruption recovery through state transitions. This closed loop does not rely on manual data selection between multiple files or interfaces, but is instead transmitted internally through practice process identifiers and segment checkpoints.
[0024] In this embodiment, the Tai Chi practice process includes at least four states: standby, recording, analysis, feedback, review, and archiving. The standby state is used to complete the data acquisition device readiness check. The recording state is used to collect video data, sensor data, and segment progress data for the current practice session. The analysis state is used to process the practice data based on segment checkpoints. The feedback state is used to generate phased correction information based on segment-level deviation records. The review state is used to retrieve historical practice data, current practice data, and standard demonstration data. The archiving state is used to save the entire practice process data. It should be understood that in actual deployment, the review and archiving states can be merged into a processing stage after feedback. After merging, the system should still maintain the state transition relationships between recording, analysis, and feedback, and be able to restore the practice progress based on the most recent segment checkpoint.
[0025] The method in this embodiment includes steps S1 to S6.
[0026] Step S1: Run a finite state machine to maintain the Tai Chi practice process state, which includes at least a recording state, an analysis state, and a feedback state, and transition between states according to event triggers.
[0027] After system startup, the finite state machine reads the current process state from the local state storage area. If there are no incomplete practice records, the finite state machine enters standby mode. In standby mode, the system checks the availability of the camera, inertial sensor, storage space, and standard demonstration data, and generates a readiness check result. The readiness check result is only used as an entry condition for entering the recording state and is not used as deviation evaluation data for this practice session.
[0028] The finite state machine transitions to its state based on events. A practice start event causes the system to enter the recording state from standby. A recording end event or a complete routine completion event causes the system to enter the analysis state from recording, or triggers an asynchronous analysis task managed by the analysis state. An analysis completion event causes the system to enter the feedback state. When the user selects to replay or archive, the system enters the replay state or archive state. A replay exit event or an archive completion event causes the system to return to standby. If an interruption event occurs during recording, the finite state machine does not directly discard the current data but instead enters the interrupt recovery process.
[0029] The purpose of the aforementioned state transitions is to provide each processing stage with clearly defined data entry and exit points. For example, the exit data for the recording state should at least include the original video file, sensor configuration snapshots, segment indexes, and segment checkpoints; the exit data for the analysis state should at least include segment-level deviation records; and the exit data for the feedback state should at least include phased correction information. All exit data are associated with the same practice process identifier, eliminating the need for subsequent states to re-guess whether these data belong to the same practice session.
[0030] Step S2: Respond to the practice start event to enter the recording state, generate a practice process identifier and associate it with the data object of this practice.
[0031] When the finite state machine responds to the training start event and enters the recording state, the state admission action executor generates a training process identifier. One method of identifier generation is as follows: the training process identifier is generated by combining a user identifier, a training start timestamp, and a random code. The user identifier is used to distinguish the training subject, the training start timestamp is used to locate the current training process, and the random code is used to reduce the probability of conflicts when different terminals start simultaneously. After generating the training process identifier, the system immediately writes it into the metadata or index field of the data object for this training.
[0032] In one implementation, the data object includes at least two of the following: original video file, sensor configuration snapshot, segment index, skeletal data, segment-level deviation record, scoring details, and correction report. The original video file is used to store user practice footage. The sensor configuration snapshot is used to store camera resolution, frame rate, inertial sensor sampling frequency, and calibration parameters. The segment index is used to record the temporal boundaries of the movement segments. The skeletal data is used to store the sequence of human key points. The segment-level deviation record is used to store segment deviation data generated segment by segment. The scoring details and correction report are used to carry the digitized results of the feedback status output.
[0033] In other implementations, practice process identifiers can be generated using methods such as universally unique identifiers, hash values, incremental session numbers, and combinations of user identifiers and startup times. Practice process identifiers can be written into file metadata, database association fields, object storage tags, segmented index tables, or message header fields. As long as multiple types of data objects can be traced back to the same practice process through the same practice process identifier, subsequent segment-by-segment analysis, feedback, review, and archiving can be supported.
[0034] Furthermore, when the finite state machine is triggered to enter the recording state, the sensor configuration is fixed to form a sensor configuration snapshot associated with the training process identifier, and the segment progress variable and storage space for storing the segment checkpoints are initialized. The sensor configuration snapshot may include camera parameters, inertial sensor sampling parameters, calibration matrix, time synchronization parameters, standard move template version or model version. The segment progress variable may represent the number of completed segments, the current target segment number, the current time pointer, or the most recent valid segment checkpoint.
[0035] The segment checkpoint storage space can be a local database table, key-value store, structured file, or other persistent data structure. This storage space is created during recording and updated each time a segment completion event occurs. When switching devices or resuming recording, the system can append a new sensor configuration snapshot version and write the version change time to the data object of the current practice session.
[0036] By generating and binding a practice process identifier at the node entering the recording state, this embodiment establishes a data loop from the start of the current practice session. Even if subsequent video files, skeletal data, and correction reports are generated by different threads, modules, or devices, they can be grouped into data objects of the same practice process using the same practice process identifier.
[0037] Step S3: In recording mode, update the segment progress variable based on the move segment boundary and form a segment checkpoint.
[0038] During recording, the system continuously receives video frames, inertial sensor data, or a fused attitude sequence of both. The system can run the segment detection process locally or in an edge computing unit. The output of the segment detection process is not the final correction conclusion, but rather a move segment boundary event. This event drives the update of the segment progress variable and is used to write the segment checkpoint.
[0039] Furthermore, the boundaries of the move segments are identified through one or more methods, including posture sequence matching, posture stillness threshold, and preset move template matching. Therefore, the segmentation detection process can employ either a single path or a fusion path of multiple detection results.
[0040] One boundary recognition method involves identifying the boundaries of a move sequence through posture sequence matching. The system dynamically times-normalizes and matches the user's current posture sequence with a preset move template. When the matching degree reaches a preset matching threshold, the current move sequence is considered complete. The preset matching threshold can be set according to different boxing styles, user skill levels, or different acquisition devices. For example, the preset matching threshold can be set to 85%.
[0041] Another boundary recognition method is to identify the boundaries of a move segment using a posture stillness threshold. The system calculates the overall motion speed of key points on the human body. When the overall motion speed is lower than a preset speed threshold but continues to exceed a preset time threshold, the current action is determined to be within the move transition area. For example, the preset speed threshold can be set to 0.1 meters per second, and the preset time threshold can be set to 0.5 seconds. This threshold is only used to illustrate one feasible configuration; in actual deployment, it can be adjusted according to the data acquisition accuracy and the rhythm of the punches.
[0042] In the fusion recognition method, the system combines posture sequence matching, posture stillness threshold, and preset move template matching to identify move segment boundaries. When any method outputs a move segment completion event, the system reads the current video timestamp and sensor timestamp to determine the end boundary of the current segment. If two adjacent methods provide similar but not identical time boundaries, the system can choose the boundary with higher confidence or use the average time within a preset window as the segment boundary.
[0043] Regarding data acquisition methods, the system can use only a camera to capture human posture, or it can use a combination of a camera and an inertial sensor. For training environments with limited space, the system can prioritize using wearable inertial sensors to generate posture sequences. For training scenarios requiring video playback, the system can prioritize using a camera to generate raw video files and skeletal keypoint data. Different acquisition methods are all grouped into the same training session's data object using training process identifiers.
[0044] In other implementations, move segment completion events can also be generated by a trained classification model, human confirmation markers, coach-side annotations, or pose events from wearable sensors. Regardless of the event source, the output is used to form segment checkpoints, rather than replacing flow control with a finite state machine.
[0045] Each time a move segment completion event is detected, the system updates the segment progress variable and forms a segment checkpoint. The segment checkpoint includes a segment number, a time boundary, a move name, and a training process identifier, and is persistently stored upon detection of the move segment completion event. The segment number determines the segment order; the time boundary is used to extract the corresponding data for that segment from the original video file and skeletal data; the move name is used to output readable, phased correction information; and the training process identifier is used to assign the segment checkpoint to the current training data loop.
[0046] Paragraph checkpoints are written to persistent storage after they are created. Persistence can be achieved through local database writing, structured file appending, transactional key-value storage, or secure mobile storage. To mitigate the risk of data loss during interruptions, the system can either refresh the storage immediately after each paragraph checkpoint is written, or commit in batches via transactions after a short buffer. Regardless of the method used, the most recent paragraph checkpoint should be saved in a location readable by the interruption recovery module.
[0047] Time boundaries can be represented using video frame numbers, sensor timestamps, unified clock times, or action sequence numbers. Persistent commits can be made through status table updates, append-only structured records, or event queue commits. None of these methods alter the role of segment checkpoints in constraining subsequent analysis, feedback, and recovery.
[0048] Step S4: After entering the analysis state or triggering the analysis task, generate paragraph-level deviation records based on paragraph checkpoints and paragraph indexes.
[0049] Upon the occurrence of a recording completion event or a full routine completion event, the finite state machine enters the analysis state, or triggers an asynchronous analysis task managed by the analysis state. The segment analysis module first reads the set of segment checkpoints corresponding to this practice session and establishes a segment index based on the segment number and time boundary. Subsequently, the system extracts motion data within the corresponding time period from the original video file, skeletal data, and sensor data according to the segment index.
[0050] Furthermore, generating the paragraph-level deviation record includes: extracting skeletal keypoint data by paragraph index, and determining paragraph deviation data based on at least one of joint angle, posture similarity, center of gravity shift, or temporal deviation. Thus, the system can use either a single deviation or a combination of multiple deviations.
[0051] For each movement segment, the system can extract a sequence of key points on the human skeleton. These key points can include locations such as the head, shoulders, elbows, wrists, hips, knees, ankles, and the center of the torso. Based on these key points, the system calculates joint angles, posture similarity, center of gravity shift, or timing deviation, and writes the results into a segment-level deviation record. The segment-level deviation record is organized at the segment level, rather than at the single level of the entire movement.
[0052] The joint angle deviation of the i-th evaluation posture within a certain move segment can be determined by the following formula.
[0053] ; in, Indicates the first The joint angle deviation of the evaluation posture; Indicates the user's position in the first month. Each evaluation posture corresponds to the measured angle at the joint; The standard demonstration data is in the first Each evaluated posture corresponds to a reference angle at a joint. The system can... The angle is compared with a preset angle threshold to determine whether the joint has an angle deviation in the current evaluation posture.
[0054] The similarity of postures in a certain move sequence can be determined by the following formula:
[0055] ; in, Indicates the first The similarity of each posture is evaluated. Indicates the user's position in the first month. A skeletal keypoint vector for evaluating posture; The standard demonstration data is in the first Each skeletal keypoint vector is used to evaluate the pose. The system can... The current evaluation posture is compared with a preset similarity threshold to determine the difference between the current evaluation posture and the standard demonstration posture.
[0056] The aforementioned angle deviation and posture similarity are merely optional calculation methods for segment deviation data. In other embodiments, segment deviation data may also include center of gravity trajectory offset, action duration deviation, left-right limb coordination deviation, or sensor posture angle deviation. Center of gravity trajectory offset can be obtained from the distance of the pelvic center, trunk center, or plantar pressure center relative to the standard trajectory. Timing deviation can be obtained from segment duration, critical posture arrival time, or dynamic time warping results. Sensor posture angle deviation can be obtained by comparing the Euler angles or quaternions of the inertial sensor with the standard posture. Regardless of the segment deviation data used, the system uses the segment index and time boundary provided by the segment checkpoint as the basis for data extraction.
[0057] Segment-level deviation records can be stored using structured fields. Each record may include a training process identifier, segment number, move name, segment start and end time, deviation location, deviation type, deviation amount, threshold comparison result, associated video segment location, and reference fields for stage correction information. This record structure allows the feedback status to directly read the deviation data of a specific move segment and generate corresponding output.
[0058] Furthermore, the system can generate a summary result for the entire set of movements based on the scores of each movement segment. This summary result can use preset weights to aggregate the scores of each segment, but the information for periodic corrections still comes directly from the segment-level deviation records. This provides an overview of the entire training session without reducing the basis for corrections to an overall score that is not segment-specific.
[0059] In the edge-cloud collaborative deployment approach, the edge device can first generate basic segment-level deviation records, and then the cloud can perform supplementary analysis on the difficult-to-determine segments. Difficult-to-determine segments can be triggered by conditions such as low confidence, missing key points, or abnormal sensor data. The cloud only processes the marked segments and does not need to reprocess the entire set of training data. When the cloud analysis results are returned to the edge, they still carry the same training process identifier and corresponding segment number, and are merged into the segment-level deviation records of this training session.
[0060] Step S5: In the feedback state, generate phased correction information based on paragraph-level deviation records.
[0061] After the analysis is completed, the finite state machine enters the feedback state. The phased feedback module reads the segment-level deviation records of this practice session and generates phased correction information according to the segment number. The phased correction information may include the move name, deviation location, deviation type, deviation amount description, suggested correction direction, related video clip location, and display method marker.
[0062] Furthermore, the generation of the phased correction information includes at least one of the following: text and image prompts, voice prompts, video highlighting prompts, or augmented reality prompts, outputted according to the movement segment. The system also reviews and displays or archives historical practice data, current practice data, and standard demonstration data based on the practice process identifier. This processing method allows feedback output and review archiving to share the same practice process identifier.
[0063] For move sequences with angular deviations, the phased feedback module can generate graphic and text prompts. These prompts can include the move sequence's name, the deviated joint, the direction of the deviation, and the corresponding video frame position. When the user views the sequence playback, the system can display a highlighted marker near the deviated joint. This highlight marker originates from the deviation location field and the associated video segment position field in the sequence-level deviation record.
[0064] For move sequences suitable for immediate feedback, the phased feedback module can generate voice prompts. Voice prompts do not require recalculating deviations; instead, they read the move name, deviation location, and deviation type fields from the sequence-level deviation record and convert them into short audio output. Voice prompts can be played when the user revisits the sequence or played sequentially from the feedback status list.
[0065] For terminals with image overlay capabilities, the phased feedback module can also generate augmented reality prompts. Based on the location of the associated video clips and the skeletal keypoint vectors, the system overlays a standard demonstration outline or deviation direction marker onto the displayed screen. Augmented reality prompts are merely one way of presenting phased correction information and do not change the fact that this information originates from segment-level deviation records.
[0066] In other implementations, video highlighting can be represented as keyframe markers, timeline interval markers, skeletal overlays, or deviation direction arrows. When the terminal has no display screen, the system can only output voice prompts or wearable device vibration prompts. When the terminal has video playback capabilities, the system can overlay deviation markers onto the video clips of the corresponding move segments. All of the above presentation methods read the same segment-level deviation record.
[0067] If no deviation exceeding a threshold is detected in a certain movement segment, the phased feedback module can generate a confirmatory prompt and mark that segment as passed. This prompt is still saved as part of the phased correction information, facilitating the review of the processing results of each segment in this practice session. In this way, the system can completely record both the deviating and non-deviating segments, rather than just outputting the conclusion of the entire set of movements.
[0068] Step S6: When the recording is interrupted, persist the current process state and the most recent segment checkpoint, and restore the practice progress after restarting.
[0069] During recording, the system continuously monitors for interruption events such as application exit, network interruption, sensor disconnection, device sleep, and user-initiated pause. When an interruption event occurs, the interruption recovery module reads the current process state, segment progress variable, and the most recent segment checkpoint, and writes this data to persistent storage. The current process state confirms that the interruption occurred during recording; the most recent segment checkpoint confirms the completion of the last completed move segment; and the segment progress variable determines the segment number to continue.
[0070] After the user restarts the system, the finite state machine reads the current process state and the most recent segment checkpoint from persistent storage. If the state record indicates that there is an incomplete practice process, the system does not directly enter standby mode, but instead displays a recovery entry or restores to the recording state according to a preset strategy. During recovery, the system loads the practice process identifier, sensor configuration snapshot, and most recent segment checkpoint, and starts collecting data from the segment to be continued.
[0071] For example, the most recent segment checkpoint shows that the user has completed the third move segment. After the system resumes, recording can continue from the starting point of the fourth move segment, and the time boundaries of the first three move segments will be retained in the new segment index. If the user chooses to restart, the system can generate a new practice process identifier and mark the data object corresponding to the old practice process identifier as an incomplete record.
[0072] In other implementations, the system can provide two recovery modes: automatic recovery and user-confirmed recovery. Automatic recovery is suitable for short interruptions; after restarting, the system directly loads the most recent segment checkpoint and enters recording mode. User-confirmed recovery is suitable for long interruptions; the system displays the move name and time boundary corresponding to the most recent segment checkpoint, allowing the user to confirm whether to continue or restart. Both modes use the current flow state and the most recent segment checkpoint as the basis for recovery.
[0073] This interruption recovery process differs from simple automatic file saving. Automatic file saving can only retain a single data file, while this embodiment simultaneously saves the Tai Chi practice process status and the most recent segment checkpoint. Therefore, the system can know which processing stage to resume at, which movement segment to continue, and which set of data objects to associate with, maintaining the same practice process identifier in subsequent analysis and feedback.
[0074] To improve recovery reliability, the interrupt recovery module also performs consistency checks on the recovery records. These checks include: whether the practice process identifier can be associated with the original video file or sensor data file, and whether the segment number of the most recent segment checkpoint is less than or equal to the segment progress variable. The checks also include: whether the time boundaries of the most recent segment checkpoint fall within the time range of the original video file, and whether the sensor configuration snapshot is compatible with the currently recovered acquisition channel. If any check item fails, the system can prompt the user to restart, or it can only recover to the last segment checkpoint that passed the check.
[0075] When writing new data objects after recovery, the system does not overwrite data objects of completed segments. The system can append new segment boundaries after the original segment index, or create continuation data segments and associate them with the same practice process identifier. If the continuation data segments are saved separately from the original video files, the data binding module records the continuation segment number, the starting segment number, and the corresponding nearest segment checkpoint in the metadata. When reading data during analysis, the original segments and continuation segments are concatenated into a data sequence under the same practice process according to the segment index.
[0076] In addition, the system can save state transition records. State transition records include the state before the transition, the state after the transition, the triggering event, the event time, and the practice process identifier. State transition records are used to help determine whether a segment-level deviation record was generated after normal analysis or supplemented after recovery. This record does not replace segment checkpoints, but rather provides state-level traceability information for review and archiving.
[0077] The aforementioned consistency verification and data continuation processing can reduce the risk of data mismatch after abnormal interruptions. For example, if a user changes the camera or inertial sensor after a recording interruption, the system can identify the change in the acquisition channel based on the sensor configuration snapshot and record the change time in the new sensor configuration snapshot. The subsequent segment-by-segment analysis module can then use different calibration parameters for the data before and after the interruption, avoiding the direct mixing of data from different acquisition configurations.
[0078] After the feedback phase ends, the system can enter either review or archiving mode. In review mode, the system reads historical practice data, current practice data, and standard demonstration data based on the practice process identifier, and displays corresponding video clips, angle curves, or segment-level deviation records by move segment. Review displays can use side-by-side videos, angle curves, segment score trends, or report lists. In archiving mode, the system saves the original video file, sensor configuration snapshots, segment indexes, skeletal data, segment-level deviation records, and correction reports as an archived data package for this practice session. Archiving can be done locally, in the cloud, or synchronously with the cloud, but all are indexed by the practice process identifier and segment number.
[0079] The edge-cloud collaboration approach can also be used for updating standard demonstration data. New standard demonstration data or preset move templates are periodically distributed from the cloud, and the edge devices save the updated versions. The version number used is written to the sensor configuration snapshot or segment index during the next training session. In this way, the analysis data during the same training process can be traced back to the standard demonstration data version used at that time. The review and archiving states represent a superior closed-loop extension, without altering the main flow of steps S1 to S6.
[0080] Example 2 like Figure 2 As shown, this embodiment provides a Tai Chi Chuan full-process state perception and phased correction system based on a finite state machine. This system can execute the method described in Embodiment 1. At the higher level, the system includes a finite state machine engine for maintaining the Tai Chi Chuan practice process state, which includes at least a recording state, an analysis state, and a feedback state, and transitions between states based on event triggers. The system also includes a state admission action executor for generating a practice process identifier when entering the recording state. A data binding module is used to associate the practice process identifier with the data object generated in this practice session. A segment checkpoint storage module is used to update the segment progress variable based on the movement segment boundary and form segment checkpoints. A segment-by-segment analysis module is used to generate segment-level deviation records based on the segment checkpoints and segment indices after entering the analysis state or triggering an analysis task. A phased feedback module is used to generate phased correction information based on the segment-level deviation records. An interruption recovery module is used to persist the current process state and the most recent segment checkpoint when the recording state is interrupted, and restore the practice progress after restarting.
[0081] The finite state machine engine maintains the state of the Tai Chi practice process and receives practice start events, recording end events, analysis completion events, review events, archiving events, and interruption events. The finite state machine engine configures state transition rules for each type of event and calls the corresponding module when a state transition occurs. The current process state output by the finite state machine engine is written to the state storage area so that the interrupt recovery module can read it in abnormal situations.
[0082] The state entry action executor is invoked when the finite state machine engine enters recording mode. This executor generates a training process identifier, stores the sensor configuration, initializes the segment progress variables, and creates a segment checkpoint storage space. The output of the state entry action executor includes the training process identifier, a snapshot of the sensor configuration, and the initialized segment progress variables. These outputs are shared by the data binding module and the segment checkpoint storage module.
[0083] The data binding module is responsible for associating the practice process identifier with the data objects generated during that practice session. Its processing can begin with the creation of the original video file. When the video capture thread creates a file handle, the data binding module writes the practice process identifier into the file metadata. When the skeletal keypoint extraction thread outputs skeletal data, the data binding module writes the same practice process identifier into the skeletal data record. When the analysis module generates segment-level deviation records, the data binding module continues to retain this identifier. Thus, data objects generated by multiple threads or modules share the same attribution marker in the storage layer.
[0084] The paragraph checkpoint storage module receives move paragraph boundary events and updates the paragraph progress variable based on these events. This module does not determine the correctness of user actions; instead, it transforms move paragraph boundaries into persistent paragraph checkpoints. Each paragraph checkpoint includes a paragraph number, time boundary, move name, and training process identifier. After a successful write, the paragraph checkpoint storage module can either return a paragraph completion event to the finite state machine engine or synchronize the most recent paragraph checkpoint with the interrupt recovery module.
[0085] The data flow of the segment analysis module begins with segment checkpoints. After reading the set of segment checkpoints, the module extracts data for the corresponding time segments from the original video file and skeleton data by segment index. Subsequently, the segment analysis module calculates at least one of joint angles, pose similarity, center of gravity shift, or temporal deviation, and forms a segment-level deviation record. The segment analysis module can be executed locally or in an asynchronous task triggered by the analysis status.
[0086] The phased feedback module reads paragraph-level deviation records and converts them into phased correction information. This module can include text generation, speech synthesis, video highlighting, or augmented reality prompting units. Different units can be enabled independently; the system does not need to enable all output formats simultaneously. The input to the phased feedback module is paragraph-level deviation records, and the output is phased correction information organized by move segments.
[0087] The interruption recovery module is connected to the finite state machine engine, the segment checkpoint storage module, and the data binding module. When recording is interrupted, the interruption recovery module reads the current process state, the practice process identifier, and the most recent segment checkpoint, and writes them to the recovery record. After the system restarts, the interruption recovery module reads the recovery record, sends a recovery command to the finite state machine engine, and provides the original practice process identifier to the data binding module. If the user chooses to continue, the system uses the original practice process identifier; if the user chooses to restart, the system generates a new practice process identifier and retains the incomplete state of the old data objects.
[0088] In one deployment method, the system is deployed on a mobile terminal. The mobile terminal's camera captures video, its processor runs a finite state machine engine and a segment checkpoint storage module, and its local storage saves practice process identifiers, sensor configuration snapshots, and segment checkpoints. Analysis tasks can be executed locally on the mobile terminal or sent to a server for execution when the network is available. Even if the server is unavailable, the mobile terminal can still complete recording status, segment checkpoint formation, and interrupt recovery.
[0089] In another deployment method, the above system is deployed in a system consisting of a training terminal and a server. The training terminal runs a finite state machine engine, a state admission action executor, a data binding module, and a segment checkpoint storage module. The server runs a partial model of the segment-by-segment analysis module and a historical archiving service. When the training terminal sends data to the server, it carries the training process identifier and segment checkpoints, enabling the server to process data by segment index, rather than just receiving a single unstructured video segment. When the cloud analysis results are returned to the training terminal, they still carry the same training process identifier and corresponding segment number.
[0090] In other implementations, the finite state machine engine can also be deployed on the server side, edge computing devices, or in a control service jointly maintained by the edge and the cloud. In this case, the edge device should still generate segment checkpoints during recording, or submit the move segment boundary events to the finite state machine engine in a timely manner. Regardless of the deployment method, the index relationship between the practice process identifier, segment checkpoints, and segment-level deviation records remains consistent.
[0091] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Equivalent substitutions made to the number of finite state machine states, state transition events, sensor types, segment boundary recognition algorithms, feedback presentation methods, or data storage methods without departing from the technical solutions of the present invention should all fall within the protection scope of the present invention.
[0092] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. A method for full-process state perception and phased correction in Tai Chi Chuan based on finite state machines, characterized in that, include: Run a finite state machine to maintain the Tai Chi Chuan practice process state, which includes at least a recording state, an analysis state, and a feedback state, and transition between states based on event triggers. Responding to the practice start event, it enters recording mode, generates a practice process identifier, and associates it with the data object of this practice session; In recording mode, update the segment progress variable based on the move segment boundary and form a segment checkpoint; After entering the analysis state or triggering the analysis task, a paragraph-level deviation record is generated according to the paragraph checkpoint and paragraph index. In the feedback state, phased correction information is generated based on the paragraph-level deviation record; If the recording is interrupted, persist the current process state and the most recent paragraph checkpoint, and restore the practice progress after restarting.
2. The method for full-process state perception and phased correction of Tai Chi Chuan based on finite state machine according to claim 1, characterized in that, The data object includes at least two of the following: original video file, sensor configuration snapshot, segment index, skeletal data, segment-level deviation record, scoring details, and correction report. The training process identifier is written into the metadata or index field of the data object.
3. The method for full-process state perception and phased correction of Tai Chi Chuan based on finite state machine according to claim 1, characterized in that, When the finite state machine is triggered to enter the recording state, the sensor configuration is solidified to form a sensor configuration snapshot associated with the exercise process identifier, and the segment progress variable and storage space for storing the segment checkpoint are initialized.
4. The method for full-process state perception and phased correction of Tai Chi Chuan based on finite state machine according to claim 1, characterized in that, The segment checkpoint includes the segment number, time boundary, move name, and the training process identifier, and is persistently stored when the move segment completion event is detected.
5. The method for full-process state perception and phased correction of Tai Chi Chuan based on finite state machine according to claim 1, characterized in that, The boundaries of the move segments are identified through one or more of the following methods: posture sequence matching, posture stillness threshold, and preset move template matching.
6. The method for full-process state perception and phased correction of Tai Chi Chuan based on finite state machine according to claim 1, characterized in that, Generating the paragraph-level deviation record includes: extracting skeletal key point data by paragraph index, and determining paragraph deviation data based on at least one of joint angle, posture similarity, center of gravity shift, or temporal deviation.
7. The method for full-process state perception and phased correction of Tai Chi Chuan based on finite state machine according to claim 1, characterized in that, The generation of the phased correction information includes: outputting at least one of the following according to the move segment: graphic prompts, voice prompts, video highlighting prompts, or augmented reality prompts; and reviewing or archiving historical practice data, current practice data, and standard demonstration data based on the practice process identifier.
8. A Tai Chi Chuan full-process state perception and phased correction system based on finite state machines, characterized in that, include: A finite state machine engine is used to maintain the state of Tai Chi practice process, which includes at least recording state, analysis state, and feedback state, and to transition between states based on event triggering. A state admission action executor is used to generate a practice process identifier when entering recording mode; The data binding module is used to associate the practice process identifier with the data object generated in this practice session. The paragraph checkpoint storage module is used to update the paragraph progress variable based on the move paragraph boundary and form paragraph checkpoints; The paragraph analysis module is used to generate paragraph-level deviation records based on the paragraph checkpoints and paragraph indexes after entering the analysis state or triggering the analysis task. A phased feedback module is used to generate phased correction information based on the paragraph-level deviation records; The interruption recovery module is used to persist the current process state and the most recent segment checkpoint when the recording is interrupted, and to restore the practice progress after restarting.
