Fitness guidance method and system

By building an extreme gradient improvement decision tree model, using fitness historical data to automatically adjust the difficulty level of fitness equipment, the problem of difficulty in adjusting fitness equipment in the existing technology is solved, and personalized fitness guidance with high accuracy is achieved , significantly improve the exercise effect.

CN113762336BActive Publication Date: 2024-12-31BEIJING LINGQI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110856254.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-28
Publication Date
2024-12-31
Estimated Expiration
2041-07-28

AI Technical Summary

Technical Problem

It is difficult for existing fitness equipment to scientifically adjust the difficulty level and time of fitness equipment based on individual physical fitness and exercise history data, resulting in poor exercise results and lack of personalization and scientificity.

Method used

By obtaining fitness history log records data, preprocessing and feature extraction, establishing an extreme gradient enhancement decision tree model, building a fitness guidance model, outputting the intensity level that fitness equipment should set to adjust the exerciser's heart rate to reach the predetermined range, using data mining and Machine learning enables automated adjustments.

Benefits of technology

It has achieved a reasoning accuracy of 91.2%, and can provide personalized exercise guidance based on individual data, significantly improving fitness results, and solving the problem of lack of scientific basis for manual adjustments and inaccurate automatic adjustments in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113762336B_ABST
    Figure CN113762336B_ABST
Patent Text Reader

Abstract

The present invention discloses a fitness guidance method and system, which includes the following steps: obtaining fitness history log record data; preprocessing the fitness history log record data, extracting feature data from the processed data, and establishing a sample set; using the sample set to train the extreme gradient boosting decision tree, and constructing a fitness guidance model; importing the target user's information to be tested into the fitness guidance model, and outputting the fitness guidance information corresponding to the target user, the fitness guidance information being the intensity level that the fitness equipment should be set to in each time period so that the heart rate of the exerciser reaches the adjustment value of the corresponding predetermined heart rate zone. The present invention enables the exerciser to adjust and control the heart rate of the exerciser to reach the corresponding predetermined heart rate zone according to different time periods of the fitness plan, and obtain a good exercise effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a fitness guidance method and system. Background Art

[0002] In the field of fitness, monitoring heart rate is a recognized means of understanding and measuring the exercise level of fitness enthusiasts. Now some wearable devices (such as smart bracelets, watches, and some special wearable devices that analyze the wearer's heart rhythm status by monitoring heart rate to achieve abnormal heart rhythm warning, treadmills and other fitness equipment are already equipped with heart rate detection sensor devices, including the commonly used hand-held type, the less used ear clip type and the chest strap type) can monitor heart rate. It is very useful in fitness occasions. If you want to have a preliminary understanding of a person's physical condition without using professional medical equipment, monitoring heart rate is an effective and generally practical way.

[0003] For the above reasons, heart rate is the most commonly used indicator to measure the intensity effect of fitness training. Usually, the maximum heart rate (MHR) of the exerciser during the past one or two weeks is used as the upper limit, and the fitness intensity effect is divided into 5 heart rate zones (Zone, see below). Figure 2 ):

[0004] 1) 50%-60% of the maximum heart rate is the moderate activity zone (Moderate Activity);

[0005] 2) 60%-70% of the maximum heart rate is the weight control zone (Weight Control);

[0006] 3) 70%-80% of the maximum heart rate is the aerobic zone;

[0007] 4) 80%-90% of the maximum heart rate is the anaerobic zone;

[0008] 5) 90%-100% of the maximum heart rate is the maximum oxygen uptake zone (VO2 Max)

[0009] The definition of the difficulty level of fitness equipment such as treadmills is usually determined by certain corresponding parameter data on the equipment. For example, the difficulty level of a treadmill is usually defined by a combination of different values ​​of the speed of the treadmill's running belt and the inclination (slope) of the treadmill's running deck. Different types of equipment may define different total difficulty levels.

[0010] To achieve scientific fitness goals during fitness, it is necessary to have a reasonable basis to solve the following problems: when to adjust the difficulty setting of fitness equipment, how long a certain difficulty setting should last, what level of difficulty should be set so that the heart rate of the fitness person can be raised or lowered to the expected heart rate range of the fitness program design within a specified time and last for a specified time to achieve the purpose of scientific fitness, and whether these difficulty settings can be automatically adjusted to a reasonable level at an appropriate time for people with different physical conditions to achieve the purpose of personalized scientific fitness in accordance with their personal physical conditions. For example, the following Figure 3 The black box area in the middle is the heart rate area that the fitness person's heart rate should reach in the corresponding time period according to the fitness plan. The curve is the whole process of the fitness person's heart rate change. The heart rate value is monitored and sampled every 5 seconds. The five-pointed star indicates that the predetermined heart rate zone has not been reached, and the dot indicates that the predetermined heart rate zone has been reached. The most ideal effect should be to calculate and predict the intensity level that should be set for the fitness equipment corresponding to each time period through some method so that the exerciser's heart rate can reach the corresponding predetermined heart rate zone.

