A step counting algorithm based on decision tree
Through the decision tree-based step calculation algorithm, two models are used to identify and correct step calculation points, the problem of poor negative scenario processing in the existing technology is solved, the accuracy and efficiency of the step calculation algorithm are improved, and labor costs are reduced.
Patent Information
- Application Number
- CN202410642025.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-05-23
AI Technical Summary
The existing step calculation algorithms require manual writing of a large number of judgment conditions when dealing with negative scenarios, resulting in high cost, increased complexity, and poor recognition effect, which cannot meet users' step calculation needs.
Using a step calculation algorithm based on a decision tree, two models are established by obtaining device data: Model one is used to identify step calculation points, and Model two is used to correct the recognition results of model one, reduce step calculation errors in negative scenarios, and improve step calculation algorithm accuracy.
By collecting a large amount of positive and negative step counting scene data, designing two decision tree models, identifying step counting points and correcting errors, the accuracy and efficiency of step counting algorithms are improved and labor costs are reduced.
Smart Images

Figure CN118427728B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of step counting, and in particular is a step counting algorithm based on a decision tree. Background Art
[0002] With the improvement of people's health awareness and the popularization of smart devices, pedometer systems have received widespread attention as health management tools. Pedometer systems monitor users' walking or running and other exercise data, providing users with information such as step statistics, exercise trajectory, energy consumption, etc., to help users understand their exercise status and health status.
[0003] However, with the advent of the information age, various data sources are continuously generated, and the data has gradually become diversified. Although the traditional pedometer algorithm can identify the step count, for negative scenarios, it is necessary to manually write a large number of judgment conditions and adjust the corresponding parameters to make up for the shortcomings of the algorithm. This not only greatly increases the labor cost, but also makes the pedometer algorithm more complicated and difficult to explain.
[0004] For example, the Chinese patent application with publication number CN106323327A discloses a step counting system, which includes a pedometer and a mobile electronic device. The pedometer is set on clothing. The pedometer includes a sensor connected to a microcontroller to sense the number of steps achieved by the user walking or running; a battery connected to the microcontroller to supply power; a first transmission unit connected to the microcontroller; the microcontroller is used to obtain the number of steps achieved and transmit the number of steps achieved through the first transmission unit; the mobile electronic device includes a second transmission unit connected to the processor and the first transmission unit respectively to receive the number of steps achieved transmitted by the first transmission unit; a display screen connected to the processor; the processor is used to obtain the number of steps achieved and display the number of steps achieved through the display screen; a storage device connected to the processor to store a step counting application. Although the system can meet the step counting requirements, its processing effect on negative scenes cannot meet the satisfactory requirements.
[0005] Based on this, the present invention provides a step counting algorithm based on a decision tree. Summary of the invention
[0006] In order to solve the problems existing in the above scheme, the present invention provides a step counting algorithm based on a decision tree.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] A step counting algorithm based on a decision tree, including:
[0009] Step 1: Acquire device data, and establish Model 1 and Model 2 according to the device data; Model 1 is used to identify step counting points; Model 2 is used to correct the recognition result of Model 1;
[0010] Furthermore, the method for establishing Model 1 and Model 2 includes:
[0011] Step SA1: Acquire the three-axis original acceleration data of the device in each direction to form sample data;
[0012] Step SA2: Clean the sample data into a preset standard format, and manually mark the corresponding step counting points by marking the peaks of the step counting waveform;
[0013] Step SA3: Read the marked acceleration data;
[0014] Step SA4: construct features and perform corresponding feature conversion to obtain corresponding feature conversion data;
[0015] Step SA5: Screen the feature conversion data to obtain the training data corresponding to model 1 and model 2 respectively. The training data of model 1 only screens the positive sample data and does not add the negative sample data;
[0016] Step SA6: Perform sample balancing on the training data of model 1 and model 2 respectively;
[0017] Step SA7: establishing corresponding Model 1 and Model 2 based on the training data of Model 1 and Model 2;
[0018] Step SA8: Evaluate and optimize Model 1 and Model 2. If the evaluation fails, return to Step SA6.
[0019] Furthermore, for the establishment of Model 1 and Model 2 in step SA7, the selected model is the decision tree, and the evaluation criterion is the lowest Gini coefficient; the Gini coefficient formula is:
[0020] ,
[0021] Among them, p is the proportion of a certain category in the current partitioned set. When p=0.5, the Gini coefficient reaches the maximum value of 0.5, and when p=0, the minimum value of the Gini coefficient is 0; k is the binary category number, k={1, 2}; p k is the probability of a certain category appearing; p A is the probability of occurrence of category A; p B is the probability of category B appearing; Gini is the Gini coefficient.
[0022] Further, the establishment process is:
[0023] Step SC1: Train the dataset D, assuming the probability of the first category is p;
[0024] Step SC2: traverse each feature Ai in the attribute set and calculate all the Gini coefficients under the feature set, select the feature A' and the split value a' that minimize the Gini coefficient as the optimal feature and the optimal subspace, the feature A' and the split value a' divide the original data set into two parts, and establish the left and right child nodes of the current data node, where the left node is the data set D1' and the right node is the data set D2';
[0025] Step SC3: Starting from the root node, the generated child nodes are recursively called according to steps SC1 and SC2 until no child nodes can be generated, and the original decision tree T is generated according to the nodes.
[0026] Step 2: Obtain the step counting data collected by the device, and analyze the step counting data through model 1 to obtain the corresponding step counting result;
[0027] Step three: Correct the step counting result by using the model 2, and display the corrected step counting result.
[0028] Furthermore, the method also includes step 4: obtaining the model 2 correction record of each device user in real time, and determining the target record based on the correction record; optimizing and evaluating the target record to obtain the step counting optimization evaluation result of each user, and the step counting optimization evaluation result includes those that need to be optimized and those that do not need to be optimized.
[0029] Furthermore, the method for optimizing and evaluating the target record includes:
[0030] Identify each target scene corresponding to the target record; and count the scene values corresponding to each of the target scenes;
[0031] Acquire error feedback data, and count the step counting error rate of each target scene according to the error feedback data;
[0032] The scene value is marked as CRi, i represents the corresponding target scene, i=1, 2, ..., n, n is a positive integer; the step counting error rate is marked as μi;
[0033] According to the formula Calculate the corresponding record evaluation value;
[0034] Where: PR represents the recorded evaluation value;
[0035] When the recorded evaluation value is greater than the threshold value X1, the step counting optimization evaluation result is that optimization is required;
[0036] When the recorded evaluation value is not greater than the threshold value X1, the step counting optimization evaluation result is that no optimization is required.
[0037] Further, it further includes Step Five: obtaining error feedback data in real time; identifying error features corresponding to the error feedback data, determining the error cause based on the error features, and performing step counting optimization according to the error cause.
[0038] Further, the method for performing step counting optimization according to the error cause includes:
[0039] Establish an optimization judgment model, perform optimization judgment on the error cause through the optimization judgment model, and determine the corresponding optimization type, where the optimization type includes a model optimization type and a device optimization type;
[0040] When the optimization type is model optimization, perform model optimization manually;
[0041] When the optimization type is device optimization, determine each alternative solution, screen each alternative solution, determine the target optimization solution, and perform device optimization according to the target optimization solution.
[0042] Further, the expression of the optimization judgment model is ;
[0043] In the formula: s is the input data; the output data is the type value 1 or 0;
[0044] When the type value is 1, it means the optimization type is the model optimization type;
[0045] When the type value is 0, it means the optimization type is the device optimization type.
[0046] Further, the method for screening each alternative solution includes:
[0047] Determine the implementation cost of each alternative solution; perform target impact assessment on each alternative solution to determine the target impact value corresponding to each alternative solution;
[0048] Calculate the corresponding screening value according to the formula PK = b1×YB - b2×CB;
[0049] In the formula: PK is the screening value; b1 and b2 are both proportionality coefficients, and the value range is 0 < b1 ≤ 1, 0 < b2 ≤ 1; YB is the target impact value; CB is the implementation cost;
[0050] Sort each alternative solution in descending order of the screening value to obtain a recommended list, and the management personnel determine the target optimization solution according to the recommended list.
[0051] Compared with the prior art, the beneficial effects of the present invention are:
[0052] The present invention collects a large amount of positive and negative step counting scene data, then marks them and sends them to the model for training. In order to count steps more accurately, the present invention designs two decision tree models; first, the data is divided by model one to identify all possible step counting points. Since the present invention only uses peak data when training model one, when the final model obtains the corresponding result, the data that is not a peak is directly judged as not counting steps. The role of model one is to allow it to identify the step counting points of slow walking and rear arm swing as much as possible, even if a large number of steps are identified for negative scenes. Then, the recognition results of model one are used as the basis for training model two. The role of model two is to correct the error of negative scene step counting in model one through a decision tree, and try to reduce the number of negative scene step counting points as much as possible without affecting the positive sample step counting results, thereby improving the accuracy of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 is a flow chart of the method of the present invention;
[0055] Figure 2 An example diagram is constructed for the model of the present invention. DETAILED DESCRIPTION
[0056] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] like Figure 1 to Figure 2 As shown, a step counting algorithm based on a decision tree includes:
[0058] Step one: Acquire device data, which includes three-axis original acceleration data in various directions, application scenario data and other data that may be applied to the present invention; establish model one and model two according to the device data; the model one is used to identify step points; the model two is used to correct the recognition result of model one, that is, to correct the error of negative scene step counting in model one, and try to reduce the number of negative scene step points as much as possible without affecting the positive sample step counting result, thereby improving the accuracy of the present invention.
[0059] The establishment methods of Model 1 and Model 2 include:
[0060] Step SA1: Data collection: Acquire the three-axis raw acceleration data of the device in all directions through sensors.
[0061] Step SA2: Data cleaning and labeling: Clean the sample data into a standard format and manually label the corresponding step counting points by labeling on the peaks of the step counting waveform.
[0062] Step SA3: Data reading: reading the marked acceleration data;
[0063] Step SA4: Feature construction: Based on data analysis, the following features of step counting are constructed:
[0064] (1) Through observation of the data: we constructed features such as whether the current point is a peak greater than the five points on the left and right sides, the extreme value of acceleration within two seconds, and the interquartile range of the peak value.
[0065] (2) Through time series analysis of the statistical domain: features such as maximum value, mean, variance, skewness, kurtosis and root mean square are constructed.
[0066] (3) Through time series analysis in the time domain: features such as differential mean, differential absolute value, differential median, and peak-to-trough spacing were constructed.
[0067] By performing feature expansion on the above features, in order to prevent the data length from being too long, the present invention only constructs a set of vectors based on the 5, 10, or even 50 points before and after the current point and performs feature conversion, thereby constructing a total of more than 200 dimensional features.
[0068] Step SA5: Data screening: Screen the data that have been feature-converted. Since the step counting points of the present invention are marked on the peaks, the present invention only judges the peak points and screens out the peak data. This will not only reduce the complexity of the calculation, but also increase the accuracy of model recognition. The data of model one in the present invention only screens the positive sample data, and does not add negative sample data. The training data in model two is the data that is identified as positive samples after all sample data are identified by model one.
[0069] Step SA6: Balanced samples: If the number of positive and negative sample data is too different, the model will recognize all the data as one type of sample during the recognition process, and the result will have a very good recognition rate, which will cause errors in the model. Therefore, the positive and negative sample data are balanced by supplementing or deleting the data, and the number of positive and negative sample data is kept consistent as much as possible. In this invention, since the back swing of slow walking or normal walking of some people is not obvious, in order to prevent these data points from being lost during model training, we also increase the number of back swing samples, so that the back swing accounts for about half of the positive sample data.
[0070] Step SA7: Model construction and feature division: The model selected this time is the decision tree, and the evaluation criterion is the Gini coefficient. Since the step counting algorithm is a binary classification, the Gini coefficient formula for the binary classification is:
[0071] ,
[0072] Where p is the proportion of a certain category in the current set after division. When p=0.5, the Gini coefficient reaches the maximum value of 0.5 (the set is the most chaotic), and when p=0, the Gini coefficient is the minimum value of 0 (the set is the purest). Therefore, the goal of classification is to minimize the Gini value; k is the binary category number, k={1, 2}; p k is the probability of a certain category appearing; p A is the probability of occurrence of category A; p B is the probability of the B category appearing; because it is a binary classification, so, p A +p B =1, which is the last formula 2p(1-p).
[0073] like Figure 2 As shown, the model construction steps are as follows:
[0074] (1) Train the dataset D, assuming that the probability of the first category is p;
[0075] (2) Traverse each feature Ai in the attribute set and calculate the Gini coefficient of all possible values under the feature set. Select the feature A' and the split value a' that minimize the Gini coefficient as the optimal feature and the optimal subspace. The feature A' and the split value a' divide the original data set into two parts. At the same time, establish the left and right child nodes of the current data node, where the left node is the data set D1' and the right node is the data set D2'.
[0076] (3) Starting from the root node, the generated child nodes are recursively called according to steps 1 and 2, and child nodes are continued to be generated until no child nodes can be generated. The original decision tree T is generated according to the nodes.
[0077] Step SA8: Model evaluation and optimization: Since the present invention has a model 2 to correct the error, for model 1, the step counting result of the positive sample must be as high as possible from the actual step count; otherwise, it needs to be optimized and go back to step 6 for parameter adjustment and training; for model 2, the validation set samples are tested and the step counting accuracy is obtained. If the error is within 5%, the model can be used, otherwise it needs to be retrained.
[0078] Step 2: Obtain the step counting data collected by the device, analyze the step counting data obtained through model 1, and obtain the corresponding step counting results;
[0079] Step 3: Correct the step counting result obtained by model 1 through model 2, and display the corrected step counting result.
[0080] The present invention collects a large amount of positive and negative step counting scene data, then marks them and sends them to the model for training. In order to count steps more accurately, the present invention designs two decision tree models; first, the data is divided by model one to identify all possible step counting points. Since the present invention only uses peak data when training model one, when the final model obtains the corresponding result, the data that is not a peak is directly judged as not counting steps. The role of model one is to allow it to identify the step counting points of slow walking and rear arm swing as much as possible, even if a large number of steps are identified for negative scenes. Then, the recognition results of model one are used as the basis for training model two. The role of model two is to correct the error of negative scene step counting in model one through a decision tree, and try to reduce the number of negative scene step counting points as much as possible without affecting the positive sample step counting results, thereby improving the accuracy of the present invention.
[0081] In one embodiment, a large amount of correction data will be obtained by continuously running Model 1 and Model 2 on many devices, but the correction data has not been fully utilized in the above embodiment. If the role of the correction data can be fully explored, the pedometer function of the current device will be greatly optimized; based on this, this embodiment is proposed.
[0082] It also includes step four: obtaining the model two correction record of each device user in real time, identifying which of the correction records are caused by negative scenarios, and marking the corresponding correction records as target records; optimizing and evaluating the target records to obtain the step optimization evaluation results of each user, and the step optimization evaluation results include those that need optimization and those that do not need optimization.
[0083] By analyzing the user's target records, the user's actual step counting situation is determined. Due to differences in users and differences in accuracy for different negative scenarios, the actual step counting error rate of some users may exceed the preset standard. At this time, the assessment needs to be optimized. The specific optimization method is developed and set by the platform to ensure the user experience of different users.
[0084] Methods for optimizing the evaluation of target records include:
[0085] Identify the negative scenes corresponding to the target record and mark them as target scenes; count the time proportion of each target scene in the user's step counting time and mark them as scene values;
[0086] Get error feedback data, which is data related to step counting errors collected through various means such as user feedback; it refers to all device users;
[0087] The step counting error rate of each target scene is calculated based on the error feedback data, and is specifically determined based on the probability and proportion of each target scene and the training process data of Model 1 and Model 2;
[0088] The scene value is marked as CRi, i represents the corresponding target scene, i=1, 2, ..., n, n is a positive integer; the step counting error rate is marked as μi;
[0089] According to the formula Calculate the corresponding record evaluation value;
[0090] Where: PR represents the recorded evaluation value;
[0091] When the recorded evaluation value is greater than the threshold value X1, the step counting optimization evaluation result is that optimization is required;
[0092] When the recorded evaluation value is not greater than the threshold value X1, the step counting optimization evaluation result is that no optimization is required.
[0093] It also includes step five: obtaining error feedback data in real time; the error feedback data is the relevant data of step counting errors collected through various methods such as user feedback; analyzing the error feedback data, determining the cause of the error, and optimizing the step counting based on the obtained error cause.
[0094] How to determine the cause of the error:
[0095] Identify the corresponding error features in the error feedback data, such as the circumstances under which step counting errors occur, such as scenario reasons (taking the elevator, taking public transportation), equipment failure, network problems and other corresponding phenomenon characteristics, and make corresponding statistics in the error feedback data; illustratively, the error feature is incorrect step counting when taking the elevator; determine the corresponding error cause based on the identified error feature; if the error feature is incorrect step counting when taking the elevator, the error cause may be collection, program analysis and other reasons leading to step counting errors when taking the elevator; perform corresponding matching and sorting based on the various existing error features and error causes, and establish a cause library; perform subsequent matching, and then determine the error cause based on the collection and analysis process of the current device.
[0096] Methods for optimizing step counting based on the cause of the error include:
[0097] Optimize the cause of the error and determine the corresponding optimization type. The optimization type includes model optimization type and equipment optimization type. The judgment is made based on whether the cause of the error can be solved after optimizing Model 2 or Model 1. If it can be solved, it is considered as an optimization type. If it cannot be solved, it is considered as an equipment optimization type. That is, the acquisition sensor of the equipment needs to be optimized first, and then Model 1 and Model 2 need to be adjusted to solve the cause of the error. According to the processing range of Model 1 and Model 2, the simulation analysis can be combined with the cause library to determine the corresponding model optimization range, and then establish the corresponding optimization judgment model. The expression is: ; In the formula: s is the input data, that is, the cause of the error; the output data is a type value of 1 or 0, the type value of 1 indicates the model optimization type; the model value of 0 indicates the equipment optimization type; the corresponding optimization type is determined by judging the optimization judgment model.
[0098] When the optimization type is model optimization, the corresponding model 1 or model 2 is optimized manually;
[0099] When the optimization type is equipment optimization, various solutions that can solve the cause of the error are determined, marked as candidate solutions, and solutions are set manually or retrieved and set using existing artificial intelligence technology; each candidate solution is screened, the target optimization solution is determined, and equipment optimization is performed according to the target optimization solution.
[0100] Regarding the evaluation and screening of the candidate solutions, in one embodiment, the evaluation may be performed in an existing manner, such as performing a manual evaluation simultaneously when the candidate solutions are being determined.
[0101] In another embodiment, the candidate solutions may be screened in the following manner, including:
[0102] Determine the implementation cost of each candidate solution; conduct a target impact assessment on each candidate solution and determine the target impact value corresponding to each candidate solution; the target impact value is based on the platform's assessment of the optimization goal of the device or system;
[0103] Exemplarily, the goal is system version update. According to the requirements of system version update, the application difficulty of each candidate solution is determined and set. For example, if the application cannot be carried out because corresponding components need to be added, the target impact value is set to the minimum of 1. For others, the corresponding target impact value is set according to the size of the optimization change to the original system. The target impact value with the smallest change impact is 100; others are set according to the corresponding difference size, and the interpolation method is used for setting; for example, the middle value is 50; they are sorted according to the possible impacts, and then the corresponding target impact values are set; subsequently, according to the actual situation of each candidate solution, the corresponding target impact values are determined; if the goal is equipment replacement, the actual situation is different, and components can be adjusted, etc. At this time, the target impact value is set based on the effect of the candidate solution. Similarly to the above, the target impact value with the best possible effect is regarded as 100, and so on; the target impact value is determined.
[0104] Mark the obtained implementation cost and target impact value as CB and YB respectively;
[0105] Remove the dimension and take its numerical value for calculation. Calculate the corresponding screening value according to the formula PK = b1×YB - b2×CB;
[0106] In the formula: PK is the screening value; b1 and b2 are both proportionality coefficients, and the value range is 0 < b1 ≤ 1, 0 < b2 ≤ 1; YB is the target impact value; CB is the implementation cost;
[0107] Sort each candidate solution in descending order of the screening value to obtain a recommended list, and the management personnel determine the target optimization solution according to the recommended list.
[0108] The above formulas are all calculated by removing the dimension and taking its numerical value. The formula is obtained by collecting a large amount of data for software simulation to get a formula closest to the actual situation. The preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained by a large amount of data simulation.
[0109] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusively, so that a process, device, article or method including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, device, article or method. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, device, article or method including that element.
[0110] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, is also included in the patent protection scope of the present invention.
[0111] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0112] For the convenience of description, the above devices are described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in one or more software and / or hardware. It should be understood by those skilled in the art that the 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 complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0113] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 The functionality specified in one or more boxes.
[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A function specified in a process or multiple boxes.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
Claims
1. A step counting algorithm based on a decision tree, characterized in that: include: Step 1: Acquire device data, and establish Model 1 and Model 2 according to the device data; Model 1 is used to identify step counting points; Model 2 is used to correct the recognition result of Model 1; Step 2: Obtain the step counting data collected by the device, and analyze the step counting data through model 1 to obtain the corresponding step counting result; Step 3: Correcting the step counting result by using the model 2, and displaying the corrected step counting result; The establishment methods of Model 1 and Model 2 include: Step SA1: Acquire the three-axis original acceleration data of the device in each direction to form sample data; Step SA2: Clean the sample data into a preset standard format, and manually mark the corresponding step counting points by marking the peaks of the step counting waveform; Step SA3: Read the marked acceleration data; Step SA4: construct features and perform corresponding feature conversion to obtain corresponding feature conversion data; Step SA5: Screen the feature conversion data to obtain the training data corresponding to model 1 and model 2 respectively. The training data of model 1 only screens the positive sample data and does not add the negative sample data; Step SA6: Perform sample balancing on the training data of model 1 and model 2 respectively; Step SA7: establishing corresponding Model 1 and Model 2 based on the training data of Model 1 and Model 2; Step SA8: Evaluate and optimize Model 1 and Model 2. If the evaluation fails, return to Step SA6. For the establishment of Model 1 and Model 2 in step SA7, the selected model is the decision tree, and the evaluation criterion is the lowest Gini coefficient; the Gini coefficient formula is: ; Among them, p is the proportion of a certain category in the current partitioned set. When p=0.5, the Gini coefficient reaches the maximum value of 0.5, and when p=0, the minimum value of the Gini coefficient is 0; k is the binary category number, k={1, 2}; p k is the probability of a certain category appearing; p A is the probability of occurrence of category A; p B is the probability of the occurrence of category B; Gini is the Gini coefficient; The establishment process is: Step SC1: Train the dataset D, assuming the probability of the first category is p; Step SC2: traverse each feature Ai in the attribute set and calculate all the Gini coefficients under the feature set, select the feature A' and the split value a' that minimize the Gini coefficient as the optimal feature and the optimal subspace, the feature A' and the split value a' divide the original data set into two parts, and establish the left and right child nodes of the current data node, where the left node is the data set D1' and the right node is the data set D2'; Step SC3: Starting from the root node, the generated child nodes are recursively called according to steps SC1 and SC2 until no child nodes can be generated, and the original decision tree is generated according to the nodes.
2. A step counting algorithm based on a decision tree according to claim 1, characterized in that: The step also includes: obtaining the model 2 correction record of each device user in real time, and determining the target record according to the correction record; The target records are optimized and evaluated to obtain step-counting optimization evaluation results for each user, where the step-counting optimization evaluation results include those that need to be optimized and those that do not need to be optimized.
3. A step counting algorithm based on a decision tree according to claim 2, characterized in that: Methods for optimizing the evaluation of target records include: Identify each target scene corresponding to the target record; and count the scene values corresponding to each of the target scenes; Acquire error feedback data, and count the step counting error rate of each target scene according to the error feedback data; The scene value is marked as CRi, i represents the corresponding target scene, i=1, 2, ..., n, n is a positive integer; the step counting error rate is marked as μi; According to the formula Calculate the corresponding record evaluation value; Where: PR represents the recorded evaluation value; When the recorded evaluation value is greater than the threshold X1, the step counting optimization evaluation result is that optimization is required; When the recorded evaluation value is not greater than the threshold X1, the step counting optimization evaluation result is that optimization is not required.
4. A step counting algorithm based on a decision tree according to claim 2, characterized in that: It further includes Step Five: obtaining error feedback data in real time; identifying the error features corresponding to the error feedback data, determining the error cause based on the error features, and performing step counting optimization according to the error cause.
5. A step counting algorithm based on a decision tree according to claim 4, characterized in that: The method for performing step counting optimization according to the error cause includes: establishing an optimization judgment model, performing optimization judgment on the error cause through the optimization judgment model, and determining the corresponding optimization type, where the optimization type includes a model optimization type and a device optimization type; When the optimization type is model optimization, perform model optimization manually; When the optimization type is device optimization, determine each alternative solution, screen each alternative solution, determine the target optimization solution, and perform device optimization according to the target optimization solution.
6. A step counting algorithm based on a decision tree according to claim 5, characterized in that: The expression of the optimization judgment model is: ; In the formula: s is the input data; the output data is the type value 1 or 0; When the type value is 1, it indicates that the optimization type is the model optimization type; When the type value is 0, it indicates that the optimization type is the device optimization type.
7. A step counting algorithm based on a decision tree according to claim 5, characterized in that: The method for screening each alternative solution includes: determining the implementation cost of each alternative solution; performing a target impact assessment on each alternative solution to determine the target impact value corresponding to each alternative solution; calculating the corresponding screening value according to the formula PK = b1×YB - b2×CB; In the formula: PK is the screening value; b1 and b2 are both proportionality coefficients, and the value range is 0 < b1 ≤ 1, 0 < b2 ≤ 1; YB is the target impact value; CB is the implementation cost; Sort each alternative solution in descending order according to the screening value to obtain a recommended list, and the management personnel determine the target optimization solution according to the recommended list.
