Training plan generation method and electronic equipment
By obtaining the characteristics of the exercise route and using the difficulty judgment model to evaluate the route difficulty, a personalized training plan is generated, which solves the problem of route difficulty neglect in the existing technology, and improves the training effect and safety.
Patent Information
- Application Number
- CN202510435073.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, it is difficult to formulate reasonable training plans for different sports routes, and the impact of the difficulty of sports routes on the training plan is ignored.
By obtaining route information, analyzing route characteristics such as orientation angle and altitude changes, the pre-trained difficulty judgment model is used to evaluate route difficulty, and a training plan is generated based on route difficulty.
实现了根据不同路线难度制定合理的训练计划,提高了训练效果,避免运动人员受伤,适应不同类型的运动需求。
Smart Images

Figure CN120280084A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of sports technology, and in particular, to a training plan generation method and an electronic device. Background Art
[0002] With the improvement of people's living standards, people pay more and more attention to the pursuit of health, and more people begin to exercise regularly to pursue physical health. More and more sports have attracted people's attention. For example, sports such as marathons, cross-country running, race walking, and hiking usually have relatively high intensities and require relatively high physical fitness and endurance. Athletes usually need to undergo certain training before they can participate in related sports to avoid physical discomfort and injuries during the exercise process.
[0003] Currently, mainly by collecting the sports information of athletes, such as data on heart rate, blood oxygen, historical training content, etc., and formulating corresponding training plans based on the collected sports information. However, the difficulty of different routes is different, and the more difficult the route, the more training is required. The above-mentioned method of generating training plans only considers the information of the athletes themselves and does not consider the difficulty of the sports route, making it difficult to formulate reasonable training plans for different sports routes. Summary of the Invention
[0004] In view of the above problems, the embodiments of the present application provide a training plan generation method and an electronic device, which are used to solve the problem in the prior art that it is difficult to formulate reasonable training plans for different sports routes.
[0005] According to one aspect of the embodiments of the present application, a training plan generation method is provided. The method includes: obtaining route information, where the route information includes multiple positioning point information; determining route characteristics according to the multiple positioning point information; determining the route difficulty corresponding to the route information according to the route characteristics through a pre-trained difficulty judgment model; and generating a training plan corresponding to the route information according to the route difficulty.
[0006] In an optional manner, the positioning point information includes coordinate data, and the route characteristics include azimuth angle information; determining the route characteristics according to the multiple positioning point information specifically includes: traversing the multiple positioning point information, and determining the azimuth angle according to the coordinate data of the positioning point information to obtain angle data; and counting the number of angle data with an azimuth angle less than a preset angle to obtain azimuth angle information.
[0007] In an alternative approach, traverse multiple positioning point information and determine the azimuth angle based on the coordinate data of the positioning point information to obtain angle data, specifically including: obtaining consecutive first positioning point information, second positioning point information, and third positioning point information from the multiple positioning point information; determining a first coordinate difference based on the coordinate data of the first positioning point information and the coordinate data of the second positioning point information; determining a second coordinate difference based on the coordinate data of the third positioning point information and the coordinate data of the second positioning point information; determining the azimuth angle corresponding to the second positioning point information based on the first coordinate difference and the second coordinate difference to obtain angle data; determining the second positioning point information as the new first positioning point information, determining the third positioning point information as the new second positioning point information, obtaining the next consecutive positioning point information as the new third positioning point information, and jumping to the step of determining the first coordinate difference based on the coordinate data of the first positioning point information and the coordinate data of the second positioning point information until multiple positioning point information is traversed.
[0008] In an alternative approach, the route information includes the direction of movement, the positioning point information includes elevation data, and the route feature includes elevation change information; determining the route feature based on multiple positioning point information specifically includes: traversing multiple positioning point information in the direction of movement and determining the slope type and slope angle based on the elevation data and coordinate data of the positioning point information; determining the elevation change information based on the elevation data, slope type, and slope angle.
[0009] In an alternative approach, traversing multiple positioning point information in the direction of movement and determining the slope type and slope angle based on the elevation data and coordinate data of the positioning point information specifically includes: obtaining two adjacent positioning point information in the direction of movement; calculating the difference between the elevation data of the two adjacent positioning point information to obtain an elevation difference; determining the slope type based on the elevation difference; calculating the distance between the two adjacent positioning points based on the coordinate data of the two adjacent positioning point information to obtain distance information; determining the slope angle based on the elevation difference and the distance information; obtaining the next two adjacent positioning point information in the direction of movement and jumping to the step of calculating the difference between the elevation data of the two adjacent positioning point information to obtain an elevation difference until multiple positioning point information is traversed, where the first positioning point information in the next two adjacent positioning point information is the second positioning point information in the two adjacent positioning point information.
[0010] In an alternative approach, the training process of the difficulty judgment model includes: collecting multiple route training data, where the route training data includes route features; classifying the multiple route training data into multiple preset difficulty levels according to the route features of each route training data through the difficulty judgment model, and determining the loss function according to the classification result; training the difficulty judgment model according to the loss function to generate feature centers corresponding to various difficulty levels.
[0011] In an alternative approach, based on a pre-trained difficulty judgment model, the route difficulty corresponding to the route information is determined according to the route features, which specifically includes: obtaining the feature centers corresponding to multiple difficulty levels generated by the difficulty judgment model; calculating the similarity between the route features and the feature centers corresponding to each difficulty level respectively; and determining the difficulty level corresponding to the feature center with the highest similarity as the route difficulty corresponding to the route information.
[0012] In an alternative approach, a training plan corresponding to the route information is generated according to the route difficulty, which specifically includes: obtaining the adjustment data of the difficulty level corresponding to the route difficulty from a pre-set adjustment data table, where the adjustment data table includes the adjustment data of multiple difficulty levels; obtaining a preset training plan, and adjusting the preset training plan according to the adjustment data to generate a training plan corresponding to the route information.
[0013] In an alternative approach, route information is obtained, which specifically includes: in response to a map display instruction, obtaining map data and controlling a display device to display a map according to the map data, where the map data includes the position information corresponding to each position on the map; in response to a positioning point selection instruction, obtaining position information from the map data according to the positions of multiple positioning points on the map respectively to obtain multiple positioning point information; and generating route information according to the multiple positioning point information.
[0014] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the training plan generation method described in any one of the above.
[0015] In the embodiments of the present application, the path features are analyzed by a pre-trained difficulty judgment model, the route difficulty corresponding to the route information is objectively evaluated, and then a training plan is generated according to the route difficulty, which can formulate a reasonable training plan for different route difficulties, thereby improving the training effect.
[0016] The above description is only an overview of the technical solutions of the embodiments of the present application. In order to be able to understand the technical means of the embodiments of the present application more clearly, it can be implemented according to the content of the description. And in order to make the above and other purposes, features, and advantages of the embodiments of the present application more obvious and understandable, the specific implementation manners of the present application are specifically given below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings are only used to illustrate the embodiments and are not considered as a limitation to the present application. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0018] Figure 1 A flowchart showing the training plan generation method provided by the embodiments of the present application is shown;
[0019] Figure 2 The flowchart shows the process of obtaining route information in the training plan generation method provided by an embodiment of the present application;
[0020] Figure 3 The structural diagram shows the adjusted data table provided by an embodiment of the present application;
[0021] Figure 4 The structural diagram shows the preset training plan provided by an embodiment of the present application;
[0022] Figure 5 The structural diagram shows the adjusted training plan provided by an embodiment of the present application;
[0023] Figure 6 The structural diagram shows the training plan generation device provided by an embodiment of the present application;
[0024] Figure 7 The structural diagram shows the electronic device provided by an embodiment of the present application. Detailed implementation manners
[0025] Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein.
[0026] Sports such as marathons, cross-country running, race walking, and hiking usually have specific routes, and the length of the routes usually reaches several kilometers, dozens of kilometers, or even longer. These sports all have relatively high requirements for endurance, speed, skills, and mental quality. Therefore, athletes need to undergo certain training before participating in these sports to have sufficient physical strength and endurance, thereby ensuring the safety of the sports process and avoiding injuries.
[0027] Due to differences in factors such as urban layout and terrain, the routes of these sports are different in different regions, and the difficulty of the routes may also be different. The altitude change, undulation degree, length, etc. of the routes will all affect the difficulty of the routes. For example, the greater the altitude change and undulation of the route, the higher the difficulty of the route. The higher the difficulty of the route for athletes to perform the sport, the more and more intense training the athletes need to undergo to complete the sport better and more safely.
[0028] Based on this, in order to generate a reasonable training plan for different routes, the present application provides a training plan generation method. By obtaining the information of the route and analyzing the information of the route, the characteristics of the route are obtained. For example, the change in altitude, the angle and number of turns, etc. The difficulty of the route is judged by these characteristics. Specifically, taking the marathon route as an example, by obtaining the marathon route information, then determining the route characteristics according to the marathon route information, then determining the route difficulty according to the route characteristics, and finally generating a corresponding training plan according to the route difficulty.
[0029] The above training plan generation method analyzes the obtained route information to obtain route characteristics, objectively and accurately evaluates the route difficulty according to the route characteristics, and finally generates a reasonable training plan according to the route difficulty, thereby solving the problems of poor training effect and easy injury of athletes.
[0030] The training plan generation method provided by the embodiments of the present application can not only be applied to evaluate the difficulty of sports competition routes such as marathons and cross-country runs, and formulate a reasonable training plan according to the route difficulty, so that athletes can achieve good results when participating in relevant competitions, but also can be used to evaluate the difficulty of users' daily running routes, and formulate a reasonable training plan according to the route difficulty to ensure the safety of users during daily running and avoid injuries.
[0031] According to an aspect of the embodiments of the present application, a training plan generation method is provided, and this method can be executed by electronic devices such as smart watches, mobile phones, tablets, and computers. As Figure 1 shown, Figure 1 The flowchart of the training plan generation method provided by the embodiments of the present application is shown, and this method includes the following steps:
[0032] Step S100: Obtain route information, where the route information includes multiple positioning point information.
[0033] Among them, the route information is used to represent the movement route, and the route information can be data such as longitude, latitude, and altitude obtained after parsing the route file. Taking the marathon movement as an example, the user can directly download the marathon race route file through the network, specifically, the route file announced by the marathon race organizer or shared by other users; the user can also generate a marathon race route file by selecting positioning points on the map according to the route announced by the marathon race organizer or shared by other users.
[0034] The route information includes multiple positioning point information. Specifically, positioning points can be preset on the route file, and when parsing the mechanical energy of the route file, data such as the longitude, latitude, and altitude corresponding to each positioning point are obtained as positioning point information. Or, when the user selects positioning points on the map, data such as the longitude, latitude, and altitude of the corresponding positions of each positioning point are obtained as positioning point information.
[0035] Further, to improve the adaptability of the training plan generation method, as Figure 2 shown, Figure 2 FIG. shows a schematic flowchart of obtaining route information in the training plan generation method provided by an embodiment of the present application. Step S100 may specifically include the following steps (steps S110 to S130):
[0036] Step S110: In response to a map display instruction, obtain map data and control the display device to display the map according to the map data, where the map data includes position information corresponding to each position on the map.
[0037] Among them, the user can obtain map data of the target area through an electronic device and display the map of the target area through the display device. The map data includes position information corresponding to each position on the map, such as longitude, latitude, altitude, etc. The map data can be obtained from a map application software on the electronic device.
[0038] Step S120: In response to a positioning point selection instruction, obtain position information from the map data according to the positions of multiple positioning points on the map respectively, and obtain multiple positioning point information.
[0039] Step S130: Generate route information according to multiple positioning point information.
[0040] Among them, the user selects multiple positioning points from the map through an electronic device to obtain the position information of each positioning point on the map, and generates route information according to this position information. Of course, the user can also directly plan a movement route on the map through the electronic device, and the electronic device automatically selects positioning points from the movement route according to a preset distance or a preset quantity.
[0041] Through steps S110 to S130, the user can independently plan a movement route according to the map displayed by the display device. Therefore, in addition to generating a training plan according to the already planned movement route, a training plan can also be generated according to the movement route independently planned by the user, improving the adaptability of the training plan generation method while indirectly ensuring the safety of the user's daily movement.
[0042] In addition, the electronic device can directly download or generate a marathon race route file through the network, or connect to other electronic devices via Bluetooth or WIFI, and transfer the marathon race route file to the electronic device through transfer software.
[0043] After step S100, step S200 is executed: determining route features based on multiple positioning point information.
[0044] Among them, the more the number of turning routes in the movement route, the higher the route difficulty; the greater the altitude change and undulation of the movement route (for example, the more the number of uphill and downhill sections, and the greater the average uphill angle and average downhill angle, the greater the undulation degree of the movement route), the higher the route difficulty. Therefore, the route features can include azimuth angle information, altitude change information, etc., and the analysis of the route information is completed by obtaining data such as the azimuth angle information and altitude change information of the movement route.
[0045] Specifically, the azimuth angle information can include data such as the number of turning routes and turning angles in the movement route, and the altitude change information can include the average altitude of the movement route, the number of uphill sections in the movement route, the uphill angle, the number of downhill sections, the downhill angle, the maximum uphill height, the average uphill height, the total uphill height, the maximum uphill angle, the average uphill angle, the total uphill angle, the maximum downhill height, the average downhill height, the total downhill height, the maximum downhill angle, the average downhill angle, the total downhill angle, etc.
[0046] Step S300: Determine the route difficulty corresponding to the route information according to the route features through a pre-trained difficulty judgment model.
[0047] Among them, the difficulty judgment model is used to judge the difficulty of the movement route. The difficulty judgment model can be a deep learning model such as a convolutional neural network or a recurrent neural network, or a classification model such as a decision tree, a random forest, a K-nearest neighbor, or a Gaussian classification. Specifically, the data of movement routes with known difficulties can be collected to construct a training data set, and the difficulty judgment model can be trained through the training data set. Finally, the trained model is integrated into the electronic device so that the electronic device can accurately determine the difficulty of the running route by using the pre-trained difficulty judgment model when generating a training plan.
[0048] Step S400: Generate a training plan corresponding to the route information according to the route difficulty.
[0049] Among them, the training plan is a systematic arrangement made to achieve specific goals. The specific goals can be skill improvement, physical fitness enhancement, etc. Taking the marathon race route as an example, the main goal of the training plan is to help runners complete the marathon race safely and effectively and achieve ideal results in the race, such as improving endurance, enhancing speed, and improving running techniques.
[0050] Specifically, data on route difficulty and training plans can be collected, and the training plan generation model can be pre-trained with this data to generate a corresponding training plan according to the route difficulty when generating a training plan. In addition, since the training requirements for different types of sports are different, in order to improve the rationality of the training plan, step S400 can specifically include the following steps (step S410 to step S420):
[0051] Step S410: Obtain the adjustment data of the difficulty level corresponding to the route difficulty from the pre-set adjustment data table, where the adjustment data table includes adjustment data for multiple difficulty levels.
[0052] Among them, different route difficulties correspond to different adjustment data, and the types of adjustment data corresponding to different types of sports are also different. Taking the marathon route as an example, as Figure 3 shown Figure 3 shows a schematic structural diagram of the adjustment data table provided by the embodiment of the present application. The route difficulty can be set to multiple difficulty levels such as low difficulty, slightly low difficulty, medium difficulty, slightly high difficulty, high difficulty, etc. The types of adjustment data can include easy run distance adjustment data, speed-up run time adjustment data, marathon pace run distance adjustment data, long slow run distance adjustment data, lactate threshold run group number adjustment data, etc.
[0053] The adjustment data table is used to store adjustment data for various difficulty levels, usually including all types of adjustment data corresponding to all difficulty levels. After determining the route difficulty, the adjustment data can be found in the adjustment data table according to the route difficulty for subsequent adjustment of the preset training plan. Specifically, assuming the preset difficulty is slightly high, the adjustment data obtained from the adjustment data table includes easy run distance adjustment data with a value of 1.1, speed-up run time adjustment data with a value of 1.2, marathon pace run distance adjustment data with a value of 1.1, long slow run distance adjustment data with a value of 1.25, and lactate threshold run group number adjustment data with a value of 1.
[0054] Of course Figure 3 The adjustment data table shown is only an example, and the content of the adjustment data table corresponding to the training content of different sports may also be different. For example, if strength training is added to the training content to exercise the lower limbs and core muscle groups, the adjustment data corresponding to strength training also needs to be added to the adjustment data table. Therefore, when pre-setting the adjustment data table, various sports training data can be fully collected to generate a more complete adjustment data table.
[0055] Step S420: Obtain the preset training plan, and adjust the preset training plan according to the adjustment data to generate a training plan corresponding to the route information.
[0056] Among them, the ways to obtain the preset training plan can be various. For example, the training plan set by the user independently, the training plan imported from other sports application software, or the training plan pre-stored in the electronic device, and the preset training plan is defaulted to the training plan corresponding to the route information of medium difficulty. Specifically, taking the marathon sport as an example, runners can usually be divided into multiple levels according to experience, such as elite level, level 1, level 2, etc. When generating the preset training plan, professionals can preset the training plans for elite level, level 1, and level 2 runners respectively according to medium difficulty and build the training plans into the electronic device.
[0057] Of course, due to individual differences, in order to make the preset training plan more adaptable to the user, the user can set the training plan according to their own situation as the preset training plan, or the user can first generate a training plan that meets their own needs through other sports application software and then use this training plan as the preset training plan.
[0058] The specific adjustment method of the preset training plan can adopt different adjustment methods according to different training contents. Specifically, taking the marathon sport as an example, if the adjustment data table is as Figure 3 shown, then the adjustment of the easy run distance can use the adjustment data multiplied by the easy run distance in the preset training plan to obtain the new easy run distance. Similarly, the speed-up run time, the marathon pace run distance, and the long slow distance run can all be adjusted in the same way as the easy run distance, and the number of lactate threshold run sets can be added with the adjustment data on the basis of the preset training plan.
[0059] Suppose the preset training plan is as Figure 4 shown, Figure 4 shows the structural schematic diagram of the preset training plan provided by the embodiment of the present application, and the route difficulty is slightly higher. Then, according to the Figure 3 shown adjustment data table, the adjusted training plan is as Figure 5 shown, Figure 5 shows the structural schematic diagram of the adjusted training plan provided by the embodiment of the present application. For example, in the preset training plan, the easy run distance on the first day of the first week is 4.8 km. According to the Figure 3 shown table, the adjustment data for the easy run distance with slightly higher difficulty is 1.1. Then, as Figure 5 shown, the adjusted easy run distance is 5.28 km; in the preset training plan, the number of lactate threshold run sets on the fourth day of the fifth week is 4 sets. According to the Figure 3 shown table, the adjustment data for the number of lactate threshold run sets with slightly higher difficulty is 1. Then, as Figure 5 shown, the adjusted number of lactate threshold run sets is 5 sets.
[0060] Through steps S410 to S420, the electronic device can adjust the preset training plan according to the adjustment data to generate a training plan corresponding to the route information. Specifically, the training plan can be preset for factors such as different types of exercises and different users' training needs. After the electronic device obtains the route information, it adjusts the preset training plan according to the adjustment data corresponding to the route difficulty to produce a new training plan, effectively improving the rationality of the training plan and the degree of adaptation to the user.
[0061] In the above embodiment, the path features are analyzed by a pre-trained difficulty judgment model to objectively evaluate the route difficulty corresponding to the route information, and then a training plan is generated according to the route difficulty, which can formulate a reasonable training plan for different route difficulties, thereby improving the training effect.
[0062] Further, the turning routes in the exercise route will have a relatively large impact on the exercise process of the exerciser. Taking running exercises such as marathons and cross-country running as an example, when the exerciser encounters a turning section, the exerciser needs to adjust the gait while overcoming the centrifugal force to maintain balance and direction, and usually needs to decelerate when turning, especially on curves with a small turning angle, which may also affect the running rhythm of the exerciser. Therefore, in order to accurately judge the route difficulty, in some embodiments, the positioning point information includes coordinate data, the route feature includes azimuth angle information, and step S200 may specifically include the following steps:
[0063] Step S210a: Traverse multiple pieces of positioning point information, and determine the azimuth angle according to the coordinate data of the positioning point information to obtain angle data.
[0064] Among them, the multiple pieces of positioning point information can be longitude and latitude, altitude sequence, and can be specifically represented by the following formula:
[0065] path=[(lat1,lon1,ele1),(lat2,lon2,ele2),···(lat M ,lon M ,ele M )] (1)
[0066] Among them, lat i refers to the longitude of the i-th positioning point, lon i refers to the latitude of the i-th positioning point, ele i refers to the altitude of the i-th positioning point, and M refers to the number of pieces of positioning point information.
[0067] The coordinate data can be the longitude and latitude coordinates of the positioning point, or can be rectangular coordinates. Specifically, the longitude and latitude coordinates can be converted into rectangular coordinates through the following formula:
[0068] x = R × cos(lat) × cos(lon)
[0069] y = R × cos(lat) × sin(lon)
[0070] Wherein, x refers to the coordinate on the X-axis of the rectangular coordinate system, y refers to the coordinate on the Y-axis of the rectangular coordinate system, lat refers to the longitude coordinate, and lon refers to the latitude coordinate.
[0071] By traversing the information of multiple positioning points and analyzing the coordinate data of the positioning point information, the azimuth angle between the positioning points on the movement route is obtained, that is, the turning angle of the turning section on the movement route. Specifically, the turning angle of the turning route can be calculated by using methods such as vectors and the cosine theorem.
[0072] Further, in order to accurately obtain the angle data, step S210a specifically includes the following steps (steps S211a to S215a):
[0073] Step S211a: Obtain continuous first positioning point information, second positioning point information, and third positioning point information from the information of multiple positioning points.
[0074] Step S212a: Determine the first coordinate difference according to the coordinate data of the first positioning point information and the coordinate data of the second positioning point information.
[0075] Wherein, the first coordinate difference includes the differences between each value in the coordinate data of the first positioning point information and the coordinate data of the second positioning point information, usually including the difference in the X-axis coordinate and the difference in the Y-axis coordinate. The specific formula is as follows:
[0076] dec_x_lc = x last -x current
[0077] dec_y_lc = y last -y current
[0078] Wherein, x last refers to the X-axis coordinate of the first positioning point information, y last refers to the Y-axis coordinate of the first positioning point information, x current refers to the X-axis coordinate of the second positioning point information, y current refers to the Y-axis coordinate of the second positioning point information, and dec_x_lc and dec_y_lc are the differences in the X-axis coordinate and the Y-axis coordinate included in the first coordinate difference.
[0079] Step S213a: Determine the second coordinate difference according to the coordinate data of the third positioning point information and the coordinate data of the second positioning point information.
[0080] Among them, the second coordinate difference includes the differences between the respective values in the coordinate data of the third positioning point information and the coordinate data of the second positioning point information, and generally includes the difference in the X-axis coordinate and the difference in the Y-axis coordinate. The specific formula is as follows:
[0081] dec_x_nc = x next - x current
[0082] dec_y_nc = y next - y current
[0083] Among them, x next refers to the X-axis coordinate of the third positioning point information, and y next refers to the Y-axis coordinate of the third positioning point information. dec_x_nc and dec_y_nc are the differences in the X-axis coordinate and the Y-axis coordinate included in the second coordinate difference.
[0084] Step S214a: Determine the azimuth angle corresponding to the second positioning point information according to the first coordinate difference and the second coordinate difference, and obtain angle data.
[0085] Among them, the azimuth angle corresponding to the second positioning point information is the turning angle at the position of the second positioning point on the movement route. The specific calculation formula is as follows:
[0086]
[0087] Step S215a: Determine the second positioning point information as the new first positioning point information, determine the third positioning point information as the new second positioning point information, obtain the next consecutive positioning point information as the new third positioning point information, and jump to step S212a until multiple positioning point information is traversed.
[0088] Among them, by traversing multiple positioning point information one by one, calculate the turning angles at the positions of each positioning point on the movement route, and analyze each positioning point on the movement route as much as possible to ensure the accuracy of the angle data.
[0089] Through steps S211a to S215a, analyze each positioning point on the movement route to accurately obtain the angle data of each turning section in the movement route, improve the detail level of the angle data, and thus improve the accuracy of the route difficulty judgment.
[0090] After step S210a, execute step S220a: Count the number of angle data whose azimuth angles are less than the preset angle to obtain azimuth angle information.
[0091] Among them, the more the number of turning sections on the movement route and the smaller the corners of the turning sections, the higher the difficulty of the movement route. When determining the route difficulty through route features, the azimuth angles of each turning section on the movement route can be obtained to obtain azimuth angle information, and the azimuth angle information can be determined as the route feature. In addition, some gentle turning sections with larger azimuth angles have relatively little impact on the movement personnel. When generating azimuth angle information, different preset angles can be set according to the movement type, and the azimuth angle information can be determined by counting the number of azimuth angles less than the preset angle in the angle data. For example, when determining the difficulty of a marathon race route, the preset angle can be set to 100 degrees, and the azimuth angle information can be determined by counting the number of turning corners with azimuth angles less than 100 degrees, so as to determine the route difficulty according to the azimuth angle information subsequently.
[0092] In the above embodiment, the azimuth angle is determined through the coordinate data of the positioning point information, that is, the turning angle of the turning section on the movement route, and the number of angle data with azimuth angles less than the preset angle is counted to obtain the azimuth angle information. Furthermore, the difficulty of the movement route is objectively evaluated through the feature of the turning angle of the turning section in the movement route, improving the accuracy of the route difficulty.
[0093] Furthermore, due to the limitations of natural terrain, such as mountainous, hilly, river valley and other terrains, the movement route may have undulations, that is, there may be uphill sections and downhill sections in the movement route. When the movement personnel pass through the uphill section, they need to overcome gravity to push their bodies upward, the load on the muscles increases, and the energy consumption increases significantly. When the movement personnel pass through the downhill section, they need to control the speed to avoid excessive impact and cause muscle fatigue and injury. Therefore, in order to more accurately determine the route difficulty of the movement route, in some embodiments, the route information includes the movement direction, the positioning point information includes altitude data, the route feature includes altitude change information, and step S200 may further include the following steps:
[0094] Step S210b: Traverse multiple positioning point information according to the movement direction, and determine the slope type and slope angle according to the altitude data and coordinate data of the positioning point information.
[0095] Among them, it can be seen from formula (1) that the positioning point information also includes altitude data, that is, the altitude ele in formula (1). i . Specifically, if the altitude data in the multiple positioning point information is different in size, it means that there are undulating changes between the positioning point information, and then the slope type (i.e., uphill or downhill) and slope angle are determined through the altitude data and coordinate data of the positioning point information. Specifically, step S210b may specifically include the following steps (steps S211b to S216b):
[0096] Step S211b: Obtain two adjacent positioning point information according to the movement direction.
[0097] Step S212b: Calculate the difference between the altitude data of adjacent two positioning point information to obtain the altitude difference.
[0098] Among them, the altitude difference is used to characterize whether there is a height difference between adjacent two positioning points on the movement route. If there is, it means that the section between these two positioning points is an uphill section or a downhill section. In addition, the uphill section and the downhill section exist relatively. Specifically, assume that the altitude of positioning point a on the movement route is greater than that of positioning point b. If the movement direction of the movement person is from positioning point a to positioning point b, then during the movement process of the movement person between positioning point a and positioning point b, the altitude will gradually decrease, that is, the section between positioning point a and positioning point b is a downhill section; if the movement direction of the movement person is from positioning point b to positioning point a, then during the movement process of the movement person between positioning point b and positioning point a, the altitude will gradually increase, that is, the section between positioning point a and positioning point b is an uphill section.
[0099] Therefore, when obtaining the altitude difference between adjacent two positioning point information, it is necessary to obtain adjacent two positioning point information according to the movement direction and calculate the difference between the altitude data of adjacent two positioning point information. The specific formula is as follows:
[0100] ele_dec = ele i+1 -ele i
[0101] Among them, ele i+1 refers to the altitude data of the latter positioning point information among adjacent two positioning point information, ele i refers to the altitude data of the former positioning point information among adjacent two positioning point information, and ele_dec refers to the altitude difference.
[0102] Step S213b: Determine the slope type according to the altitude difference.
[0103] Among them, the slope type usually includes an uphill section and a downhill section. If the altitude difference is greater than 0, it means that the section between adjacent two positioning points on the movement route is an uphill section. If the altitude difference is less than 0, it means that the section between adjacent two positioning points on the movement route is a downhill section.
[0104] Step S214b: Calculate the distance between adjacent two positioning points according to the coordinate data of adjacent two positioning point information to obtain the distance information.
[0105] Among them, as can be seen from formula (1), the coordinate data of the positioning point information is the longitude and latitude data of the positioning point. The distance between adjacent two positioning points can be calculated by the following formula:
[0106] C = sin(lati ) × sin(lat i+1 ) × cos(lon i -lon i+1 ) + cos(lat i ) × cos(lat i+1 )
[0107]
[0108] where d i,i+1 refers to the distance between positioning point i and positioning point i + 1 calculated based on the coordinate data (i.e., longitude and latitude) of two adjacent positioning point information, with the unit of meters, lat i refers to the longitude value of the previous positioning point information in two adjacent positioning point information, lon i refers to the latitude value of the previous positioning point information in two adjacent positioning point information, lat i+1 refers to the longitude value of the next positioning point information in two adjacent positioning point information, lon i+1 refers to the latitude value of the next positioning point information in two adjacent positioning point information, and π refers to the circumference ratio.
[0109] Step S215b: Determine the slope angle based on the altitude difference and distance information.
[0110] where the slope angle can be calculated based on the concept of slope in trigonometry and geometry. Specifically, the slope angle can be calculated based on the change in the vertical height (i.e., altitude) and the change in the horizontal distance (i.e., the distance information between two positioning points) between two positioning points. The specific formula is as follows:
[0111]
[0112] where up_hill_anger refers to the uphill angle and down_hill_anger refers to the downhill angle. Specifically, if ele_dec is greater than 0, it means the slope type is an uphill section, and the angle of the uphill section can be calculated by formula (2); if ele_dec is less than 0, it means the slope type is a downhill section, and the angle of the downhill section can be calculated by formula (3); if ele_dec is equal to 0, it means the section between two positioning points is a flat section, and there is no need to calculate the slope angle.
[0113] Step S216b: Obtain the information of the next two adjacent positioning points according to the moving direction, and jump to step S212b until multiple positioning point information is traversed, where the previous positioning point information in the next two adjacent positioning point information is the latter positioning point information in the two adjacent positioning point information.
[0114] Through steps S211b to S216b, each positioning point on the movement route is analyzed to accurately obtain the slope type and slope angle of the section between two adjacent positioning points in the movement route, improve the detail level of the slope type and slope angle, and thus improve the accuracy of route difficulty judgment.
[0115] After step S210b, step S220b is executed: Determine the altitude change information according to the altitude data, slope type, and slope angle.
[0116] Among them, the altitude change information is used to characterize the undulation of the movement route. Specifically, data such as the number of uphill sections, the number of downhill sections, the total uphill height, the total downhill height, the total uphill angle, the total downhill angle, etc. can be statistically calculated based on the altitude data, slope type, and slope angle, and data such as the maximum uphill height, the average uphill height, the maximum downhill height, the average downhill height, the maximum uphill angle, the average uphill angle, the maximum downhill angle, the average downhill angle, etc. can be calculated based on the slope type and slope angle to determine the altitude change information according to these data.
[0117] In the above embodiments, by traversing multiple positioning point information and analyzing the altitude data and coordinate data of the positioning point information, the altitude change information is determined, and then the difficulty of the movement route is objectively evaluated through the altitude changes of the uphill and downhill sections in the movement route, improving the accuracy of the route difficulty.
[0118] Further, in order to improve the calculation efficiency, reduce the storage requirements and energy consumption, and optimize the model performance, in some embodiments, a difficulty judgment model can be pre-trained to generate feature centers corresponding to each difficulty level, and then the route difficulty is determined according to the feature centers. Specifically, step S300 can specifically include the following steps:
[0119] Step S310: Obtain the feature centers corresponding to multiple difficulty levels generated by the difficulty judgment model.
[0120] Among them, the difficulty judgment model can be pre-trained. The specific training process can include the following steps (steps S510 to S530):
[0121] Step S510: Collect multiple route training data, and the route training data includes route features.
[0122] Among them, the route training data can be obtained by collecting known movement routes and analyzing the movement routes to determine the route features of each movement route. Taking the marathon movement as an example, the marathon race routes in historical marathon races can be collected, and the route features can be determined according to the multiple positioning point information of the marathon race routes to obtain multiple route training data, thereby constructing a training dataset.
[0123] Step S520: Through the difficulty judgment model, classify multiple route training data into multiple preset difficulty levels according to the route characteristics of each route training data, and determine the loss function according to the classification results.
[0124] Step S530: Train the difficulty judgment model according to the loss function to generate feature centers corresponding to various difficulty levels.
[0125] Among them, classify multiple route training data through the difficulty judgment model to generate feature centers corresponding to various difficulty levels. Taking the K-means clustering algorithm as an example of the difficulty judgment model, assume that the number of categories of difficulty levels is set to 5, namely five difficulty levels: low difficulty, slightly low difficulty, medium difficulty, slightly high difficulty, and high difficulty. Specifically, use the K-means clustering algorithm to divide multiple route training data into 5 categories and obtain the clustering centers of 5 difficulty levels (that is, the low-difficulty clustering center corresponding to the low-difficulty movement route, the slightly low-difficulty clustering center corresponding to the slightly low-difficulty movement route, the medium-difficulty clustering center corresponding to the medium-difficulty movement route, the slightly high-difficulty clustering center corresponding to the slightly high-difficulty movement route, and the high-difficulty clustering center corresponding to the high-difficulty movement route).
[0126] Through steps S510 to S530, train the difficulty judgment model to generate feature centers corresponding to various difficulty levels for subsequent calculation of the route difficulty of the movement route, so that only by integrating the feature centers corresponding to various difficulty levels on the electronic device, the route difficulty can be determined through the feature centers, reducing the storage requirements and energy consumption of the difficulty judgment model.
[0127] After step S310, execute step S320: Calculate the similarity between the route feature and the feature centers corresponding to each difficulty level respectively.
[0128] Step S330: Determine the difficulty level corresponding to the feature center with the highest similarity as the route difficulty corresponding to the route information.
[0129] Among them, the similarity between the route feature and the feature center can be calculated using algorithms such as Manhattan distance, cosine similarity, and Euclidean distance. As an example, calculate the Euclidean distances from the route feature to the low-difficulty clustering center, the slightly low-difficulty clustering center, the medium-difficulty clustering center, the slightly high-difficulty clustering center, and the high-difficulty clustering center respectively. The difficulty level to which the clustering center with the smallest Euclidean distance belongs is the route difficulty corresponding to the route information. For example, if the Euclidean distance between the route feature and the high-difficulty clustering center is the smallest, the difficulty of the movement route belongs to high difficulty.
[0130] In the above embodiments, by obtaining the feature centers corresponding to multiple difficulty levels and then determining the route difficulty according to the similarity between the route features and the feature centers corresponding to each difficulty level, the route difficulty can be determined only by the feature centers. Without integrating a relatively large-sized difficulty judgment model structure on the electronic device, the difficulty of the movement route can also be judged, reducing the storage requirements and energy consumption and improving the calculation efficiency.
[0131] According to another aspect of the embodiments of the present application, there is also provided a training plan generation device, as Figure 6 shown, Figure 6 FIG. shows a schematic structural diagram of the training plan generation device provided by the embodiments of the present application. The training plan generation device 1 includes: an acquisition module 11, a first determination module 12, a second determination module 13, and a generation module 14.
[0132] The acquisition module 11 is used to acquire route information, and the route information includes multiple positioning point information. The first determination module 12 is used to determine route features according to the multiple positioning point information. The second determination module 13 is used to determine the route difficulty corresponding to the route information according to the route features through a pre-trained difficulty judgment model. The generation module 14 is used to generate a training plan corresponding to the route information according to the route difficulty.
[0133] In the above embodiments, by analyzing the path features through a pre-trained difficulty judgment model, objectively evaluating the route difficulty corresponding to the route information, and then generating a training plan according to the route difficulty, a reasonable training plan can be formulated for different route difficulties, thereby improving the training effect.
[0134] According to yet another aspect of the embodiments of the present application, there is also provided an electronic device, as Figure 7 shown, Figure 7 FIG. shows a schematic structural diagram of the electronic device provided by the embodiments of the present application. The specific embodiments of the present application do not limit the specific implementation of the electronic device.
[0135] As Figure 7 shown, the electronic device 2 may include: a processor 21 and a memory 22.
[0136] Among them, the memory 22 is used to store a computer program 23. The memory 22 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory. The computer program 23 may include computer executable instructions.
[0137] The processor 21 is used to execute the computer program 23 to implement the above-mentioned training plan generation method embodiments.
[0138] The processor 21 may be a central processing unit (CPU), or a specific application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. One or more processors included in the electronic device may be of the same type, such as one or more CPUs; or may be of different types, such as one or more CPUs and one or more ASICs.
[0139] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the embodiment of the above-mentioned training plan generation method.
[0140] An embodiment of the present application provides a computer program that can be executed by a processor to implement the embodiment of the above-mentioned training plan generation method.
[0141] An embodiment of the present application provides a computer program product including a computer program, which when executed by a processor implements the embodiment of the above-mentioned training plan generation method.
[0142] In several embodiments provided by the present application, if any function is implemented in the form of a software functional module / unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, part or all of the technical solution of the present application may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be an electronic device such as a personal computer, a server, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media that can store computer program codes such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0143] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems may also be used in conjunction with the teachings herein. The structure required to construct such a system will be apparent from the above description. In addition, the embodiments of the present application are not directed to any specific programming language. It should be understood that the content of the present application described herein can be implemented using various programming languages, and the description of the specific language above is for the purpose of disclosing the best mode of the present application.
[0144] It should be noted that the above embodiments are illustrative of the present application rather than restrictive of the present application, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a claim listing several devices, several units or modules of these devices may be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
[0145] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for generating a training plan, characterized in that, The method includes: Obtaining route information, where the route information includes multiple positioning point information; Determining route features according to the multiple positioning point information; Determining the route difficulty corresponding to the route information according to the route features through a pre-trained difficulty judgment model; Generating a training plan corresponding to the route information according to the route difficulty.
2. The training plan generation method according to claim 1, characterized in that The positioning point information includes coordinate data, and the route features include azimuth angle information; The determining the route features according to the multiple positioning point information specifically includes: Traversing the multiple positioning point information, and determining the azimuth angle according to the coordinate data of the positioning point information to obtain angle data; Counting the number of the angle data whose azimuth angle is less than a preset angle to obtain the azimuth angle information.
3. The training plan generation method according to claim 2, wherein The traversing the multiple positioning point information, and determining the azimuth angle according to the coordinate data of the positioning point information to obtain angle data specifically includes: Obtaining consecutive first positioning point information, second positioning point information, and third positioning point information from the multiple positioning point information; Determining a first coordinate difference according to the coordinate data of the first positioning point information and the coordinate data of the second positioning point information; Determining a second coordinate difference according to the coordinate data of the third positioning point information and the coordinate data of the second positioning point information; Determining the azimuth angle corresponding to the second positioning point information according to the first coordinate difference and the second coordinate difference to obtain angle data; Determining the second positioning point information as the new first positioning point information, determining the third positioning point information as the new second positioning point information, obtaining the next consecutive positioning point information as the new third positioning point information, and jumping to the step of determining the first coordinate difference according to the coordinate data of the first positioning point information and the coordinate data of the second positioning point information until the multiple positioning point information is traversed.
4. The training plan generation method according to claim 2, wherein The route information includes a movement direction, the positioning point information includes elevation data, and the route features include elevation change information; The determining the route features according to the multiple positioning point information specifically includes: Traversing the multiple positioning point information in accordance with the movement direction, and determining the slope type and slope angle according to the elevation data and coordinate data of the positioning point information; Determining the elevation change information according to the elevation data, the slope type, and the slope angle.
5. The training plan generation method according to claim 4, wherein The traversing the multiple positioning point information in accordance with the movement direction, and determining the slope type and slope angle according to the elevation data and coordinate data of the positioning point information specifically includes: Obtaining adjacent two positioning point information in accordance with the movement direction; Calculating the difference between the elevation data of the adjacent two positioning point information to obtain an elevation difference; Determining the slope type according to the elevation difference; Calculating the distance between the adjacent two positioning points according to the coordinate data of the adjacent two positioning point information to obtain distance information; Determining the slope angle according to the elevation difference and the distance information. Obtain the information of the next two adjacent positioning points in the described movement direction, and jump to the step of calculating the difference between the altitude data of the two adjacent positioning points to obtain the altitude difference, until all the multiple positioning point information is traversed, where the previous positioning point information in the next two adjacent positioning point information is the latter positioning point information in the two adjacent positioning point information.
6. The training plan generation method according to claim 1, wherein The training process of the difficulty judgment model includes: Collect multiple route training data, where the route training data includes route features; Through the difficulty judgment model, classify the multiple route training data into multiple preset difficulty levels according to the route features of each route training data, and determine the loss function according to the classification results; Train the difficulty judgment model according to the loss function to generate feature centers corresponding to various difficulty levels.
7. The training plan generation method according to claim 1, characterized in that The specific process of determining the route difficulty corresponding to the route information through the pre-trained difficulty judgment model includes: Obtain the feature centers corresponding to multiple difficulty levels generated by the difficulty judgment model; Calculate the similarity between the route features and the feature centers corresponding to each difficulty level respectively; Determine the difficulty level corresponding to the feature center with the highest similarity as the route difficulty corresponding to the route information.
8. The training plan generation method according to claim 1, characterized in that, The specific process of generating the training plan corresponding to the route information according to the route difficulty includes: Obtain the adjustment data of the difficulty level corresponding to the route difficulty from the pre-set adjustment data table, where the adjustment data table includes the adjustment data of multiple difficulty levels; Obtain the preset training plan, and adjust the preset training plan according to the adjustment data to generate the training plan corresponding to the route information.
9. The training plan generation method according to claim 1, wherein The specific process of obtaining the route information includes: In response to the map display instruction, obtain map data and control the display device to display the map according to the map data, where the map data includes the position information corresponding to each position on the map; In response to the positioning point selection instruction, obtain the position information from the map data according to the positions of multiple positioning points on the map respectively to obtain multiple positioning point information; Generate the route information according to the multiple positioning point information.
10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the training plan generation method according to any one of claims 1 to 9.