Spine rehabilitation method and device and computer readable storage medium

By generating personalized, continuous biomimetic digital twins and globally optimal rehabilitation trajectories, and combining real-time biomechanical simulation and data fusion, the problem of not being able to balance safety and effectiveness in existing rehabilitation methods is solved, and a personalized, safe, real-time rehabilitation plan is realized.

CN121662285APending Publication Date: 2026-03-13SHENZHEN HULE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing rehabilitation methods rely on static templates, which cannot simultaneously satisfy the effectiveness of personalized rehabilitation and real-time biomechanical safety, and pose a risk of secondary injury.

Method used

Using three-dimensional spatial coordinates based on user-calibrated motion capture, an inverse kinematics optimization algorithm is applied to generate a continuum bionic digital twin. Combined with a reinforcement learning algorithm, a globally optimal rehabilitation trajectory is generated. Through biomechanical simulation and real-time data fusion, trajectory deviation is monitored and optimized in real time, and safety thresholds are dynamically adjusted.

Benefits of technology

It achieves biomechanical safety of personalized rehabilitation programs, overcomes the limitations of morphological comparison in traditional methods, provides high-frequency and high-precision real-time data fusion, and ensures the safety and effectiveness of the rehabilitation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121662285A_ABST
    Figure CN121662285A_ABST
Patent Text Reader

Abstract

The invention discloses a spine rehabilitation method and device and a computer readable storage medium, and the method comprises the steps: generating a continuum bionic digital twinborn body based on a three-dimensional space coordinate captured by a user calibration motion; generating a global optimal rehabilitation trajectory based on the continuum bionic digital twins and a preset reward function; collecting a real-time motion data stream; running biomechanical simulation and calculating trajectory deviation based on the real-time motion data stream, the continuum bionic digital twins and the global optimal rehabilitation trajectory to solve real-time biomechanical stress distribution and trajectory deviation signals; comparing the real-time biomechanical stress distribution with a preset biomechanical safety threshold to generate a risk early warning signal; and responding to the track deviation signal, and resolving a local deviation correction track. Personalized effectiveness and real-time safety of spine rehabilitation can be taken into consideration, and closed-loop safety and accurate guidance of the whole rehabilitation process are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical rehabilitation technology, and in particular to a spinal rehabilitation method, device and computer-readable storage medium. Background Technology

[0002] With the increasing awareness of health and the aging population, home-based rehabilitation has become an important health management model. To assist users in correctly performing rehabilitation exercises at home, various guidance schemes utilizing computer vision have emerged in existing technologies.

[0003] Currently, existing technologies typically employ conventional computer vision pose estimation algorithms for rehabilitation guidance. This method uses a terminal device's camera to capture the user's training video stream, and then uses pose estimation algorithms to identify and extract the coordinates of the user's skeletal joints in real time. Subsequently, the system geometrically compares these real-time coordinates with a pre-set or expert-recorded "standard movement template," determining whether the user's movements are "standard" by calculating differences in key angles and limb positions.

[0004] However, this existing technological approach, which relies on "standard movement templates," presents a fundamental technical contradiction: On the one hand, to ensure the safety of all users (especially in unsupervised home settings), these "standard templates" must be sufficiently simple and conservative. This often leads to insufficient effectiveness of rehabilitation training, failing to provide targeted and adequate rehabilitation stimulation for users at different recovery stages or with varying physical abilities. On the other hand, if the difficulty of the "standard template" is increased in pursuit of "effectiveness," this "one-size-fits-all" approach poses significant safety risks. This is because "standard templates" cannot adapt to each user's unique physiological structure, muscle strength level, flexibility, or current state of fatigue. A "standard" movement for user A may exert abnormal pressure or shear force on the spinal joints (especially the lumbar spine) of user B (or user A in a fatigued state), thereby causing secondary injury.

[0005] Therefore, how to design a rehabilitation method that can break free from the constraints of "static templates" and provide users with a dynamic optimization scheme that can ensure both personalized "rehabilitation effectiveness" and real-time "biomechanical safety" has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] This application provides a spinal rehabilitation method that aims to address the problem that existing rehabilitation methods rely on static templates and cannot simultaneously satisfy the requirements of personalized rehabilitation effectiveness and real-time biomechanical safety.

[0007] To achieve the above objectives, embodiments of this application provide a spinal rehabilitation method, comprising:

[0008] Based on the three-dimensional spatial coordinates captured by the user's calibrated motion, an inverse kinematics optimization algorithm is applied for calibration to generate a continuum bionic digital twin representing the spinal kinematics model.

[0009] Based on the continuum-like bionic digital twin and the preset reward function, a reinforcement learning algorithm is applied to generate the globally optimal rehabilitation trajectory.

[0010] Collect user motion data to generate a real-time motion data stream;

[0011] Based on the real-time motion data stream, the continuum bionic digital twin, and the globally optimal rehabilitation trajectory, a biomechanical simulation is run and the trajectory deviation is calculated to resolve the real-time biomechanical stress distribution and trajectory deviation signal.

[0012] The real-time biomechanical stress distribution is compared with a preset biomechanical safety threshold, so as to generate a risk warning signal when the real-time biomechanical stress distribution exceeds the biomechanical safety threshold;

[0013] In response to the trajectory deviation signal, and based on the continuum bionic digital twin and the global optimal rehabilitation trajectory, a real-time trajectory optimization algorithm is applied to solve the local correction trajectory.

[0014] In one embodiment, an inverse kinematics optimization algorithm is applied for calibration to generate a continuum bionic digital twin representing a spinal kinematic model, including:

[0015] The spinal kinematic model is modeled as a continuum structure based on a piecewise constant strain model;

[0016] The curvature, bending plane angle, and segment length of the continuum structure under the user calibration action are calculated based on the three-dimensional spatial coordinates to complete the calibration.

[0017] In one embodiment, a reinforcement learning algorithm is applied to generate the globally optimal Cochrane trajectory, including:

[0018] Define a multi-objective reward function R, which satisfies the following mathematical relationship:

[0019] R = w eff ·f effect (a)-w risk ·f risk (a)-w effort ·f effort (s,a)

[0020] Where s is the current state, a is the action to be explored, and w eff w risk weffort For the preset weights, f effect (a) is the effect reward, f risk (a) For the risk penalty determined based on the continuum biomimetic digital twin simulation, f effort (s,a) represents the punishment for effort;

[0021] The reinforcement learning algorithm is iterated to maximize the multi-objective reward function R in order to generate the globally optimal rehabilitation trajectory.

[0022] In one embodiment, user motion data is collected to generate a real-time motion data stream, including:

[0023] Simultaneously acquire visual 3D joint data streams and inertial measurement unit data streams;

[0024] Based on the data stream from the inertial measurement unit, predict the state vector and covariance at the next moment;

[0025] Based on the visual 3D joint data stream, the state vector and covariance are updated to generate the real-time motion data stream.

[0026] In one embodiment, running a biomechanical simulation and calculating trajectory deviation to resolve real-time biomechanical stress distribution and trajectory deviation signals includes:

[0027] The continuous biomimetic digital twin is driven by the real-time motion data stream to generate a tetrahedral mesh of key soft tissues.

[0028] A position-based dynamic solver is applied to iteratively solve the strain constraints of the tetrahedral mesh in order to update the mesh node positions;

[0029] Based on the strain ε determined by the grid node positions and the preset Young's modulus E, the von Mises stress is calculated using the following formula to generate the real-time biomechanical stress distribution:

[0030] Stress = E·ε;

[0031] Based on the real-time motion data stream and the globally optimal rehabilitation trajectory, the trajectory deviation is calculated to generate the trajectory deviation signal.

[0032] In one embodiment, the real-time biomechanical stress distribution is compared with a preset biomechanical safety threshold to generate a risk warning signal when the real-time biomechanical stress distribution exceeds the biomechanical safety threshold, including:

[0033] Calculate the peak stress in the real-time biomechanical stress distribution;

[0034] The peak stress is compared with the preset biomechanical safety threshold;