[0011] In terms of formulating specific fitness plans for each exercise, most people currently do not scientifically discover the rules and formulate scientific and reasonable fitness plans from the perspective of analyzing the fitness history data of fitness enthusiasts. There are mainly the following practices:

[0012] 1. The fitness coaches or fitness enthusiasts manually adjust the difficulty of fitness equipment at designated time points according to the recommendations of fixed and rigid fitness programs that are commonly used but not scientific and may not conform to the actual physical condition of the individual. This method of using a fixed difficulty setting process for everyone obviously lacks scientific basis. The fitness effect may vary greatly due to the great differences in physical constitutions of different people. In addition, it is necessary to manually adjust the difficulty of fitness equipment at different time points. Automation has not been achieved, let alone intelligence.

[0013] Second, the automatic change process of the sequence difficulty during the fitness process is fixedly set on the fitness equipment according to the commonly used fitness program. This solution only realizes the automatic adjustment of the equipment difficulty at certain time points, but obviously does not solve the problem of setting the difficulty level and duration based on the scientific fitness goals and personalized fitness.

[0014] 3. Based on monitoring the heart rate of the fitness participants and recording the difficulty level of the fitness equipment at the corresponding time, combined with popular fitness programs that are commonly used but not necessarily scientific and do not take into account the differences in personal physical constitutions of the fitness participants, a self-implemented empirical heart rate and difficulty corresponding adjustment algorithm is used to automatically increase or decrease the difficulty of the fitness equipment according to the current heart rate of the fitness participant and the current time point to increase or decrease the heart rate of the fitness participant, in the hope of achieving the goal of scientific and reasonable fitness. This solution is obviously a great improvement over the previous two. It not only realizes automatic adjustment, but also takes into account the changes in heart rate with fitness difficulty and time. It attempts to calculate the next adjustment difficulty level based on the current heart rate and fitness difficulty level at a certain point in time so that the fitness person's heart rate can be increased or decreased to the target range. This solution is obviously advanced to a certain extent, but it is still an empirical closed-loop control in essence, because its adjustment algorithm is still a manually designed logical judgment, rather than based on the underlying law that the fitness person's own heart rate changes with changes in difficulty. Therefore, although the actual effect of this solution is a great improvement over the previous two solutions, it is still inaccurate most of the time. That is to say, after adjusting the fitness difficulty according to its algorithm, the fitness heart rate often does not increase or decrease to the expected and ideal heart rate range, and is still far from the goal of scientific fitness. This is also a real problem faced by a large foreign fitness chain that commissioned us to do research and development.

[0015] To sum up, when current fitness chain companies formulate exercise plans for exercisers who come to the store to exercise and buy fitness equipment such as treadmills with special coaching services, they either fail to guide exercisers in setting the difficulty level (or intensity level) of the equipment and the exercise time for each difficulty based on certain scientific and reasonable rules, and they do not formulate personalized fitness intensity and time setting plans based on the different physical conditions of exercisers. Or, although they formulate fitness plans based on fitness intensity effect ranges and design certain algorithms to automatically adjust the difficulty of fitness equipment over time based on the fitness plans, these algorithms are all artificially set logical judgments based on empirical formulas, and are not designed based on the exercisers' own physical conditions and exercise history. As a result, there is a large gap between scientific and reasonable fitness in terms of the accuracy of controlling the changes in the heart rate of exercisers during exercise and the rigor of the difficulty setting of fitness equipment. Summary of the invention

[0016] In order to solve the above technical problems, the present invention proposes a fitness guidance method and system, which enables a fitness person to adjust and control his / her heart rate to a corresponding predetermined heart rate zone according to different periods of a fitness plan, thereby obtaining a good exercise effect.

[0017] In order to achieve the above object, the technical solution of the present invention is as follows:

[0018] A fitness guidance method comprises the following steps:

[0019] Get fitness history log record data;

[0020] Preprocess the fitness history log record data, extract feature data from the processed data, and establish a sample set;

[0021] The sample set is used to train the extreme gradient boosting decision tree and build a fitness guidance model;

