User Data-Based Behavioral Pattern Mining and Guidance Methods and Systems
By utilizing historical consensus databases and LSTM models to generate personalized rehabilitation behavior sequences, the problem of users lacking professional guidance during home rehabilitation is solved, achieving real-time, safe, and effective rehabilitation guidance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- KAIENTAI (NANJING) TECH CO LTD
- Filing Date
- 2026-02-24
- Publication Date
- 2026-05-26
Smart Images

Figure CN121722832B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data retrieval technology, and more specifically to a method and system for mining and guiding behavioral patterns based on user data. Background Technology
[0002] With the improvement of medical standards in my country, the number of postoperative patients in fields such as orthopedics and sports medicine is gradually increasing. Standardized rehabilitation after surgery is a key factor in determining the quality of functional recovery. However, in home rehabilitation scenarios, users often have problems such as improper movements due to a lack of professional guidance, which affects the recovery effect. Existing technologies usually rely on users' active feedback or regular follow-up visits, which makes it difficult to respond to the effect of users' rehabilitation behavior in real time. Therefore, existing technologies have shortcomings. Summary of the Invention
[0003] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for mining and guiding behavioral patterns based on user data. This method stores all user behavior information in a historical data consensus library, retrieves information based on the historical data consensus library and user behavior codes, generates behavioral sequences adapted to user action habits and recovery speeds, and guides users in training.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] This invention provides a method for mining and guiding behavioral patterns based on user data, including:
[0006] Obtain the user's current behavior data;
[0007] The behavior code is obtained based on the current behavior data and the medical effectiveness rule sub-library in the historical consensus database; the historical consensus database is composed of data stored in the blockchain.
[0008] Based on the behavior encoding and the effect association rule sub-library in the historical consensus database, a valid behavior sequence is obtained;
[0009] Based on the phased rule sub-library in the historical consensus database, the action parameters in the effective behavior sequence are determined.
[0010] As a further improvement of the present invention, the historical consensus database includes a medical effectiveness rule sub-library, an effect correlation rule sub-library, an abnormal behavior rule sub-library, a staged rule sub-library, and a comparison sub-library. The medical effectiveness rule sub-library stores effective thresholds, the effect correlation rule sub-library stores correlation coefficients between behavior combinations and key recovery indicators, the abnormal behavior rule sub-library stores gradient data, the staged rule sub-library stores recovery period parameters, and the comparison sub-library stores prediction errors. Each sub-library corresponds to a master node, and each master node corresponds to multiple sub-nodes. Each sub-node stores a portion of the data stored in the blockchain, and the data stored in each sub-library is determined according to the communication mechanism between its corresponding sub-nodes.
[0011] As a further improvement of the present invention, the data stored in each sub-database is determined according to the communication mechanism between its corresponding child nodes, including:
[0012] For each child node, local information is obtained based on the data it stores.
[0013] The local information is broadcast to two adjacent child nodes, and the local information corresponding to the two adjacent child nodes is received.
[0014] The intermediate information is obtained based on its own local information and the local information of the two adjacent child nodes.
[0015] The intermediate information is transmitted to the corresponding master node so that the master node can calculate and store the data.
[0016] As a further improvement of the present invention, a behavior code is obtained based on the current behavior data and the medical effectiveness rule sub-library in the historical consensus database, including:
[0017] The effective behavior vector is obtained based on the current behavior data and the medical effectiveness rule sub-library.
[0018] A composite vector is obtained based on the current behavior data and the LSTM model;
[0019] The behavior code is obtained based on the effective behavior vector and the composite vector.
[0020] As a further improvement of the present invention, an effective behavior vector is obtained based on the current behavior data and the medical effectiveness rule sub-library, including:
[0021] Based on the current behavior data and the effective threshold in the medical effectiveness rule sub-library, an effectiveness identifier is obtained;
[0022] Calculate the attention weight based on the validity identifier;
[0023] Based on the attention weights and the current behavior data, an effective behavior vector is obtained.
[0024] As a further improvement of the present invention, based on the behavior encoding and the effect association rule sub-library in the historical consensus database, an effective behavior sequence is obtained, including:
[0025] Candidate behavior combinations are generated based on the behavior codes and historical database;
[0026] The first behavior combination is obtained based on the correlation coefficients in the sub-library of candidate behavior combinations and effect association rules;
[0027] Based on the first combination of behaviors and the effective threshold in the medical effectiveness rule sub-library, an effective behavior sequence is obtained.
[0028] As a further improvement of the present invention, an effective behavior sequence is obtained based on the first behavior combination and the effective threshold in the medical effectiveness rule sub-library, including:
[0029] A composite vector is obtained based on the current behavior data and the LSTM model;
[0030] The second behavior combination is obtained based on the first behavior combination, the composite vector, and the effective threshold in the medical effectiveness rule sub-library;
[0031] The effective behavior sequence is obtained based on the correlation coefficients in the second behavior combination and the effect association rule sub-library.
[0032] As a further improvement of the present invention, the action parameters in the effective behavior sequence are determined based on the phased rule sub-library in the historical consensus database, including:
[0033] The initial action parameters are determined based on the recovery period parameters in the phased rule sub-library.
[0034] The total reward value is obtained based on the user's historical behavior data and the reward function;
[0035] The action parameters and corresponding triggering conditions in the effective behavior sequence are determined based on the total reward value and the LSTM.
[0036] As a further improvement of the present invention, determining the action parameters in the effective behavior sequence based on the total reward value includes:
[0037] Calculate the current gradient data corresponding to each behavioral feature based on the user's historical behavior data;
[0038] Based on the abnormal behavior rule sub-library, lazy gradient data and abnormal gradient data corresponding to each behavior feature are obtained;
[0039] The gradient trend corresponding to each behavioral feature is obtained based on the lazy gradient data and the abnormal gradient data;
[0040] The action parameters in the effective action sequence are determined based on the gradient trend and the total reward value.
[0041] This invention provides a system for mining and guiding behavioral patterns based on user data, comprising:
[0042] The acquisition module is used to acquire the user's current behavior data;
[0043] The behavior coding module is used to obtain behavior codes based on the current behavior data and the medical effectiveness rule sub-library in the historical consensus database; the historical consensus database is composed of data stored in the blockchain.
[0044] The behavior determination module is used to obtain a valid behavior sequence based on the behavior code and the effect association rule sub-library in the historical consensus database;
[0045] The parameter determination module is used to determine the action parameters in the effective behavior sequence based on the phased rule sub-library in the historical consensus database.
[0046] This invention generates information stored in the historical consensus database through the communication mechanism between each child node, encodes behavior through user behavior data, selects effective behavior sequences that match user behavior from the historical consensus database, and further updates the parameters in the effective behavior sequences based on the reward function, LSTM model and gradient data, ultimately obtaining behavior sequences that both meet medical standards and match the user's movement habits and recovery speed, guiding the user to train. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the method steps of the present invention;
[0048] Figure 2 This is a schematic diagram illustrating the steps of the communication mechanism;
[0049] Figure 3 This is a schematic diagram of the child node structure;
[0050] Figure 4 A schematic diagram illustrating the steps to obtain an effective sequence of behaviors;
[0051] Figure 5 A schematic diagram illustrating the steps for determining the action parameters in the valid action sequence. Detailed Implementation
[0052] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof.
[0053] The term "and / or" in the following text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0054] like Figure 1 As shown in the figure, this application provides a method for mining and guiding behavioral patterns based on user data, including:
[0055] Obtain the user's current behavior data;
[0056] Behavioral codes are obtained based on current behavioral data and a sub-library of medical effectiveness rules in the historical consensus database; the historical consensus database is composed of data stored in the blockchain.
[0057] Based on the behavior coding and the effect association rule sub-library in the historical consensus database, the effective behavior sequence is obtained;
[0058] Based on the phased rule sub-library in the historical consensus database, the action parameters in the effective behavior sequence are determined.
[0059] Specifically, in this embodiment, the user's behavioral data is the rehabilitation video uploaded by the user. By analyzing the rehabilitation video, the user's behavioral characteristics can be statistically analyzed, such as the range of motion of joints and the proportion of frames with muscle exertion. For example, when obtaining the range of motion of joints, the coordinates of key points can be extracted from each frame of the rehabilitation video. Key points can be the lateral femoral condyle, the lateral tibial condyle, etc. Vectors are generated based on the key points, and the angle between the vectors is calculated. The angle between the vectors in each frame of the rehabilitation video is calculated, and the action corresponding to each frame is determined. The average value of the angle corresponding to each action is recorded as the range of motion of the joint corresponding to that action. Since joints may move simultaneously when performing each action, there may be multiple ranges of motion for each action. The proportion of muscle exertion frames can be obtained through model training. For example, multiple rehabilitation videos can be acquired, and each frame can be manually labeled to indicate whether it is an exertion frame. The joint range of motion can be obtained using the method described above. Then, the contour of the exertion area (such as the front of the thigh) can be obtained through contour recognition. Since the muscle bulges when exerting force and relaxes when not exerting force, the contour can be used to distinguish whether force is exerted. Furthermore, since the coordinate fluctuation of key points is small when exerting force and large when not exerting force, the coordinate fluctuation amplitude of each key point can be obtained. Finally, the joint range of motion, contour features, and coordinate fluctuation amplitude of each frame are used as input. For example, contour features can be represented by contour area, etc. This embodiment does not limit this. When calculating the coordinate fluctuation amplitude, two frames before and after the current frame can be selected (a total of 5 frames). The frame is used as a sliding window. Then, for each key point, the standard deviation of the x-coordinate and y-coordinate within the window is calculated. Finally, the sum of the standard deviations in the two directions is taken as the coordinate fluctuation amplitude. Then, the joint range of motion, contour features and coordinate fluctuation amplitude are normalized and a feature vector is generated as input. Whether it is a force exertion frame is the output. A binary classification model is trained based on the results of manual annotation. This embodiment does not limit the binary classification model and can directly use existing models such as support vector machine models. This embodiment does not limit the training parameters. For example, the total number of iterations can be set to 500, the optimizer can be Adam, and the loss function can be binary cross-entropy loss. Model training is a technical means that can be implemented by those skilled in the art, and this embodiment will not elaborate on it.
[0060] After training, the model can directly determine whether each frame in the rehabilitation video is a muscle exertion frame, and thus obtain the proportion of muscle exertion frames in the entire video. After obtaining the joint range of motion and the proportion of muscle exertion frames based on the current behavior data, and combining the effective thresholds stored in the medical effectiveness rule sub-library, it can capture the user's effective behaviors, the temporal distribution of effective behaviors, and intensity changes, so as to obtain the predicted trend of the user's key recovery indicators based on the current behavior data and the LSTM model. Key recovery indicators may include joint range of motion and weekly improvement rate, etc. Finally, behavior codes are generated based on the current effective behaviors and predicted trends, and then effective behavior sequences adapted to user behaviors are determined based on the behavior codes. The weekly improvement rate is used to measure the user's recovery status. For example, the average proportion of muscle exertion frames in each rehabilitation video uploaded by the user last week can be obtained, and the average proportion of muscle exertion frames in each rehabilitation video this week can be obtained. The improvement rate of the average is used as the weekly improvement rate.
[0061] This embodiment encodes user behavior data, selects effective behavior sequences that match user behavior from a historical consensus database, and further updates the parameters in the effective behavior sequences based on the reward function, LSTM model, and gradient data. Finally, it obtains behavior sequences that meet medical standards and are adapted to the user's movement habits and recovery speed, guiding the user to train.
[0062] Furthermore, the historical consensus database in this embodiment includes a medical effectiveness rule sub-library, an effect correlation rule sub-library, an abnormal behavior rule sub-library, a staged rule sub-library, and a comparison sub-library. The medical effectiveness rule sub-library stores the effective thresholds for each behavioral feature. The effect correlation rule sub-library stores the correlation coefficients between behavioral combinations and key recovery indicators. For example, it can generate a vector corresponding to each behavioral combination, quantify each vector into a specific numerical value, and finally calculate the correlation coefficient between the numerical value corresponding to each behavioral combination and each key recovery indicator. The abnormal behavior rule sub-library is used to store gradient data, which includes lazy gradient data and abnormal gradient data. The gradient measures the changing trend of each key recovery indicator; therefore, each key recovery indicator has its corresponding lazy gradient data and abnormal gradient data. When the gradient is greater than 0, it indicates that the rehabilitation training is effective; when the gradient is less than 0, the indicator shows a downward trend, indicating laziness or damage. Furthermore, the value of the lazy gradient should be greater than the abnormal gradient. Specifically, all stored user data can be divided into multiple types according to age, rehabilitation site, etc. Each type can be divided into a normal recovery group and an abnormal recovery group. The normal recovery group consists of users who reach the recovery goal within a specified time. Then, the gradient value corresponding to each user in the normal recovery group within the preset time is calculated, and the 5th percentile is used as the value for that category. The lazy gradient data corresponding to the type is used. The 5th percentile is chosen because it represents the boundary of the normal recovery group where the recovery progress is slow but still within the normal range. This indicates that the user is slacking off, affecting the recovery progress but not significantly affecting the recovery effect. The abnormal recovery group consists of users who have suffered secondary injuries due to overtraining or incorrect movements, resulting in failure to reach the recovery goal within the specified time. The 95th percentile can be used as the abnormal gradient data corresponding to this type by calculating the gradient value of each user in the abnormal recovery group within the preset time. The 95th percentile represents the part of the abnormal recovery group where the recovery regression is the most severe, indicating that the user has suffered serious damage. The 5th percentile and 95th percentile are examples, and this embodiment does not limit them. For example, the 10th percentile and 90th percentile can be selected. The phased rule sub-library is used to store recovery period parameters, specifically the initial values of each action in the behavioral sequence corresponding to different postoperative recovery stages (such as recovery period and stable period). By statistically analyzing the behavioral sequences of users at different postoperative stages, the numerical range corresponding to each action in each stage can be obtained, and the median can be used as the initial value. Furthermore, it can also be classified according to age, rehabilitation site, etc., to obtain recovery period parameters for users of different types and at different recovery stages.The comparison sub-database stores prediction errors, including the prediction error for each user and the average prediction error for all users. Specifically, for each user, after uploading their current behavior data, an LSTM model is used to obtain the user's feature vector, and the true feature vector is obtained in subsequent retraining. The error between the predicted feature vector and the true feature vector is the prediction error. The data in the historical consensus database is not static and needs to be updated periodically based on user-uploaded data.
[0063] Furthermore, such as Figure 2 As shown, each sub-database acts as a master node, and each master node corresponds to multiple sub-nodes. Each sub-node stores a portion of the data stored in the blockchain. The data stored in each sub-database is determined based on the communication mechanism between its corresponding sub-nodes. The specific steps include:
[0064] For each child node, local information is obtained based on the data it stores.
[0065] Broadcast local information to two adjacent child nodes, and receive local information corresponding to the two adjacent child nodes;
[0066] The intermediate information is obtained by combining the local information of the node itself with the local information of the two adjacent child nodes.
[0067] The intermediate information is transmitted to the corresponding master node so that the master node can calculate and store the data.
[0068] Taking the medical effectiveness rule sub-database as an example, all user data can be grouped by age group. Each sub-node stores user data for one age group. Each node calculates the initial threshold corresponding to each behavioral feature based on its stored data, and then uses the set of initial thresholds corresponding to each behavioral feature as local information. For example, each initial threshold is obtained by filtering users who have recovered after rehabilitation and statistically analyzing each behavioral feature of these users during the rehabilitation process. The feature value corresponding to the 90th percentile is used as the initial threshold for that behavioral feature. Here, 90% is merely an example, and this embodiment does not impose limitations. Next, for each node, its corresponding local information is broadcast to its two adjacent sub-nodes, and it receives the local information corresponding to its two adjacent sub-nodes. Not all sub-nodes have two adjacent sub-nodes; for example... Figure 3In the diagram, child node A has only one adjacent child node, which is child node B, and child node D has only one adjacent child node, which is child node C. Child node B has two adjacent child nodes, which are child node A and child node C. Therefore, child node A only broadcasts its corresponding local information to child node B and only receives the corresponding local information from child node B. Child node B broadcasts its corresponding local information to child node A and child node C and receives the corresponding local information from child node A and child node C. Child node D only broadcasts its corresponding local information to child node C and only receives the corresponding local information from child node C.
[0069] Taking child node B as an example, after receiving the local information corresponding to child nodes A and C, it obtains an intermediate threshold based on the amount of data stored in the child nodes. For instance, for the behavioral feature of joint mobility, the initial thresholds calculated by child nodes A, B, and C are respectively: , and The proportions of data stored in child nodes A, B, and C to the total data stored in all child nodes corresponding to the medical validity rules sub-database are respectively... , and The intermediate threshold corresponding to the joint mobility in child node B is obtained as follows:
[0070]
[0071] Similarly, the intermediate thresholds corresponding to each behavioral feature in child node B can be obtained, and the set of intermediate thresholds corresponding to each behavioral feature is used as the intermediate information for child node B. Then, each child node transmits the intermediate information and local information to the master node. The master node weights the intermediate information according to the proportion of data stored in each child node to obtain the effective threshold for each behavioral feature, and finally stores the effective thresholds and local information.
[0072] Similarly, the data stored in each other sub-database can also be determined through the communication mechanism between sub-nodes. This embodiment will not elaborate on this, and this embodiment only uses age classification as an example for introduction. However, this embodiment is not limited to this. Those skilled in the art can further classify according to rehabilitation sites. This embodiment will not elaborate on this.
[0073] This embodiment generates the data stored in each sub-database based on the communication mechanism between sub-nodes, so that each sub-node only processes a portion of the data. While significantly reducing the amount of computation, it can perform in-depth analysis of data from different groups more quickly and in detail. This makes it easier to capture the effective behavioral patterns of an individual's group more accurately when performing behavior coding, and when filtering effective behavior sequences, it can find behaviors that are strongly correlated with the individual's recovery based on more refined group data, ensuring the accuracy of the final effective behavior sequences.
[0074] Furthermore, this embodiment provides a step for obtaining behavioral codes based on current behavioral data and a sub-library of medical effectiveness rules in a historical consensus database, including:
[0075] The effective behavior vector is obtained based on the current behavioral data and the medical effectiveness rule sub-library.
[0076] A composite vector is obtained based on the current behavioral data and the LSTM model;
[0077] The behavior code is obtained based on the effective behavior vector and the composite vector.
[0078] Specifically, the system first analyzes the rehabilitation videos uploaded by users to statistically analyze their behavioral characteristics, including the duration of each rehabilitation session, the number of rehabilitation movements performed, joint range of motion, the percentage of muscle exertion frames, weekly improvement rate, and the number of interruptions during rehabilitation. Then, each behavioral characteristic is standardized and concatenated to obtain the current feature vector. Next, based on the user's age and the corresponding sub-node in the medical effectiveness rule sub-library, it is determined whether the amount of user data meeting that age requirement reaches a preset threshold. This embodiment does not limit the preset threshold; for example, it can be set to 50 people. If so, the system retrieves the local information corresponding to that age group stored in the medical effectiveness rule sub-library. The value of each behavioral characteristic in the current behavioral data is compared with the initial threshold corresponding to each characteristic in the local information to obtain the validity identifier for each characteristic. For example, if the duration of the current rehabilitation session is greater than its corresponding initial threshold, the validity identifier for the duration of the current rehabilitation session is 1; otherwise, it is 0. Therefore, the validity identifier corresponding to each behavioral characteristic can be obtained. If the amount of data does not reach the preset threshold, the system retrieves the validity threshold for each characteristic stored in the medical effectiveness rule sub-library, compares it with the value of each behavioral characteristic in the current behavioral data, and obtains the validity identifier. The validity identifiers of each feature are concatenated in the order of the current feature vector to obtain the current validity identifier vector. Then, the importance weight corresponding to each feature is obtained. This embodiment does not limit the specific value of the importance weight. For example, in the early postoperative period (e.g., 1-2 weeks), it is necessary to avoid overtraining, so a larger importance weight can be set for the number of interruptions. In the stable period (3-8 weeks), it is necessary to enhance the recovery effect, so a larger weight can be set for the weekly improvement rate. In this embodiment, only age is used as an example for judging when obtaining the validity identifier, but this embodiment is not limited to this. When the sub-nodes are further classified according to the rehabilitation site, the rehabilitation site also needs to be considered here. This embodiment will not elaborate on this.
[0079] Next, the validity identifier vector is weighted with the importance weight to obtain the attention weight. for:
[0080]
[0081] in, Indicates the first The importance weights corresponding to each behavioral feature The first one in the validity identifier vector The validity identifier corresponding to each behavioral feature This represents the total number of behavioral characteristics.
[0082] Apply attention weights to the current feature vector Weighted, the current behavior vector is obtained as follows:
[0083]
[0084] Next, each current behavior vector within a preset time period is obtained and input into the GRU model in chronological order to obtain the effective behavior vector. Then, each current feature vector within a preset time period is obtained and input into the LSTM model sequentially to predict the feature vector after the next rehabilitation. This feature vector is then normalized to obtain a composite vector. Finally, the composite vector is concatenated with the effective behavior vector to obtain the behavior encoding.
[0085] Both the GRU and LSTM models require training. Since both are existing models, their training process will not be detailed in this embodiment. For example, training and validation sets can be generated by obtaining current behavior vectors from multiple users based on a historical database. The training set is then input into the GRU model in batches to generate corresponding effective behavior vectors. The loss function is calculated using these effective behavior vectors, and the parameters in the model are updated based on the loss function and backpropagation algorithm until a preset number of iterations is reached. After validation with the validation set, a trained GRU model is obtained. The loss function can be determined based on the mean squared error between the effective behavior vectors and the baseline behavior vectors. The baseline vectors can be generated based on high-quality recovery users (e.g., users who achieve rehabilitation goals within 3 months without secondary injury). For example, current behavior vectors corresponding to multiple high-quality recovery users can be obtained from a historical database, and their corresponding effective behavior vectors can be calculated. The mean of each calculated effective behavior vector is used as the baseline behavior vector. Since the model is not yet fully trained, the generation of the baseline behavior vectors can be performed manually. This embodiment does not restrict the parameters used in model training; for example, the total number of iterations can be set to 500, and the learning rate to 0.001.
[0086] For example, the LSTM model is trained based on the same principle. First, training and validation sets are generated by obtaining the current behavior vectors of multiple users from the historical database. The training set is then input into the LSTM model in batches, and the corresponding composite vectors are predicted. The loss function is calculated using the generated composite vectors, and the parameters in the model are updated based on the loss function and the backpropagation algorithm until the preset number of iterations is reached. After validation with the validation set, the trained LSTM model is obtained. The loss function can be determined based on the mean squared error between the currently predicted composite vector and the user's true feature vector after the next rehabilitation. Similarly, this embodiment does not limit the parameters in the model training. For example, the total number of iterations can be set to 500, and the learning rate can be 0.001.
[0087] Based on the above analysis, the steps in this embodiment for obtaining the effective behavior vector based on the current behavior data and the medical effectiveness rule sub-library include:
[0088] Based on the current behavioral data and the effective threshold in the medical effectiveness rule sub-library, an effectiveness identifier is obtained;
[0089] Calculate attention weights based on validity indicators;
[0090] Based on attention weights and current behavior data, an effective behavior vector is obtained.
[0091] This embodiment uses an attention weighting mechanism to automatically amplify behavioral features that actually contribute to recovery and weaken ineffective behaviors. It also uses a GRU model to capture the temporal patterns of recent effective behaviors and constructs a unique effective behavior vector for each user. At the same time, it uses an LSTM model to predict future feature trends based on historical data to obtain a composite vector. The effective behavior vector is then concatenated with the composite vector to obtain the behavior code. Finally, the accuracy of the effective behavior sequence is improved through the behavior code.
[0092] Furthermore, such as Figure 4 As shown, this embodiment provides a step for obtaining a valid behavior sequence based on behavior encoding and an effect association rule sub-library in a historical consensus database, including:
[0093] Candidate behavior combinations are generated based on behavior codes and historical databases;
[0094] The first behavior combination is obtained based on the correlation coefficients in the sub-library of candidate behavior combinations and effect association rules;
[0095] Based on the first action combination and the effective threshold in the medical effectiveness rule sub-library, the effective action sequence is obtained.
[0096] Specifically, the historical database stores the behavior codes of each recovered user during the rehabilitation process. Therefore, a similarity match is performed between the user's behavior code and the behavior codes in the historical database to obtain behavior codes with a similarity greater than a first preset similarity. These are used as candidate behavior codes that can be determined to match the user's behavioral characteristics. Then, the corresponding behavior combinations for these users are called to obtain a candidate behavior combination set. For each user, each rehabilitation video corresponds to a behavior code and an action sequence. The action sequence can be obtained through video recognition; this embodiment does not limit this. Therefore, each behavior code corresponds to a behavior combination. This embodiment does not limit the storage method of behavior combinations. For example, one behavior combination can be represented as [knee flexion (duration 1.5 minutes), stretching (duration 1 minute), relaxation (duration 0.5 minutes)]. The effect association rule sub-library stores the correlation coefficient between each behavior combination and the key recovery indicators. Therefore, this embodiment further selects behavior combinations from the candidate behavior combination set whose average correlation coefficient with the key recovery indicators is higher than the second preset similarity to obtain the first behavior combination. If the candidate behavior combination set includes only one behavior combination, it is directly used as the first behavior combination. If there is no behavior code with a similarity greater than the first preset similarity, the behavior combination corresponding to the behavior code with the highest similarity is recorded as the first behavior combination. In this embodiment, the specific values of the first preset similarity and the second preset similarity are not limited.
[0097] However, an effective behavior sequence needs to match not only the user's historical behavioral characteristics but also their historical behavioral trends. Therefore, it is necessary to obtain the composite vector corresponding to each first behavior combination and the composite vector corresponding to the user's currently uploaded video, which is predicted based on the above steps. The difference between each element in the two composite vectors is compared. If the difference between each element is within a preset range, then based on the initial threshold or effective threshold in the medical validity rule sub-library, it is determined whether each element in each first combination is greater than the initial threshold or effective threshold. The first behavior combination that meets both conditions is taken as the second behavior combination. The choice between the initial threshold and the effective threshold depends on the steps for generating the validity identifier. If the validity identifier is generated by comparing with the initial threshold, then the initial threshold is still selected here; otherwise, if the validity identifier is generated by comparing with the effective threshold, then the effective threshold is still selected here. Furthermore, to ensure the integrity of the effective behavior sequence, the historical database needs to be traversed further to find each behavior combination that includes the second behavior combination. Finally, the correlation coefficient in the effect association rule sub-library is used for filtering, retaining only the behavior combination with the highest correlation coefficient as the effective behavior sequence. If there is no first behavior combination that satisfies both conditions, then directly traverse the historical database to find every behavior combination that includes the first behavior combination. Finally, filter by the correlation coefficient in the effect association rule sub-library and retain only the behavior combination with the highest correlation coefficient as the effective behavior sequence.
[0098] Based on the above analysis, it can be summarized that the steps provided in this embodiment for obtaining an effective behavior sequence based on the first behavior combination and the effective threshold in the medical effectiveness rule sub-library include:
[0099] A composite vector is obtained based on the current behavioral data and the LSTM model;
[0100] The second combination of actions is obtained based on the first combination of actions, the composite vector, and the effective threshold in the medical effectiveness rule sub-library;
[0101] The effective behavior sequence is obtained based on the correlation coefficients in the second behavior combination and effect association rule sub-library.
[0102] In this embodiment, based on the correlation coefficients in the effect association rule sub-library, the first behavior combination associated with the recovery effect is selected from the candidate combinations. Then, the composite vector predicted by LSTM is used to determine the second behavior combination by the difference between the composite vector and the first behavior combination. This ensures that the second behavior combination can both conform to future behavior trends and guarantee recovery efficiency. Finally, in order to ensure the completeness of the actions included in the behavior sequence, the combination is screened again to obtain the effective behavior sequence.
[0103] Furthermore, this embodiment provides a step for determining action parameters in a valid behavior sequence based on a phased rule sub-library in a historical consensus database, including:
[0104] The initial action parameters are determined based on the recovery period parameters in the phased rule sub-library.
[0105] The total reward value is obtained based on the user's historical behavior data and the reward function;
[0106] The action parameters and corresponding triggering conditions in the effective action sequence are determined based on the total reward value and LSTM.
[0107] Furthermore, this embodiment provides a method for determining action parameters in an effective behavior sequence based on the total reward value, including:
[0108] Calculate the current gradient data corresponding to each behavioral feature based on the user's historical behavior data;
[0109] Based on the abnormal behavior rule sub-library, obtain the lazy gradient data and abnormal gradient data corresponding to each behavior feature;
[0110] The gradient trend corresponding to each behavioral feature is obtained based on lazy gradient data and abnormal gradient data;
[0111] The action parameters in the effective action sequence are determined based on the gradient trend and the total reward value.
[0112] Specifically, after obtaining the valid behavior sequence, the first step is to retrieve the action parameters corresponding to each action in the valid behavior sequence from the historical database. For example, if an action in the valid behavior sequence is knee flexion for 1.5 minutes, then the action parameter corresponding to this action in the valid behavior sequence is 1.5 minutes. Then, based on the user's historical behavior data, the average duration of each knee flexion is 1.4 minutes; 1.4 minutes is the user's corresponding action parameter. Next, based on the user's age and recovery stage, the initial action parameter corresponding to this action, such as 1.2 minutes, is retrieved from the staged rule sub-library. The specific values mentioned above are merely examples, and this embodiment does not impose any limitations on them.
[0113] Next, a reward function is calculated based on the user's historical behavior data. The reward function includes an execution reward and an effect reward, which are used to measure whether the short-term action details meet the standards. For example, the execution reward can be the rate of change of the current muscle exertion frame percentage compared to the adjacent previous muscle exertion frame percentage, and the effect reward is the average rate of change of the current joint range of motion compared to the adjacent previous joint range of motion. Finally, the execution reward and effect reward are normalized and weighted to obtain the reward function.
[0114] Next, based on the user's historical behavior data, it is necessary to calculate the gradient data for each behavior feature. For example, the average rate of change of each behavior feature within a preset time period can be used as the gradient data for each behavior feature. Then, the lazy gradient data and abnormal gradient data corresponding to each behavior feature in the staged rule sub-library are obtained, and the gradient trend corresponding to each behavior feature is determined. The gradient trend includes normal trend, lazy trend, and abnormal trend. For example, if the current gradient data corresponding to a behavior feature is greater than the lazy gradient data, it means that the behavior feature corresponds to the normal trend. If the current gradient data corresponding to the behavior feature is less than or equal to the lazy gradient data and greater than the abnormal gradient data, it means that the behavior feature corresponds to the lazy trend. If the current gradient data corresponding to the behavior feature is less than or equal to the abnormal gradient data, it means that the behavior feature corresponds to the abnormal trend. Then, the number of behavior features in each trend is counted.
[0115] like Figure 5As shown, if the number of behavioral features in the normal trend is the largest, it indicates that the user's overall recovery is good. Then, the reward function is compared with the threshold. If the reward function is greater than or equal to the threshold, it indicates that the current action is highly complete. At this time, the action parameter can be appropriately increased, such as adjusting the action parameter to the action parameter corresponding to the action in the effective behavior sequence, i.e., 1.5 minutes. If the reward function is less than the threshold, it indicates that the current action is not complete enough. At this time, the action parameter can be adjusted to the initial action parameter, i.e., 1.2 minutes, to avoid blindly increasing it and causing user injury. This embodiment does not limit the threshold. Those skilled in the art can set it according to information such as the recovery stage. If the number of behavioral features in the lazy trend is the highest, it indicates that the user's overall recovery trend is slowing down. However, the slowdown is caused by laziness, not by injury. In this case, it is necessary to forcibly increase the intensity (the value of the action parameter) to break the inertia of laziness. The specific increase in intensity can be determined based on the number of behavioral features in the lazy trend or the difference between the laziness gradient data. This embodiment does not impose any restrictions on this. If the number of behavioral features in the abnormal trend is the highest, it indicates that the user may have suffered an injury. In this case, it is necessary to stop the rehabilitation actions and remind the user to seek medical attention in a timely manner. If multiple trends have the same number of features, further judgment can be made based on the specific values of the current gradient data.
[0116] The trigger condition is the time for updating the action parameters corresponding to the action in the valid behavior sequence. For example, if the trigger condition is 3 days, the updated action parameters will be used after 3 days, and the average user duration of 1.4 minutes will still be used within 3 days. The trigger condition needs to be determined based on the prediction accuracy of the LSTM model. Since LSTM is a model for processing time series, the longer the future time is predicted, the larger the error will be. Therefore, an error threshold needs to be set, and the maximum number of days less than the error threshold is used as the trigger condition. This allows for advance planning of parameter adjustments and ensures the reliability of the prediction results. This embodiment does not limit the error threshold. For example, the average prediction error of all users stored in the comparison sub-database can be used as the error threshold, and the data in the comparison sub-database can be classified according to the number of prediction days. Finally, the maximum number of days less than the error threshold is used as the trigger condition.
[0117] This embodiment identifies rehabilitation trends through gradient data corresponding to current behavioral characteristics and quantifies the execution quality and effect of the current action by combining a reward function, thereby achieving fine-grained adjustment of action parameters. At the same time, this embodiment determines the triggering conditions for parameter updates based on the prediction accuracy of the LSTM model, which not only plans the timing of adjustments in advance but also ensures the reliability of predictions. Finally, through the synergy of the reward function, gradient data, and triggering conditions, the dynamic adjustment of action parameters not only conforms to the user's behavioral habits and recovery rhythm but also forcibly breaks the inertia when slacking off and provides timely warnings when injuries occur, effectively improving the safety and recovery efficiency of rehabilitation and providing users with precise rehabilitation guidance that combines medical compliance and individual adaptation.
[0118] This application provides a user data-based behavior pattern mining and guidance system, including:
[0119] The acquisition module is used to acquire the user's current behavior data;
[0120] The behavior coding module is used to obtain behavior codes based on current behavior data and the medical effectiveness rule sub-library in the historical consensus database; the historical consensus database is composed of data stored in the blockchain.
[0121] The behavior determination module is used to obtain effective behavior sequences based on behavior codes and the effect association rule sub-library in the historical consensus database;
[0122] The parameter determination module is used to determine the action parameters in the valid behavior sequence based on the phased rule sub-library in the historical consensus database.
[0123] This application provides a method and system for mining and guiding behavior patterns based on user data. It generates information stored in a historical consensus database through a communication mechanism between each sub-node, encodes behavior through user behavior data, selects effective behavior sequences that match user behavior from the historical consensus database, and further updates the parameters in the effective behavior sequences based on reward functions, LSTM models, and gradient data. Finally, it obtains behavior sequences that both meet medical standards and match the user's movement habits and recovery speed, guiding the user to train.
[0124] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0125] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0126] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0127] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for mining and guiding behavioral patterns based on user data, characterized in that, include: Obtain the user's current behavior data; Based on the current behavioral data and the medical effectiveness rule sub-library in the historical consensus database, the behavioral code is obtained; The historical consensus database is composed of data stored in the blockchain; Based on the behavior encoding and the effect association rule sub-library in the historical consensus database, a valid behavior sequence is obtained; Based on the phased rule sub-library in the historical consensus database, determine the action parameters in the effective behavior sequence; The historical consensus database includes a medical effectiveness rule sub-database, an effect correlation rule sub-database, an abnormal behavior rule sub-database, a phased rule sub-database, and a comparison sub-database. The medical effectiveness rule sub-database stores effective thresholds; the effect correlation rule sub-database stores correlation coefficients between behavior combinations and key recovery indicators; the abnormal behavior rule sub-database stores gradient data; the phased rule sub-database stores recovery period parameters; and the comparison sub-database stores prediction errors. Each sub-database corresponds to a master node, and each master node corresponds to multiple sub-nodes. Each sub-node stores a portion of the data stored in the blockchain. The data stored in each sub-database is determined according to the communication mechanism between its corresponding sub-nodes. Among them, based on the current behavioral data and the medical effectiveness rule sub-library in the historical consensus database, behavioral codes are obtained, including: The effective behavior vector is obtained based on the current behavior data and the medical effectiveness rule sub-library. A composite vector is obtained based on the current behavior data and the LSTM model; The behavior code is obtained based on the effective behavior vector and the composite vector; The effective behavior sequence is obtained based on the behavior encoding and the effect association rule sub-library in the historical consensus database, including: Candidate behavior combinations are generated based on the behavior codes and historical database; The first behavior combination is obtained based on the correlation coefficients in the sub-library of candidate behavior combinations and effect association rules; Based on the first combination of behaviors and the effective threshold in the medical effectiveness rule sub-library, an effective behavior sequence is obtained; Specifically, the action parameters in the effective behavior sequence are determined based on the phased rule sub-library in the historical consensus database, including: The initial action parameters are determined based on the recovery period parameters in the phased rule sub-library. The total reward value is obtained based on the user's historical behavior data and the reward function; The action parameters and corresponding triggering conditions in the effective behavior sequence are determined based on the total reward value and the LSTM.
2. The method for mining and guiding user behavior patterns based on user data according to claim 1, characterized in that, The data stored in each sub-database is determined according to the communication mechanism between its corresponding child nodes, including: For each child node, local information is obtained based on the data it stores. The local information is broadcast to two adjacent child nodes, and the local information corresponding to the two adjacent child nodes is received. The intermediate information is obtained based on its own local information and the local information of the two adjacent child nodes. The intermediate information is transmitted to the corresponding master node so that the master node can calculate and store the data.
3. The method for mining and guiding user behavior patterns based on user data according to claim 1, characterized in that, Based on the current behavior data and the medical effectiveness rule sub-library, an effective behavior vector is obtained, including: Based on the current behavior data and the effective threshold in the medical effectiveness rule sub-library, an effectiveness identifier is obtained; Calculate the attention weight based on the validity identifier; Based on the attention weights and the current behavior data, an effective behavior vector is obtained.
4. The method for mining and guiding user behavior patterns based on user data according to claim 1, characterized in that, Based on the first behavior combination and the effective threshold in the medical effectiveness rule sub-library, an effective behavior sequence is obtained, including: A composite vector is obtained based on the current behavior data and the LSTM model; The second behavior combination is obtained based on the first behavior combination, the composite vector, and the effective threshold in the medical effectiveness rule sub-library; The effective behavior sequence is obtained based on the correlation coefficients in the second behavior combination and the effect association rule sub-library.
5. The method for mining and guiding user behavior patterns based on user data according to claim 1, characterized in that, Determining the action parameters in the effective behavior sequence based on the total reward value includes: Calculate the current gradient data corresponding to each behavioral feature based on the user's historical behavior data; Based on the abnormal behavior rule sub-library, lazy gradient data and abnormal gradient data corresponding to each behavior feature are obtained; The gradient trend corresponding to each behavioral feature is obtained based on the lazy gradient data and the abnormal gradient data; The action parameters in the effective action sequence are determined based on the gradient trend and the total reward value.
6. A user data-based behavior pattern mining and guidance system, characterized in that, include: The acquisition module is used to acquire the user's current behavior data; The behavior coding module is used to obtain behavior codes based on the current behavior data and the medical effectiveness rule sub-library in the historical consensus database; The historical consensus database is composed of data stored in the blockchain; The behavior determination module is used to obtain a valid behavior sequence based on the behavior code and the effect association rule sub-library in the historical consensus database; The parameter determination module is used to determine the action parameters in the effective behavior sequence based on the phased rule sub-library in the historical consensus database. The historical consensus database includes a medical effectiveness rule sub-database, an effect correlation rule sub-database, an abnormal behavior rule sub-database, a phased rule sub-database, and a comparison sub-database. The medical effectiveness rule sub-database stores effective thresholds; the effect correlation rule sub-database stores correlation coefficients between behavior combinations and key recovery indicators; the abnormal behavior rule sub-database stores gradient data; the phased rule sub-database stores recovery period parameters; and the comparison sub-database stores prediction errors. Each sub-database corresponds to a master node, and each master node corresponds to multiple sub-nodes. Each sub-node stores a portion of the data stored in the blockchain. The data stored in each sub-database is determined according to the communication mechanism between its corresponding sub-nodes. Among them, based on the current behavioral data and the medical effectiveness rule sub-library in the historical consensus database, behavioral codes are obtained, including: The effective behavior vector is obtained based on the current behavior data and the medical effectiveness rule sub-library. A composite vector is obtained based on the current behavior data and the LSTM model; The behavior code is obtained based on the effective behavior vector and the composite vector; The effective behavior sequence is obtained based on the behavior encoding and the effect association rule sub-library in the historical consensus database, including: Candidate behavior combinations are generated based on the behavior codes and historical database; The first behavior combination is obtained based on the correlation coefficients in the sub-library of candidate behavior combinations and effect association rules; Based on the first combination of behaviors and the effective threshold in the medical effectiveness rule sub-library, an effective behavior sequence is obtained; Specifically, the action parameters in the effective behavior sequence are determined based on the phased rule sub-library in the historical consensus database, including: The initial action parameters are determined based on the recovery period parameters in the phased rule sub-library. The total reward value is obtained based on the user's historical behavior data and the reward function; The action parameters and corresponding triggering conditions in the effective behavior sequence are determined based on the total reward value and the LSTM.
Citation Information
Patent Citations
Scene interactive AI rehabilitation assessment training and health monitoring system
CN120690453A
Rehabilitation training data mining system and method based on deep reinforcement learning
CN120932907A