[0035] When the peak stress exceeds the preset biomechanical safety threshold, the risk warning signal is generated.

[0036] In one embodiment, a real-time trajectory optimization algorithm is applied to solve for local correction trajectories, including:

[0037] The current state of the continuum bionic digital twin is taken as the starting point, and the nearest point on the global optimal recovery trajectory is taken as the ending point;

[0038] A sampling path planning algorithm is applied to expand nodes between the starting point and the ending point. The expansion of nodes follows a cost function Cost, which satisfies the following mathematical relationship:

[0039] Cost = w dist ·||q new -q parent ||+w risk ·f risk (q new ),

[0040] Where, q new For the new node, q parent As the parent node, w dist and w risk Let f be the preset weight, ||...|| be the distance metric, and f be the distance. risk (q new The instantaneous stress cost of the new node determined on the continuum biomimetic digital twin;

[0041] The node is optimized based on the cost function Cost to solve the local correction trajectory.

[0042] In one embodiment, the preset biomechanical safety threshold is a dynamic safety threshold, and the spinal rehabilitation method further includes:

[0043] The stability of user actions is analyzed based on the real-time motion data stream to determine the fatigue index;

[0044] The dynamic safety threshold is dynamically adjusted based on the fatigue index.

[0045] To achieve the above objectives, embodiments of this application also propose a spinal rehabilitation device, including a memory, a processor, and a spinal rehabilitation program stored in the memory and executable on the processor. When the processor executes the spinal rehabilitation program, it implements the spinal rehabilitation method as described in any of the above claims.

[0046] To achieve the above objectives, embodiments of this application also propose a computer-readable storage medium storing a spinal rehabilitation program, which, when executed by a processor, implements the spinal rehabilitation method as described in any of the preceding claims.

[0047] The spinal rehabilitation method described in this application has the following beneficial effects:

[0048] 1. Overcoming the limitations of "kinematic" assessment and achieving "biomechanical" simulation safety: This application no longer only compares "kinematic" geometric shapes such as joint angles, but adopts "continuous biomimetic digital twin" and "position-based dynamics (PBD)" real-time stress simulation technology. Therefore, this application can calculate the "real-time biomechanical stress distribution" inside the user's spine (such as intervertebral discs), thereby overcoming the defect of only being able to perform morphological comparison and not being able to assess the inherent risks of "dynamics". It can identify dangerous movements that "look correct but the internal stress has exceeded the safety threshold", and achieve active avoidance of "secondary injury".

[0049] 2. Overcoming the shortcomings of "static templates" and achieving the effectiveness of "personalized generation": This application abandons the one-size-fits-all standard action template and instead adopts a reinforcement learning algorithm, combined with a mathematical multi-objective reward function that includes a risk penalty term. In this way, this application can perform offline deduction based on the user's personalized "twin" to generate a biomechanically optimal global rehabilitation trajectory, thereby overcoming the "one-size-fits-all" template defect and achieving a balance between rehabilitation effectiveness and personalized needs while ensuring safety.

[0050] 3. Overcoming the risk of "delayed error correction" and achieving a closed-loop "safe guidance": When the user deviates from the trajectory, this application employs a real-time trajectory optimization algorithm (such as sampling path planning) and makes it follow a cost function that includes instantaneous stress costs. This means that this application no longer simply prompts an error, but can calculate a local correction trajectory in real time. This trajectory itself has undergone biomechanical safety constraints, ensuring that the correction process is also safe, thereby overcoming the shortcomings of traditional error correction instructions that may cause new risks and achieving a closed-loop safety throughout the entire rehabilitation process.

[0051] 4. Overcoming the limitations of "static thresholds" and achieving "dynamic adaptive" early warning: This application employs a dynamic safety threshold mechanism, determining a fatigue index by analyzing motion stability and dynamically adjusting the biomechanical safety threshold based on this index. Thus, the safety "red line" of this application can automatically tighten as the user's physiological state (fatigue) changes, overcoming the deficiency of static thresholds in dealing with the risk of accumulated fatigue. This allows risk warnings to be triggered earlier when the user is fatigued and their control decreases, achieving proactive risk avoidance.

[0052] 5. Overcoming the shortcomings of "single sensing" and achieving high-frequency and high-precision "multimodal fusion": This application adopts an extended Kalman filter fusion strategy to fuse the visual 3D key point data stream with the inertial measurement unit data stream. In this way, this application can generate a "real-time motion data stream" that is both high-frequency (from IMU) and globally accurate (from vision). This overcomes the technical shortcomings of single sensors (such as pure vision) having low frequency, high noise, or (such as pure IMU) easy drift, and provides stable and reliable data input for subsequent real-time biomechanical simulation and trajectory optimization. Attached Figure Description

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

[0054] Figure 1 This is a modular structure diagram of an embodiment of the spinal rehabilitation device of the present invention;

[0055] Figure 2 This is a flowchart illustrating an embodiment of the spinal rehabilitation method of the present invention.

[0056] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0057] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0058] To better understand the above technical solutions, exemplary embodiments of this disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of this disclosure to those skilled in the art.

[0059] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The quantifier "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of "first," "second," and "third," etc., does not indicate any order and can be interpreted as names.

[0060] like Figure 1 As shown, Figure 1 This is a schematic diagram of the hardware operating environment server 1 (also called spinal rehabilitation equipment) involved in the embodiment of the present invention.

[0061] The server in this embodiment of the invention includes devices with display functions such as "Internet of Things devices", smart air conditioners, smart lights, smart power supplies with network connectivity, AR / VR devices with network connectivity, smart speakers, autonomous vehicles, PCs, smartphones, tablets, e-book readers, and portable computers.

[0062] like Figure 1 As shown, the server 1 includes: a memory 11, a processor 12, and a network interface 13.

[0063] The memory 11 includes at least one type of readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the server 1, such as the hard disk of the server 1. In other embodiments, the memory 11 can also be an external storage device of the server 1, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the server 1.

[0064] Furthermore, the memory 11 may include both internal storage units of the server 1 and external storage devices. The memory 11 can be used not only to store application software and various types of data installed on the server 1, such as the code of the spinal rehabilitation program 10, but also to temporarily store data that has been output or will be output.

[0065] In some embodiments, processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip, used to run program code stored in memory 11 or process data, such as executing spinal rehabilitation program 10.

[0066] The network interface 13 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface), which is typically used to establish communication connections between the server 1 and other electronic devices.

[0067] The network can be the Internet, a cloud network, a Wi-Fi network, a Personal Area Network (PAN), a Local Area Network (LAN), and / or a Metropolitan Area Network (MAN). Various devices in the network environment can be configured to connect to the communication network according to various wired and wireless communication protocols. Examples of such wired and wireless communication protocols may include, but are not limited to, at least one of the following: Transmission Control Protocol and Internet Protocol (TCP / IP), User Datagram Protocol (UDP), Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), ZigBee, EDGE, IEEE 802.11, Li-Fi, 802.16, IEEE 802.11s, IEEE 802.11g, multi-hop communication, wireless access points (APs), device-to-device communication, cellular communication protocols, and / or Bluetooth communication protocols, or combinations thereof.

[0068] Optionally, the server may also include a user interface, which may include a display, an input unit such as a keyboard, and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be referred to as a screen or display unit, used to display information processed in server 1 and to display a visual user interface.

[0069] Figure 1 Only server 1, which includes components 11-13 and spinal rehabilitation program 10, is shown. Those skilled in the art will understand that... Figure 1 The structure shown does not constitute a limitation on server 1 and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0070] In this embodiment, the processor 12 can be used to call the spinal rehabilitation program stored in the memory 11 and perform the following operations:

[0071] Based on the three-dimensional spatial coordinates captured by the user's calibrated motion, an inverse kinematics optimization algorithm is applied for calibration to generate a continuum bionic digital twin representing the spinal kinematics model.

[0072] Based on the continuum-like bionic digital twin and the preset reward function, a reinforcement learning algorithm is applied to generate the globally optimal rehabilitation trajectory.

[0073] Collect user motion data to generate a real-time motion data stream;