[0022] The target user's information to be measured is imported into the fitness guidance model, and the fitness guidance information corresponding to the target user is output, wherein the fitness guidance information is the intensity level that the fitness equipment should be set to in each time period so that the exerciser's heart rate reaches the adjustment value of the corresponding predetermined heart rate zone.

[0023] Preferably, the preprocessing includes first filling in missing data and filtering invalid, extreme and noise data; and then converting the original data into normal distribution data by using interval quantization, normalization and BOX-COX transformation.

[0024] Preferably, the characteristic data includes at least the fitness enthusiast number, age, fitness equipment type, initial difficulty of each heart rate continuous increase or continuous decrease interval, initial heart rate, time, start time of the time zone corresponding to the continuous increase / decrease of heart rate, end time of the time zone corresponding to the continuous increase / decrease of heart rate, heart rate change in the heart rate continuous increase / decrease interval, difficulty change in the heart rate continuous increase / decrease interval, and the number of times the fitness equipment adjusts the difficulty level in the continuous increase / decrease interval.

[0025] Preferably, the method further comprises the following step: using a K-fold crossover method to verify the accuracy of the fitness guidance model.

[0026] Preferably, the loss function of the fitness guidance model is:

[0027]

[0028] in represents the loss function of sample i, Ω(f t ) is the regularization term,

[0029] According to Taylor's complete expansion

[0030]

[0031] The Taylor second-order expansion of f(x+Δx) at point x is approximately

[0032]

[0033] According to the above formula, the model f of the tth tree on the right side of the loss function L t (x i ) corresponds to Δx, Then the corresponding value is x, and the right side of the loss function L is approximately expanded and simplified and the constant is added to become:

[0034]

[0035] in I is the loss function of a single tree, and f(x) is the fitting function of a single tree.

[0036] Preferably, the node splitting algorithm used when constructing a single tree is a greedy method.

[0037] Preferably, the method comprises the following steps: encapsulating the fitness guidance model into an inference engine to provide a web service.

[0038] Preferably, the method comprises the following steps:

[0039] Receive a remote inference engine call request based on the http protocol sent by the application;

[0040] Get the heart rate data information and fitness equipment status in the request;

[0041] The user's heart rate data information and fitness equipment status are inferred using the inference engine, and the inferred fitness guidance information is returned.

[0042] A fitness guidance system includes a processor and a memory for storing instructions executable by the processor, and at least one fitness device, wherein:

[0043] When the processor executes the instructions, any one of the above methods is implemented;

[0044] The fitness equipment is provided with an embedded application, which provides log recording data and interacts with a server through the application, and adjusts the difficulty level setting of the fitness equipment according to the interaction result. The interval time range between each two fitness equipment adjustments is 30-60 seconds. The log recording data includes the fitness person number, age, fitness equipment type, initial difficulty of each heart rate continuous increase or continuous decrease interval, initial heart rate, time, start time of the time zone corresponding to the continuous increase / decrease of heart rate, end time of the time zone corresponding to the continuous increase / decrease of heart rate, heart rate change in the heart rate continuous increase / decrease interval, difficulty change in the heart rate continuous increase / decrease interval, and the number of times the fitness equipment adjusts the difficulty level in the continuous increase / decrease interval.

[0045] Preferably, it also includes a client, which is used to remotely interact with the processor to obtain historical fitness records, fitness guidance information, corporate promotion information, etc.

[0046] Based on the above technical scheme, the beneficial effects of the present invention are: using data mining and analysis technology to mine and analyze the historical data of more than 18,000 fitness people using equipment for fitness, extracting and synthesizing important feature data, and using it to train the extreme machine learning gradient boosting decision tree classification model, and discovering the time in the fitness process, the heart rate change of the fitness people, the number of difficulty changes and the difficulty change of the fitness equipment. The model trained with the fitness data of all fitness people can be used to guide customers who come to the fitness chain store for the first time to use equipment for fitness to perform correct exercises that conform to the rules of most people. For fitness record data and fitness customers who have reached more than 10,000 pieces, personalized mining and model training can also be performed for their personal fitness data, so that the model can guide fitness people who use equipment for fitness to perform correct exercises that conform to their own conditions. The reasoning accuracy of the model trained by the present invention based on the provided fitness history record data can reach 91.2%, far exceeding the empirical algorithm, and the feedback from users participating in the trial test is good. Later, with more fitness history record data, the accuracy of the model can be further improved.

