A method and device for obtaining motion parameters, electronic equipment, and storage medium
By dynamically adjusting the size of the smooth window, combining the change value and weight of the motion parameter, the problem of difficulty in taking into account the accuracy and real-timeness of the motion parameter acquisition in the existing technology is solved, and high real-timeness and accuracy when the movement speed changes greatly are achieved Spend.
Patent Information
- Application Number
- CN202010670944.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-13
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2040-07-13
AI Technical Summary
When obtaining motion parameters in the prior art, it is difficult to ensure both accuracy and real-timeness, especially when the motion speed changes greatly, the fixed size of the smooth window leads to poor real-timeness of the motion speed after processing.
By dynamically adjusting the smoothing window size according to the change value of the motion parameters, calculate the parameter change value using the motion parameters and weights within the preset period, determine the appropriate window adjustment value, and dynamically adjust the smoothing window to improve the real-timeness and accuracy of the motion parameters.
It achieves the real-time and accuracy of motion parameters when the movement speed changes greatly, adapts to the real-time needs of different motion states, and improves the user experience.
Smart Images

Figure CN113934291B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to intelligent detection technology, and in particular to a motion parameter acquisition method and device, electronic equipment, and storage medium. Background Art
[0002] As electronic devices become smarter and more portable, users can use electronic devices to monitor certain exercise parameters during exercise to understand their exercise conditions. For example, when a user is running, he or she can use an electronic device to monitor his or her exercise speed.
[0003] Specifically, the electronic device can collect the movement speed of the user during the movement in real time, and eliminate the abnormal values collected by the sensor at certain moments and calculate the compensation value, and the compensation value is used to replace the corresponding abnormal value. The abnormal value refers to the movement speed that is significantly different from other collected movement speeds. Secondly, some interference factors that exist when collecting the movement speed may cause a small deviation between the collected movement speed and the actual movement speed; therefore, the electronic device also uses a preset smoothing window to smooth the collected movement speed to reduce the deviation. Among them, the smoothing process includes: the electronic device determines a time length according to the preset smoothing window, and uses multiple movement speeds collected within the time length before each moment to calculate the processed movement speed at this moment.
[0004] The above-mentioned movement speed at all moments during the user's movement process is calculated and processed using the same duration. However, the change in the movement speed during the user's movement is not fixed. Therefore, if the movement speed at a certain moment changes less than the movement speed at a previous moment; then, when the above-mentioned duration is set to be smaller, the accuracy of the movement speed processed at the above-mentioned moment calculated is lower. If the movement speed at a certain moment changes more than the movement speed at a previous moment; then, when the above-mentioned duration is set to be larger, the calculated movement speed processed at the above-mentioned moment and the actual movement speed at the certain moment are greatly different; that is, for movement speeds with larger changes, the real-time performance of the processed movement speed is poor.
[0005] In summary, the above scheme cannot simultaneously guarantee the accuracy and real-time performance of the processed motion speed. Summary of the invention
[0006] The embodiments of the present application provide a motion parameter acquisition method and device, an electronic device, and a storage medium, which can simultaneously improve the accuracy and real-time performance of the acquired motion parameters.
[0007] In order to achieve the above technical objectives, the embodiments of the present application adopt the following technical solutions:
[0008] In a first aspect, an embodiment of the present application provides a method for obtaining motion parameters, the method comprising: periodically obtaining motion parameters of an electronic device according to a preset period; obtaining a window size M of a first smoothing window at a current moment; using the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the first M preset periods at the current moment, and a preset weight K i , calculate the parameter change value at the current moment; determine N parameter change intervals corresponding to the motion parameters at the current moment; from the N parameter change intervals, determine the first parameter change interval where the parameter change value at the current moment is located, and determine the window adjustment value corresponding to the first parameter change interval; use the window adjustment value to adjust the window size of the first smoothing window to obtain a second smoothing window; use the second smoothing window to smooth the motion parameters at the current moment to obtain the processed motion parameters.
[0009] The first smoothing window is used to smooth the motion parameters of the electronic device at the current moment, M≥2, M is a positive integer. i takes values in {1, 2, ..., M} in sequence. The parameter change value at the current moment is used to characterize the maximum change value of the motion parameter at the current moment compared with the motion parameter of the previous M preset periods. N≥2, N is a positive integer.
[0010] Through this solution, the electronic device uses the window adjustment value corresponding to the first parameter change interval where the parameter change value at the current moment is located to adjust the window size of the first smoothing window, and obtains the second smoothing window used to smooth the motion parameters at the current moment. It can be known that the greater the change of the motion parameters at any moment compared to the previous motion parameters, the higher the real-time requirements for the motion parameters. It can also be known that the smaller the smoothing window used to smooth the motion parameters at any moment, the fewer motion parameters used for smoothing and before this moment, that is, the motion parameters used for smoothing are all relatively close to the motion parameters at this moment; therefore, the real-time performance of the processed motion parameters at this moment is higher.
[0011] Then, when the electronic device adjusts the window size of the first smooth window based on the window adjustment value corresponding to the first parameter change interval where the parameter change value at the current moment is located, the window adjustment value can be used to reduce the window size of the first smooth window when the parameter change value at the current moment is large, and obtain a second smooth window with a smaller window. When the parameter change value at the current moment is large, the motion parameters at the current moment are smoothed using the second smooth window with a smaller window, and the processed motion parameters have higher real-time performance, and the processed motion parameters are more accurate.
[0012] Secondly, the window adjustment value can also be used to increase the window size of the first smooth window when the parameter change value at the current moment is small, so as to obtain the second smooth window after the window is enlarged. When the parameter change value at the current moment is small, the motion parameters at the current moment are smoothed using the second smooth window after the window is enlarged to obtain the processed motion parameters. Since the parameter change value at the current moment is small, the motion parameters at the current moment are smoothed using the second smooth window after the window is enlarged, that is, more motion parameters with a size close to the motion parameters at the current moment are used to obtain the processed motion parameters, and the processed motion parameters are more accurate.
[0013] In a possible implementation, since the window size of the smoothing window represents the number of motion parameters required for smoothing the operating parameters at a certain moment, and if the window size of the smallest smoothing window is Q, starting from the Qth preset period, the number of motion parameters acquired by the electronic device is greater than or equal to Q. Therefore, starting from the Qth preset period, the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the first M preset periods at the current moment, and the preset weight K are used. i , calculate the parameter change value at the current moment. Where Q≤M, Q≥2, Q is a positive integer.
[0014] In another possible implementation, the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset periods at the current moment, and the preset weight K are used. i , calculate the parameter change value at the current moment, including: calculate the motion parameter V at the current moment D The motion parameter V of the previous i preset cycles at the current moment i The absolute value of the difference ΔV i ; Calculate the absolute value ΔV i With the preset weight K i The product of CV i , and determine max{CV1, CV2, ..., CV M} is the parameter change value at the current moment. Among them, i takes values in {1, 2, ..., M} in sequence; max{CV1, CV2, ..., CV M} is used to calculate CV1, CV2, ..., CV M The maximum value in .
[0015] It is understandable that the preset weight K i The preset weight K can be set according to the length of the interval between the previous i preset cycles and the current moment, and the smaller the length of the interval between the previous i preset cycles and the current moment, the larger the preset weight K is. iThe larger the value is. Since the motion parameters of the preset period closer to the current moment in the first M preset periods are closer to the motion parameters of the current moment, a larger preset weight can be set for the preset period closer to the current moment in the first M preset periods, so that the motion parameters of the preset period closer to the current moment have a greater impact on the calculation of the parameter change value at the current moment, and the parameter change value at the current moment more accurately represents the change of the real-time motion parameters.
[0016] In another possible implementation, multiple motion parameter intervals are pre-stored in the electronic device, each motion parameter interval corresponds to N parameter change intervals, different motion parameter intervals correspond to different N parameter change intervals; each parameter change interval in the N parameter change intervals corresponds to a window adjustment value. Among them, the N parameter change intervals corresponding to the motion parameter at the current moment are: the N parameter change intervals corresponding to the first motion parameter interval in which the motion parameter at the current moment is located among the multiple motion parameter intervals.
[0017] It can be understood that a plurality of motion parameter intervals are set according to the size of the motion parameters, and then N parameter change intervals are set according to the size of the parameter change value under each motion parameter interval, and the N parameter change intervals correspond to different window adjustment values, so that the set window adjustment value is more precise. By setting N parameter change intervals for different motion parameters, and N window adjustment values corresponding to the N parameter change intervals, it is determined that the window adjustment value corresponding to the motion parameters and parameter change values at the current moment is more accurate; and then the window size of the first smooth window is adjusted using the more accurate window adjustment value, and the real-time performance of the obtained second smooth window is more in line with the real-time performance required by the motion parameters and parameter change values at the current moment. Therefore, the real-time performance and accuracy of the processed motion parameters obtained by smoothing the motion parameters at the current moment using the second smooth window are higher.
[0018] In another possible implementation, the above-mentioned smoothing process of the motion parameters at the current moment using the second smoothing window to obtain the processed motion parameters includes: obtaining the motion parameters of the previous P preset periods at the current moment and the preset weight K j ; Calculate the motion parameters V of the previous j preset cycles at the current moment j With the preset weight K j The product S j , and calculate the processed motion parameters Among them, j takes values in {1, 2, ..., P} in sequence.
[0019] It is understandable that the preset weight K jThe preset weight K can be set according to the length of the interval between the previous j preset periods and the current moment, and the smaller the length of the interval between the previous j preset periods and the current moment, the greater the preset weight K. j Since the motion parameters of the preset period closer to the current moment among the first P preset periods at the current moment are closer to the motion parameters at the current moment, a larger preset weight can be set for the preset period closer to the current moment among the first P preset periods, so that the motion parameters of the preset period closer to the current moment have a greater influence on the calculation of the processed motion parameters at the current moment, and the processed motion parameters at the current moment are more accurate.
[0020] In another possible implementation, the above-mentioned using the window adjustment value to adjust the window size of the first smoothing window to obtain the second smoothing window includes: if the sum of the window adjustment value and the window size of the first smoothing window is greater than or equal to a preset minimum window value, and less than or equal to a preset maximum window value, adding the window adjustment value to the window size of the first smoothing window to obtain the second smoothing window. The window size of the second smoothing window is equal to the sum of the window adjustment value and the window size of the first smoothing window.
[0021] In another possible implementation, the method further includes: if the sum of the window adjustment value and the window size of the first smooth window is less than a preset minimum window value, then the preset minimum window value is used as the window size of the second smooth window; if the sum of the window adjustment value and the window size of the first smooth window is greater than a preset maximum window value, then the preset maximum window value is used as the window size of the second smooth window.
[0022] It can be understood that, as the size of the smoothing window is larger, the motion parameters with a larger time interval from the current moment are also used to smooth the motion parameters at the current moment, while the motion parameters with a larger time interval from the current moment differ greatly from the motion parameters at the current moment. Therefore, the window size of the second smoothing window is controlled to be smaller than the preset maximum window value to ensure that the motion parameters with a large difference from the motion parameters at the current moment are not used for smoothing, thereby improving the accuracy of the processed motion parameters at the current moment. Secondly, the window size of the second smoothing window is also controlled to be larger than the preset minimum window value to ensure that there are enough motion parameters for smoothing the motion parameters at the current moment.
[0023] In a second aspect, an embodiment of the present application further provides a motion parameter acquisition device, which includes: a parameter acquisition module, a window adjustment module and a parameter calculation module.
[0024] The parameter acquisition module is used to periodically acquire the motion parameters of the electronic device according to a preset period.
[0025] The window adjustment module is used to obtain the window size M of the first smooth window at the current moment; using the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the first M preset cycles at the current moment, and the preset weight K i , calculate the parameter change value at the current moment; determine the N parameter change intervals corresponding to the motion parameters at the current moment; from the N parameter change intervals, determine the first parameter change interval where the parameter change value at the current moment is located, and determine the window adjustment value corresponding to the first parameter change interval; use the window adjustment value to adjust the window size of the first smoothing window to obtain a second smoothing window. Among them, the first smoothing window is used to smooth the motion parameters of the electronic device at the current moment, M≥2, M is a positive integer; i takes values in {1, 2, ..., M} in sequence; the parameter change value at the current moment is used to characterize the maximum change value of the motion parameters at the current moment compared to the motion parameters of the previous M preset periods; N≥2, N is a positive integer.
[0026] The parameter calculation module is used to use the second smoothing window to smooth the motion parameters at the current moment to obtain the processed motion parameters.
[0027] In a possible implementation, the window adjustment module is used to use the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset periods at the current moment, and the preset weight K i , calculate the parameter change value at the current moment, including: a window adjustment module, specifically used to start from the Qth preset period, using the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset periods at the current moment and the preset weight K i , calculate the parameter change value at the current moment. Where Q≤M, Q≥2, Q is a positive integer.
[0028] In another possible implementation, the window adjustment module is used to use the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset periods at the current moment, and the preset weight K i , calculate the parameter change value at the current moment, including: a window adjustment module, specifically used to calculate the motion parameter VD at the current moment and the motion parameter V of the previous i preset cycles at the current moment i The absolute value of the difference ΔV i ; Calculate the absolute value ΔV i With the preset weight K i The product of CV i , and determine max{CV1, CV2, ..., CV M} is the parameter change value at the current moment. Among them, i takes values in {1, 2, ..., M} in sequence; max{CV1, CV2, ..., CV M} is used to calculate CV1, CV2, ..., CV M The maximum value in .
[0029] In another possible implementation, multiple motion parameter intervals are pre-stored in the electronic device, each motion parameter interval corresponds to N parameter change intervals, different motion parameter intervals correspond to different N parameter change intervals; each parameter change interval in the N parameter change intervals corresponds to a window adjustment value. Among them, the N parameter change intervals corresponding to the motion parameter at the current moment are: the N parameter change intervals corresponding to the first motion parameter interval in which the motion parameter at the current moment is located among the multiple motion parameter intervals.
[0030] In another possible implementation, the parameter calculation module is used to use the second smoothing window to smooth the motion parameters at the current moment to obtain the processed motion parameters, including: a parameter calculation module, specifically used to obtain the motion parameters of the first P preset periods at the current moment and the preset weight K j ; Calculate the motion parameters V of the previous j preset cycles at the current moment j With the preset weight K j The product S j , and calculate the processed motion parameters Among them, j takes values in {1, 2, ..., P} in sequence.
[0031] In another possible implementation, the window adjustment module is used to adjust the window size of the first smooth window using the window adjustment value to obtain the second smooth window, including: the window adjustment module is specifically used to add the window adjustment value to the window size of the first smooth window to obtain the second smooth window if the sum of the window adjustment value and the window size of the first smooth window is greater than or equal to the preset minimum window value and less than or equal to the preset maximum window value. The window size of the second smooth window is equal to the sum of the window adjustment value and the window size of the first smooth window.
[0032] In another possible implementation, the window adjustment module is further used to: if the sum of the window adjustment value and the window size of the first smooth window is less than a preset minimum window value, use the preset minimum window value as the window size of the second smooth window; if the sum of the window adjustment value and the window size of the first smooth window is greater than a preset maximum window value, use the preset maximum window value as the window size of the second smooth window.
[0033] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor and a memory for storing instructions executable by the processor;
[0034] The processor is configured to execute instructions so that the electronic device executes the motion parameter acquisition method of the first aspect and any possible implementation manner thereof.
[0035] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes a motion parameter acquisition method as in the first aspect and any possible implementation manner thereof.
[0036] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising one or more instructions, which can be executed on an electronic device to enable the electronic device to execute a motion parameter acquisition method such as the first aspect and any possible implementation method thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0038] Figure 2A A graph of motion parameters acquired in real time provided by an embodiment of the present application;
[0039] Figure 2B A curve diagram of motion parameters after compensation provided in an embodiment of the present application;
[0040] Figure 2C A schematic diagram of the smoothing process provided in an embodiment of the present application;
[0041] Figure 3 A motion parameter curve graph after smoothing window processing using different window sizes provided in an embodiment of the present application;
[0042] Figure 4 A process of obtaining motion parameters provided in an embodiment of the present application Figure 1 ;
[0043] Figure 5 Flow chart 2 of a method for obtaining motion parameters provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of obtaining motion parameters provided in an embodiment of the present application;
[0045] Figure 7 A process of obtaining motion parameters provided in an embodiment of the present application Figure 3 ;
[0046] Figure 8 A schematic diagram of the structure of a motion parameter acquisition device provided in an embodiment of the present application;
[0047] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0049] A motion parameter acquisition method provided in an embodiment of the present application can be applied to an electronic device. The execution subject of the motion parameter acquisition method can be a motion parameter acquisition device. The motion parameter acquisition device can be the above-mentioned electronic device. The motion parameter acquisition device can also be a central processing unit (CPU) of the above-mentioned electronic device; or, a control module for executing motion parameter acquisition in the above-mentioned electronic device, etc.
[0050] It should be noted that the electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, a smart watch, a sports bracelet, a virtual reality terminal, an augmented reality terminal, a wireless terminal in unmanned driving, etc. The embodiments of the present application do not limit the specific technology and specific device form used by the electronic device.
[0051] Figure 1 The hardware structure diagram of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the electronic device may include at least one processor 11 , a memory 12 , a communication interface 13 and a bus 14 .
[0052] Combine the following Figure 1 A detailed introduction to the various components of electronic equipment:
[0053] The processor 11 may be a processor or a general term for multiple processing elements. For example, the processor 11 may be a CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application, such as one or more microprocessors (Digital Signal Processor, DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, FPGA).
[0054] The processor 11 can execute various functions of the electronic device by running or executing software programs stored in the memory 12 and calling data stored in the memory 12.
[0055] In a specific implementation, as an embodiment, the processor 11 may include one or more CPUs. Figure 1 As shown, the processor 11 includes CPU0 and CPU1.
[0056] In a specific implementation, as an embodiment, the electronic device may include multiple processors. Figure 1 As shown, it includes processor 11 and processor 15. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0057] The memory 12 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 12 may exist independently and be connected to the processor 11 via the bus 14. The memory 12 may also be integrated with the processor 11. Among them, the memory 12 is used to store the software program that executes the solution of the present application, and the execution is controlled by the processor 11.
[0058] The communication interface 13 is used to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The communication interface 13 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.
[0059] The bus 14 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 1 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0060] Figure 1 The device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently. Although not shown, the electronic device may also include a battery, a camera, a Bluetooth module, a global positioning system (GPS) module, a display screen, etc., which will not be described in detail here.
[0061] It should be noted that the hardware structure of the above-mentioned motion parameter acquisition device can refer to Figure 1 Schematic diagram of the hardware structure of the electronic device shown.
[0062] With the intelligentization and portability of electronic devices, electronic devices provide services to users in more and more scenarios. Especially in sports scenarios, the intelligentization and portability of electronic devices allow users to carry electronic devices during exercise to monitor their own exercise parameters through electronic devices. Among them, the exercise parameters can be exercise speed, cadence or stride, etc.
[0063] Specifically, in the process of monitoring the motion parameters of the electronic device itself, the electronic device can use a sensor to collect the motion parameters. Due to some external factors, such as signal interference, the motion parameters collected by the electronic device are inaccurate. For example, the motion parameters collected at certain moments are abnormal values (also referred to as bad values), that is, the values exceed the normal range of the motion parameters. Therefore, the electronic device identifies the abnormal values of the collected motion parameters and removes them, and also calculates the compensation values corresponding to the abnormal values, and replaces the corresponding abnormal values with the compensation values. Replacing the corresponding abnormal values with the compensation values solves the problem of the discontinuity of the curve composed of all the collected motion parameters, but in addition to the abnormal values, there are also motion parameters that are slightly different from the actual motion speed, which leads to the problem that the curve composed of all the collected motion parameters is not smooth. Therefore, the electronic device also smoothes the collected motion parameters to reduce the deviation between the motion speed and the actual motion speed, and solves the problem of the curve being not smooth.
[0064] For example, see Figure 2A The graph of motion parameters acquired in real time is shown, the horizontal axis of the graph is time, and the vertical axis is motion parameters. It can be seen that the electronic device has collected two abnormal values, one abnormal value a1 is much smaller than the normal range of the motion parameters, and the other abnormal value a2 is much larger than the normal range of the motion parameters. Among them, the normal range of the motion parameters can be a range determined by multiple motion parameters adjacent to the acquisition time of the abnormal value, or a range determined by all motion parameters except the abnormal value.
[0065] against Figure 2A The electronic device compensates the abnormal value of the motion parameter, and the following can be obtained: Figure 2B The curve diagram of the compensated motion parameters is shown in FIG. Figure 2B It can be seen that the compensation value corresponding to the abnormal value a1 is b1, and the compensation value corresponding to the abnormal value a2 is b2.
[0066] In some embodiments, the electronic device may use a smoothing algorithm to calculate the compensation value corresponding to the abnormal value, including: for the abnormal value collected at any moment, obtaining the motion parameters collected within a certain time period before the moment, and averaging all the operating parameters collected within the time period; and using the average value as the compensation value at the moment. The certain time period depends on the window size of the smoothing window used by the smoothing algorithm.
[0067] For example, see Figure 2C As shown, at a certain time t a The motion parameter collected is an abnormal value. The electronic device determines a certain time length T2 according to the window size of the smoothing window used by the smoothing algorithm, for example, 60 seconds; then at a certain time t a The motion parameters collected in the previous T2 are averaged to obtain the motion parameters at a certain time t a compensation value.
[0068] In some embodiments, the electronic device may also use a smoothing algorithm to smooth the collected motion parameters. The process of the electronic device using a smoothing algorithm to smooth each collected motion parameter is similar to the process of using a smoothing algorithm to calculate a compensation value at a certain moment, and the embodiments of the present application are not described in detail here.
[0069] It can be known that in the process of smoothing the collected motion parameters using the smoothing algorithm mentioned above, the electronic device uses the same smoothing window to smooth all collected motion parameters; that is, the electronic device uses the same size smoothing window to smooth all collected motion parameters.
[0070] In addition, since it takes time for the electronic device to collect motion parameters and smooth the motion parameters, the sensitivity of the electronic device to changes in motion parameters will be reduced, that is, there is a delay in the electronic device obtaining changes in motion parameters. Then, the motion parameters output by the electronic device at each moment cannot reflect the changes in the motion parameters at that moment in real time, that is, the changes in the motion parameters are reflected with delay. The real-time nature of the motion parameters indicates the degree of delay in reflecting the changes in the motion parameters, and the higher the sensitivity, the higher the real-time nature of the motion parameters, and the lower the sensitivity, the lower the real-time nature of the motion parameters. Among them, the real-time nature of the motion parameters can also be called the sensitivity of obtaining real-time motion parameters, or the followability of real-time operation parameters.
[0071] Secondly, the variation intensity of the user's motion state during the motion process is not fixed (i.e., the variation of motion parameters is not fixed). For example, the user can first maintain a uniform speed and then quickly increase the speed during the running process. The variation intensity of the motion state is very small and the variation of motion parameters is also very small during the duration when the user maintains a uniform speed. The variation intensity of the motion state is very large and the variation of motion parameters is also very large during the duration when the user quickly increases the speed. And under different variation intensities of motion states, the real-time requirements for motion parameters are also different. For multiple continuous motion parameters with large variations, if the real-time of motion parameters is low, the variation degree of motion parameters can not be quickly indicated. Therefore, if the variation intensity of motion state is larger (i.e., the variation of motion parameters is larger), the real-time requirements of motion parameters are higher; if the variation intensity of motion state is smaller (i.e., the variation of motion parameters is smaller), the real-time requirements of motion parameters are lower.
[0072] If the smoothing window is larger, the more motion parameters before the moment are used for smoothing the motion parameters collected at each moment, the smoother the curve of the processed motion parameters is, and the lower the real-time performance of the motion parameters is. If the smoothing window is smaller, the fewer motion parameters before the moment are used for smoothing the motion parameters collected at each moment, the lower the smoothness of the curve of the processed motion parameters is, and the higher the real-time performance of the motion parameters is. The above-mentioned solution of smoothing all the collected motion parameters with a smoothing window of the same window size, that is, all the collected motion parameters are smoothed with motion parameters within the same duration, without considering the different real-time performance requirements of the motion parameters under different change intensities of motion states, has the problem of low accuracy of the processed motion speed and poor real-time performance of the processed motion speed.
[0073] For example, see Figure 3The motion parameter curves after being processed by smoothing windows of different window sizes are shown in FIG. 3. Three electronic devices use smoothing windows of different window sizes to smooth the operating parameters collected during the same motion process and generate corresponding three motion parameter curves. Among them, the smoothing window corresponding to curve 1 is larger than the smoothing window corresponding to curve 2, and the smoothing window corresponding to curve 2 is larger than the smoothing window corresponding to curve 3. It can be seen that curve 1 has a higher smoothness, but the duration T when the intensity of the change in the motion state is large 31 and duration T 32 The real-time performance of the motion parameters of curve 1 is low; during the time T when the intensity of the motion state change is large 31 and duration T 32 The real-time performance of the motion parameters of curve 3 is higher, but the smoothness of curve 3 is lower, especially at time t 33 Therefore, the above solution of using a smoothing window of the same window size to smooth all collected motion parameters either results in low accuracy of the motion speed after processing or poor real-time performance of the motion speed after processing.
[0074] At present, electronic devices (for example, mobile phones or sports bracelets) monitor the user's motion parameters during the user's exercise, and also output the motion parameters in real time, or output the motion parameters of the user's exercise after the user's exercise. For example, in an indoor sports scene, the user needs to adjust the motion state in real time according to his or her own motion parameters, so the electronic device needs to display the motion parameters in real time through the display screen. For another example, in an outdoor sports live broadcast scene, the motion parameters of each athlete need to be displayed in real time on the display screen. For these sports scenes that require real-time display of motion parameters, if the real-time performance of the motion parameters is poor, the changes in the motion parameters cannot be displayed quickly, reducing the user experience.
[0075] The embodiment of the present application provides a method for obtaining motion parameters, by which the accuracy and real-time performance of the obtained motion parameters can be improved at the same time. Furthermore, in those sports scenes that require real-time display of motion parameters, such as outdoor sports live broadcast scenes, the changes in motion parameters can be quickly displayed to improve the user experience.
[0076] The method for obtaining motion parameters provided in the embodiment of the present application can be applied to electronic devices. Considering that the real-time requirements for motion parameters are different under different motion state change intensities, the electronic device adjusts the window size of the smoothing window according to the change intensity of the motion state, that is, the change size of the motion parameter, so as to adjust the real-time performance of the motion parameter, thereby ensuring the accuracy and real-time performance of the motion parameter at the same time. Figure 4 As shown, the method for acquiring motion parameters may include S401-S407.
[0077] S401: The electronic device periodically obtains motion parameters of the electronic device according to a preset period.
[0078] The electronic device can receive a user's power-on operation or automatically determine that the user starts to exercise, and then determine that an instruction instructing the user to start exercising is detected; in response to the instruction instructing the user to start exercising, a motion parameter is obtained and stored; however, a motion parameter is obtained and stored every preset period.
[0079] It should be noted that the motion parameters of the electronic device may refer to the motion parameters of the user. The user may carry the electronic device or a module in the electronic device for obtaining the motion parameters of the electronic device; in this way, the motion parameters obtained by the electronic device are the motion parameters of the user.
[0080] Among them, the preset period can be 1s, 3s or 10s, etc., and the embodiment of the present application does not limit the duration of the preset period.
[0081] Among them, the motion parameter may be pace, motion speed, cadence or stride, etc.; pace is a concept used in marathon training, which may refer to the time taken to travel 1 kilometer. Taking the motion parameter as motion speed as an example, the electronic device may obtain the motion speed of the electronic device through a speed sensor; or, the cadence of the electronic device within a preset period may be obtained through an adaptive cruise control (ACC) sensor, and then the motion speed of the electronic device may be calculated based on the cadence within the preset period; or, the moving distance of the electronic device within the preset period may be measured, and the motion speed of the electronic device may be calculated using the moving distance and the duration of the preset period.
[0082] S402: The electronic device obtains a window size M of a first smoothing window at a current moment.
[0083] The first smoothing window is used to smooth the motion parameters of the electronic device at the current moment, M≥2, and M is a positive integer.
[0084] Each time the electronic device obtains the motion parameters, it also obtains the window size M of the first smoothing window at the current moment. The window size M of the first smoothing window is the window size of the smoothing window of the electronic device at the current moment.
[0085] The electronic device pre-stores an initial smoothing window and a window size Q of the initial smoothing window. Q≤M, Q≥2, and Q is a positive integer. After the electronic device starts to acquire motion parameters, the window size Q of the initial smoothing window is modified.
[0086] S403: The electronic device uses the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the first M preset periods at the current moment, and the preset weight K i , calculate the parameter change value at the current moment.
[0087] Here, i takes values in {1, 2, ..., M} in sequence. The parameter change value at the current moment is used to represent the maximum change value of the motion parameter at the current moment compared with the motion parameter of the previous M preset periods.
[0088] The motion parameters of the M preset periods before the current moment refer to the motion parameters obtained at the M moments before the current moment and adjacent to the current moment. i The weight is set according to the length of the interval between the previous i preset cycles and the current moment, and the smaller the length of the interval between the previous i preset cycles and the current moment, the larger the preset weight K i The larger the interval is, the larger the preset weight is; for example, the preset weight corresponding to the first preset period with the smallest interval duration at the current moment may be 1.
[0089] The electronic device obtains the motion parameters before the current moment according to M. If M motion parameters before the current moment are obtained, the parameter change value at the current moment is calculated; if the number of motion parameters before the current moment is less than M, the parameter change value at the current moment is not calculated.
[0090] In the embodiment of the present application, since the window size of the smoothing window represents the number of motion parameters required for smoothing the operating parameters at a certain moment, and starting from the Qth preset period, the number of motion parameters acquired by the electronic device is greater than or equal to the window size Q of the initial smoothing window. Therefore, the electronic device can start from the Qth preset period and use the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset periods at the current moment, and the preset weight K i , calculate the parameter change value at the current moment. Where Q≤M, Q≥2, Q is a positive integer.
[0091] In the embodiment of the present application, the electronic device can calculate the motion parameter V at the current moment. D The motion parameter V of the previous i preset cycles at the current moment i The absolute value of the difference ΔV i ; Then calculate the absolute value ΔV i With the preset weight K i The product of CV i , and determine max{CV1, CV2, ..., CV M} is the parameter change value at the current moment. Among them, i takes values in {1, 2, ..., M} in sequence; max{CV1, CV2, ..., CV M} is used to calculate CV1, CV2, ..., CV M The maximum value in .
[0092] The electronic device can calculate the above product CV according to the first parameter calculation formula i , the first parameter calculation formula is shown in formula (1):
[0093] CV i =|V D -V i |*K i (1)
[0094] The electronic device then calculates the parameter change value CV at the current moment according to the second parameter calculation formula D , the second parameter calculation formula is shown in formula (2):
[0095] CV D = max{CV1,CV2,…,CV M} (2)
[0096] Among them, |V D -V i | indicates V D With V i The absolute value of the difference ΔV i .
[0097] S404: The electronic device determines N parameter change intervals corresponding to the motion parameters at the current moment.
[0098] Wherein, N≥2, and N is a positive integer.
[0099] In the embodiment of the present application, multiple motion parameter intervals are pre-stored in the electronic device, each motion parameter interval corresponds to N parameter change intervals, different motion parameter intervals correspond to different N parameter change intervals; each parameter change interval in the N parameter change intervals corresponds to a window adjustment value. Among them, the N parameter change intervals corresponding to the motion parameter at the current moment are: the N parameter change intervals corresponding to the first motion parameter interval in which the motion parameter at the current moment is located among the multiple motion parameter intervals.
[0100] Exemplarily, taking the moving speed as an example, the multiple moving parameter intervals can be the first moving speed interval, the second moving speed interval, and the third moving speed interval. The first moving speed interval is 100 m / min and above, the second moving speed interval is from 100 m / min to 133 m / min, and the third moving speed interval is 133 m / min and above. Among them, 100 m / min means running 100 meters in one minute, and 133 m / min means running 133 meters in one minute. Secondly, the first moving speed interval, the second moving speed interval, and the third moving speed interval correspond to different N parameter change intervals.
[0101] Among them, the N window adjustment values corresponding to the different N parameter change intervals can be the same. Since the greater the change intensity of the motion state, the higher the real-time requirement for the motion parameters, the larger the value of the parameter change interval, the larger the corresponding window adjustment value. And, the window adjustment value can be a positive number or a negative number. When the parameter change interval is small, the corresponding window adjustment value is used to increase the window size of the first smoothing window at the current moment; when the parameter change interval is large, the corresponding window adjustment value is used to decrease the window size of the first smoothing window at the current moment.
[0102] S405. The electronic device determines, from the N parameter change intervals, the first parameter change interval where the parameter change value at the current moment is located, and determines the window adjustment value corresponding to the first parameter change interval.
[0103] The electronic device determines, from the N parameter change intervals corresponding to the above-mentioned first motion parameter interval, the first parameter change interval where the parameter change value at the current moment is located.
[0104] S406. The electronic device adjusts the window size of the first smoothing window using the window adjustment value to obtain a second smoothing window.
[0105] The electronic device can calculate the sum H of the window adjustment value and the window size M of the first smoothing window, and determine whether H is greater than or equal to the preset minimum window value Q min , and less than or equal to the preset maximum window value Q max . If Q min ≤H≤Q max , then the electronic device determines that the window size P of the second smoothing window is equal to H (that is, P is equal to the sum H of M and the window adjustment value). If Q max <H, then the electronic device determines that the window size P of the second smoothing window is equal to Q max (that is, P is equal to the preset maximum window value Q max ). If H<Q min , then the electronic device determines that the window size P of the second smoothing window is equal to Q min (that is, P is equal to the preset minimum window value Q min)。
[0106] Among them, if Q min ≤H≤Q max , add the window adjustment value to the window size of the first smoothing window to obtain a second smoothing window; where the window size of the second smoothing window is equal to H.
[0107] Among them, if H < Q min , then use the preset minimum window value as the window size of the second smoothing window; if Q max < H, then use the preset maximum window value as the window size of the second smoothing window.
[0108] S407. The electronic device smooths the motion parameters at the current moment by using the second smoothing window to obtain the processed motion parameters.
[0109] The electronic device obtains the motion parameters of the previous P preset cycles at the current moment according to the window size P of the second smoothing window; then calculates the processed motion parameters by using the motion parameters of the previous P preset cycles at the current moment. Then, the electronic device replaces the motion parameters at the current moment with the processed motion parameters at the current moment to save the processed motion parameters at the current moment. After the electronic device obtains the processed motion parameters at the current moment and obtains the motion parameters of the new current moment, it continues to execute S402 - S407 to obtain the processed motion parameters of the new current moment.
[0110] Among them, the motion parameters of the previous P preset cycles at the current moment refer to the motion parameters obtained at P moments that are before the current moment and adjacent to the current moment.
[0111] In the embodiment of the present application, the electronic device obtains the motion parameters of the previous P preset cycles at the current moment and the preset weight K j ; then calculates the product S j of the motion parameter V j of the previous j preset cycles at the current moment and the preset weight K j , and calculates the processed motion parameter Among them, j takes values in {1, 2,..., P} in turn.
[0112] Among them, the preset weight K j is a weight set according to the length of the interval between the previous j preset cycles and the current moment, and the smaller the length of the interval between the previous j preset cycles and the current moment, the larger the preset weight K j . K j and K i are both preset weights, but the value ranges of i and j may be the same or different.
[0113] It can be understood that, through this solution, the electronic device uses the window adjustment value corresponding to the first parameter change interval in which the parameter change value at the current moment is located to adjust the window size of the first smoothing window, and obtains the second smoothing window used to smooth the motion parameters at the current moment. It can be known that the greater the change of the motion parameters at any moment compared to the previous motion parameters, the higher the real-time requirements for the motion parameters. It can also be known that the smaller the smoothing window used to smooth the motion parameters at any moment, the fewer motion parameters used for smoothing and before this moment, that is, the motion parameters used for smoothing are all relatively close to the motion parameters at this moment; therefore, the real-time performance of the processed motion parameters at this moment is higher.
[0114] Then, when the electronic device adjusts the window size of the first smooth window based on the window adjustment value corresponding to the first parameter change interval where the parameter change value at the current moment is located, the window adjustment value can be used to reduce the window size of the first smooth window when the parameter change value at the current moment is large, and obtain a second smooth window with a smaller window. When the parameter change value at the current moment is large, the motion parameters at the current moment are smoothed using the second smooth window with a smaller window, and the processed motion parameters have higher real-time performance. Therefore, the larger the parameter change value at the current moment, the greater the change in the motion parameters at the current moment. If the real-time performance of the processed motion parameters is higher, the processed motion parameters can more accurately reflect the change in the motion parameters at the current moment, and therefore, the processed motion parameters at the current moment are more accurate.
[0115] Secondly, the window adjustment value can also be used to increase the window size of the first smooth window when the parameter change value at the current moment is small, so as to obtain the second smooth window after the window is enlarged. When the parameter change value at the current moment is small, the motion parameters at the current moment are smoothed using the second smooth window after the window is enlarged to obtain the processed motion parameters. Since the parameter change value at the current moment is small, the motion parameters at the current moment are smoothed using the second smooth window after the window is enlarged, that is, more motion parameters with a size close to the motion parameters at the current moment are used to obtain the processed motion parameters, and the processed motion parameters are more accurate.
[0116] In the embodiment of the present application, the method of obtaining the sports parameter is described by taking the sports parameter as the pace as an example. The pace here refers to the time taken to travel 1 kilometer, in minutes. Figure 5 , the method for obtaining motion parameters includes S501-S506.
[0117] S501: The electronic device periodically obtains the speed of the electronic device according to a preset period.
[0118] The electronic device pre-stores: the window size Q of the initial smoothing window is 2, the preset minimum window value Q min is 2, and the preset maximum window value Q max is 30. Each time the electronic device obtains a pace, it saves the pace in the smooth window at the current moment; and the number of paces saved in the smooth window at the current moment does not exceed the window size of the smooth window at the current moment.
[0119] For example, the electronic device obtains the first pace and saves the first pace in the initial smoothing window.
[0120] For example, taking an indoor sports scene where the exercise pace needs to be displayed in real time on a display screen, the electronic device may be a treadmill including a display screen, which measures the step frequency within a preset period through an ACC sensor, and then calculates the pace using the step frequency within the preset period.
[0121] For example, taking the outdoor sports live broadcast scene as an example, the electronic device may be a sports bracelet. The sports bracelet includes a GPS module and an ACC sensor. The sports bracelet can measure the distance within a preset period through the GPS module, and then calculate the pace according to the distance and the duration of the preset period; it can also measure the step frequency within a preset period through the ACC sensor; and then calculate the pace using the step frequency within the preset period.
[0122] S502: The electronic device obtains a window size M of a first smoothing window at a current moment starting from the second preset period.
[0123] When the electronic device starts the second preset cycle, the first smoothing window at the current moment is the initial smoothing window, and the initial smoothing window stores two paces, so the pace at the current moment can be smoothed. Therefore, starting from the second preset cycle, the pace after the second preset cycle is smoothed. Among them, Q max ≥M≥Q min .
[0124] S503: The electronic device uses the current pace, the pace of the previous M preset cycles at the current moment, and the preset weight K i , calculate the pace change value at the current moment.
[0125] Here, i takes values in {1, 2, ..., M} in sequence.
[0126] The electronic device has pre-stored: preset weight K g , g is successively in {1, 2, ..., Q max}. Preset weight K gThe weight is set according to the length of the interval between the first g preset periods and the current moment, and the smaller the length of the interval between the first g preset periods and the current moment, the greater the preset weight K g The larger the K j and K i All belong to K g .
[0127] For example, K g This may include K1 equal to 1, K2 equal to 0.95, K3 equal to 0.90, K4 equal to 0.85, and so on.
[0128] S504, the electronic device determines N pace change intervals corresponding to the pace interval where the current pace is located; then determines a first pace change interval where the current pace change value is located from the N pace change intervals, and determines a window adjustment value corresponding to the first pace change interval.
[0129] Wherein, N≥2, and N is a positive integer.
[0130] The electronic device pre-stores: 3 pace intervals including slow pace interval, medium pace interval and fast pace interval. The slow pace interval is more than 10 minutes, the medium pace interval is 7.5 minutes to 10 minutes, and the fast pace interval is less than 7.5 minutes; the 6 pace change intervals corresponding to the slow pace interval are 0-25, 25-30, 30-50, 50-55, 55-60, and more than 60; the 6 pace change intervals corresponding to the medium pace interval are 0-15, 15-20, 20-30, 30-35, 35-40, and more than 40; the 6 pace change intervals corresponding to the fast pace interval are 0-5, 5-10, 10-15, 15-20, 20-30, and more than 30; the 6 window adjustment values are 1, 0, -1, -5, -20, and -30.
[0131] Among them, the above 6 pace change intervals all correspond to the same 6 window adjustment values, and 1, 0, -1, -5, -20, and -30 correspond to the pace change intervals from small to large values respectively.
[0132] S505: The electronic device uses the window adjustment value to adjust the window size of the first smoothing window to obtain a second smoothing window.
[0133] The electronic device may calculate the sum H of the window adjustment value and the window size M of the first smoothing window, and compare H with Q max and Q min The size of Q min =2, Q maxis 30. If 30 ≥ H ≥ 2, the electronic device determines that the window size P of the second smoothing window is equal to H. If H > 30, the electronic device determines that the window size P of the second smoothing window is equal to 30. If H < Qmin, the electronic device determines that the window size P of the second smoothing window is equal to 2.
[0134] S506. The electronic device smooths the pace at the current moment by using the second smoothing window to obtain the processed pace.
[0135] It should be noted that the specific process of S506 can refer to the detailed description of S407, which will not be elaborated here in the embodiments of the present application.
[0136] It can be understood that through this solution, the electronic device determines the window adjustment value corresponding to the pace and the pace change value at the current moment more accurately through multiple pace change intervals respectively set for different paces and multiple window adjustment values corresponding to the multiple pace change intervals; and then adjusts the window size of the first smoothing window by using the more accurate window adjustment value, so that the real-time performance of the obtained second smoothing window better meets the real-time performance required by the pace at the current moment and the pace change value at the current moment. Therefore, the real-time performance and accuracy of the processed pace obtained by smoothing the pace at the current moment by using the second smoothing window are higher.
[0137] Exemplarily, referring to Figure 6 the schematic diagram of obtaining motion parameters shown in the figure, the electronic device responds to the instruction indicating that the user starts to exercise, and obtains the motion parameter V at the first moment t 50 and saves it to the parameter list; after the first moment t 50 , a motion parameter is obtained every 1 preset period and saved to the parameter list. For example, the motion parameter V at the moment t 50 , the motion parameter V at the moment t 51 , the motion parameter V at the moment t 51 , the motion parameter V at the moment t 52 , the motion parameter V at the moment t 52 , the motion parameter V at the moment t 53 , the motion parameter V at the moment t 53 , the motion parameter V at the moment t 54 , the motion parameter V at the moment t 54 . If Q = 2, the electronic device starts from the second preset period and executes S502 - S506 to obtain the processed motion parameters. For example, the processed motion parameter V' at the current moment t 52 , the processed motion parameter V' at the current moment t 52 , the processed motion parameter V' at the current moment t 53 , the processed motion parameter V' at the current moment t 53 , the processed motion parameter V' at the current moment t 54 , the processed motion parameter V' at the current moment t 54The electronic device also replaces the corresponding motion parameters with the processed motion parameters to save the processed motion parameters into a parameter list, wherein the parameter list is used to store the motion parameters.
[0138] Furthermore, based on the above t 50 -t 54 Take the example to explain the specific process of the motion parameter acquisition method. Figure 7 As shown, the electronic device includes a parameter acquisition module, a window adjustment module, a parameter calculation module, a display module and a parameter list. The parameter acquisition module acquires the first time t 50 The motion parameter V 50 And save it to the parameter list; at the first moment t 50 After that, a motion parameter is obtained at every preset period and saved in the parameter list. 52 , the electronic device obtains the current time t 52 The processed motion parameters V' 52 Includes steps A1-A4.
[0139] A1. The window adjustment module obtains the current time t 52 The window size of the first smoothing window is M, M = Q = 2; where the current time t 52 The first smoothing window is the initial smoothing window.
[0140] A2, the window adjustment module uses the current time t 52 The motion parameter V 52 , current time t 52 The motion parameters of the first two preset cycles (i.e., t 51 The motion parameter V 51 and t 50 The motion parameter V 50 ), and preset weights K1 and K2, calculate the current time t 52 Parameter variation value CV D52 Among them, the motion parameter V 51 is the current time t 52 The motion parameter V1 of the first preset cycle, the motion parameter V 51 Corresponding to K1; motion parameter V 50 is the current time t 52 The motion parameters V2 and V of the first two preset cycles are 50 Corresponding to K2. K1 is greater than K2. Calculate CV D52 The formula is shown in the following formula (3):
[0141]
[0142] A3, the window adjustment module adjusts the current time t52 The motion parameter V 52 and the current time t 52 Parameter variation value CV D52 , determine the current time t 52 The window adjustment value is 1, and the current time t 52 The window size of the second smoothing window is 3. Among them, since the current time t 52 There are only two motion parameters before, so the second smoothing window at the current time t52 only includes two motion parameters, namely V 51 and V 50 , instead of 3 motion parameters.
[0143] A4, parameter calculation module uses the current time t 52 The motion parameters in the second smooth window and their corresponding preset weights are used to calculate the processed motion parameters V' 52 and use the processed motion parameter V' 52 Replace V 52 , the processed motion parameter V' 52 Save in the parameter list. Among them, the calculated motion parameter V' 52 The formula is shown in formula (4):
[0144]
[0145] For the current time t 53 , the electronic device obtains the current time t 53 The processed motion parameters V' 53 Includes steps B1-B4.
[0146] B1. The window adjustment module obtains the current time t 53 The window size of the first smoothing window is M, M=3; where the current time t 53 The first smoothing window is the current time t 52 The second smoothing window.
[0147] B2, the window adjustment module uses the current time t 53 The motion parameter V 53 , current time t 53 The motion parameters of the first three preset cycles (i.e. V' 52 、V 51 and V 50 ), and preset weights K1, K2 and K3, calculate the current time t 53 Parameter variation value CV D53 .
[0148] Among them, the motion parameter V' 52 is the current time t53 The motion parameters V1 and V' of the first preset cycle 52 Corresponding to K1; motion parameter V 51 is the current time t 53 The motion parameters V2 and V of the first two preset cycles are 51 Corresponding to K2; motion parameter V 50 is the current time t 53 The motion parameters V3 and V 50 Corresponding to K3. K1 is greater than K2, and K2 is greater than K3.
[0149] It should be noted that the calculation of the current time t 53 Parameter variation value CV D53 For the specific process, please refer to the above calculation of the current time t 52 Parameter variation value CV D52 The specific description of the embodiments of the present application will not be repeated here.
[0150] B3, the window adjustment module adjusts the current time t 53 The motion parameter V 53 and the current time t 53 Parameter variation value CV D53 , determine the current time t 53 The window adjustment value is 0, and the current time t 53 The window size of the second smoothing window is 3. Among them, the current time t 53 The second smoothing window includes V' 52 、V 51 and V 50 .
[0151] B4, parameter calculation module uses the current time t 53 The motion parameters in the second smooth window and their corresponding preset weights are used to calculate the processed motion parameters V' 53 and use the processed motion parameter V' 53 Replace V 53 , the processed motion parameter V' 53 Stored in the parameter list.
[0152] It should be noted that the motion parameter V' after calculation is 53 For the specific process, please refer to the motion parameter V' after the above calculation. 52 The specific description of the embodiments of the present application will not be repeated here.
[0153] For the current time t 54 , the electronic device obtains the current time t 54 The processed motion parameters V'54 Includes steps C1-C4.
[0154] C1. The window adjustment module obtains the current time t 54 The window size of the first smoothing window is M, M=3; where the current time t 54 The first smoothing window is the current time t 53 The second smoothing window.
[0155] C2, the window adjustment module uses the current time t 54 The motion parameter V 54 , current time t 54 The motion parameters of the first three preset cycles (i.e. V' 53 、V' 52 and V 51 ), and preset weights K1, K2 and K3, calculate the current time t 54 Parameter variation value CV D54 .
[0156] Among them, the motion parameter V' 53 is the current time t 54 The motion parameters V1 and V' of the first preset cycle 53 Corresponding to K1; motion parameter V' 52 is the current time t 54 The motion parameters V2 and V' of the first two preset cycles 52 Corresponding to K2; motion parameter V 51 is the current time t 54 The motion parameters V3 and V 51 Corresponding to K3. K1 is greater than K2, and K2 is greater than K3.
[0157] It should be noted that the calculation of the current time t 54 Parameter variation value CV D54 For the specific process, please refer to the above calculation of the current time t 52 Parameter variation value CV D52 The specific description of the embodiments of the present application will not be repeated here.
[0158] C3, the window adjustment module adjusts the current time t 54 The motion parameter V 54 and the current time t 54 Parameter variation value CV D54 , determine the current time t 54 The window adjustment value is -5, and the current time t 54 The window size of the second smoothing window is 2.
[0159] Among them, and determine the current time t 54 The second smoothing window includes V' 53 and V' 52 Since the current time t 54 The window adjustment value -5 is equal to the current time t 54 The sum of the window sizes 3 of the first smoothing window is equal to -2, which is less than the preset minimum window value 2. 54 The window size of the second smoothing window is set to a preset minimum window value of 2.
[0160] C4, parameter calculation module uses the current time t 54 The motion parameters in the second smooth window and their corresponding preset weights are used to calculate the processed motion parameters V' 54 and use the processed motion parameter V' 54 Replace V 54 , the processed motion parameter V' 54 Stored in the parameter list.
[0161] It should be noted that the motion parameter V' after calculation is 54 For the specific process, please refer to the motion parameter V' after the above calculation. 52 The specific description of the embodiments of the present application will not be repeated here.
[0162] It is understandable that the above method can be implemented by a motion parameter acquisition device. In order to realize the above functions, the motion parameter acquisition device includes a hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0163] The embodiment of the present application can divide the functional modules of the above-mentioned motion parameter acquisition device, etc. according to the above-mentioned method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0164] In the case of dividing each functional module into corresponding functional modules, Figure 8 A possible structural diagram of a motion parameter acquisition device involved in the above embodiment is shown. The device 800 includes: a parameter acquisition module 801, a window adjustment module 802 and a parameter calculation module 803.
[0165] The parameter acquisition module 801 is used to support the device 800 to perform S401, S501 in the above method embodiment, and / or other processes for the technology described herein; the window adjustment module 802 is used to support the device 800 to perform S402-S406, S502-S505 in the above method embodiment, and / or other processes for the technology described herein. The parameter calculation module 803 is used to support the device 800 to perform S407, S506 in the above method embodiment, and / or other processes for the technology described herein.
[0166] Of course, the above-mentioned device 800 includes but is not limited to the unit modules listed above. For example, the device 800 may also include a storage unit for storing motion parameters of the electronic device, and a display module for displaying the processed motion parameters. In addition, the specific functions that can be realized by the above-mentioned functional units also include but are not limited to the functions corresponding to the method steps described in the above examples. The detailed description of other units of the device 800 can refer to the detailed description of the corresponding method steps, and the embodiments of the present application will not be repeated here.
[0167] When an integrated unit is used, the parameter acquisition module 801 , the window adjustment module 802 and the parameter calculation module 803 etc. may be integrated into one processing module, and the parameter acquisition module 801 , the window adjustment module 802 and the parameter calculation module 803 may be the processing module of the device 800 .
[0168] Fig. 9 A possible structural diagram of the electronic device involved in the above embodiment is shown. The electronic device 900 includes: a processing module 901 , a storage module 902 and a communication module 903 .
[0169] The processing module 901 is used to control and manage the electronic device 900. The storage module 902 is used to store program codes and data of the electronic device 900. The communication module 903 is used to communicate with other devices. For example, the communication module 903 is used to receive or send data to other devices.
[0170] Among them, the processing module 901 can be a processor or a controller, for example, it can be a CPU, a general processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements a computing function, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The communication module 903 can be a transceiver, a transceiver circuit or a communication interface, etc. The storage module 902 can be a memory.
[0171] When the processing module 901 is a processor (such as Figure 1 The processor 11 and processor 15 shown in FIG. 1 ), the communication module 903 is a communication circuit (such as Figure 1 The communication interface 13 shown in FIG. 1 is a storage module 902, and the storage module 902 is a storage device (such as Figure 1 When the memory 12 is shown, the electronic device provided by the present application can be Figure 1 The electronic device shown in the figure, wherein the processor, communication interface and memory can be coupled together via a bus.
[0172] The embodiment of the present application further provides a computer storage medium in which a computer program code is stored. When the processor executes the computer program code, the electronic device executes Figure 4 and Figure 5 The relevant method steps in any of the figures implement the method in the above embodiment.
[0173] The present application also provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute Figure 4 and Figure 5 The relevant method steps in any of the figures implement the method in the above embodiment.
[0174] Among them, the motion parameter acquisition device 800, electronic device 900, computer storage medium or computer program product provided in the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0175] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0176] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0177] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0178] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0179] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, or all or part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk, and other media that can store program codes.
[0180] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for obtaining motion parameters, characterized in that: Applied to electronic equipment, the method comprises: periodically acquiring the motion parameters of the electronic device according to a preset period; Obtaining a window size M of a first smoothing window at the current moment; wherein the first smoothing window is used to smooth the motion parameters of the electronic device at the current moment, M≥2, and M is a positive integer; The motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset cycles at the current moment, and the preset weight K are used. i , calculate the parameter change value at the current moment; wherein i takes values in {1, 2, ..., M} in sequence; the parameter change value at the current moment is used to represent the maximum change value of the motion parameter at the current moment compared with the motion parameter of the previous M preset periods; Determine N parameter change intervals corresponding to the motion parameter at the current moment; wherein N≥2, and N is a positive integer; Determine, from the N parameter change intervals, a first parameter change interval in which the parameter change value at the current moment is located, and determine a window adjustment value corresponding to the first parameter change interval; Using the window adjustment value to adjust the window size of the first smoothing window to obtain a second smoothing window; Using the second smoothing window to smooth the motion parameters at the current moment to obtain processed motion parameters; The motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset cycles at the current moment, and the preset weight K are used. i , calculating the parameter change value at the current moment, including: Calculate the motion parameter V at the current moment D and the motion parameter V of the previous i preset cycles at the current moment i The absolute value of the difference ΔV i ; Calculate the absolute value ΔV i With the preset weight K i The product of CV i , and determine max{CV1, CV2, ..., CV M } is the parameter change value at the current moment; wherein i takes values in {1, 2, ..., M} in sequence; max{CV1, CV2, ..., CV M } is used to calculate CV1, CV2, ..., CV M The maximum value in .
2. The method according to claim 1, characterized in that The motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset cycles at the current moment, and the preset weight K are used. i , calculating the parameter change value at the current moment, including: Starting from the Qth preset period, the motion parameters of the electronic device at the current moment, the motion parameters of the electronic device in the previous M preset periods at the current moment, and the preset weight K are used. i , calculate the parameter change value at the current moment; wherein 2≤Q≤M, Q is a positive integer.
3. The method according to claim 1 or 2, characterized in that: The electronic device pre-stores a plurality of motion parameter intervals, each motion parameter interval corresponds to N parameter change intervals, and different motion parameter intervals correspond to different N parameter change intervals; each parameter change interval in the N parameter change intervals corresponds to a window adjustment value; The N parameter change intervals corresponding to the motion parameter at the current moment are: the N parameter change intervals corresponding to the first motion parameter interval in which the motion parameter at the current moment is located among the multiple motion parameter intervals.
4. The method according to claim 3, characterized in that The step of smoothing the motion parameters at the current moment by using the second smoothing window to obtain the processed motion parameters includes: Get the motion parameters and preset weights K of the previous P preset periods at the current moment j ; Wherein, j takes values in {1, 2, ..., P} in sequence; Calculate the motion parameters V of the previous j preset periods at the current moment j With the preset weight K j The product S j , and calculate the processed motion parameters 5. The method according to claim 1 or 2, characterized in that: The step of adjusting the window size of the first smoothing window by using the window adjustment value to obtain a second smoothing window includes: If the sum of the window adjustment value and the window size of the first smoothing window is greater than or equal to a preset minimum window value and less than or equal to a preset maximum window value, the window adjustment value is added to the window size of the first smoothing window to obtain the second smoothing window; wherein the window size of the second smoothing window is equal to the sum of the window adjustment value and the window size of the first smoothing window.
6. The method according to claim 5, characterized in that The method further comprises: If the sum of the window adjustment value and the window size of the first smoothing window is less than the preset minimum window value, using the preset minimum window value as the window size of the second smoothing window; If the sum of the window adjustment value and the window size of the first smoothing window is greater than the preset maximum window value, the preset maximum window value is used as the window size of the second smoothing window.
7. A motion parameter acquisition device, characterized in that: The device comprises: A parameter acquisition module, used to periodically acquire the motion parameters of the device according to a preset period; The window adjustment module is used to obtain the window size M of the first smoothing window at the current moment; using the motion parameters of the device at the current moment, the motion parameters of the device in the previous M preset cycles at the current moment, and the preset weight K i , calculating the parameter change value at the current moment; determining N parameter change intervals corresponding to the motion parameter at the current moment; determining a first parameter change interval in which the parameter change value at the current moment is located from the N parameter change intervals, and determining a window adjustment value corresponding to the first parameter change interval; using the window adjustment value to adjust the window size of the first smoothing window to obtain a second smoothing window; Wherein, the first smoothing window is used to smooth the motion parameters of the device at the current moment, M≥2, M is a positive integer; i takes values in {1, 2, ..., M} in sequence; the parameter change value at the current moment is used to represent the maximum change value of the motion parameter at the current moment compared with the motion parameters of the previous M preset periods; N≥2, N is a positive integer; a parameter calculation module, configured to use the second smoothing window to perform smoothing processing on the motion parameters at the current moment to obtain processed motion parameters; The motion parameters of the device at the current moment, the motion parameters of the device in the previous M preset cycles at the current moment, and the preset weight K are used. i , calculating the parameter change value at the current moment, including: calculating the motion parameter V at the current moment D and the motion parameter V of the previous i preset cycles at the current moment i The absolute value of the difference ΔV i ; Calculate the absolute value ΔV i With the preset weight K i The product of CV i , and determine max{CV1, CV2, ..., CV M } is the parameter change value at the current moment; wherein i takes values in {1, 2, ..., M} in sequence; max{CV1, CV2, ..., CV M } is used to calculate CV1, CV2, ..., CV M The maximum value in .
8. The device according to claim 7, characterized in that The window adjustment module is used to adopt the motion parameters of the device at the current moment, the motion parameters of the device in the previous M preset cycles at the current moment, and the preset weight K i , calculating the parameter change value at the current moment, including: The window adjustment module is specifically used to use the motion parameters of the device at the current moment, the motion parameters of the device in the previous M preset periods at the current moment, and the preset weight K starting from the Qth preset period. i , calculate the parameter change value at the current moment; wherein 2≤Q≤M, Q is a positive integer.
9. The device according to claim 7 or 8, characterized in that The device pre-stores a plurality of motion parameter intervals, each motion parameter interval corresponds to N parameter change intervals, and different motion parameter intervals correspond to different N parameter change intervals; each parameter change interval in the N parameter change intervals corresponds to a window adjustment value; The N parameter change intervals corresponding to the motion parameter at the current moment are: the N parameter change intervals corresponding to the first motion parameter interval in which the motion parameter at the current moment is located among the multiple motion parameter intervals.
10. The device according to claim 9, characterized in that The parameter calculation module is used to use the second smoothing window to smooth the motion parameters at the current moment to obtain the processed motion parameters, including: The parameter calculation module is specifically used to obtain the motion parameters and preset weights K of the previous P preset periods at the current moment. j ; Calculate the motion parameters V of the previous j preset cycles at the current moment j With the preset weight K j The product S j , and calculate the processed motion parameters Among them, j takes values in {1, 2, ..., P} in sequence.
11. The device according to claim 7 or 8, characterized in that The window adjustment module is used to adjust the window size of the first smoothing window by using the window adjustment value to obtain a second smoothing window, including: The window adjustment module is specifically used to add the window adjustment value and the window size of the first smooth window to obtain the second smooth window if the sum of the window adjustment value and the window size of the first smooth window is greater than or equal to a preset minimum window value and less than or equal to a preset maximum window value; wherein the window size of the second smooth window is equal to the sum of the window adjustment value and the window size of the first smooth window.
12. The device according to claim 11, characterized in that The window adjustment module is further used for: If the sum of the window adjustment value and the window size of the first smoothing window is less than the preset minimum window value, using the preset minimum window value as the window size of the second smoothing window; If the sum of the window adjustment value and the window size of the first smoothing window is greater than the preset maximum window value, the preset maximum window value is used as the window size of the second smoothing window.
13. An electronic device, characterized in that: include: a processor and a memory for storing instructions executable by the processor; The processor is configured to execute the instruction so that the electronic device executes the motion parameter acquisition method as described in any one of claims 1-6.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the motion parameter acquisition method according to any one of claims 1 to 6.