[0074] Based on the real-time motion data stream, the continuum bionic digital twin, and the globally optimal rehabilitation trajectory, a biomechanical simulation is run and the trajectory deviation is calculated to resolve the real-time biomechanical stress distribution and trajectory deviation signal.

[0075] The real-time biomechanical stress distribution is compared with a preset biomechanical safety threshold, so as to generate a risk warning signal when the real-time biomechanical stress distribution exceeds the biomechanical safety threshold;

[0076] In response to the trajectory deviation signal, and based on the continuum bionic digital twin and the global optimal rehabilitation trajectory, a real-time trajectory optimization algorithm is applied to solve the local correction trajectory.

[0077] Based on the hardware architecture of the aforementioned spinal rehabilitation device, embodiments of the spinal rehabilitation method of the present invention are proposed. The spinal rehabilitation method of the present invention aims to solve the problem in existing rehabilitation methods that rely on static templates and cannot simultaneously satisfy the requirements of personalized rehabilitation effectiveness and real-time biomechanical safety.

[0078] Reference Figure 2 , Figure 2 In one embodiment of the spinal rehabilitation method of the present invention, the spinal rehabilitation method includes the following steps:

[0079] S10. Based on the three-dimensional spatial coordinates captured by the user's calibrated motion, an inverse kinematics optimization algorithm is applied for calibration to generate a continuum bionic digital twin representing the spinal kinematics model.

[0080] Step S10 is the "offline phase" or "initialization phase" in which the system conducts all rehabilitation planning and assessments. Its core task is to create a personalized, high-fidelity biomechanical model for the current user.

[0081] Here, the bionic digital twin is a highly personalized virtual model used to simulate the continuous deformation behavior of a user's spine during rehabilitation movements. Unlike traditional rigid skeletal chain models, this model treats the spine as a flexible continuous medium, capable of capturing the nonlinear bending response of intervertebral discs and soft tissues, thus providing a precise geometric and dynamic basis for subsequent biomechanical simulations.

[0082] In some embodiments, step S10 is implemented through steps S11 and S12:

[0083] S11. The spinal kinematic model is modeled as a continuum structure based on a piecewise constant strain model.

[0084] Specifically, the system uses a "Piecewise Constant Strain (PCS)" model to construct the continuum structure.

[0085] The PCS model is an efficient and accurate continuum modeling method. It mathematically discretizes a continuous flexible structure (such as the L1 to L5 spinal segments in the human body) into N virtual "continuum segments". One advantage of this model is that it assumes that the strain (curvature) within each segment is constant, so the complex three-dimensional morphology of each segment can be fully described by only three configuration parameters: curvature k (degree of bending), bending plane angle φ (direction of bending), and segment length L (tension or compression).

[0086] Therefore, the complete form of the entire spinal kinematic model (i.e., the continuum bionic digital twin) can be efficiently represented by a low-dimensional state vector q:

[0087] q=[k1,φ1,L1,…,k N ,φ N ,L N ] T .

[0088] This low-dimensional representation greatly reduces the computational complexity of subsequent steps (such as reinforcement learning in S20 and real-time trajectory optimization in S60), making it possible to run on consumer-grade terminal devices.

[0089] S12. Based on the three-dimensional spatial coordinates, calculate the curvature, bending plane angle and segment length of the continuum structure under the user calibration action to complete the calibration.

[0090] Specifically, the system first guides the user to perform a set of preset "calibration movements" (e.g., maximum forward flexion, backward extension, left / right bending). As the user performs the movements, the system's camera (or other sensors) captures and generates "three-dimensional spatial coordinates" in real time, which correspond to key anatomical landmarks on the spine (e.g., C7, T12, L5, and bilateral posterior superior iliac spines).

[0091] Subsequently, the system executes the "inverse kinematics optimization algorithm". The goal of this algorithm is to find a set of optimal PCS model state vectors q (i.e., the k, φ, L values ​​defined in S11) such that the virtual marker point position P calculated by the forward solution from this vector q is such that... virtual (q), and the three-dimensional spatial coordinates P actually captured by the sensor. sensor The error between them is minimized. Mathematically, this calibration process is expressed as a nonlinear optimization problem, i.e., solving:

[0092]

[0093] Among them, ||…|| 2 This represents the sum of squares of the Euclidean distances.

[0094] Combining steps S11 and S12, we can see that step S11 provides the mathematical framework for implementing S10 (i.e., the PCS model), while step S12 provides the specific path for personalized calibration (i.e., inverse kinematics optimization). Together, they enable the system to calibrate (or "fit") the sparse 3D spatial coordinates from the camera into a continuous and high-fidelity flexible spine model.

[0095] For example, taking a user who is 180cm tall and weighs 75kg as an example, the system guides them to perform the "maximum forward bend" movement. At this time, the camera captures the 3D coordinates (P, T, L5) of their C7, T12, and L5 joints. sensor ) are respectively P C7 P T12 P L5 The system uses the inverse kinematics optimization algorithm of S12 to iteratively solve the problem and finally calculate the state vector q of its L1-L5 segments. For example, the mean value of k is 0.8 (indicating high bending) and the mean value of φ is 1.57 (indicating forward bending in the sagittal plane), thus completing the twin model calibration of the user in this specific posture.

[0096] Understandably, by employing a piecewise constant strain model (PCS) and applying inverse kinematics optimization for personalized calibration, this approach can construct a high-fidelity, personalized spinal kinematic model for the user using a low-dimensional state vector. This model is not only far more accurate than traditional rigid body models, but its computational efficiency also provides an accurate, robust, and computationally feasible model foundation for the subsequent reinforcement learning planning and real-time biomechanical simulation in step S20, thereby ensuring the personalization, safety, and effectiveness of the subsequent rehabilitation program.

[0097] S20. Based on the continuum bionic digital twin and the preset reward function, a reinforcement learning algorithm is applied to generate the globally optimal rehabilitation trajectory.

[0098] This step S20 aims to "plan" an ideal exercise path for the user that balances safety and effectiveness, based on the personalized model created in step S10.

[0099] Here, the globally optimal rehabilitation trajectory is a series of temporal state points (i.e., movement trajectories) that the system calculates through reinforcement learning algorithms for the "continuous bionic digital twin" of a specific user generated in step S10, under the premise of satisfying biomechanical safety constraints (e.g., minimizing intervertebral disc stress), which can maximize the rehabilitation effect (e.g., maximize the activation of the target muscle group or the range of motion).

[0100] In some embodiments, step S20 is implemented through steps S21 and S22:

[0101] S21. Define a multi-objective reward function R, which satisfies the following mathematical relationship:

[0102] R = w eff ·f effect (a)-w risk ·f risk (a)-w effort ·f effort (s,a)

[0103] Where s is the current state, a is the action to be explored, and w eff w risk w effort For the preset weights, f effect (a) is the effect reward, f risk (a) For the risk penalty determined based on the continuum biomimetic digital twin simulation, f effort (s,a) represents the punishment for effort.

[0104] Specifically, step S21 aims to define the core "objective function" or "guiding principle" of the reinforcement learning algorithm in step S20. This reward function R is a multi-objective optimization function, which aims to find the optimal balance among "rehabilitation effectiveness," "biomechanical safety," and "exercise economy."

[0105] During training, the algorithm will continuously attempt to execute an action to be explored, "a", from the "current state s".

[0106] s (current state): represents the state vector of the continuum bionic digital twin at the current time step, for example, it can correspond to the state vector q of the PCS model defined in S11.

[0107] a (Action to be explored): Represents the target state vector (e.g., q) output by the "Actor" network of the reinforcement learning algorithm, which is intended to be executed at the next time step. target ).

[0108] After each attempt, the system calculates a "score" based on the multi-objective reward function R to judge the quality of action a, where:

[0109] f effect (a) (Effect Reward): This is a function used to evaluate the effectiveness of rehabilitation. For example, it can be quantified as the "distance" or "similarity" between the action to be explored (a) and the final rehabilitation target posture. The closer action a is to the target posture, the higher the reward (f) becomes. effect The higher the value of (a), the higher the reward.