[0047] As long as the fitness equipment can be wirelessly connected to the Internet and can provide heart rate and corresponding exercise difficulty level data, and supports program call mode to adjust the exercise difficulty level, the present invention can be applied to automatically guide the fitness person to exercise scientifically and rationally. The present invention can be applied to the fitness equipment of any fitness chain enterprise that can provide member fitness history record data for targeted data mining and model training, and the model trained with the fitness history record data of most people can be embedded into the fitness equipment as a universal intelligent guidance model that meets the basic conditions of most people. The fitness equipment needs to have an embedded hardware and software environment for running the model and encapsulating the software. Since it is used as a single machine, there is no concurrent call. It is expected that it can also run on low-end embedded motherboards with low power consumption and insufficient hardware resources such as CPU and memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.

[0049] Figure 1 is a flow chart of a fitness guidance method in an embodiment;

[0050] Figure 2 is a diagram showing a fitness intensity effect divided into five heart rate intervals in one embodiment;

[0051] Figure 3 It is a heart rate zone diagram that the heart rate of the fitness person should reach during the corresponding time period;

[0052] Figure 4 It is a graph showing the relationship between heart rate and difficulty level during fitness;

[0053] Figure 5 This is the corresponding relationship between time, heart rate and difficulty level during fitness process a;

[0054] Figure 6 This is the corresponding relationship between time, heart rate and difficulty level during fitness;

[0055] Figure 7 This is the corresponding relationship diagram between time, heart rate and difficulty level during fitness process c;

[0056] Figure 8 It is the corresponding relationship diagram of time, heart rate and difficulty level during fitness;

[0057] Fig. 9 This is the corresponding relationship diagram between time, heart rate and difficulty level during fitness;

[0058] Fig.10 It is the corresponding relationship diagram f between time, heart rate and difficulty level during fitness;

[0059] Fig.11 This is the corresponding relationship diagram g between time, heart rate and difficulty level during fitness. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0061] like Figure 1As shown, the present invention provides a fitness guidance method, which mines and analyzes the historical records of fitness members using fitness equipment such as treadmills to exercise, extracts the best combination of feature data to train the gradient boosting decision tree model used to process classification problems in machine learning, and then encapsulates the trained model with relatively high test accuracy into a web service (hereinafter referred to as the web inference server) that can be called using the HTTP protocol for remote calling by an embedded software system (hereinafter referred to as the client) deployed on the fitness equipment. During the fitness process, when the time period corresponding to each heart rate zone is about to start, the client on the fitness equipment sets the current time (the time when the fitness user starts each exercise is positioned as 0, and the time unit is seconds. If the fitness user exercises for 30 minutes at a time, the time value when the entire exercise is completed is 1800), the current difficulty level (taking the treadmill as an example, each difficulty level corresponds to a certain belt speed and flat plate slope), the number of difficulty changes adjusted in the fitness program plan, the current heart rate value, the start time and end time of the time period corresponding to the next heart rate zone in the fitness program plan, and the heart rate median of the next heart rate zone (the values ​​of the five heart rate zones are in ascending order of difficulty: 1, 2, 3, 4 ,5, for the convenience of processing, the range of the normal heart rate value before starting fitness is positioned at 0, which does not belong to the above 5 heart rate zones) is sent to the web inference service in the form of http request parameters as the input data of the web server inference model. After receiving the request data, the web service calls the extreme gradient boosting decision tree model for classification in real time for inference to obtain the final value of the difficulty level that needs to be adjusted and returns it to the client on the fitness device. After the client receives the difficulty level value recommended by the model, it adjusts it multiple times according to the number of difficulty level changes specified in the fitness plan. The time interval between each adjustment should not exceed a certain length of time (time The long range is 30-60 seconds. This data is the law discovered by mining and analyzing the fitness history records of multiple fitness people. If the interval between two difficulty adjustments exceeds 60 seconds, the heart rate is very likely to fluctuate in the opposite direction of the expected direction. In this case, the final heart rate is very likely to fail to increase or decrease to the expected heart rate zone, thereby affecting the exercise effect). Finally, the difficulty level recommended by the model is adjusted to increase or decrease the heart rate of the fitness person to the expected heart rate zone. In this way, the heart rate of the fitness person is adjusted to the expected heart rate zone according to the different time periods of the fitness plan, achieving a good exercise effect. The specific steps include the following:

[0062] Step 101, obtaining fitness history log record data.

[0063] In this embodiment, historical exercise data of fitness equipment such as treadmills used by fitness enthusiasts is obtained. The treadmills and other fitness equipment have the function of regularly recording (for example, every 5 seconds) the initial difficulty, initial heart rate, time, start time of the time zone corresponding to the continuous increase / decrease of heart rate, end time of the time zone corresponding to the continuous increase / decrease of heart rate, heart rate change in the continuous increase / decrease interval of heart rate, difficulty change in the continuous increase / decrease interval of heart rate, the number of times the fitness equipment adjusts the difficulty level in the continuous increase / decrease interval, etc. of each interval of continuous heart rate increase or continuous decrease, and does not involve the privacy information of the fitness enthusiasts, such as the name and contact information.

[0064] Step 102, pre-processing the fitness history log record data, extracting feature data from the processed data, and establishing a sample set.

[0065] In this embodiment, since the fitness history data provided are all in the form of logs, tabular data (Tabular Data) is extracted from the fitness logs and missing data is filled and invalid data is filtered. Some fitness users' data are randomly selected from the logs, and a data analysis and display program written based on a data analysis toolkit and a visualization toolkit is used to visualize the data and make detailed observations to check the changes in heart rate as the difficulty of the fitness equipment changes over time. Some extreme data that need to be filtered or the characteristics of noise data are found, so as to increase the targeted processing program to filter the data again, and then interval quantization, normalization, and BOX-COX transformation are used to convert the original data into standard normal distribution data, and then the correlation between data items is analyzed using tools such as correlation analysis heat maps. The initial feature data items and target data items are determined according to the feature screening and improvement methods such as data correlation analysis and feature interaction and the actual needs of the application of this technical solution. The embedded method (feature selection is used as part of the model training process, and the best combination of features is fed back through the accuracy of the model training results) is used to select features, and the feature values ​​(Feature) and label values ​​(Label / Target) are tentatively selected as the independent variable (X) vector data and the dependent variable (Y) vector data for training the machine learning model (M can be regarded as a complex function or function combination that the machine learning model needs to fit through training): Y = M (X)

[0066] After using the embedded method of feature selection to try the best combination of feature data items many times, the best feature value combination is determined to be time, the change in heart rate in the interval of continuous increase or decrease in heart rate (i.e., the final value minus the initial value), the number of times the fitness equipment adjusts the difficulty level in this interval, and the label value is the change in the difficulty level in this interval (i.e., the final value minus the initial value), which is used as the data for model training and testing. The main basis for the selection of feature combinations here is not only the comparison of the training model later, but also the following information found after checking the different fitness log data of multiple different fitness people:

[0067] 1) There is no direct linear correlation between the heart rate value and the difficulty level of the fitness person during the fitness process, but is in a many-to-many state with no corresponding rules, such as Figure 4 Shown:

[0068] 2) Heart rate does not simply increase / decrease with the increase / decrease of the difficulty of fitness equipment, nor can it increase the heart rate from a lower range to a higher range by increasing the difficulty from a smaller level to a larger level at one time. If the total difficulty level is 10, it is impossible to increase the heart rate from the moderate activity zone to the maximum oxygen uptake zone by increasing the difficulty level from 1 to 10 at one time. Instead, it is necessary to increase the difficulty multiple times in succession, with the time interval between each increase in difficulty not exceeding 30-60 seconds, so that the heart rate can be gradually increased. Continuously reducing the difficulty level to reduce the heart rate is not so regular, and there is a large lag reaction, but in the second half of the time zone, it will continue to decrease according to a similar pattern, such as Figure 5 , Figure 6 , Figure 7 As shown:

[0069] Step 103, using the sample set to train the extreme gradient boosting decision tree to build a fitness guidance model.

[0070] In this embodiment, since the extreme gradient boosting decision tree has a relatively strong fitting ability and can handle classification problems, the present invention combines and uses multiple decision tree classifier base models in a certain order. The base models are dependent on each other. When each subsequent base model is added to the integration, the existing decision tree classification model is used as the basis to use gradient descent to reduce the fitting error of the integrated model on the training data set (specifically, the output value of the loss function becomes smaller and smaller), thereby achieving an improvement in the comprehensive accuracy of the existing integrated model, thereby continuously improving the accuracy of the updated integrated model. The final prediction result of the integrated model is a combination of the prediction results of multiple classifiers, making the overall classification ability stronger.

[0071] Regarding several key algorithmic aspects of the extreme gradient boosting decision tree model, the core integrated algorithm ideas are as follows:

[0072]

[0073]

[0074]

[0075] …

[0076]

[0077] in represents the tth iteration of the ith sample, is the prediction result of the i-th sample after the t-th iteration, f t (x i ) is the prediction result of the tth tree, is the prediction result of the t-1th tree, and so on.