[0110] f risk (a) (Risk Penalty): This is a penalty item used to assess biomechanical safety. It pre-calculates the predicted biomechanical stress that the critical soft tissues (such as intervertebral discs) within the continuum biomimetic digital twin will experience when the continuum biomimetic digital twin performs the action to be explored, by invoking a biomechanical simulation solver (such as PBD / FEA) in subsequent steps (as described in S40-S50). The higher the predicted stress, the greater the risk. risk The higher the value of (a), the greater the penalty.

[0111] f effort (s,a) (Effort Penalty): This is a penalty term used to evaluate motion economy. It quantifies the smoothness of the energy expenditure or control torque required to transition from the current state s to the action to be explored a. This term is used to penalize unnecessary high-energy or "jittering" movements.

[0112] w eff w risk w effort: These are preset weighting coefficients used to adjust the priorities of the above three items. For example, in the early stages of recovery, w can be... risk The (risk weight) is set to a very high value to ensure that safety is the primary objective.

[0113] S22. The reinforcement learning algorithm is iterated to maximize the multi-objective reward function R in order to generate the globally optimal rehabilitation trajectory.

[0114] Step S22 is the execution step of S20. The system uses a pre-defined reinforcement learning algorithm (e.g., Soft Actor-Critic (SAC) algorithm or Proximal Policy Optimization (PPO) algorithm) to perform a large number (e.g., tens of thousands to millions of) trial-and-error iterations in the "simulation environment" constructed in S10, with the "reward function R" defined in S21 as the sole objective.

[0115] During the iteration process, the algorithm's policy network is continuously updated to ensure that its output action 'a' consistently achieves higher cumulative rewards R. Training is complete when the iterations converge or reach a preset number of iterations. The resulting "optimal policy network" contains the "optimal action" sequence that maximizes reward R from any state 's'. At this point, the system performs a complete sampling through this optimal policy network to generate a complete, personalized, and optimal motion path under the constraints of the S21 reward function—the globally optimal rehabilitation trajectory.

[0116] It is understandable that through the synergy of steps S20-S22, particularly by introducing a "biomechanical risk penalty" f risk (a) The multi-objective reward function of this invention completely abandons the outdated method of "imitating static templates". This solution can "pre-plan" using the personalized twin of S10 during the offline planning stage, automatically calculating a reward function that meets the user's personalized needs (f effect It has also been proven safe in biomechanical terms (f risk This exercise program ensures extremely high safety and effectiveness for subsequent users when executing this globally optimal rehabilitation trajectory, thus solving the technical challenge of balancing "effectiveness" and "safety" in existing technologies.

[0117] S30. Collect user motion data to generate a real-time motion data stream.

[0118] Step S30 is a data input step that the system executes in real-time during the user's rehabilitation training. Its purpose is to acquire high-frequency, high-precision motion information of the user's body (especially the spine and pelvis) in three-dimensional space. Here, the real-time motion data stream is the direct data source for driving the continuum-like bionic digital twin and calculating trajectory deviations in subsequent step S40. To ensure the real-time performance and accuracy of subsequent biomechanical simulations, the real-time motion data stream can be generated by fusing data from multiple sensors.

[0119] In some embodiments, step S30 is implemented through steps S31, S32, and S33:

[0120] S31. Synchronously acquire visual 3D joint data stream and inertial measurement unit data stream.

[0121] Specifically, the system uses the camera of a terminal device (e.g., a mobile phone, computer, or dedicated equipment) to run a pose estimation algorithm to obtain the visual 3D joint data stream. This data stream typically contains the 3D spatial coordinates of the user's major skeletal joints (e.g., C7, T12, L5, bilateral posterior superior iliac spines) in the camera coordinate system.

[0122] Simultaneously, the system acquires inertial measurement units (IMUs) data streams from one or more IMUs worn on key parts of the user's body (e.g., sternum and sacrum) via wireless communication (e.g., Bluetooth). These IMU data streams typically contain high-frequency angular velocity and linear acceleration data. These two data streams are complementary: the visual 3D keypoint data stream provides global absolute position information, but its acquisition frequency is relatively low (e.g., 15-30 Hz); the inertial measurement unit data stream provides high-frequency (e.g., 100 Hz or higher), low-latency relative rotational attitude information, but its position information drifts with time integration.

[0123] S32. Based on the data stream of the inertial measurement unit, predict the state vector and covariance at the next moment.

[0124] Specifically, steps S32 and S33 together describe the execution process of an extended Kalman filter (EKF) for data fusion.

[0125] In the "prediction" phase of step S32, the system uses the high-frequency inertial measurement unit data stream from S31 as the control input u. k =[a k ,ω k ] T , where a k For acceleration, ω k ω is the angular velocity.

[0126] The system defines a state vector x that contains the system state to be estimated, such as the 6DoF (six degrees of freedom) attitude (position p, velocity v, quaternion attitude q, angular velocity ω) of key segments (such as the pelvis and thoracic cavity).

[0127] Specifically, the system uses kinematic integrals to perform state transitions, and its state transition equation is as follows:

[0128]

[0129] Where f is a nonlinear kinematic function, x k-1 Given the state at the previous moment, w k This represents process noise. The nonlinear function f can be defined through kinematic equations, for example, its position component p. k and attitude components q k (In quaternion representation) can be updated in the following ways:

[0130] p k =p k-1 +v k-1 Δt+0.5a k Δt 2 ,

[0131]

[0132] Where Δt is the time step (e.g., Δt = 1 / 200s), This represents quaternion multiplication.

[0133] Process noise w k Modeled as w k ~N(0,Q), the process noise covariance Q (e.g., Q = diag([0.01,0.01,0.01,0.005,0.005,0.005])) is used to model the IMU drift. This nonlinear function f can be solved numerically (e.g., 4th-order Runge-Kutta gamma method), with its initial state x0 set to zero motion and a unit quaternion (e.g., x0 = [0,0,0,0,1,0,0]). T Simultaneously, the system updates the covariance. To represent the uncertainty of this predicted state:

[0134]

[0135] Among them, F k The Jacobian matrix of the state transition function f relative to the state x ), P k-1 This is the covariance of the previous time step.

[0136] The output of step S32 is the predicted state and covariance sequence {x_k^-, P_k^-|k=

[0137] 1..N}.

[0138] S33. Based on the visual 3D joint data stream, update the state vector and covariance to generate the real-time motion data stream.

[0139] Step S33 is the "update" phase of EKF. When the low-frequency visual 3D keypoint data stream z from S31... k Upon arrival, the system treats it as an "observation".

[0140] The system uses an observation function h (i.e., the observation model) to measure the predicted state in S32. Mapping to the observation space (i.e., the virtual 3D key point positions corresponding to this state):

[0141]

[0142] Subsequently, the system calculates the predicted observations. Compared with the actual observed value z k The "residual" (i.e., innovation) between these. The system predicts the covariance based on this residual. And measure the noise covariance R, and calculate the Kalman gain K. k Finally, the system uses the Kalman gain K. k The predicted state in S32 Perform "correction" to obtain the optimal estimated state x at the current time k. k :

[0143]

[0144] The optimal estimated state x k The sequence constitutes the final output, which is a real-time motion data stream that combines the advantages of both sensors (high frequency, high precision, and low drift).

[0145] Combining steps S31, S32, and S33 above, it can be seen that S31 provides two complementary data sources: a high-frequency but drift-prone IMU data stream, and a low-frequency but globally accurate visual data stream. S32 uses the high-frequency IMU data stream for "prediction," ensuring the real-time nature and high-frequency characteristics of the data stream. S33 uses the low-frequency visual data stream for "updating" or "calibrating," its core function being to periodically correct the drift accumulated in S32 due to IMU integration. The two are combined through an extended Kalman filter (EKF) framework, enabling the system to output a fused attitude data stream that is both high-frequency and low-latency (inherited from the IMU), and globally accurate and drift-free (inherited from vision).

[0146] For example, when a user performs a "bridge" hip raise exercise:

[0147] At t = 2.00s, the EKF update step of S33 has just been completed, and the fused position x of the L5 joint is... k The value is [0.50, 0.30, 0.10]m.

[0148] During the period from t = 2.00s to t = 2.05s (before the camera outputs new data), the prediction step of S32 runs continuously (e.g., at 200Hz). Based on the IMU data stream of S31 (a k (Upward), S32 continuous prediction At t = 2.05s, the predicted position may be [0.51, 0.30, 0.18]m (which may be higher due to drift).

[0149] At t = 2.05s, the camera in step S31 captures a new frame, triggering the update step in step S33. The camera measures the "true" position z. k The value is [0.51, 0.30, 0.16]m.

[0150] Step S33 calculates the residual between the predicted value (0.18m) and the observed value (0.16m), applies Kalman gain for correction, and finally outputs the optimal estimate x at time t = 2.05s. k The value is [0.51, 0.30, 0.162]m. This x... k It was then used as the drive input for the S40 and as x k-1 Used for the next round of predictions for S32.

[0151] It is understandable that through the synchronous multi-source acquisition in step S31, the IMU integral prediction in step S32, and the visual Kalman update in step S33, step S30 generates a high-frequency fused real-time motion data stream, thus achieving low latency and high accuracy in attitude estimation, thereby providing stable boundary conditions for twin drive and deviation analysis, and avoiding the influence of single sensor drift or noise.

[0152] S40. Based on the real-time motion data stream, the continuum biomimetic digital twin, and the globally optimal rehabilitation trajectory, perform biomechanical simulation and calculate trajectory deviation to resolve the real-time biomechanical stress distribution and trajectory deviation signal.

[0153] Step S40 is the core of the system's real-time analysis, executed cyclically during user training. It has two parallel tasks:

[0154] Biomechanical simulation: The real-time motion data stream of S30 drives the continuous biomimetic digital twin of S10 to calculate the internal biomechanical risks (i.e., the real-time biomechanical stress distribution) in real time.

[0155] Kinematic comparison: The real-time motion data stream of S30 is compared with the globally optimal rehabilitation trajectory generated by S20 to calculate the geometric deviation (i.e., the trajectory deviation signal).

[0156] These two parallel outputs (stress distribution and trajectory deviation) together provide the basis for decision-making in the subsequent S50 (risk warning) and S60 (trajectory correction).

[0157] In some embodiments, step S40 can be implemented through steps S41-S44:

[0158] S41. Based on the real-time motion data stream, drive the continuous biomimetic digital twin to generate a tetrahedral mesh of key soft tissues.

[0159] Specifically, step S41 is the preparation stage for real-time simulation. The system first uses the real-time motion data stream output in S30 (i.e., the high-frequency 6DoF attitude data fused in S33) as the driving input to update the state vector q of the continuum bionic digital twin (i.e., the PCS model) constructed in S10.

[0160] After the continuum biomimetic digital twin is driven to the pose of the current frame, the system generates a tetrahedral mesh for subsequent physical simulation based on the pose and the geometric model of a predefined key biomechanical region (e.g., L4 / L5 or L5 / S1 intervertebral disc). This mesh discretizes the continuous soft tissue into a set of computable vertices and elements.

[0161] S42. Apply a position-based dynamic solver to iteratively solve the strain constraints of the tetrahedral mesh to update the mesh node positions.

[0162] Step S42 is the core computational step in real-time biomechanical simulation, employing a Position-Based Dynamics (PBD) solver. The PBD solver is a technique used in computer graphics for real-time deformable body simulation, characterized by its high computational speed and numerical stability. The solver's workflow is as follows:

[0163] 1. Predicting Position: First, based on the velocity of the previous frame and the acceleration (e.g., gravity) of the current frame, predict the next position of each node in the tetrahedral mesh generated by S41.

[0164] 2. Constraint Solving: Subsequently, the solver iteratively processes a series of pre-defined geometric constraints. For soft tissue simulation, these constraints are primarily “strain constraints,” such as Green-Lagrange strain constraints or their linearized forms.

[0165] 3. Position Correction: In each iteration, the solver calculates the current predicted position. The resulting strain violated how many preset constraints, and a correction vector Δp ​​was calculated. i The node is pulled back to a position that satisfies the constraints.

[0166] 4. Position Update: After all iterations (e.g., 5-10 times), the system obtains a final set of mesh node positions that satisfy all constraints.

[0167] 5. Speed ​​Update: Finally, based on Based on the position of the previous frame, update the velocity of the grid nodes for prediction in the next frame.

[0168] S43. Based on the strain ε determined by the grid node positions and the preset Young's modulus E, the von Mises stress is calculated using the following formula to generate the real-time biomechanical stress distribution:

[0169] Stress = E·ε.

[0170] Specifically, step S43 quantifies biomechanical stress based on the simulation results of S42. The system first uses the mesh node positions output by S42. Given the initial rest-pose position of the mesh, the system calculates the deformation gradient F for each tetrahedral element, and then calculates the strain tensor ε. Subsequently, the system applies a simplified material constitutive relation (e.g., Hooke's law for linear elasticity) to calculate the stress. As shown in the formula Stress = E·ε, the system multiplies the calculated strain ε by a preset Young's modulus E (representing the material hardness of the soft tissue) to obtain the stress tensor. Finally, the system calculates a scalar value from the stress tensor, namely the von Mises stress, which represents the total stress state within the material. The set of von Mises stress values ​​for all tetrahedral elements constitutes the real-time biomechanical stress distribution (which can be rendered as a stress heatmap).

[0171] S44. Based on the real-time motion data stream and the global optimal rehabilitation trajectory, calculate the trajectory deviation to generate the trajectory deviation signal.

[0172] Specifically, steps S44 and S41-S43 are executed in parallel to calculate kinematic deviations. The system acquires the real-time motion data stream (representing the user's current posture) from S30 and the globally optimal rehabilitation trajectory (representing the target posture at the current time t) from S20. The system calculates the user's current actual position P at predetermined key control points (e.g., the pelvic center point). current The target position P defined by the global optimal trajectory target The three-dimensional spatial difference between (t) is quantized as the trajectory deviation signal (e.g., a deviation vector ΔP = P). current -P target (t)).

[0173] In summary, steps S41, S42, and S43 together constitute a "biomechanical risk simulation pipeline." They work together to convert the motion data stream of S30 (e.g., lumbar posture) into internal, invisible tissue stress (the output of S43). S44, on the other hand, constitutes a parallel "kinematic geometry comparison pipeline," which compares the motion data stream of S30 (e.g., pelvic position) with the target of S20 (the output of S44).

[0174] For example, when a user performs a "plank exercise," S20's "global optimal trajectory" defines the target position P of their pelvis. target .

[0175] Scenario: The user's core strength is insufficient due to fatigue, and the pelvis begins to sink ("lower back").

[0176] S30 Input: The real-time motion data stream of S30 accurately captured this "sinking" posture. current .

[0177] Pipeline S41-S43: This "sinking" posture drives the twin model of S41 into a "lumbar hyperextension" state. The PBD solver of S42 calculates the node positions of the L5 / S1 intervertebral disc mesh in this hyperextension posture. Based on these positions, S43 calculates a large strain ε and ultimately outputs a high von Mises stress value (e.g., 1.2 MPa), concentrated on the posterior side of the intervertebral disc. This is the "real-time biomechanical stress distribution".

[0178] S44 pipeline: S44 calculation P current With P target The difference between them outputs a "trajectory deviation signal" of △P = [0, -0.05, 0]m, which quantifies the amplitude of the "waist collapse".

[0179] It is understandable that, through the coordination of steps S41-S44, this scheme can simultaneously calculate two key feedback criteria within a single time step: one is the internal risk based on physical simulation (S43), and the other is the apparent error based on geometric comparison (S44). This dual analysis mechanism ensures that the subsequent feedback instructions in S50 and S60 can both correct the user's apparent posture and proactively avoid potential, invisible biomechanical damage risks.

[0180] S50. The real-time biomechanical stress distribution is compared with a preset biomechanical safety threshold, so as to generate a risk warning signal when the real-time biomechanical stress distribution exceeds the biomechanical safety threshold.

[0181] Specifically, this step aims to transform the complex real-time biomechanical stress distribution (a high-dimensional data field) output by S40 (specifically S43) into an immediate, binary safety decision.

[0182] This step S50 works in parallel with step S44 of S40 (calculating trajectory deviation). S44 focuses on the "morphological" deviation of the motion, while this step S50 focuses on the "intrinsic risk" of the motion. The risk warning signal generated in this step S50 is configured to have a high processing priority for achieving proactive, biomechanical simulation-based damage avoidance.

[0183] In some embodiments, step S50 can be achieved by relying on the following steps S51-S53:

[0184] S51. Calculate the peak stress in the real-time biomechanical stress distribution.

[0185] Specifically, step S51 is the process of data dimensionality reduction and risk quantification. The system receives the real-time biomechanical stress distribution from S43. This distribution is a dataset containing the von Mises stress scalar values ​​of each element in the tetrahedral mesh generated in S41.

[0186] To perform the comparison in S52, the system needs to simplify this distribution (data field) into a single, representative risk indicator. This step S51 involves iterating through all stress values ​​in the dataset, finding and outputting the maximum value, which is defined as the peak stress (Stress_peak).

[0187] S52. Compare the peak stress with the preset biomechanical safety threshold.

[0188] Specifically, step S52 is the logical judgment step for safety decision-making. The system performs a simple logical comparison operation. The system reads the peak stress output in S51 (e.g., a scalar value in megapascals (MPa)) and reads a preset biomechanical safety threshold (Threshold_safety). This threshold is a pre-set scalar value representing the upper limit of acceptable stress for critical soft tissues (such as intervertebral discs).

[0189] S53. When the peak stress exceeds the preset biomechanical safety threshold, generate the risk warning signal.

[0190] Specifically, step S53 is an action performed based on the comparison result of S52. When the comparison result of S52 is "true" (i.e., the peak stress does exceed the preset biomechanical safety threshold), step S53 immediately generates a risk warning signal.

[0191] This signal is a data command used to trigger the highest priority user feedback. This feedback may include, but is not limited to: Visual feedback: immediately highlighting the excessive area in red on the S40's stress heatmap. Auditory feedback: playing a clear, high-priority warning tone or voice prompt (e.g., "Excessive lumbar pressure detected, adjust immediately!"). Tactile feedback: triggering a vibration alert if the device supports it.

[0192] If the comparison result of S52 is "false", then no signal is generated in this step S53, and the system continues to execute the trajectory correction in S60 (if a deviation is detected in S44).

[0193] Based on the above, steps S51, S52, and S53 constitute a linear "risk interruption" pipeline. S51 is responsible for "risk quantification" (extracting peak values ​​from the stress field), S52 is responsible for "risk decision-making" (comparing peak values ​​with thresholds), and S53 is responsible for "risk execution" (issuing an alarm when the threshold is exceeded).

[0194] For example, let's continue with the "plank" example from S40:

[0195] Scenario: The user has "lumbar hyperextension" (lumbar spine collapse).

[0196] S40 Output: S43 outputs a real-time biomechanical stress distribution, which shows stress concentration on the posterior side of the L5 / S1 intervertebral disc.

[0197] S51 execution: S51 traverses the distribution and calculates the peak stress Stress_peak as 1.2 MPa.

[0198] S52 execution: The system reads the preset biomechanical safety threshold Threshold_safety, which is (for example) set to 1.0MPa. The system compares 1.2MPa > 1.0MPa, and the judgment result of S52 is "true".

[0199] S53 Execution: Since the result of S52 is "true", S53 immediately generates the aforementioned risk warning signal. The system then issues a voice alarm through the speaker, "Lumbar spine risk detected!", while the twin heatmap on the screen is highlighted in red in the L5 / S1 area.

[0200] Understandably, through the coordinated work of S51, S52, and S53, this solution provides an immediate, biomechanical safety "fuse-off" mechanism based on internal physical simulation results. Independent of the morphological biases of S44 (which will be handled by S60), this mechanism is specifically designed to issue the highest priority warning when user actions are about to occur or have already caused potential damage to internal tissues, thereby ensuring the bottom line of safety for home rehabilitation training.

[0201] S60. Responding to the trajectory deviation signal, and based on the continuum bionic digital twin and the global optimal rehabilitation trajectory, apply a real-time trajectory optimization algorithm to solve the local correction trajectory.

[0202] Specifically, step S60 is the system's real-time trajectory calibration module, which is executed cyclically during user training. The trigger condition for step S60 is the response to the trajectory deviation signal generated by S40 (specifically S44). Step S60 is activated when S44 detects that the user's actual motion posture (kinematics) deviates from the globally optimal rehabilitation trajectory ("green light band") generated by S20.

[0203] Its core task is to generate a personalized and safe "return path" (i.e., a local correction trajectory) in real time. The starting point of this path is the user's current incorrect posture, and the ending point is the globally optimal recovery trajectory.

[0204] Steps S60 and S50 (risk warning) work in parallel: S50 handles the "absolute risk" (stress exceeding the limit) in biomechanics, while S60 handles the "morphological deviation" (deviation from the trajectory) in kinematics.

[0205] In some embodiments, step S60 is implemented through steps S61-S63:

[0206] S61. Take the current state of the continuum bionic digital twin as the starting point and the nearest point on the global optimal rehabilitation trajectory as the ending point.

[0207] Specifically, step S61 sets the boundary conditions for the planning problem in the real-time trajectory optimization algorithm of S62. The start and end points of these boundary conditions are as follows:

[0208] Start State: The system obtains the current state (e.g., the current state vector q) of the continuum bionic digital twin, which represents the user's current actual posture, output by S30 (specifically S33). current ).

[0209] Goal State: On the globally optimal recovery trajectory (a sequence of state points) generated by S20, the system searches for and determines a state space at a distance q. current Recent target point q goal .

[0210] S62. Apply a sampling path planning algorithm to expand nodes between the starting point and the ending point. The expansion of nodes follows a cost function Cost, which satisfies the following mathematical relationship:

[0211] Cost = w dist ·||q new -q parent ||+w risk ·f risk (q new ),

[0212] Where, q new For the new node, q parent As the parent node, w dist and w risk Let f be the preset weight, ||...|| be the distance metric, and f be the distance. risk (q new ) represents the instantaneous stress cost determined for the new node on the continuum biomimetic digital twin.

[0213] Specifically, step S62 is the core calculation step of S60, which uses a sampled path planning algorithm (e.g., RRT (Rapidly-exploring Random Tree Star) algorithm) to find the path from the “starting point” to the “ending point” defined in S61.

[0214] The algorithm operates in the high-dimensional state space of a continuum-like bionic digital twin (defined by the state vector q of S11). The algorithm expands the nodes (q) in random directions starting from the "starting point". new To construct a search tree.

[0215] The cost function, Cost, is the core rule guiding how the algorithm "expands" and "optimizes" the tree. It is a multi-objective optimization function used to evaluate the tree from a "parent node" (q). parent ) expand to a "new node" (q) new The "cost" of )