[0078] The ensemble model initially starts with a prediction constant, and each time a new base model (a single decision tree) is added, a new fitting function f is added. (x) Fit the residuals of the previous predictions. When the model is trained to round t, the number of decision trees as the base model increases to t. The score of a sample (in the form of a feature vector) is predicted. According to the value of the sample's feature vector, it will fall into a corresponding leaf node in each tree. Each leaf node corresponds to a score. The scores corresponding to each tree are added up according to certain weights to get the predicted value (target value) of the sample.

[0079] According to the above algorithm, the loss function of the integrated model is obtained as follows:

[0080]

[0081] in represents the loss function of sample i, Ω(f t ) is the regularization term.

[0082] According to Taylor's complete expansion

[0083]

[0084] The Taylor second-order expansion of f(x+Δx) at point x is approximately

[0085]

[0086] According to the above formula, the model f of the tth tree on the right side of the loss function L t (x i ) corresponds to Δx, Then the corresponding value is x. The right side of the loss function is approximately expanded and simplified and the constant is added to get:

[0087]

[0088] in I is the loss function of a single tree, and f(x) is the fitting function of a single tree.

[0089] The node splitting algorithm used in this scheme when building (growing) a single decision tree is the greedy method:

[0090]

[0091] In the above algorithm, I is the node sample set, d is the feature dimension, the output is the optimal split, G is the gain, H is the gradient, the subscript L represents the left child node, the subscript R represents the right child node, sorted(I, b y x jk ) means sorting the values ​​of all samples contained in this node under feature k. Indicates the selection of the maximum gain. The two for loops in the algorithm traverse each feature k = 1, 2, ..., m, sort and split the values ​​of all samples under each feature, calculate the gain after splitting, select the feature with the largest gain after splitting, and use this feature as the splitting point to split the tree.

[0092] The CSV format data converted from historical log data is read in using the Pandas toolkit and divided into 5 groups of equal data using the 5-fold cross-validation method. One group is selected as the validation test data in each iteration, and the other four groups are used as training data sets to train the extreme gradient boosting decision tree model to optimize the model prediction accuracy. Regarding the main hyperparameter settings of the model, the experimental hyperparameter search method used in the previous model training showed that the model achieved the best accuracy when the learning rate was 0.1, the maximum depth of the tree did not exceed 10, the weight threshold of the split node was 1, and the number of training rounds did not exceed 80. In addition, the number of categories is set according to the actual difficulty level of the fitness equipment. If the difficulty of the fitness equipment is only 10 levels, then the number of categories is set to 19 (because the direct result of the model prediction output is the change in the difficulty level, the value range is between -9 and 9, but the category cannot be a negative number, so the category is 0-18).

[0093] After the model training and testing are completed and the accuracy is confirmed to be the best on the existing data, the model is exported as a model data file (containing the structure of multiple trees and weights and other data) and deployed to the specified location on the server where the web service and model inference package program have been deployed.

[0094] Step 104, import the target user's information to be measured into the fitness guidance model, and output the fitness guidance information corresponding to the target user, wherein the fitness guidance information is the intensity level that the fitness equipment should be set to in each time period so that the exerciser's heart rate reaches the adjustment value of the corresponding predetermined heart rate zone.

[0095] In this embodiment, the embedded application in the fitness device complies with the specification of using the HTTP protocol to interact with the inference web service. After pre-setting the time periods during the fitness process and the expected heart rate zones corresponding to each time period, the target user's information to be tested is imported into the fitness guidance model, and the intensity level that the fitness device should be set to is output so that the exerciser's heart rate reaches the adjustment value of the predetermined heart rate zone corresponding to each time period.

[0096] In one embodiment, the preprocessing includes filling missing data and filtering invalid data.

[0097] In this embodiment, useful data in the log data is parsed out, and converted into CSV format data after filling, filtering and other cleaning processes using a program. The principle of filtering data here is:

[0098] 1) The data with inconsistent changes in heart rate (HR) and intensity level (Intensity Level) due to inaccurate heart rate sensors or improper wearing of the fitness equipment by the fitness trainer are considered invalid data and need to be filtered out, such as Figure 8 As shown in the figure: the difficulty level changes again within 30 seconds after the change. The difficulty level change during this period has no effect on the heart rate and needs to be filtered out, such as Fig. 9 As shown:

[0099] 2) When the difficulty level remains unchanged for a long time, the data where the heart rate fluctuates without a certain upward or downward trend is filtered out. This is not only unhelpful for our study of the relationship between increasing / decreasing the difficulty level and increasing / decreasing the heart rate, but also increases invalid data, such as Fig.10 As shown;

[0100] 3) The heart rate zone values ​​in the fitness program that are out of the range [1-5] are considered invalid data and need to be filtered out, as shown below:

[0101]

[0102] The time after cleaning and the corresponding difficulty level and heart rate change trend are as follows Fig.11 As shown, extract features and target data from the cleaned data and save them in CSV format:

[0103] Features=(start_time,end_time,delta_hr,scale_times)

[0104] Target = (delta_intensity)

[0105] here:

[0106] start_time is the starting time of the corresponding time zone for the continuous increase / decrease of heart rate.

[0107] end_time is the end time of the corresponding time zone of continuous increase / decrease of heart rate.

[0108] delta_hr is the heart rate change in the heart rate continuous increase / decrease interval (i.e. the final value minus the initial value),

[0109] delta_intensity is the difficulty change in the heart rate continuous increase / decrease interval (i.e. the final value minus the initial value),

[0110] scale_times is the number of times the fitness equipment adjusts the difficulty level within this interval.

[0111] The specific data examples are shown in the following table:

[0112]

[0113] In one embodiment, the method includes the following steps: encapsulating the fitness guidance model into an inference engine to provide a web service.

[0114] In this embodiment, after the model is trained and tested to obtain the best accuracy, the model data (including the composition structure of the entire decision tree, each bifurcation threshold and weight parameter on the tree) is exported into a model data file for storage, an inference engine that encapsulates the model is developed, and a web service that supports concurrent access is developed and implemented. The web service loads the model data file to the inference engine when it is started. Whenever an HTTP request call is received from the client software deployed on a fitness device such as a treadmill, the input data of the calling model is parsed (based on the start time and end time of the time period corresponding to the next heart rate zone in the fitness plan, the current difficulty level of the fitness device, the number of difficulty changes and adjustments of the fitness plan, the current heart rate value, and the target heart rate value to be increased / lowered (i.e., the median heart rate of the target heart rate zone)) and used to call the model inference engine to obtain the final value of the difficulty level to be adjusted, and return it to the client on the fitness device in the form of HTTP response data. After the client receives the difficulty level value recommended by the model, it adjusts the difficulty once every 30 seconds according to the number of difficulty level changes specified in the fitness plan, and continuously adjusts the number of fitness plans to reach the difficulty level recommended by the model.

[0115] In one embodiment, the steps include: receiving a remote call inference engine request based on the http protocol sent by an application; obtaining the heart rate data information and fitness equipment status in the request; using the inference engine to infer the user's heart rate data information and fitness equipment status, and returning the inferred fitness guidance information.

[0116] In one embodiment, a fitness guidance system is provided, including a database server for recording fitness log data and an inference server deployed with a web service for providing inference service calls and an environment for running a fitness guidance model. The database and the inference server may also share a server to save costs. The inference server includes a processor and a memory for storing processor executable instructions, the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the processor implements the following steps when executing a computer program: obtaining fitness history log record data; preprocessing the fitness history log record data, extracting feature data from the processed data, and establishing a sample set; using the sample set to train an extreme gradient boosting decision tree to construct a fitness guidance model; importing the target user's information to be tested into the fitness guidance model, and outputting the fitness guidance information corresponding to the target user, wherein the fitness guidance information is the intensity level that the fitness equipment should set to make the exerciser's heart rate reach the adjustment value of the predetermined heart rate zone corresponding to each time period after presetting the time period during the fitness process and the expected heart rate zone corresponding to each time period.

[0117] The fitness equipment is equipped with an embedded application program, which has the function of using wireless network networking. When the user is exercising, this data is sent to the log service deployed on the server in the form of HTTP request call to record the exercise history data of the fitness user, and then it will continue to be used for training to improve the model accuracy and test the model. In addition, before the heart rate zone needs to change, the application program on the fitness device sends the input data mentioned in the previous section of the model to the web reasoning service in the form of HTTP request call, and automatically adjusts the equipment difficulty according to the recommended difficulty level obtained by the returned web reasoning service call model reasoning engine. The interval time range of each two fitness equipment adjustments is 30-60 seconds. The log record data in the log service includes the fitness person number, fitness equipment type, initial difficulty of each heart rate continuous rise or continuous decline interval, initial heart rate, time, start time of the corresponding time zone of the heart rate continuous rise / decline, end time of the corresponding time zone of the heart rate continuous rise / decline, heart rate change in the heart rate continuous rise / decline interval, difficulty change in the heart rate continuous rise / decline interval, and the number of times the fitness equipment adjusts the difficulty level in the continuous rise / decline interval.