[0216] w dist ·||q new -q parent ||(Distance Cost Term): This term is used to evaluate the "economy" or "efficiency" of the movement. ||...|| is a distance metric (e.g., the Euclidean distance of the state vector q) used to quantify the magnitude of the movement from the parent node to the new node. This term penalizes excessively long, unnecessary, or "detour-like" correction actions and is weighted by the preset weight w. dist Scaling is performed.

[0217] w risk ·f risk (q new (Biomechanical risk cost): This is a key constraint to ensure the "safety" of the correction process. risk (q new This is a function that, during the "expansion" phase of path planning, immediately invokes the biomechanical simulation solver (PBD / FEA) in S40 (specifically S43). This function uses simulation calculations to determine the position of the continuum bionic digital twin at the "new node" q. new The instantaneous stress cost (e.g., peak stress in that posture) borne by the internal tissues (such as intervertebral discs) during a particular posture. This actively and heavily penalizes those attempting to extend through "biomechanical danger zones" (e.g., postures that lead to lumbar hyperextension or increased stress), and is weighted by the preset weight w. risk Scaling is performed.

[0218] S63. Optimize the node based on the cost function Cost to solve the local correction trajectory.

[0219] Specifically, sampling path planning algorithms (such as RRT) continuously expand and "rewiring" nodes in the search tree under the guidance of the cost function Cost in S62 in order to find a path from the "starting point" to the "ending point" that minimizes the total cost (i.e. the path integral of Cost in S62).

[0220] Once the algorithm finds such an optimal path, step S63 solves it into a series of continuous state points Q. corrective ={q0,q1,…,q end The sequence Q corrective This is the final output local correction trajectory.

[0221] This trajectory (e.g., in the form of a "blue AR light band") is sent to the user interface to provide the user with a "return path" guidance that is both efficient (w dist constraint) and absolutely safe (w risk constraint).

[0222] In summary, steps S61, S62, and S63 work together to form a "safe path planner". Among them, S61 is responsible for "defining the problem" (where to come from and where to go). S62 is the core solver, which searches in the high-dimensional state space through a cost function that combines "efficiency" (w dist ) and "safety" (w risk ). S63 is responsible for outputting the optimal result of this search (local correction trajectory). The real-time call of S62 to S43 (FEA solver) is the key to ensuring that this "correction" action itself does not introduce secondary damage.

[0223] Continuing with the example of "plank" in S40 and S50:

[0224] S44 is triggered: S44 detects that the user has a "sagging waist", and △P = [0, -0.05, 0] m. This deviation signal triggers S60.

[0225] S50 is not triggered: Assume that at this time, Stress_peak (0.9 MPa) < Threshold_safety (1.0 MPa), and S50 does not issue the highest priority alarm.

[0226] S61 is executed: S61 sets the planning problem: START = q current (sagging waist state); GOAL = q target (standard plank state defined by S20).

[0227] S62 is executed: The RRT algorithm starts to search.

[0228] Path A (dangerous path): The algorithm attempts a path of "violently lifting the hips". When S62 evaluates the node q new on this path, it calls the f risk function. The FEA solver of S43 reports that this action will cause the instantaneous stress (f risk ) to soar to 1.3 MPa. Therefore, w risk ·f risk makes the cost of this path extremely high, and the algorithm abandons this path.

[0229] Path B (safe path): The algorithm attempts a path of "first tightening the core and then slowly lifting the hips". S� evaluates all the nodes on this path, and S43 reports frisk <0.5MPa. Although the w of this path dist The item may be slightly higher than path A, but its total cost (due to w) risk (The item is extremely low) is far below path A.

[0230] S63 execution: S63 ultimately determines "path B" as the optimal solution and calculates it (a smooth and safe "buttock lifting" motion) as a local correction trajectory, which is presented to the user in the form of a "blue AR light strip".

[0231] It is understandable that, through the synergy of steps S61, S62, and S63, this application addresses the deep-seated technical problem that "error correction" itself may lead to "secondary harm." It no longer simply tells the user "you're wrong," but instead utilizes a real-time trajectory optimization algorithm based on biomechanical constraints to dynamically generate a solution for the user on "how to safely correct the error." This ensures closed-loop safety throughout the entire rehabilitation training process (including execution and correction).

[0232] In some embodiments, the preset biomechanical safety threshold in step S52 is a dynamic safety threshold. In this case, the threshold is no longer a static value fixed before training begins, but an adaptive parameter that changes in real time during training. The purpose is to enable the system's safety strategy to respond to changes in the user's physiological state during training, especially the accumulation of fatigue.

[0233] Accordingly, the spinal rehabilitation method of this application also includes the following steps (which we refer to as the S70 pipeline, which is executed in parallel and cyclically with S40, S50, and S60):

[0234] S71. Analyze the stability of the user's actions based on the real-time motion data stream to determine the fatigue index.

[0235] Specifically, step S71 is the quantification step of fatigue state. The system continuously receives the real-time motion data stream from S30. The system uses one or more stability quantification metrics to "analyze the stability of user actions." For example:

[0236] Center of Mass (CoM) Sway Amplitude: Based on the continuous bionic digital twin described in S10 and the real-time motion data stream described in S30, the system calculates the user's composite center of mass (CPM) position in real time. Subsequently, within a rolling time window (e.g., the past 5 seconds), the system calculates the variance of displacement or the root mean square (RMS) of velocity at this CPM position to quantify the user's body sway amplitude.

[0237] Jitter: The system analyzes the high-frequency components of the velocity or acceleration signals of key joints (e.g., L5 or the center of the pelvis) in the S30 data stream. When a user's core muscles begin to fatigue, their fine control over body posture decreases, which is directly reflected in an increase in the values ​​of the above indicators (e.g., amplitude of center of gravity sway or jitter).

[0238] The system integrates these stability indices over time or applies a low-pass filter to generate a slowly changing, monotonically increasing (or slowly decreasing at rest) scalar value, which is then determined as the fatigue index (Index_fatigue), for example, a value ranging from 0 to 1.

[0239] S72. Based on the fatigue index, dynamically adjust the dynamic safety threshold.

[0240] Specifically, step S72 is an adaptive adjustment step for the safety policy. The system reads a "base safety threshold" (Threshold_base), which may be the upper limit of stress for the user in a state of high alertness, as used in S21. Subsequently, the system dynamically adjusts this threshold based on the fatigue index output in S71 to generate the dynamic safety threshold (Threshold_dynamic) actually used in S52.

[0241] This adjustment process can be implemented using a function f:

[0242] Threshold_dynamic=Threshold_base·f(Index_fatigue).

[0243] For example, a linear penalty function can be used:

[0244] Threshold_dynamic=Threshold_base·(1-k·Index_fatigue),

[0245] Where k is a preset fatigue influence coefficient (e.g., k = 0.5).

[0246] In summary, steps S71 and S72 work together to form an "adaptive safety strategy module." S71 indirectly observes the user's physiological state (fatigue level) by analyzing motion data streams (stability). S72 then directly applies this observation result (fatigue index) to the system's safety decision model (safety threshold).

[0247] For example, when a user begins "plank" training, and this is the initial stage of training, the user's stability is high, and the system determines Index_fatigue = 0.1 by executing step S71. Assume Threshold_base = 1.0 MPa and k = 0.5. The system calculates Threshold_dynamic = 1.0 * (1 - 0.5 * 0.1) = 0.95 MPa by executing step S72. Then, step S52 uses 0.95 MPa as the threshold.

[0248] After the user holds the position for 60 seconds, core muscle fatigue begins. At this point, the system detects a significant increase in the user's center of gravity (CoM) sway through step S71. Index_fatigue subsequently rises to 0.4. The system then executes step S72, immediately recalculating Threshold_dynamic = 1.0 * (1 - 0.5 * 0.4) = 0.80 MPa. From this moment on, the comparison logic in step S52 becomes IF(Stress_peak > 0.80 MPa).

[0249] It is understandable that, through the dynamic adjustment mechanisms of S71 and S72, the safety threshold (i.e., the "red line") of this application will automatically tighten as the user's fatigue level increases. This allows the risk warning in step S50 (e.g., when "lumbar collapse" causes the stress to reach 0.85 MPa) to be triggered earlier, thereby proactively and preemptively preventing secondary injuries caused by compensatory actions or decreased control in a fatigued state, greatly improving the intelligence and safety of the system.

[0250] In summary, the spinal rehabilitation method of this application has the following beneficial effects:

[0251] 1. Overcoming the limitations of "kinematic" assessment and achieving "biomechanical" simulation safety: This application no longer only compares "kinematic" geometric shapes such as joint angles, but adopts "continuous biomimetic digital twin" and "position-based dynamics (PBD)" real-time stress simulation technology. Therefore, this application can calculate the "real-time biomechanical stress distribution" inside the user's spine (such as intervertebral discs), thereby overcoming the defect of only being able to perform morphological comparison and not being able to assess the inherent risks of "dynamics". It can identify dangerous movements that "look correct but the internal stress has exceeded the safety threshold", and achieve active avoidance of "secondary injury".

[0252] 2. Overcoming the shortcomings of "static templates" and achieving the effectiveness of "personalized generation": This application abandons the one-size-fits-all standard action template and instead adopts a reinforcement learning algorithm, combined with a mathematical multi-objective reward function that includes a risk penalty term. In this way, this application can perform offline deduction based on the user's personalized "twin" to generate a biomechanically optimal global rehabilitation trajectory, thereby overcoming the "one-size-fits-all" template defect and achieving a balance between rehabilitation effectiveness and personalized needs while ensuring safety.

[0253] 3. Overcoming the risk of "delayed error correction" and achieving a closed-loop "safe guidance": When the user deviates from the trajectory, this application employs a real-time trajectory optimization algorithm (such as sampling path planning) and makes it follow a cost function that includes instantaneous stress costs. This means that this application no longer simply prompts an error, but can calculate a local correction trajectory in real time. This trajectory itself has undergone biomechanical safety constraints, ensuring that the correction process is also safe, thereby overcoming the shortcomings of traditional error correction instructions that may cause new risks and achieving a closed-loop safety throughout the entire rehabilitation process.

[0254] 4. Overcoming the limitations of "static thresholds" and achieving "dynamic adaptive" early warning: This application employs a dynamic safety threshold mechanism, determining a fatigue index by analyzing motion stability and dynamically adjusting the biomechanical safety threshold based on this index. Thus, the safety "red line" of this application can automatically tighten as the user's physiological state (fatigue) changes, overcoming the deficiency of static thresholds in dealing with the risk of accumulated fatigue. This allows risk warnings to be triggered earlier when the user is fatigued and their control decreases, achieving proactive risk avoidance.

[0255] 5. Overcoming the shortcomings of "single sensing" and achieving high-frequency and high-precision "multimodal fusion": This application adopts an extended Kalman filter fusion strategy to fuse the visual 3D key point data stream with the inertial measurement unit data stream. In this way, this application can generate a "real-time motion data stream" that is both high-frequency (from IMU) and globally accurate (from vision). This overcomes the technical shortcomings of single sensors (such as pure vision) having low frequency, high noise, or (such as pure IMU) easy drift, and provides stable and reliable data input for subsequent real-time biomechanical simulation and trajectory optimization.

[0256] Furthermore, this invention also proposes a computer-readable storage medium, which can be any one or any combination of several of the following: hard disk, multimedia card, SD card, flash memory card, SMC, read-only memory (ROM), erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB memory, etc. The computer-readable storage medium includes a spinal rehabilitation program 10. The specific implementation of the computer-readable storage medium of this invention is largely the same as the specific implementation of the spinal rehabilitation method and server 1 described above, and will not be repeated here.

Claims

1. A spinal rehabilitation method, characterized in that, include: Based on the three-dimensional spatial coordinates captured by the user's calibrated motion, an inverse kinematics optimization algorithm is applied for calibration to generate a continuum bionic digital twin representing the spinal kinematics model. Based on the continuum-like bionic digital twin and the preset reward function, a reinforcement learning algorithm is applied to generate the globally optimal rehabilitation trajectory. Collect user motion data to generate a real-time motion data stream; Based on the real-time motion data stream, the continuum bionic digital twin, and the globally optimal rehabilitation trajectory, a biomechanical simulation is run and the trajectory deviation is calculated to resolve the real-time biomechanical stress distribution and trajectory deviation signal. The real-time biomechanical stress distribution is compared with a preset biomechanical safety threshold, so as to generate a risk warning signal when the real-time biomechanical stress distribution exceeds the biomechanical safety threshold; In response to the trajectory deviation signal, and based on the continuum bionic digital twin and the global optimal rehabilitation trajectory, a real-time trajectory optimization algorithm is applied to solve the local correction trajectory.

2. The spinal rehabilitation method as described in claim 1, characterized in that, The inverse kinematics optimization algorithm is applied for calibration to generate a continuum biomimetic digital twin representing the spinal kinematic model, including: The spinal kinematic model is modeled as a continuum structure based on a piecewise constant strain model; The curvature, bending plane angle, and segment length of the continuum structure under the user calibration action are calculated based on the three-dimensional spatial coordinates to complete the calibration.

3. The spinal rehabilitation method as described in claim 2, characterized in that, Reinforcement learning algorithms are applied to generate globally optimal Cochrane trajectories, including: Define a multi-objective reward function R, which satisfies the following mathematical relationship: R=w eff ·f effect (a)-w risk ·f risk (a)-w effort ·f effort (s,a), Where s is the current state, a is the action to be explored, and w eff w risk w effort For the preset weights, f effect (a) is the effect reward, f risk (a) For the risk penalty determined based on the continuum biomimetic digital twin simulation, f effort (s,a) represents the punishment for effort; The reinforcement learning algorithm is iterated to maximize the multi-objective reward function R in order to generate the globally optimal rehabilitation trajectory.

4. The spinal rehabilitation method as described in claim 3, characterized in that, Collect user motion data to generate a real-time motion data stream, including: Simultaneously acquire visual 3D joint data streams and inertial measurement unit data streams; Based on the data stream from the inertial measurement unit, predict the state vector and covariance at the next moment; Based on the visual 3D joint data stream, the state vector and covariance are updated to generate the real-time motion data stream.

5. The spinal rehabilitation method as described in claim 4, characterized in that, Run biomechanical simulations and calculate trajectory deviations to resolve real-time biomechanical stress distribution and trajectory deviation signals, including: The continuous biomimetic digital twin is driven by the real-time motion data stream to generate a tetrahedral mesh of key soft tissues. A position-based dynamic solver is applied to iteratively solve the strain constraints of the tetrahedral mesh in order to update the mesh node positions; Based on the strain ε determined by the grid node positions and the preset Young's modulus E, the von Mises stress is calculated using the following formula to generate the real-time biomechanical stress distribution: Stress = E·ε; Based on the real-time motion data stream and the globally optimal rehabilitation trajectory, the trajectory deviation is calculated to generate the trajectory deviation signal.

6. The spinal rehabilitation method as described in claim 5, characterized in that, The real-time biomechanical stress distribution is compared with a preset biomechanical safety threshold, and a risk warning signal is generated when the real-time biomechanical stress distribution exceeds the biomechanical safety threshold, including: Calculate the peak stress in the real-time biomechanical stress distribution; The peak stress is compared with the preset biomechanical safety threshold; When the peak stress exceeds the preset biomechanical safety threshold, the risk warning signal is generated.

7. The spinal rehabilitation method as described in claim 6, characterized in that, A real-time trajectory optimization algorithm is applied to solve for local correction trajectories, including: The current state of the continuum bionic digital twin is taken as the starting point, and the nearest point on the global optimal recovery trajectory is taken as the ending point; A sampling path planning algorithm is applied to expand nodes between the starting point and the ending point. The expansion of nodes follows a cost function Cost, which satisfies the following mathematical relationship: Cost=w dist ·||q new -q parent ||+w risk ·f risk (q new ), Where, q new For the new node, q parent As the parent node, w dist and w risk Let f be the preset weight, ||...|| be the distance metric, and f be the distance. risk (q new The instantaneous stress cost of the new node determined on the continuum biomimetic digital twin; The node is optimized based on the cost function Cost to solve the local correction trajectory.

8. The spinal rehabilitation method as described in claim 7, characterized in that, The preset biomechanical safety threshold is a dynamic safety threshold, and the spinal rehabilitation method further includes: The stability of user actions is analyzed based on the real-time motion data stream to determine the fatigue index; The dynamic safety threshold is dynamically adjusted based on the fatigue index.

9. A spinal rehabilitation device, characterized in that, It includes a memory, a processor, and a spinal rehabilitation program stored in the memory and executable on the processor, wherein the processor, when executing the spinal rehabilitation program, implements the spinal rehabilitation method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a spinal rehabilitation program, which, when executed by a processor, implements the spinal rehabilitation method as described in any one of claims 1-8.