[0118] In one embodiment, the model trained with the fitness history record data of most people can also be embedded in the fitness equipment as a universal fitness guidance model that conforms to the basic conditions of most people. The fitness equipment needs to have an embedded hardware and software environment for running the model and encapsulating the software. Because it is used on a single machine and there is no concurrent call, it is expected to run on a low-end embedded motherboard with low power consumption and insufficient hardware resources such as CPU and memory.

[0119] In one embodiment, a client is also included, which is used to remotely interact with the server to obtain historical fitness records, fitness guidance information, corporate promotion information, etc. The client can specifically be a personal computer, PAD, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.

[0120] The above description is only a preferred implementation of a fitness guidance method and system disclosed in the present invention, and is not intended to limit the protection scope of the embodiments of this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of this specification shall be included in the protection scope of the embodiments of this specification.

[0121] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0122] Each embodiment in the embodiments of this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

Claims

1. A fitness guidance method, characterized in that: The steps include: Get fitness history log record data; Preprocess the fitness history log record data, extract feature data from the processed data, and establish a sample set, wherein the feature data at least includes the fitness person number, age, fitness equipment type, initial difficulty of each heart rate continuous increase or continuous decrease interval, initial heart rate, time, start time of the time zone corresponding to the heart rate continuous increase / decrease, end time of the time zone corresponding to the heart rate continuous increase / decrease, heart rate change in the heart rate continuous increase / decrease interval, difficulty change in the heart rate continuous increase / decrease interval, and the number of times the fitness equipment adjusts the difficulty level in the continuous increase / decrease interval; The sample set is used to train the extreme gradient boosting decision tree and build a fitness guidance model; The target user's information to be tested is imported into the fitness guidance model, and the fitness guidance information corresponding to the target user is output. The fitness guidance information is the intensity level that the fitness equipment should be set to in each time period so that the exerciser's heart rate reaches the adjustment value of the corresponding predetermined heart rate zone. The loss function of the fitness guidance model is: in represents the loss function of sample i, Ω(f t ) is the regularization term, According to Taylor's complete expansion The Taylor second-order expansion of f(x+Δx) at point x is approximately According to the above formula, the model f of the tth tree on the right side of the loss function L t (x i ) corresponds to Δx, Then the corresponding value is x, and the right side of the loss function L is approximately expanded and simplified and the constant is added to become: in l is the loss function of a single tree, and f(x) is the fitting function of a single tree.

2. A fitness guidance method according to claim 1, characterized in that: The preprocessing includes first filling in missing data and filtering invalid, extreme and noise data; then using interval quantization, normalization and BOX-COX transformation to convert the original data into normal distribution data.

3. A fitness guidance method according to claim 1, characterized in that: The method also includes the following steps: using a K-fold crossover method to verify the accuracy of the fitness guidance model.

4. A fitness guidance method according to claim 1, characterized in that: The node splitting algorithm used when constructing a single tree is the greedy method.

5. A fitness guidance method according to claim 1, characterized in that: The steps include: The fitness guidance model is encapsulated as an inference engine to provide web services.

6. A fitness guidance method according to claim 5, characterized in that: The steps include: Receive a remote inference engine call request based on the http protocol sent by the application; Get the heart rate data information and fitness equipment status in the request; The user's heart rate data information and fitness equipment status are inferred using the inference engine, and the inferred fitness guidance information is returned.

7. A fitness guidance system, characterized in that: comprising a processor and a memory for storing instructions executable by the processor, and at least one fitness device, wherein When the processor executes the instructions, the method according to any one of claims 1 to 6 is implemented; The fitness equipment is provided with an embedded application, which provides log recording data and interacts with a server through the application, and adjusts the difficulty level setting of the fitness equipment according to the interaction result. The interval time range between each two fitness equipment adjustments is 30-60 seconds. The log recording data includes the fitness person number, age, fitness equipment type, initial difficulty of each heart rate continuous increase or continuous decrease interval, initial heart rate, time, start time of the time zone corresponding to the continuous increase / decrease of heart rate, end time of the time zone corresponding to the continuous increase / decrease of heart rate, heart rate change in the heart rate continuous increase / decrease interval, difficulty change in the heart rate continuous increase / decrease interval, and the number of times the fitness equipment adjusts the difficulty level in the continuous increase / decrease interval.

8. A fitness guidance system according to claim 7, characterized in that: It also includes a client, which is used to remotely interact with the processor to obtain historical fitness records, fitness guidance information and corporate promotion information.