WO2020221109A1 - 一种移动距离计算方法、装置以及*** - Google Patents

一种移动距离计算方法、装置以及*** Download PDF

Info

Publication number
WO2020221109A1
WO2020221109A1 PCT/CN2020/086524 CN2020086524W WO2020221109A1 WO 2020221109 A1 WO2020221109 A1 WO 2020221109A1 CN 2020086524 W CN2020086524 W CN 2020086524W WO 2020221109 A1 WO2020221109 A1 WO 2020221109A1
Authority
WO
WIPO (PCT)
Prior art keywords
motion
preset
terminal
preset motion
models
Prior art date
Application number
PCT/CN2020/086524
Other languages
English (en)
French (fr)
Inventor
姜永航
陈霄汉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2020221109A1 publication Critical patent/WO2020221109A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/10Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 by using measurements of speed or acceleration
    • G01C21/12Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 by using measurements of speed or acceleration executed aboard the object being navigated; Dead reckoning
    • G01C21/16Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 by using measurements of speed or acceleration executed aboard the object being navigated; Dead reckoning by integrating acceleration or speed, i.e. inertial navigation
    • G01C21/165Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 by using measurements of speed or acceleration executed aboard the object being navigated; Dead reckoning by integrating acceleration or speed, i.e. inertial navigation combined with non-inertial navigation instruments
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D21/00Measuring or testing not otherwise provided for
    • G01D21/02Measuring two or more variables by means not covered by a single other subclass
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S19/00Satellite radio beacon positioning systems; Determining position, velocity or attitude using signals transmitted by such systems
    • G01S19/38Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system
    • G01S19/39Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system the satellite radio beacon positioning system transmitting time-stamped messages, e.g. GPS [Global Positioning System], GLONASS [Global Orbiting Navigation Satellite System] or GALILEO
    • G01S19/42Determining position
    • G01S19/45Determining position by combining measurements of signals from the satellite radio beacon positioning system with a supplementary measurement
    • G01S19/47Determining position by combining measurements of signals from the satellite radio beacon positioning system with a supplementary measurement the supplementary measurement being an inertial measurement, e.g. tightly coupled inertial
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H20/00ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
    • G16H20/30ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to physical therapies or activities, e.g. physiotherapy, acupressure or exercising

Definitions

  • This application relates to the field of terminals, and in particular to a method, device and system for calculating a moving distance.
  • the smart terminal can determine the amount of exercise of the sports target by detecting the number of steps and moving distance of the sports target, and further determine the parameters of the sports target's exercise intensity, calorie consumption, etc., to provide good motion detection for the sports target.
  • the embodiments of the present application provide a method, device, and system for calculating a moving distance, which solves the problem of large errors caused when estimating the moving distance in the prior art.
  • an embodiment of the present application provides a method for calculating a moving distance.
  • the method includes: when the terminal detects that the moving target is in a moving state, the terminal determines the acceleration information and the first motion parameter of the moving target;
  • the N preset motion models determine the second motion parameter of the motion target during the motion time; wherein, the first motion parameter is the number of steps of the motion target, and the second motion parameter is the step width of the motion target; or, the first motion parameter is For the moving time of the moving target, the second moving parameter is the moving speed of the moving target; N is an integer greater than or equal to 2; the terminal determines the moving distance of the moving target according to the first moving parameter and the second moving parameter.
  • the embodiment of the present application provides a method for calculating a moving distance.
  • the terminal detects that the moving target is in a moving state, the terminal determines the acceleration information and the first motion parameter of the moving target.
  • the terminal determines the second movement parameter of the moving target within the movement time according to the acceleration information and the N preset movement models.
  • the first motion parameter is the number of steps of the motion target, and the second motion parameter is the stride length of the motion target; or, the first motion parameter is the motion time of the motion target, and the second motion parameter is the motion speed of the motion target;
  • N is An integer greater than or equal to 2; the terminal determines the moving distance of the moving target according to the first motion parameter and the second motion parameter.
  • the calculation results of the N preset motion models can be combined to determine the second motion parameter, which avoids the need for a single preset motion model to calculate the moving distance of the moving target. Assuming that the acceleration of the motion model and the acceleration information of the moving target are significantly different, the error in the calculation of the moving distance is large, so the accuracy of calculating the moving distance of the moving target can be improved.
  • the first motion parameter is the number of steps of the motion target
  • the second motion parameter is the stride length of the motion target.
  • the terminal determines the moving distance according to the first motion parameter and the second motion parameter, including: The product of the number and the stride length determines the movement distance.
  • the first motion parameter is the motion time of the motion target
  • the second motion parameter is the motion speed of the motion target
  • the terminal determines the moving distance according to the first motion parameter and the second motion parameter, including: The product of time and movement speed determines the movement distance.
  • the terminal determines the second motion parameter of the moving target during the motion time according to the acceleration information and N preset motion models, including: the terminal inputs the acceleration information into the N preset motion models to obtain N preset motion models.
  • the terminal inputs the acceleration information into the N preset motion models to obtain N preset motion models.
  • the terminal determines the second motion parameter according to the third motion parameter corresponding to each preset motion model and the respective weight of each preset motion model.
  • the method provided in the embodiment of the present application further includes: the terminal determines the respective weight of each preset motion model according to the similarity between the acceleration information and each of the N preset motion models . Determine the weight of each preset motion model based on the similarity between the acceleration information and the preset motion model, which can make the weight setting of each preset motion model more reasonable. For example, you can assign a preset motion model with higher similarity to the acceleration information Larger weight, thereby improving the accuracy of the movement distance calculation.
  • the terminal determines the respective weight of each preset motion model according to the similarity between the acceleration information and each of the N preset motion models, including: the terminal determines each preset motion The acceleration variance average and step frequency average of the model; the terminal determines the acceleration information and each preset motion model according to the acceleration variance average and step frequency average of each preset motion model and the acceleration variance and step frequency of acceleration information The similarity of each preset motion model; the terminal determines the weight of each preset motion model according to the similarity between the acceleration information and each preset motion model.
  • the similarity between the acceleration information and each of the N preset motion models can be more accurately determined.
  • the N preset motion models are preset motion models among the M preset motion models, and the similarity between the N preset motion models and the acceleration information is greater than or equal to the preset threshold.
  • M is an integer greater than N.
  • the acceleration information includes the first acceleration information corresponding to each of the multiple time windows within the movement time; when the second movement parameter is the movement speed of the moving target, the terminal will use the acceleration information and N
  • the preset motion model determining the second motion parameter of the moving target during the motion time includes: the terminal determines the motion speed corresponding to each time window according to the first acceleration information corresponding to each time window and the N preset motion models. In order to calculate the corresponding movement speed in each time window.
  • the terminal determines the movement distance of the moving target according to the first movement parameter and the second movement parameter, including: the terminal determines the movement according to the movement speed corresponding to each time window and the respective time length of each time window The moving distance of the target. Determining the movement distance according to the corresponding movement speed in each time window can make the final result of determining the movement distance based on the movement speed more accurate.
  • the method provided in the embodiment of the present application further includes: the terminal obtains N preset motion models from the server.
  • the terminal obtains the N preset motion models pre-trained by the server, which can reduce the calculation amount of the terminal and save the calculation time.
  • the N preset motion models are pre-stored in the terminal.
  • an embodiment of the present application provides a method for calculating a movement distance, and the method includes: a server obtains historical data.
  • the historical data includes exercise data of different exercise types.
  • the server divides the historical data into N types of historical data.
  • the server performs preset motion model training on N types of historical data, and obtains N preset motion models.
  • the embodiment of the application provides a method for calculating a movement distance.
  • the server obtains historical data; the server divides the historical data into N types of historical data; the server performs preset motion model training on the N types of historical data to obtain N preset motion models.
  • the server classifies historical data, and trains different types of historical data with preset motion models to obtain N preset motion models. Improved the adaptability to different operating scenarios.
  • the method further includes: the server sends the N preset motion models to the terminal.
  • the server sending N preset motion models to the terminal includes: the server receives an acquisition request from the terminal.
  • the acquisition request is used to request N preset motion models.
  • the server sends N preset motion models to the terminal according to the acquisition request.
  • the terminal obtains at least M preset motion models from the server.
  • the N preset motion models are preset motion models among the M preset motion models, and the similarity between the N preset motion models and the acceleration information is greater than or equal to the preset threshold.
  • M is an integer greater than N.
  • the server selects N preset motion models from the M preset motion models, the acquisition request sent by the terminal to the server also needs to carry acceleration information of the moving target.
  • an embodiment of the present application provides a moving distance calculation device.
  • the moving distance calculation device includes a processing unit configured to determine the acceleration information and the first movement of the moving object when it is detected that the moving object is in a moving state. Parameters; the processing unit is also used to determine the second motion parameter of the moving target in the motion time according to the acceleration information and the N preset motion models; wherein the first motion parameter is the number of steps of the moving target, and the second motion parameter is the motion The stride length of the target; or, the first motion parameter is the motion time of the motion target, and the second motion parameter is the motion speed of the motion target; N is an integer greater than or equal to 2; the processing unit is also used for summing according to the first motion parameter and The second motion parameter determines the moving distance of the moving target.
  • the first motion parameter is the number of steps of the motion target
  • the second motion parameter is the step width of the motion target
  • the processing unit is also specifically configured to: determine the moving distance according to the product of the number of steps and the stride length .
  • the first motion parameter is the motion time of the motion target
  • the second motion parameter is the motion speed of the motion target
  • the processing unit is also specifically used for: determining the moving distance according to the product of the motion time and the motion speed .
  • the processing unit is also specifically used to: input acceleration information into N preset motion models to obtain the third motion parameter corresponding to each preset motion model in the N preset motion models;
  • the third motion parameter corresponding to the preset motion model and the respective weight of each preset motion model are used to determine the second motion parameter.
  • the processing unit is further specifically configured to: determine the respective weight of each preset motion model according to the similarity between the acceleration information and each of the N preset motion models.
  • the processing unit is also specifically used to: determine the average value of the acceleration variance and the average step frequency of each preset motion model; according to the average value of the acceleration variance and the average step frequency of each preset motion model As well as the acceleration variance and step frequency of the acceleration information, the similarity between the acceleration information and each preset motion model is determined; the weight of each preset motion model is determined according to the similarity between the acceleration information and each preset motion model.
  • the N preset motion models are preset motion models among the M preset motion models, and the similarity between the N preset motion models and the acceleration information is greater than or equal to the preset threshold, M Is an integer greater than N.
  • the acceleration information includes first acceleration information corresponding to each time window of the multiple time windows within the exercise time; the processing unit is further specifically configured to: according to the first acceleration information corresponding to each time window, And N preset motion models determine the motion speed corresponding to each time window.
  • the processing unit is also specifically configured to: determine the moving distance of the moving target according to the moving speed corresponding to each time window and the respective time length of each time window.
  • the moving distance calculation device further includes: a communication unit configured to obtain N preset motion models from the server.
  • an embodiment of the present application provides a device for calculating a moving distance.
  • the device for calculating a moving distance may be a terminal or a chip in the terminal.
  • the communication unit may be a communication interface.
  • the processing unit may be a processor.
  • the moving distance calculation device may further include a storage unit.
  • the storage unit may be a memory.
  • the storage unit is used to store computer program code, and the computer program code includes instructions.
  • the processing unit executes the instructions stored in the storage unit, so that the terminal implements the movement distance calculation method described in the first aspect or any one of the possible implementation manners of the first aspect.
  • the processing unit may be a processor, and the communication unit may be collectively referred to as a communication interface.
  • the communication interface may be an input/output interface, pin or circuit, etc.
  • the processing unit executes the computer program code stored in the storage unit, so that the terminal implements the movement distance calculation method described in the first aspect or any one of the possible implementations of the first aspect.
  • the storage unit may be the chip
  • the storage unit (for example, register, cache, etc.) in the terminal may also be a storage unit (for example, read-only memory, random access memory, etc.) located outside the chip in the terminal.
  • the processor, the communication interface and the memory are coupled with each other.
  • an embodiment of the present application provides a movement distance calculation device, the movement distance calculation device includes: a communication unit, configured to obtain movement history data; a processing unit, configured to divide the history data into N types of history data; processing The unit is also used to perform preset motion model training on N types of historical data to obtain N preset motion models.
  • the communication unit is further specifically configured to: send the N preset motion models to the terminal.
  • the communication unit is further specifically configured to: receive an acquisition request from the terminal; the acquisition request is used to request N preset motion models.
  • the communication unit is further specifically configured to: send N preset motion models to the terminal.
  • the communication unit is also specifically configured to send at least M preset motion models to the terminal.
  • the N preset motion models are preset motion models among the M preset motion models, and the similarity between the N preset motion models and the acceleration information is greater than or equal to the preset threshold.
  • M is an integer greater than N.
  • the processing unit selects N preset motion models from the M preset motion models, the acquisition request sent by the terminal to the server also needs to carry acceleration information of the moving target.
  • an embodiment of the present application provides a device for calculating a moving distance.
  • the device for calculating a moving distance may be a server or a chip in the server.
  • the communication unit may be a communication interface.
  • the processing unit may be a processor.
  • the moving distance calculation device may further include a storage unit.
  • the storage unit may be a memory.
  • the storage unit is used to store computer program code, and the computer program code includes instructions.
  • the processing unit executes the instructions stored in the storage unit, so that the server implements the movement distance calculation method described in the second aspect or any one of the possible implementation manners of the second aspect.
  • the processing unit may be a processor, and the communication unit may be collectively referred to as a communication interface.
  • the communication interface may be an input/output interface, pin or circuit, etc.
  • the processing unit executes the computer program code stored in the storage unit, so that the terminal implements the movement distance calculation method described in the second aspect or any one of the possible implementations of the second aspect.
  • the storage unit may be the chip
  • the internal storage unit for example, register, cache, etc.
  • the processor, the communication interface and the memory are coupled with each other.
  • an embodiment of the present application provides a moving distance calculation device, which includes: a processor and a communication interface; the communication interface is coupled to the processor, and the processor is used to run a computer program or instruction to implement the first aspect and the first aspect.
  • a moving distance calculation device which includes: a processor and a communication interface; the communication interface is coupled to the processor, and the processor is used to run a computer program or instruction to implement the first aspect and the first aspect.
  • an embodiment of the present application provides another movement distance calculation device, which includes: a processor and a communication interface; the communication interface is coupled to the processor, and the processor is used to run a computer program or instruction to implement the second aspect and The moving distance calculation method described in any possible implementation of the second aspect.
  • an embodiment of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores instructions.
  • the movement distance calculation device executes the operations as described in the first aspect and the first aspect.
  • any one of the possible implementations described in the moving distance calculation method can be any one of the possible implementations described in the moving distance calculation method.
  • an embodiment of the present application provides a computer-readable storage medium with instructions stored in the computer-readable storage medium.
  • the movement distance calculation device executes the operations as described in the second aspect and the first aspect.
  • the embodiments of the present application provide a computer program product containing instructions.
  • the travel distance calculation device can execute any one of the first aspect and the first aspect. The calculation method of the movement distance described in the realization method.
  • an embodiment of the present application provides a computer program product containing instructions.
  • the travel distance calculation device can execute any one of the second aspect and the second aspect. The calculation method of the movement distance described in the realization method.
  • an embodiment of the present application provides a chip.
  • the chip includes a processor and a communication interface, and the communication interface is coupled to the processor.
  • the processor is used to run a computer program or instruction to implement any of the first aspect and the first aspect. The calculation method of the movement distance described in a possible implementation.
  • the chip provided in the embodiment of the present application further includes a memory for storing computer programs or instructions.
  • an embodiment of the present application provides a chip.
  • the chip includes a processor and a communication interface, and the communication interface is coupled to the processor.
  • the processor is used to run a computer program or instruction to implement any of the second and second aspects. The calculation method of the movement distance described in a possible implementation.
  • the chip provided in the embodiment of the present application further includes a memory for storing computer programs or instructions.
  • an embodiment of the present application provides a movement distance calculation system, including: a terminal, and a server communicating with the terminal, and the terminal is used to perform any one of the possible implementation manners of the first aspect and the first aspect
  • the server is used to execute the moving distance calculation method described in the second aspect and any one of the possible implementation manners of the second aspect.
  • FIG. 1 is a schematic structural diagram of a mobile phone provided by an embodiment of this application.
  • FIG. 2 is a system architecture diagram of a moving distance calculation system provided by an embodiment of the application
  • FIG. 3 is a system architecture diagram of another movement distance calculation system provided by an embodiment of the application.
  • FIG. 4a is a schematic diagram of an interface for displaying movement data of a moving target on a mobile phone according to an embodiment of the application
  • 4b is a schematic diagram of an interface of a sports bracelet displaying sports data of a sports target according to an embodiment of the application;
  • FIG. 5 is a first schematic flowchart of a method for calculating a moving distance provided by an embodiment of the application
  • FIG. 6 is a schematic diagram of a method for interaction between a terminal and a server according to an embodiment of the application
  • FIG. 7 is a second schematic flowchart of a method for calculating a moving distance provided by an embodiment of this application.
  • FIG. 8 is a third flowchart of a method for calculating a moving distance provided by an embodiment of this application.
  • FIG. 9 is a fourth flowchart of a method for calculating a moving distance according to an embodiment of the application.
  • FIG. 10 is a fifth schematic flowchart of a method for calculating a moving distance provided by an embodiment of this application.
  • FIG. 11 is a schematic structural diagram of a moving distance device provided by an embodiment of this application.
  • FIG. 12 is a schematic structural diagram of another moving distance device provided by an embodiment of this application.
  • words such as “first” and “second” are used to distinguish the same items or similar items that have substantially the same function and effect.
  • the first motion parameter and the second motion parameter are only for distinguishing different motion parameters, and the sequence of them is not limited.
  • words such as “first” and “second” do not limit the quantity and order of execution, and words such as “first” and “second” do not limit the difference.
  • At least one refers to one or more, and “multiple” refers to two or more.
  • “And/or” describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, both A and B exist, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the associated objects are in an "or” relationship.
  • "The following at least one item (a)” or similar expressions refers to any combination of these items, including any combination of a single item (a) or plural items (a).
  • at least one item (a) of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple .
  • Step counting algorithm When a person is in motion, an acceleration will be generated in the three dimensions of the space (using a person as a reference object, respectively, up and down, front and back, and left and right). During the movement of the moving target, one of the three dimensions of acceleration always changes periodically with time. The value of the periodically changing acceleration changes with time. When the periodically changing acceleration is placed in a coordinate system with time as the axis, the acceleration curve generally appears as a sinusoidal curve. In the process of human movement, each step corresponds to a peak in the sine curve. We usually count a peak as one step.
  • the essence of the pedometer algorithm is to determine the period of the acceleration waveform.
  • the acceleration experiences a peak-trough-peak, or trough-peak-trough, it is recorded as one step.
  • the step counting algorithm can also count the number of steps q taken in time t 2 , then the corresponding step frequency
  • Cadence The frequency of the step of the moving target during exercise.
  • the calculation method of cadence is the number of steps taken by the moving target in a period of time divided by the duration of this period of time (the unit of duration is generally minutes). Exemplarily, if the moving target has walked 1200 steps in 10 minutes, the step frequency of the moving target is 120.
  • Stride length the range of the step of the moving target during the movement, that is, the length of the step of the moving target during the movement.
  • Acceleration The amount of change in the speed of the moving target due to stepping and retraction during the movement.
  • the server Since the moving speed of the moving target is related to the cadence of the moving target, the server needs to collect a large amount of historical data of multiple moving targets that can reflect the cadence of the moving target when training the motion model.
  • the historical data may also include: the movement distance corresponding to the cadence.
  • the server performs model training on these historical data to obtain a motion model (the motion model is a mathematical model, the input parameter is the step frequency of the moving target, and the output parameter is the stride of the moving target or the speed of the moving target, where the output The parameter is related to model training, the model training output for stride is stride, and the training output for motion speed is motion speed).
  • the server sends the motion model to the terminal, and the terminal receives the motion model sent from the server.
  • the acceleration data of the moving target collected by the terminal (the acceleration data is the original acceleration data of the moving target collected by the sensor, and the acceleration information can be obtained after processing the acceleration data) and then the step counting algorithm is used to record the number of steps of the moving target (or Exercise time) and cadence.
  • the terminal inputs the stride frequency into the aforementioned motion model to obtain stride length.
  • the terminal multiplies the stride by the number of steps determined by the step counting algorithm to obtain the moving distance of the moving target.
  • the terminal inputs the step frequency into the motion model to obtain the moving speed of the moving target; multiplying the moving speed by the moving time of the moving target to obtain the moving distance of the moving target.
  • the moving target may have multiple movement states during the movement, different movement states generally correspond to different movement models.
  • Using a single motion model when estimating the moving distance of a moving target may cause a large error between the estimated moving distance and the actual moving distance of the moving target.
  • the server trains the aforementioned acceleration model, in addition to comprehensively considering the cadence of the moving target and the height of the moving target, it also introduces the acceleration variance as a parameter of the motion model. And before training the motion model, the server classifies the motion of the motion target according to the difference in cadence of each motion. Respectively determine the historical motion parameters (including height, stride frequency and acceleration variance) of each type of motion. Different motion types correspond to different motion models.
  • the exemplary motion model is:
  • M k a k *f+b k *v+c k *h+d k
  • f cadence
  • v acceleration variance
  • h height
  • a k , b k , c k , d k are model parameters representing the motion type numbered k.
  • a k , b k , c k , and d k may be constants obtained after model training.
  • k represents the number of the exercise type.
  • M k represents the stride (or movement speed) of the movement type numbered k.
  • the model parameters a k , b k , c k , and d k of the motion models obtained by training the historical data of different motion types are different.
  • the output parameter is stride
  • the step count of the moving target is determined in the step-counting algorithm, and the stride is multiplied by the number of steps to get the moving distance of the moving target.
  • the output parameter is the motion speed
  • the motion time of the motion target is determined, and the motion speed of the motion target is multiplied by the motion time to obtain the moving distance of the motion target.
  • the server classifies the motion state of the moving target and trains to obtain multiple motion models separately, when the motion state of the moving target is at the junction of the two motion states, regardless of whether the terminal chooses to be located in the two motion states.
  • the motion state which motion state corresponds to the motion model
  • the calculation result may produce large errors.
  • selecting the motion model according to the step frequency of the moving target may not always be able to select the motion model most similar to the current motion state.
  • the cadence of the exercise target is not completely related to the exercise state. As a result, the best motion model cannot be selected.
  • an embodiment of the present application provides a method for calculating a moving distance, which can be applied to a terminal that calculates the moving distance of a moving target.
  • the terminal can be any terminal with a mobile distance calculation function, such as a mobile phone, a wearable device (such as a sports bracelet), a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), etc.
  • a mobile distance calculation function such as a mobile phone, a wearable device (such as a sports bracelet), a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), etc.
  • PDA Personal Digital Assistant
  • the embodiment is described in detail by taking the terminal as the mobile phone 100 as an example. It should be understood that the illustrated mobile phone 100 is only an example of a terminal, and the mobile phone 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have Different component configurations.
  • the mobile phone 100 may specifically include: a processor 101, a radio frequency (RF) circuit 102, a memory 103, a touch screen 104, a Bluetooth device 105, one or more sensors 106, a Wi-Fi device 107, a positioning device 108, Audio circuit 109, peripheral interface 110, power supply device 111 and other components. These components can communicate through one or more communication buses or signal lines (not shown in Figure 1). Those skilled in the art can understand that the hardware structure shown in FIG. 1 does not constitute a limitation on the mobile phone, and the mobile phone 100 may include more or less components than those shown in the figure, or combine some components, or arrange different components.
  • RF radio frequency
  • the processor 101 is the control center of the mobile phone 100. It uses various interfaces and lines to connect to the various parts of the mobile phone 100, and executes the operation of the mobile phone 100 by running or executing application programs stored in the memory 103 and calling data stored in the memory 103. Various functions and processing data.
  • the processor 101 may include one or more processing units.
  • the processor 101 may be a Kirin 960 chip manufactured by Huawei Technologies Co., Ltd.
  • the above-mentioned processor 101 may further include a fingerprint verification chip for verifying the collected fingerprint.
  • the radio frequency circuit 102 can be used to receive and send wireless signals during the process of sending and receiving information or talking.
  • the radio frequency circuit 102 may receive the downlink data of the base station and send it to the processor 101 for processing; in addition, it may send the uplink data to the base station.
  • the radio frequency circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
  • the radio frequency circuit 102 can also communicate with other devices through wireless communication.
  • the wireless communication can use any communication standard or protocol, including but not limited to global system for mobile communications, general packet radio service, code division multiple access, broadband code division multiple access, long-term evolution, email, short message service, etc.
  • the memory 103 is used to store application programs and data.
  • the processor 101 executes various functions and data processing of the mobile phone 100 by running the application programs and data stored in the memory 103.
  • the memory 103 mainly includes a storage program area and a storage data area.
  • the storage program area can store the operating system and at least one application program required by at least one function (such as sound playback function, image playback function, etc.); the storage data area can store Data created at 100 o'clock (such as audio data, phone book, etc.).
  • the memory 103 may include a high-speed random access memory, and may also include a non-volatile memory, such as a magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the memory 103 can store various operating systems, for example, those developed by Apple Operating system, developed by Google Operating system, etc.
  • the foregoing memory 103 may be independent and connected to the processor 101 through the foregoing communication bus; the memory 103 may also be integrated with the processor 101.
  • the touch screen 104 may include a touch pad 104-1 and a display (may also be referred to as a display screen) 104-2.
  • the touchpad 104-1 can collect touch events on or near the user of the mobile phone 100 (for example, the user uses a finger, a stylus, or any other suitable object on the touchpad 104-1 or on the touchpad 104 -1 near operation), and send the collected touch information to other devices such as the processor 101.
  • the user's touch event near the touchpad 104-1 can be referred to as floating touch; floating touch can mean that the user does not need to directly touch the touchpad in order to select, move, or drag a target (such as an icon, etc.) , And only the user is located near the electronic device in order to perform the desired function.
  • floating touch the terms "touch”, “contact”, etc. do not imply direct contact with the touch screen, but nearby or close contact.
  • the touchpad 104-1 that can perform floating touch can be implemented by capacitive, infrared light sensing, ultrasonic waves, and the like.
  • the touch panel 104-1 may be used to display information input by the user or information provided to the user, and various menus of the mobile phone 100.
  • the display 104-2 can be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the touchpad 104-1 can cover the display 104-2. When the touchpad 104-1 detects a touch event on or near it, it transmits it to the processor 101 to determine the type of the touch event, and then the processor 101 can provide corresponding visual output on the display 104-2 according to the type of the touch event.
  • the touchpad 104-1 and the display 104-2 are used as two independent components to implement the input and output functions of the mobile phone 100, but in some embodiments, the touchpad 104-1 can be used It is integrated with the display 104-2 to realize the input and output functions of the mobile phone 100. It is understandable that the touch screen 104 is formed by stacking multiple layers of materials. Only the touch panel (layer) and the display screen (layer) are shown in the embodiments of the present application, and other layers are not described in the embodiments of the present application. .
  • the touch pad 104-1 may cover the display 104-2, and the size of the touch pad 104-1 is larger than the size of the display 104-2, so that the display 104-2 is completely Covered under the touchpad 104-1, or the above-mentioned touchpad 104-1 can be configured on the front of the mobile phone 100 in the form of a full panel, that is, the user's touch on the front of the mobile phone 100 can be sensed by the mobile phone, so that you can Realize the full touch experience on the front of the phone.
  • the touchpad 104-1 is arranged on the front of the mobile phone 100 in the form of a full panel
  • the display 104-2 can also be arranged on the front of the mobile phone 100 in the form of a full panel, so that it can be placed on the front of the mobile phone. Achieve a bezelless structure.
  • the mobile phone 100 may also include a Bluetooth device 105, which is used to implement data exchange between the mobile phone 100 and other short-distance electronic devices (such as mobile phones, smart watches, etc.).
  • the Bluetooth device in the embodiment of the present application may be an integrated circuit or a Bluetooth chip.
  • the mobile phone 100 also includes at least one sensor 106, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor.
  • the ambient light sensor can adjust the brightness of the display of the touch screen 104 according to the brightness of the ambient light.
  • the proximity sensor can turn off the power of the display when the mobile phone 100 is moved to the ear. .
  • an accelerometer sensor is used to detect the magnitude of acceleration in various directions (usually three axes)
  • the acceleration sensor is used to collect acceleration data of a moving target
  • the processor 101 processes the acceleration data to obtain the moving target The moving distance.
  • Accelerometer sensors can also be used to detect the magnitude and direction of gravity when stationary, and can be used to identify mobile phone gestures (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, knock As for the other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which can be configured in the mobile phone 100, we will not repeat them here.
  • mobile phone gestures such as horizontal and vertical screen switching, related games, magnetometer posture calibration
  • vibration recognition related functions such as pedometer, knock
  • the other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which can be configured in the mobile phone 100, we will not repeat them here.
  • the Wi-Fi device 107 is used to provide the mobile phone 100 with network access in compliance with Wi-Fi related standard protocols.
  • the mobile phone 100 can connect to the Wi-Fi access point through the Wi-Fi device 107 to help users send and receive emails, Browsing web pages and accessing streaming media, etc., it provides users with wireless broadband Internet access.
  • the Wi-Fi device 107 can also serve as a Wi-Fi wireless access point, which can provide Wi-Fi network access for other electronic devices.
  • the positioning device 108 is used to provide a geographic location for the mobile phone 100. It is understandable that the positioning device 108 may specifically be a receiver of a positioning system such as Global Positioning System (GPS), Beidou satellite navigation system, Russian GLONASS, etc. After receiving the geographic location sent by the above-mentioned positioning system, the positioning device 108 sends the information to the processor 101 for processing, or sends the information to the memory 103 for storage. In some other embodiments, the positioning device 108 may also be a receiver of an assisted global satellite positioning system (AGPS). The AGPS system assists the positioning device 108 to complete ranging and positioning services by acting as an auxiliary server.
  • AGPS assisted global satellite positioning system
  • the auxiliary positioning server communicates with the positioning device 108 (ie GPS receiver) of the mobile phone 100 via a wireless communication network to provide positioning assistance.
  • the positioning device 108 may also be a positioning technology based on a Wi-Fi access point.
  • Every Wi-Fi access point has a globally unique MAC address, electronic devices can scan and collect the broadcast signals of surrounding Wi-Fi access points when Wi-Fi is turned on, so they can get Wi-Fi -The MAC address broadcasted by the Fi access point; the electronic device sends the data (such as MAC address) that can indicate the Wi-Fi access point to the location server through the wireless communication network, and the location server retrieves each Wi-Fi access
  • the geographic location of the entry point is combined with the strength of the Wi-Fi broadcast signal to calculate the geographic location of the electronic device and send it to the positioning device 108 of the electronic device.
  • the audio circuit 109, the speaker 113, and the microphone 114 can provide an audio interface between the user and the mobile phone 100.
  • the audio circuit 109 can transmit the electrical signal converted from the received audio data to the speaker 113, and the speaker 113 converts it into a sound signal for output.
  • the microphone 114 converts the collected sound signals into electrical signals, which are received by the audio circuit 109 and converted into audio data, and then output the audio data to the RF circuit 102 for transmission to, for example, another mobile phone, or output the audio data to Memory 103 for further processing.
  • the peripheral interface 110 is used to provide various interfaces for external input/output devices (such as a keyboard, a mouse, an external display, an external memory, a user identification module card, etc.). For example, it is connected to a mouse through a universal serial bus (USB) interface, and is connected to a subscriber identity module card (SIM) card provided by a telecommunication operator through a metal contact on a subscriber identity module card slot.
  • SIM subscriber identity module card
  • the peripheral interface 110 can be used to couple the aforementioned external input/output peripheral devices to the processor 101 and the memory 103.
  • the mobile phone 100 may also include a power supply device 111 (such as a battery and a power management chip) for supplying power to various components.
  • a power supply device 111 such as a battery and a power management chip
  • the battery can be logically connected to the processor 101 through the power management chip, so that the power supply device 111 can manage charging, discharging, and power consumption management. And other functions.
  • the mobile phone 100 may also include a camera (front camera and/or rear camera), a flash, a micro-projection device, a near field communication (NFC) device, etc., which will not be repeated here. .
  • a camera front camera and/or rear camera
  • a flash a flash
  • micro-projection device a micro-projection device
  • NFC near field communication
  • the movement distance calculation method provided by the embodiment of the present application is applied to the movement distance calculation system shown in FIG. 2.
  • the moving distance calculation system includes a terminal 201 and a server 202 communicating with the terminal.
  • the terminal 201 is used to obtain acceleration data of the moving target, and determine the moving distance of the moving target according to the acceleration data of the moving target.
  • the server 202 is configured to obtain historical data of multiple moving targets, and divide the historical data of the moving targets into N categories according to the cadence and acceleration data.
  • the server 202 is also configured to perform model training on each type of historical data to obtain N preset motion models.
  • the terminal 201 may include a processor 2012, and a sensor 2011 and a memory 2013 connected to the processor 2012.
  • the sensor 2011 is used to detect and collect acceleration information of the moving target, and send the collected acceleration data to the processor 2012.
  • the sensor 2011 may be an acceleration sensor.
  • the sensor 2011 is also used to detect whether the moving target is in motion.
  • the memory 2013 is used to store N preset motion models.
  • the memory 2013 may be a read only memory (ROM).
  • the processor 2012 is configured to receive acceleration information sent by the sensor 2011, and obtain N preset motion models from the memory 2013.
  • the processor 2012 may also be used to determine the moving distance of the moving target according to the acceleration information.
  • the processor 2012 is a central processing unit (CPU).
  • the processor 2012 may also process the aforementioned acceleration information according to the N preset motion models to obtain the moving distance of the moving target.
  • the terminal may be an exemplary mobile phone or a sports bracelet. Both the mobile phone and the sports bracelet have a display interface that can display the motion data of the sports target.
  • an application for displaying the motion data of the sports target can be run on the mobile phone.
  • the motion data of the sports target is shown in Figure 4a .
  • the movement data of the movement target may include: movement distance, movement time, average speed, number of steps, and stride length.
  • the exercise data of the exercise target may further include: calories, average pace, average heart rate, and average number of steps.
  • the motion data of the motion target displayed by the APP is only exemplary. In actual display, the movement data of the moving target may be all or part of the data shown in the figure, and the movement data of the moving target may also be data other than the data shown in the figure.
  • the display screen of the sports bracelet can display the motion data of the sports target as shown in Fig. 4b.
  • the movement data of the movement target includes: movement distance, movement time, average speed, number of steps and stride length.
  • the exercise data of the exercise target may further include: calories and average number of steps.
  • the sports data of the sports target displayed on the display screen of the sports bracelet is only exemplary.
  • the movement data of the moving target may be all or part of the data shown in the figure, and the movement data of the moving target may also be data other than the data shown in the figure.
  • the sports bracelet may also send the motion data of the above-mentioned sports target to the mobile phone, so that the mobile phone can display the motion data of the sports target as shown in FIG. 4a.
  • the method includes:
  • Step 101 When the terminal detects that the moving target is in a moving state, the terminal determines the acceleration information and the first motion parameter of the moving target.
  • the motion state may be walking, running, or cycling.
  • the first motion parameter is the number of steps of the motion target or the motion time of the motion target.
  • the acceleration information includes acceleration variance and cadence.
  • the acceleration information in the embodiment of the present application is obtained by the terminal according to the acceleration data collected by the sensor.
  • the first motion parameter can be obtained by the terminal processing acceleration data collected by the sensor according to a step counting algorithm.
  • the acceleration changes with time (during the walking or running of the moving target, the acceleration of the moving target is recorded with time as the horizontal axis and acceleration as the vertical axis, and the acceleration curve is close to a sine curve).
  • the terminal detecting that the moving target is in a moving state can be achieved in the following two ways:
  • Method 1 The terminal obtains the acceleration data of the moving target.
  • the terminal analyzes the acceleration data of the moving target to determine the acceleration characteristics of the moving target. If the acceleration characteristic meets the preset condition, the terminal determines that the moving target is in a moving state.
  • the aforementioned acceleration feature is acceleration variance.
  • the preset condition is: if the acceleration variance is greater than the preset threshold.
  • the terminal determines that the acceleration variance of the moving target is greater than the preset threshold, it is determined that the moving target is in a moving state.
  • the acceleration characteristics may also be other characteristics of the acceleration of the moving target, such as chi-square distribution. This application does not limit this.
  • Method 2 The terminal processes the acceleration data of the moving target through the step-counting algorithm to determine whether the acceleration data meets the step-counting conditions (that is, whether the acceleration waveform period in the acceleration data has a peak-trough-peak, or a trough-peak-trough Characteristic acceleration cycle), if the acceleration data meets the step-counting condition, the terminal determines that the moving target is in a moving state.
  • the step-counting conditions that is, whether the acceleration waveform period in the acceleration data has a peak-trough-peak, or a trough-peak-trough Characteristic acceleration cycle
  • the terminal can determine the acceleration information of the moving target through the following method 1 or method 2:
  • the sensor in the terminal detects the acceleration data of the moving target in real time, and sends the acceleration data to the processor in the terminal.
  • the processor receives the acceleration data sent by the sensor, and then the processor obtains acceleration information according to the acceleration data.
  • the sensor detects the acceleration data of the moving target in real time.
  • the sensor obtains acceleration information after processing the acceleration data, and then sends the acceleration information to the processor.
  • the process of processing the acceleration information obtained by the acceleration data collected by the sensor according to the pedometer algorithm is specifically:
  • the terminal counts the acceleration during the recording period, and counts the change trends of all accelerations. Whenever there is a peak in the acceleration of the moving target, it is recorded as a step. After the recording period is over, the acceleration variance in the current recording period is calculated according to the formula for calculating the acceleration variance, and the step frequency of the moving target is determined by dividing the number of steps of the moving target by the duration of the recording period.
  • the acceleration variance can be calculated by the following formula:
  • s is the variance of the acceleration, a 1, a 2, ... a n , respectively, for recording the n cycle acceleration.
  • b is the average value of the n accelerations,
  • Step 102 The terminal determines the second motion parameter of the moving target within the motion time according to the acceleration information and the N preset motion models.
  • N is an integer greater than or equal to 2.
  • the N preset motion models may be stride motion models or speed motion models.
  • the stride motion model is used to calculate the stride of the moving target.
  • the velocity motion model can be used to calculate the velocity of a moving target.
  • the N preset motion models are multiple motion models obtained by performing mathematical model training on historical data of multiple motion targets by the server according to the acceleration variance and stride frequency.
  • the second motion parameter is the step width of the motion target.
  • the first motion parameter is the motion time of the motion target
  • the second motion parameter is the motion speed of the motion target.
  • the N preset motion models may be obtained through training of multiple historical data.
  • the N preset motion models in the embodiment of the present application have different motion types.
  • the motion types of the N preset motion models may include any one or more combinations of the following: a motion model of the motion target in a running state, a motion model of the motion target in a walking state or a motion target in a riding state.
  • the N preset motion models can be obtained by the terminal from the server.
  • the N preset motion models can also be pre-stored in the terminal (for example, stored in the ROM of the terminal).
  • the method provided in this embodiment of the present application further includes: the terminal sends an acquisition request to the server, and the acquisition request is used to acquire the N preset motion models.
  • the server receives the acquisition request from the terminal.
  • the server sends N preset motion models to the terminal, so that the terminal obtains the N preset motion models from the server.
  • the terminal may also obtain the N preset motion models from the server. At this time, the terminal obtains the priority of the N preset motion models from the server. The priority is higher than the priority of the N preset motion models pre-stored in the terminal, that is, the terminal may use the N preset motion models obtained from the server to calculate the second motion parameter.
  • Step 103 The terminal determines the moving distance of the moving target according to the first motion parameter and the second motion parameter.
  • the first motion parameter is the number of steps of the motion target
  • the second motion parameter is the step width of the motion target.
  • step 103 in the embodiment of the present application may be specifically implemented in the following manner: the terminal determines the moving distance of the moving target according to the number of steps of the moving target and the stride of the moving target. Specifically, the terminal determines the moving distance according to the product of the number of steps and the stride length.
  • the first motion parameter is the motion time of the motion target
  • the second motion parameter is the motion speed of the motion target.
  • step 103 in the embodiment of the present application may be specifically implemented in the following manner: the terminal determines the moving distance of the moving target according to the number of steps of the moving target and the stride of the moving target. Specifically, the terminal determines the movement distance according to the product of the movement time and the movement speed.
  • the embodiment of the present application provides a method for calculating a moving distance.
  • the terminal detects that the moving target is in a moving state, the terminal determines the acceleration information and the first motion parameter of the moving target.
  • the terminal determines the second movement parameter of the moving target within the movement time according to the acceleration information and the N preset movement models.
  • the first motion parameter is the number of steps of the motion target, and the second motion parameter is the stride length of the motion target; or, the first motion parameter is the motion time of the motion target, and the second motion parameter is the motion speed of the motion target;
  • N is An integer greater than or equal to 2; the terminal determines the moving distance of the moving target according to the first motion parameter and the second motion parameter.
  • Use N preset motion models to calculate the moving distance of the moving target.
  • the calculation results of N preset motion models can be combined to determine the second motion parameter, which avoids the large difference between the acceleration information of the single preset motion model and the acceleration information of the motion target when calculating the moving distance of the moving target through a single preset motion model
  • the resulting movement distance calculation error is relatively large, so the accuracy of calculating the movement distance of the moving target can be improved.
  • the method provided in the embodiment of the present application further includes:
  • Step 201 The terminal sends an acquisition request to the server, where the acquisition request is used to request acquisition of N preset motion models.
  • the acquisition request may also carry any one of the height or age of the sports target.
  • the server selects N preset motion models from the M preset motion models, the acquisition request sent by the terminal to the server also needs to carry acceleration information of the moving target.
  • Step 202 The server receives the acquisition request from the terminal.
  • Step 203 The server sends N preset motion models to the terminal.
  • the server may actively send the N preset motion models to the terminal after training the N preset motion models, or may send the N preset motion models to the terminal triggered by the acquisition request sent by the terminal.
  • step 201 and step 202 can be omitted.
  • Step 204 The terminal receives N preset motion models from the server.
  • step 102 in the embodiment of the present application can be specifically implemented in the following ways:
  • Step 1021 the terminal inputs the acceleration information into the N preset motion models, and obtains the third motion parameter corresponding to each preset motion model in the N preset motion models.
  • the values of the third motion parameter corresponding to different preset motion models in the N preset motion models are different.
  • the terminal calculates the acceleration data in this recording period to obtain the acceleration information of the moving target.
  • the terminal inputs acceleration information into each of the aforementioned N preset motion models respectively.
  • Each preset motion model will output a third motion parameter.
  • the third motion parameter has the same parameter type as the aforementioned second motion parameter. That is, if the second motion parameter is the stride, the third motion parameter is also the stride. If the second motion parameter is speed, the third motion parameter is also speed.
  • the stride motion model can be represented by the following mathematical model:
  • f represents step frequency
  • v represents acceleration variance
  • a i, b i, d i is the number of model parameters for the type of motion of i.
  • a i, b i, d i can be obtained after the training by the model constants.
  • i represents the number of the exercise type.
  • X i represents the stride of the exercise type numbered i.
  • Motion model to the historical data obtained in different sports training model parameters a i, b i, different d i.
  • the server when the server performs model training on historical data, in addition to considering the cadence of the sports target, the height factor of the sports target is also added.
  • the terminal inputs the height of the moving target and the motion parameters of the moving target into the moving target motion model at the same time to improve the accuracy of calculating the moving distance.
  • the N preset motion models can also be divided in combination with different age groups or different heights.
  • the server or the terminal may select N preset motion models that match the height in combination with the height of the sports target.
  • the server or the terminal may select N preset motion models that match the age in combination with the age of the motion target.
  • a j , b j , and d j are the model parameters representing the motion type numbered j.
  • a j , b j , and d j may be constants obtained after model training.
  • j represents the number of the exercise type.
  • Y j represents the movement speed of the movement type numbered j.
  • c i can be a constant obtained after model training.
  • c j can be a constant obtained after model training.
  • the N preset motion models are the first preset motion model and the second preset motion model, and the output of the preset motion model is stride as an example, then a is input to the first In a preset motion model, the third motion parameter X 1 is obtained . Then input a into the second preset motion model to obtain the third motion parameter X 2 .
  • Step 1022 The terminal determines the second motion parameter according to the third motion parameter corresponding to each preset motion model and the respective weight of each preset motion model.
  • each preset motion model corresponds to a weight
  • the weight corresponding to one preset motion model may be the same as or different from the weight corresponding to other preset motion models.
  • the sum of the weights of the N preset motion models is equal to 1.
  • the weight is used to indicate the degree of correlation between the preset motion model and the motion process of the moving target in the recording period. It should be understood that the greater the weight of one of the N preset motion models, the higher the degree of correlation between the preset motion model and the motion process of the moving target. The smaller the weight of one of the N preset motion models is, the lower the correlation degree between the preset motion model and the motion process of the moving target is.
  • each preset motion model will have a corresponding acceleration.
  • the terminal calculates the third motion parameter output by each preset motion model and the weight corresponding to the preset motion model according to a preset algorithm to obtain the second motion parameter.
  • step 1022 may be specifically implemented in the following manner: the terminal according to the formula Determine the second motion parameter.
  • W is the weight of a predetermined number i represents a motion model of weight i
  • X-i represents a motion type represented number of steps i
  • i is the number of types of movement, from 1,2 i, ..., N.
  • step 1022 may be specifically implemented in the following manner: the terminal according to the formula Determine the second motion parameter.
  • ⁇ j represents the weight of the preset motion model numbered j
  • Y j represents the moving speed of the motion type numbered j.
  • the N preset motion models are the first preset motion model and the second preset motion model respectively, and the weight of the first preset motion model is The weight of the second preset motion model is The second motion parameter
  • the respective weight of each preset motion model can be obtained by the terminal from the server, that is, the server assigns a weight to each preset motion model, and then compares each preset motion model with its respective weight.
  • the mapping relationship between the two is sent to the terminal.
  • the respective weight of each preset motion model is assigned by the terminal itself.
  • the terminal assigning weights to each preset motion model by itself can be implemented through the following step 104.
  • the method provided by the embodiment of the present application further includes:
  • Step 104 The terminal determines the respective weight of each preset motion model according to the similarity between the acceleration information and each of the N preset motion models.
  • step 104 in the embodiment of the present application can be specifically implemented through the following steps:
  • Step 1041 the terminal determines the average value of the acceleration variance and the average step frequency of the preset motion model.
  • the terminal simultaneously obtains the average value of the acceleration variance and the average step frequency of each preset motion model.
  • the terminal or the server may also configure a weight for each preset motion model in advance.
  • the terminal may directly input acceleration information into each preset motion model to obtain the third motion parameter corresponding to the acceleration information in each preset motion model.
  • the terminal multiplies the third motion parameter corresponding to each preset motion model by the weight corresponding to each preset motion model and then accumulates the second motion parameter.
  • the server assigns weights to each preset motion model, which can reduce the calculation amount of the terminal.
  • Step 1042 the terminal determines the similarity between the acceleration information and the preset motion model according to the acceleration variance average value and the step frequency average value of the preset motion model and the acceleration variance and step frequency of the acceleration information.
  • the terminal is pre-configured with an algorithm for calculating the similarity between the preset motion model and the motion of the moving target.
  • the acceleration variance average value and the step frequency average value of the aforementioned preset motion model and the acceleration variance and step frequency band of the acceleration information are respectively incorporated into the aforementioned similarity algorithm to obtain the similarity between the acceleration information and the preset motion model.
  • the Euclidean distance between the acceleration variance average value and the step frequency average value of the preset motion model and the acceleration variance and the step frequency of the acceleration information can be calculated.
  • Euclidean distance is used as the similarity between the preset motion model and acceleration information.
  • the formula for calculating Euclidean distance is:
  • l represents the Euclidean distance between the preset motion model and the acceleration information
  • a 1 represents the normalized average value of the acceleration variance of the preset motion model
  • a 2 represents the normalized value of the acceleration variance of the acceleration information
  • b 1 represents the predicted value.
  • the normalized average value of the cadence of the motion model and b 2 represents the normalized value of the cadence of the acceleration information.
  • the value of the acceleration variance is usually small, the value of the step frequency is usually large. If the average value of the acceleration variance and the average step frequency of the preset motion model and the acceleration information of the acceleration information are directly calculated Euclidean distance between the two, the acceleration variance accounts for a small proportion, which will cause the calculation of similarity to be inaccurate. Therefore, it is necessary to normalize the average value of the acceleration variance and the average step frequency of the preset motion model and the acceleration variance and the step frequency of the acceleration information. Specifically:
  • a x represents the average value of the acceleration variance of the preset motion model
  • a xmin presets the minimum value of the acceleration variance of the motion model
  • a xmax presets the maximum value of the acceleration variance of the motion model
  • a y represents the acceleration variance of the acceleration information
  • a ymin is the minimum value of the acceleration variance of the acceleration information
  • a ymax is the maximum value of the acceleration variance of the acceleration information.
  • b x represents the average value of the step frequency of the preset motion model
  • b xmin presets the minimum value of the step frequency of the motion model
  • b xmax presets the maximum value of the step frequency of the motion model
  • b y acceleration information represents the pitch, minimum pitch of b ymin acceleration information, the maximum value of pitch b ymax acceleration information.
  • Step 1043 The terminal determines the weight of the preset motion model according to the similarity between the acceleration information and the preset motion model.
  • the terminal determines the weight of the preset motion model according to the similarity between the acceleration information and the preset motion model, which can be specifically implemented as follows:
  • the terminal determines the sum of the similarities between the acceleration information and the aforementioned N preset motion models, and obtains the sum of the similarities.
  • the terminal determines the proportion of the similarity of each of the N preset motion models in the total similarity.
  • the terminal determines the proportion of the similarity of each preset motion model in the total similarity as the respective weight of each preset motion model.
  • the N preset motion models are the first preset motion model, the second preset motion model, the third preset motion model, the fourth preset motion model, and the fifth preset motion. model.
  • the similarities between the first to fifth preset motion models and the acceleration information are 10, 30, 2, 5, and 3, respectively.
  • the sum of the similarities between the acceleration information and the first to fifth preset motion models is 50, and the calculated similarities between the acceleration information and the first to fifth preset motion models account for 20% of the total similarity.
  • 60%, 4%, 10%, 6%. 20%, 60%, 4%, 10%, and 6% are respectively used as the weights of the first to fifth preset motion models.
  • the weight of the first preset motion model is 20%
  • the weight of the second preset motion model is 60%
  • the weight of the third preset motion model is 4%
  • the weight of the fourth preset motion model is 10%
  • the weight of the fifth preset motion model is 6%.
  • the server can classify the motion state into multiple motion types according to the acceleration variance and cadence (for example, the motion state is divided into walking and running.
  • the state of walking and running can also be further classified. Divided, for example, walking is divided into 5 levels, and the motion state between levels is different. Running is divided into 5 levels, and the motion state between levels is different). Because the movement goal is usually only similar to a few movement types in this movement cycle. For example, the moving target is quite different from the running state in the walking state. At this time, if the acceleration information of the moving target in this recording period is respectively brought to all acceleration models, it may cause unnecessary calculations to increase, and the model with low similarity to the acceleration information of the moving target may be reduced The accuracy of the calculation result.
  • the method provided in the embodiment of the present application further includes: N preset motion models are similar among the M preset motion models A preset motion model whose degree is greater than or equal to a preset threshold, and M is an integer greater than or equal to N.
  • the server divides the acceleration and cadence of each movement in the historical data into M categories according to preset rules.
  • the server trains each type of historical data in the M categories to obtain M preset motion models.
  • the server sends the M preset motion models to the terminal, and the terminal receives the M preset motion models from the server.
  • the terminal calculates each preset of the M preset motion models according to the method described in step 1042 and step 1043.
  • the similarity between the motion model and the acceleration information Take N preset movement models whose similarity with acceleration information among the M preset movement models is greater than a preset threshold, or take N preset movement models with the greatest similarity to acceleration information among the M preset movement models model.
  • the server can also select N preset motion models with the greatest similarity to the acceleration information from the M preset motion models for the terminal. It should be understood that when the terminal selects N preset motion models from the M preset motion models, the terminal obtains the M preset motion models from the server.
  • the terminal calculates the moving distance of the moving target according to the moving speed and the moving time of the moving target, since the moving target may be in different motion states in different time periods (for example, the moving target is walking Go to the training site, and then start running exercise, after running exercise, walk a certain distance). If the multiple motion states are recorded in one cycle to calculate the movement distance, the calculation result will have a large error.
  • the exercise time may also be divided into multiple time windows (for example, time windows are divided by the time length of every second or every minute), and the terminal according to the first acceleration information corresponding to each time window, and N
  • the preset motion model determines the motion speed corresponding to each time window.
  • the acceleration information includes first acceleration information corresponding to each of the multiple time windows within the exercise time.
  • the terminal determines the motion speed corresponding to each time window according to the first acceleration information corresponding to each time window and the N preset motion models.
  • the terminal determines the movement distance of the movement target according to the movement speed corresponding to each time window and the respective time length of each time window.
  • the terminal divides the exercise time into multiple time windows according to the preset duration.
  • the terminal separately brings the acceleration information in each time window into N preset motion models to obtain the motion speed of the moving target in each time window (this process is the same as the previous process in the embodiment of this application, and will not be repeated here. ).
  • the terminal multiplies the moving speed of the moving target in each time window by the time length of the time window to obtain the moving distance of the moving target in each time window.
  • the terminal sums the moving distance of the moving target in each time window to obtain the total moving distance of the moving target.
  • Fig. 10 shows the process of obtaining N preset motion models through the server training.
  • the method includes:
  • Step 301 The server obtains historical data.
  • the historical data includes exercise data of different exercise types.
  • the historical data is the collected motion trajectory data of multiple moving targets. These historical data include the acceleration variance, stride frequency, step number, stride length (or motion speed, motion time) of each moving target in each motion trajectory, and Moving distance.
  • the aforementioned historical data can be stored in the server or other storage devices that establish a communication connection with the server.
  • Step 302 The server divides historical data into N types of historical data.
  • the server classifies the historical data according to the preset acceleration variance interval and gait interval.
  • the gait types of the sports target are divided into five categories, which are the first gait type, the second gait type, the third gait type, the fourth gait type, and the fifth gait type.
  • the acceleration variance range of all possible data in the historical data is from c 1 to c 6 ; the range of step frequency is from d 1 to d 6 .
  • the historical data with the acceleration variance between c 1 and c 2 and the step frequency between d 1 and d 2 are classified into the first-step state type.
  • the historical data with acceleration variance between c 2 and c 3 and cadence between d 2 and d 3 are classified as the second gait type.
  • the historical data with the acceleration variance between c 3 and c 4 and the cadence between d 3 and d 4 is divided into the third gait type.
  • the historical data with acceleration variance between c 4 and c 5 and cadence between d 4 and d 5 is divided into the fourth gait type.
  • the historical data with the acceleration variance between c 5 and c 6 and the cadence between d 5 and d 6 is divided into the fifth gait type.
  • Step 303 The server performs preset motion model training on the N types of historical data to obtain N preset motion models.
  • the server inputs the classified historical data into the corresponding mathematical model for training.
  • the server uses the least square method to calculate historical data to determine the preset motion model.
  • the server uses the least square method to calculate the historical data, and the specific process of determining the preset motion model includes:
  • the server extracts the step frequency and acceleration variance at each time point in the historical data.
  • the server arranges these points in a coordinate system with cadence and acceleration variance as the axes. These points are basically distributed in strips. By finding a straight line, the sum of the squares of the distances between all the above points and the straight line is minimized.
  • the mathematical expression of the straight line is the preset motion model we trained.
  • the server may also accept the second historical data sent by the terminal or other devices.
  • the second historical data is historical data generated by the terminal in the process of calculating the moving distance of the moving target. And combine the aforementioned historical data and the aforementioned other historical data to further classify and perform preset motion model training. Get new N preset training models.
  • the N preset training models are sent to the terminal so that the terminal determines the moving distance of the moving target according to the N preset training models.
  • the second historical data information may also be other historical data, such as historical data of the movement of other moving targets collected by other devices.
  • the above-mentioned terminal or server includes hardware structures and/or software modules corresponding to each function.
  • the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the embodiments of the present application.
  • the embodiment of the present application may divide the above-mentioned terminal or server into functional modules according to the above method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 11 shows a possible structural schematic diagram of a moving distance calculating device involved in the foregoing embodiment.
  • the moving distance calculating device includes: a processing unit 301.
  • the moving distance calculation device may further include: a communication unit 302.
  • the moving distance calculation device is a terminal or a chip applied in the terminal, and the processing unit 301 is configured to execute the foregoing step 101, step 102, and step 103.
  • the processing unit 301 is further configured to execute step 1021, step 1022, step 104, step 1041, step 1042, and step 1043.
  • the communication unit 302 is configured to execute the foregoing step 201 and step 204.
  • the moving distance calculation device is a server or a chip applied to the server, and the processing unit 301 is used in the above steps 302 and 303.
  • the communication unit 302 is configured to execute the foregoing step 301, step 202, and step 203.
  • the moving distance calculation device may further include a storage unit.
  • a storage unit all relevant content of each step involved in the above method embodiment can be cited in the function description of the corresponding function module, and will not be repeated here.
  • FIG. 12 shows a schematic diagram of a possible structure of the moving distance calculation device involved in the foregoing embodiment.
  • the moving distance calculation device includes: a processing module 412 and a communication module 413.
  • the processing module 412 is used to control and manage the actions of the movement distance calculation device.
  • the communication module 413 is used to support communication between the mobile distance calculation device and other network entities.
  • the moving distance calculating device may also include a storage module 411 for storing program codes and data of the moving distance calculating device.
  • the moving distance calculation device is a terminal or a chip applied in the terminal, and the processing module 412 is configured to execute the foregoing step 101, step 102, and step 103.
  • the processing module 412 is further configured to perform step 1021, step 1022, step 104, step 1041, step 1042, and step 1043.
  • the communication module 413 is configured to execute the foregoing step 201 and step 204.
  • the moving distance calculation device is a server or a chip applied in the server, and the processing module 412 is configured to execute the above steps 302 and 303.
  • the communication module 413 is configured to execute the foregoing step 301, step 202, and step 203.
  • the processing module 412 may be a processor or a controller, such as a central processing unit (Central Processing Unit, CPU), a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), and an application-specific integrated circuit (Application-Specific Integrated Circuit). Integrated Circuit, ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in conjunction with the disclosure of this application.
  • the processor may also be a combination for realizing computing functions, for example, including a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
  • the communication module 413 may be a communication interface or the like.
  • the storage module 411 may be a memory.
  • the terminal provided in the embodiment of the present application may be the terminal shown in FIG.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium.
  • the movement distance calculation device executes steps 101 and steps in the embodiments. 102 and step 103.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium.
  • the movement distance calculation device executes step 1021, step 1022, step 104, and step 1041 in the embodiment. , Step 1042, and Step 1043.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, and when the instructions are executed, the movement distance calculation device executes steps 201 and 204 in the embodiment.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, and when the instructions are executed, the movement distance calculation device executes step 302 and step 303 in the embodiment.
  • a computer-readable storage medium stores instructions.
  • the movement distance calculation device executes step 301, step 202, and step 203 in the embodiment.
  • the aforementioned readable storage medium may include: U disk, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
  • a computer program product including instructions.
  • the computer program product stores instructions.
  • the movement distance calculation device executes steps 101, 102, 103, and 1021 in the embodiment. 1022, step 104, step 1041, step 1042, and step 1043.
  • a computer program product including instructions is provided, and instructions are stored in the computer program product, and when the instructions are executed, the moving distance calculation device executes step 201 and step 204.
  • a computer program product including instructions.
  • the computer program product stores instructions.
  • the movement distance calculation device executes step 302 and step 303.
  • a computer program product including instructions.
  • the computer program product stores instructions.
  • the movement distance calculation device executes step 301, step 202, and step 203.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Automation & Control Theory (AREA)
  • Biophysics (AREA)
  • Physical Education & Sports Medicine (AREA)
  • Epidemiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)

Abstract

一种移动距离计算方法、装置以及***,涉及终端领域,解决了现有技术中估计移动距离时引起的误差较大的问题。该方法包括:终端检测到运动目标处于运动状态的情况下,终端确定运动目标的加速度信息和第一运动参数(步骤101);终端根据加速度信息和N个预设运动模型确定运动目标在运动时间内的第二运动参数(步骤102);其中,第一运动参数为运动目标的步数,第二运动参数为运动目标的步幅;或者,第一运动参数为运动目标的运动时间,第二运动参数为运动目标的运动速度;N为大于或等于2的整数;终端根据第一运动参数和第二运动参数确定运动目标的移动距离(步骤103)。用于提高计算运动目标距离的准确度。

Description

一种移动距离计算方法、装置以及***
本申请要求在2019年4月30日提交中国国家知识产权局、申请号为201910364520.3的中国专利申请的优先权,发明名称为“一种移动距离计算方法、装置以及***”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端领域,尤其涉及一种移动距离计算方法、装置以及***。
背景技术
随着人们对运动和健康越来越重视,可以检测运动目标的健康和运动状态已经成为智能终端(如手机或者运动手环)必备的功能。智能终端可以通过检测运动目标的运动步数和移动距离确定运动目标的运动量,进一步确定运动目标的运动强度、热量消耗等参数,给运动目标提供良好的运动检测。
但是,在确定运动目标的移动距离时,通常情况下需要确定运动目标的步幅,但是当前通过运动检测算法确定步幅的方式存在误差,这样会导致估计移动距离时引起的误差较大。
发明内容
本申请实施例提供了一种移动距离计算方法、装置以及***,解决了现有技术中估计移动距离时引起的误差较大的问题。
为了解决上述技术问题,本申请实施例采用如下技术方案:
第一方面,本申请实施例提供一种移动距离计算方法,该方法包括:终端检测到运动目标处于运动状态的情况下,终端确定运动目标的加速度信息和第一运动参数;终端根据加速度信息和N个预设运动模型确定运动目标在运动时间内的第二运动参数;其中,第一运动参数为运动目标的步数,第二运动参数为运动目标的步幅;或者,第一运动参数为运动目标的运动时间,第二运动参数为运动目标的运动速度;N为大于或等于2的整数;终端根据第一运动参数和第二运动参数确定运动目标的移动距离。
本申请实施例提供一种移动距离计算方法,当终端检测到运动目标处于运动状态的情况下,终端确定运动目标的加速度信息和第一运动参数。终端根据加速度信息和N个预设运动模型确定运动目标在运动时间内的第二运动参数。其中,第一运动参数为运动目标的步数,第二运动参数为运动目标的步幅;或者,第一运动参数为运动目标的运动时间,第二运动参数为运动目标的运动速度;N为大于或等于2的整数;终端根据第一运动参数和第二运动参数确定运动目标的移动距离。利用N个预设运动模型计算运动目标的移动距离,可以综合N个预设运动模型的计算结果确定第二运动参数,避免了通过单一预设运动模型计算运动目标的移动距离时,因单一预设运动模型的加速度与运动目标的加速度信息差别较大而导致的移动距离计算误差较大的问题,因此可以提高计算运动目标的移动距离的准确度。
一种可能的实现方式中,第一运动参数为运动目标的步数,第二运动参数为运动目标的步幅,终端根据第一运动参数和第二运动参数确定移动距离,包括:终端根据步数以及步幅的乘积,确定移动距离。
一种可能的实现方式中,第一运动参数为运动目标的运动时间,第二运动参数为运 动目标的运动速度;终端根据第一运动参数和第二运动参数确定移动距离,包括:终端根据运动时间与运动速度的乘积,确定移动距离。
一种可能的实现方式中,终端根据加速度信息和N个预设运动模型确定运动目标在运动时间内的第二运动参数,包括:终端将加速度信息输入N个预设运动模型,得到N个预设运动模型中每个预设运动模型对应的第三运动参数;终端根据每个预设运动模型对应的第三运动参数以及每个预设运动模型各自的权重,确定第二运动参数。通过为各个预设运动模型设置权重,可以使第二运动参数符合运动目标的运动特征。
一种可能的实现方式中,本申请实施例提供的方法还包括:终端根据加速度信息与N个预设运动模型中每个预设运动模型的相似度,确定每个预设运动模型各自的权重。通过加速度信息与预设运动模型的相似度确定各个预设运动模型的权重,可以使各个预设运动模型的权重设置更加合理,例如,可以为与加速度信息相似度较高的预设运动模型分配较大的权重,从而提高了移动距离计算的准确性。
一种可能的实现方式中,终端根据加速度信息与N个预设运动模型中每个预设运动模型的相似度,确定每个预设运动模型各自的权重,包括:终端确定每个预设运动模型的加速度方差平均值和步频平均值;终端根据每个预设运动模型的加速度方差平均值和步频平均值以及加速度信息的加速度方差和步频,确定加速度信息和每个预设运动模型的相似度;终端根据加速度信息和每个预设运动模型的相似度确定每个预设运动模型的权重。通过加速度方差和步频可以更加精确的确定加速度信息与N个预设运动模型中每个预设运动模型的相似度。
一种可能的实现方式中,N个预设运动模型为M个预设运动模型中的预设运动模型,且N个预设运动模型和加速度信息之间的相似度大于或等于预设阈值,M为大于N的整数。通过选择M个预设运动模型中相似度较高的N个运动模型可以降低终端的计算量,以及排除相似度较低的运动模型对计算结果的干扰。
一种可能的实现方式中,加速度信息包括运动时间内的多个时间窗口中每个时间窗口对应的第一加速度信息;第二运动参数为运动目标的运动速度时,终端根据加速度信息和N个预设运动模型确定运动目标在运动时间内的第二运动参数,包括:终端根据每个时间窗口对应的第一加速度信息,以及N个预设运动模型确定每个时间窗口对应的运动速度。以便于计算每个时间窗口内分别对应的运动速度。
一种可能的实现方式中,终端根据第一运动参数和第二运动参数确定运动目标的移动距离,包括:终端根据每个时间窗口对应的运动速度以及每个时间窗口各自的时间长度,确定运动目标的移动距离。根据每个时间窗口内分别对应的运动速度确定移动距离可以使最终根据运动速度确定移动距离的结果更加精确。
一种可能的实现方式中,本申请实施例提供的方法还包括:终端从服务器处获取N个预设运动模型。终端获取服务器预先训练好的N个预设运动模型,可以减轻终端的运算量,节省运算时间。
一种可能的实现方式中,该N个预设运动模型预先存储在终端中。
第二方面,本申请实施例提供一种移动距离计算方法,该方法包括:服务器获取历史数据。该历史数据中包括不同运动类型的运动数据。服务器将历史数据划分为N类历史数据。服务器对N类历史数据进行预设运动模型训练,得到N个预设运动模型。
本申请实施例提供一种移动距离计算方法,服务器获取历史数据;服务器将历史数据划分为N类历史数据;服务器对N类历史数据进行预设运动模型训练,得到N个预设运 动模型。服务器通过对历史数据进行分类,并分别对不同类型的历史数据进行预设运动模型训练,得到N个预设运动模型。提高了对不同运行类型场景的适应性。
一种可能的实现方式中,在服务器对N类历史数据进行预设运动模型训练,得到N个预设运动模型之后,该方法还包括:服务器向终端发送N个预设运动模型。
一种可能的实现方式中,服务器向终端发送N个预设运动模型,包括:服务器接收来自终端的获取请求。该获取请求用于请求N个预设运动模型。服务器根据获取请求,向终端发送N个预设运动模型。
应理解,如果由终端从M个预设运动模型中选择N个预设运动模型,则终端从服务器处获取至少M个预设运动模型。
一种可能的实现方式中,N个预设运动模型为M个预设运动模型中的预设运动模型,且N个预设运动模型和加速度信息之间的相似度大于或等于预设阈值,M为大于N的整数。
应理解,如果由服务器从M个预设运动模型中选择N个预设运动模型,则终端向服务器发送的获取请求中还需要携带运动目标的加速度信息。
第三方面,本申请实施例提供一种移动距离计算装置,该移动距离计算装置包括:处理单元,用于在检测到运动目标处于运动状态的情况下,确定运动目标的加速度信息和第一运动参数;处理单元,还用于根据加速度信息和N个预设运动模型确定运动目标在运动时间内的第二运动参数;其中,第一运动参数为运动目标的步数,第二运动参数为运动目标的步幅;或者,第一运动参数为运动目标的运动时间,第二运动参数为运动目标的运动速度;N为大于或等于2的整数;处理单元,还用于根据第一运动参数和第二运动参数确定运动目标的移动距离。
一种可能的实现方式中,第一运动参数为运动目标的步数,第二运动参数为运动目标的步幅;处理单元,还具体用于:根据步数以及步幅的乘积,确定移动距离。
一种可能的实现方式中,第一运动参数为运动目标的运动时间,第二运动参数为运动目标的运动速度;处理单元,还具体用于:根据运动时间与运动速度的乘积,确定移动距离。
一种可能的实现方式,处理单元,还具体用于:将加速度信息输入N个预设运动模型,得到N个预设运动模型中每个预设运动模型对应的第三运动参数;根据每个预设运动模型对应的第三运动参数以及每个预设运动模型各自的权重,确定第二运动参数。
一种可能的实现方式,处理单元,还具体用于:根据加速度信息与N个预设运动模型中每个预设运动模型的相似度,确定每个预设运动模型各自的权重。
一种可能的实现方式,处理单元,还具体用于:确定每个预设运动模型的加速度方差平均值和步频平均值;根据每个预设运动模型的加速度方差平均值和步频平均值以及加速度信息的加速度方差和步频,确定加速度信息和每个预设运动模型的相似度;根据加速度信息和每个预设运动模型的相似度确定每个预设运动模型的权重。
一种可能的实现方式,N个预设运动模型为M个预设运动模型中的预设运动模型,且N个预设运动模型和加速度信息之间的相似度大于或等于预设阈值,M为大于N的整数。
一种可能的实现方式,加速度信息包括运动时间内的多个时间窗口中每个时间窗口对应的第一加速度信息;处理单元,还具体用于:根据每个时间窗口对应的第一加速度信息,以及N个预设运动模型确定每个时间窗口对应的运动速度。
一种可能的实现方式,处理单元,还具体用于:根据每个时间窗口对应的运动速度以及每个时间窗口各自的时间长度,确定运动目标的移动距离。
一种可能的实现方式,移动距离计算装置还包括:通信单元,用于从服务器处获取N个预设运动模型。
另一种示例,本申请实施例提供一种移动距离计算装置,该移动距离计算装置可以是终端,也可以是终端内的芯片。当该移动距离计算装置是终端时,该通信单元可以为通信接口。该处理单元可以是处理器。该移动距离计算装置还可以包括存储单元。该存储单元可以是存储器。该存储单元,用于存储计算机程序代码,计算机程序代码包括指令。该处理单元执行该存储单元所存储的指令,以使该终端实现第一方面或第一方面的任意一种可能的实现方式中描述的一种移动距离计算方法。当该移动距离计算装置是终端内的芯片时,该处理单元可以是处理器,该通信单元可以统称为:通信接口。例如,通信接口可以为输入/输出接口、管脚或电路等。该处理单元执行存储单元所存储的计算机程序代码,以使该终端实现第一方面或第一方面的任意一种可能的实现方式中描述的一种移动距离计算方法,该存储单元可以是该芯片内的存储单元(例如,寄存器、缓存等),也可以是该终端内的位于该芯片外部的存储单元(例如,只读存储器、随机存取存储器等)。
可选的,处理器、通信接口和存储器相互耦合。
第四方面,本申请实施例提供一种移动距离计算装置,该移动距离计算装置包括:通信单元,用于获取运动的历史数据;处理单元,用于将历史数据划分为N类历史数据;处理单元,还用于对N类历史数据进行预设运动模型训练,得到N个预设运动模型。
一种可能的实现方式中,在处理单元对N类历史数据进行预设运动模型训练,得到N个预设运动模型之后,通信单元,还具体用于:向终端发送N个预设运动模型。
一种可能的实现方式中,通信单元,还具体用于:接收来自终端的获取请求;该获取请求用于请求N个预设运动模型。通信单元,还具体用于:向终端发送N个预设运动模型。
应理解,如果由终端从M个预设运动模型中选择N个预设运动模型,则通信单元,还具体用于:向终端发送至少M个预设运动模型。
一种可能的实现方式中,N个预设运动模型为M个预设运动模型中的预设运动模型,且N个预设运动模型和加速度信息之间的相似度大于或等于预设阈值,M为大于N的整数。
应理解,如果由处理单元从M个预设运动模型中选择N个预设运动模型,则终端向服务器发送的获取请求中还需要携带运动目标的加速度信息。
另一种示例,本申请实施例提供一种移动距离计算装置,该移动距离计算装置可以是服务器,也可以是服务器内的芯片。当该移动距离计算装置是服务器时,该通信单元可以为通信接口。该处理单元可以是处理器。该移动距离计算装置还可以包括存储单元。该存储单元可以是存储器。该存储单元,用于存储计算机程序代码,计算机程序代码包括指令。该处理单元执行该存储单元所存储的指令,以使该服务器实现第二方面或第二方面的任意一种可能的实现方式中描述的一种移动距离计算方法。当该移动距离计算装置是服务器内的芯片时,该处理单元可以是处理器,该通信单元可以统称为:通信接口。例如,通信接口可以为输入/输出接口、管脚或电路等。该处理单元执行存储单元所存储的计算机程序代码,以使该终端实现第二方面或第二方面的任意一种可能的实现方式中描述的一种移动距离计算方法,该存储单元可以是该芯片内的存储单元(例如,寄存器、缓存等),也可以是该服务器内的位于该 芯片外部的存储单元(例如,只读存储器、随机存取存储器等)。
可选的,处理器、通信接口和存储器相互耦合。
第五方面,本申请实施例提供一种移动距离计算装置,该装置包括:处理器和通信接口;通信接口和处理器耦合,处理器用于运行计算机程序或指令,以实现如第一方面和第一方面的任一种可能的实现方式中所描述的移动距离计算方法。
第六方面,本申请实施例提供另一种移动距离计算装置,该装置包括:处理器和通信接口;通信接口和处理器耦合,处理器用于运行计算机程序或指令,以实现如第二方面和第二方面的任一种可能的实现方式中所描述的移动距离计算方法。
第七方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令在移动距离计算装置上运行时,使得移动距离计算装置执行如第一方面和第一方面的任一种可能的实现方式中所描述的移动距离计算方法。
第八方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令在移动距离计算装置上运行时,使得移动距离计算装置执行如第二方面和第二方面的任一种可能的实现方式中所描述的移动距离计算方法。
第九方面,本申请实施例提供一种包含指令的计算机程序产品,当计算机程序产品在移动距离计算装置上运行时,使得移动距离计算装置执行如第一方面和第一方面的任一种可能的实现方式中所描述的移动距离计算方法。
第十方面,本申请实施例提供一种包含指令的计算机程序产品,当计算机程序产品在移动距离计算装置上运行时,使得移动距离计算装置执行如第二方面和第二方面的任一种可能的实现方式中所描述的移动距离计算方法。
第十一方面,本申请实施例提供一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行计算机程序或指令,以实现如第一方面和第一方面的任一种可能的实现方式中所描述的移动距离计算方法。
具体的,本申请实施例中提供的芯片还包括存储器,用于存储计算机程序或指令。
第十二方面,本申请实施例提供一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行计算机程序或指令,以实现如第二方面和第二方面的任一种可能的实现方式中所描述的移动距离计算方法。
具体的,本申请实施例中提供的芯片还包括存储器,用于存储计算机程序或指令。
第十三方面,本申请实施例提供一种移动距离计算***,包括:终端,以及与该终端通信的服务器,终端用于执行如第一方面和第一方面的任一种可能的实现方式中所描述的移动距离计算方法,服务器用于执行如第二方面和第二方面的任一种可能的实现方式中所描述的移动距离计算方法。
应当理解的是,本申请中对技术特征、技术方案、有益效果或类似语言的描述并不是暗示在任意的单个实施例中可以实现所有的特点和优点。相反,可以理解的是对于特征或有益效果的描述意味着在至少一个实施例中包括特定的技术特征、技术方案或有益效果。因此,本说明书中对于技术特征、技术方案或有益效果的描述并不一定是指相同的实施例。进而,还可以任何适当的方式组合本实施例中所描述的技术特征、技术方案和有益效果。本领域技术人员将会理解,无需特定实施例的一个或多个特定的技术特征、技术方案或有益效果即可实现实施例。在其他实施例中,还可在没有体现所有实施例的特定实施例中识别出额外的技术特征和有益效果。
附图说明
图1为本申请实施例提供的一种手机的结构示意图;
图2为本申请实施例提供的一种移动距离计算***的***架构图;
图3为本申请实施例提供的另一种移动距离计算***的***架构图;
图4a为本申请实施例提供的一种手机显示运动目标的运动数据的界面示意图;
图4b为本申请实施例提供的一种运动手环显示运动目标的运动数据的界面示意图;
图5为本申请实施例提供的一种移动距离计算方法的流程示意图一;
图6为本申请实施例提供的一种终端与服务器交互的方法示意图;
图7为本申请实施例提供的一种移动距离计算方法的流程示意图二;
图8为本申请实施例提供的一种移动距离计算方法的流程示意图三;
图9为本申请实施例提供的一种移动距离计算方法的流程示意图四;
图10为本申请实施例提供的一种移动距离计算方法的流程示意图五;
图11为本申请实施例提供的一种移动距离装置的结构示意图;
图12为本申请实施例提供的另一种移动距离装置的结构示意图。
具体实施方式
为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。例如,第一运动参数和第二运动参数仅仅是为了区分不同的运动参数,并不对其先后顺序进行限定。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
需要说明的是,本申请中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
在介绍本申请实施例之前,首先对本申请实施例涉及到的相关名词做如下解释:
计步算法:人在运动的时候,会在空间的三个维度(以人为参照物,则分别为上下,前后和左右)中分别产生一个加速度。在运动目标的运动过程中,三个维度的加速度总有一个是随着时间变化呈现周期性变化的。该周期性变化的加速的值随着时间的变化而变化,将该周期性变化的加速度放置在以时间为轴的坐标系中,加速度曲线总体呈现为一个正弦曲线。在人运动过程中,每一次步伐都会对应一个正弦曲线中的峰值。我们通常把一次峰值记为一步。
计步算法的本质是确定加速度波形的周期。当加速度经历一次波峰-波谷-波峰,或者波谷-波峰-波谷时,记为一步。确定一步的持续时间(例如,确定在一步的周期内共有n个加速度采样点,则这一步的持续时间t 1=n×(1/F));其中,t 1为这一步的持续时间,n为加速度采样点的个数,F为加速度的采样频率。根据每一步的持续时间确定运动目标 的步频,则对应的步频
Figure PCTCN2020086524-appb-000001
计步算法还可以统计在时间t 2内走的步数q,则对应的步频
Figure PCTCN2020086524-appb-000002
步频:运动目标在运动过程中步伐的频率。步频的计算方法为运动目标在一段时间内走的步数除以本段时间的时长(时长单位一般为分钟)。示例性的,运动目标在10分钟内走了1200步,则运动目标的步频为120。
步幅:运动目标在运动过程中步伐的幅度,也即运动目标在运动过程中步伐的长度。
加速度:运动目标在运动过程中由于迈步和收步而产生的速度的变化量。
由于运动目标的运动速度与运动目标的步频相关,因此,服务器在训练运动模型时,需要采集多个运动目标的大量的可以反映运动目标的步频的历史数据。此外,该历史数据还可以包括:步频对应的移动距离。
目前,服务器对这些历史数据进行模型训练,得到一个运动模型(该运动模型为一个数学模型,输入参数为运动目标的步频,输出参数为运动目标的步幅或者运动目标的运动速度,其中输出参数与模型训练有关,针对步幅的模型训练输出为步幅,针对运动速度的训练输出为运动速度)。服务器向终端发送运动模型,终端接收来自服务器发送的运动模型。终端采集到的运动目标的加速度数据(该加速度数据为传感器采集到的运动目标的原始加速度数据,对该加速度数据进行处理后可以得到加速度信息)之后使用计步算法记录运动目标的步数(或者运动时间)和步频。终端将步频输入到上述运动模型中得到步幅。终端将步幅乘以上述通过计步算法确定的步数得到运动目标的移动距离。或者终端将步频输入到运动模型中得到运动目标的运动速度;将运动速度乘以运动目标的运动时间得到运动目标的移动距离。
但是,由于运动目标在运动的过程中可能会有多种运动状态,不同的运动状态一般对应不同的运动模型。在估计运动目标的移动距离时利用单一的运动模型可能会使得估计的移动距离与运动目标真实的移动距离之间存在较大的误差。
在一种实现方式中,服务器在训练上述加速度模型时,除了综合考虑运动目标的步频和运动目标身高以外,还引入加速度方差作为运动模型的参数。并且服务器在训练运动模型之前,根据各次运动步频的不同对运动目标的运动进行分类。分别确定每类运动的历史运动参数(包括身高、步频和加速度方差)不同的运动类型对应不同的运动模型。示例性的该运动模型为:
M k=a k*f+b k*v+c k*h+d k
其中,f表示步频,v表示加速度方差,h表示身高。a k,b k,c k,d k为表示编号为k的运动类型的模型参数。示例性的,a k,b k,c k,d k可以为通过模型训练后得到的常数。k表示运动类型的编号。M k表示编号为k的运动类型的步幅(或运动速度)。
对于不同运动类型的历史数据训练得到的运动模型的模型参数a k,b k,c k,d k不同。
在计算运动目标的移动距离时,首先确定运动目标的步频,根据运动目标的步频确定与该步频对应的运动模型,将步频、加速度方差和身高作为输入参数输入到该模型中,输出步幅(或者运动速度)。在得到输出参数后,对输出参数进行进一步计算即可得到运动目标的移动距离。
示例性的,输出参数为步幅,则在计步算法中确定运动目标的步数,将步幅乘以步数得 到运动目标的移动距离。或者输出参数为运动速度,则确定运动目标的运动时间,将运动目标的运动速度乘以运动时间得到运动目标的移动距离。
在该实现方式中,虽然服务器对运动目标的运动状态进行了分类,并分别训练得到多个运动模型,但是当运动目标的运动状态处于两种运动状态交界处时,无论终端选择位于该两种运动状态中哪个运动状态对应的运动模型,计算结果都可能会产生较大误差。并且在使用模型计算运动目标的移动距离时,根据运动目标的步频选择运动模型不总是能够选择与本次运动状态最相似的运动模型。尤其是在跑步状态下,运动目标的步频与运动状态并不完全相关。导致无法选择到最佳的运动模型。
对此,本申请的实施例提供一种移动距离计算方法,可应用于计算运动目标的移动距离的终端中。例如,该终端可以为手机、可穿戴设备(如运动手环)、平板电脑、个人数字助理(Personal Digital Assistant,PDA)等任何具有移动距离计算功能的终端中,当然,在以下实施例中,对该终端的具体形式不作任何限制。
下面以该终端为手机100为例对实施例进行具体说明。应该理解的是,图示手机100仅是终端的一个范例,并且手机100可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。
如图1所示,手机100具体可以包括:处理器101、射频(RF)电路102、存储器103、触摸屏104、蓝牙装置105、一个或多个传感器106、Wi-Fi装置107、定位装置108、音频电路109、外设接口110以及电源装置111等部件。这些部件可通过一根或多根通信总线或信号线(图1中未示出)进行通信。本领域技术人员可以理解,图1中示出的硬件结构并不构成对手机的限定,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图1对手机100的各个部件进行具体的介绍:
处理器101是手机100的控制中心,利用各种接口和线路连接手机100的各个部分,通过运行或执行存储在存储器103内的应用程序,以及调用存储在存储器103内的数据,执行手机100的各种功能和处理数据。在一些实施例中,处理器101可包括一个或多个处理单元。举例来说,处理器101可以是华为技术有限公司制造的麒麟960芯片。在本申请一些实施例中,上述处理器101还可以包括指纹验证芯片,用于对采集到的指纹进行验证。
射频电路102可用于在收发信息或通话过程中,无线信号的接收和发送。特别地,射频电路102可以将基站的下行数据接收后,给处理器101处理;另外,将涉及上行的数据发送给基站。通常,射频电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频电路102还可以通过无线通信和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯***、通用分组无线服务、码分多址、宽带码分多址、长期演进、电子邮件、短消息服务等。
存储器103用于存储应用程序以及数据,处理器101通过运行存储在存储器103的应用程序以及数据,执行手机100的各种功能以及数据处理。存储器103主要包括存储程序区以及存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等);存储数据区可以存储根据使用手机100时所创建的数据(比如音频数据、电话本等)。此外,存储器103可以包括高速随机存取存储器,还可以包括非易失存储器,例如磁盘存储器件、闪存器件或其 他易失性固态存储器件等。存储器103可以存储各种操作***,例如,苹果公司所开发的
Figure PCTCN2020086524-appb-000003
操作***,谷歌公司所开发的
Figure PCTCN2020086524-appb-000004
操作***等。上述存储器103可以是独立的,通过上述通信总线与处理器101相连接;存储器103也可以和处理器101集成在一起。
触摸屏104可以包括触控板104-1和显示器(也可以称为显示屏)104-2。其中,触控板104-1可采集手机100的用户在其上或附近的触摸事件(比如用户使用手指、触控笔等任何适合的物体在触控板104-1上或在触控板104-1附近的操作),并将采集到的触摸信息发送给其他器件例如处理器101。其中,用户在触控板104-1附近的触摸事件可以称之为悬浮触控;悬浮触控可以是指,用户无需为了选择、移动或拖动目标(例如图标等)而直接接触触控板,而只需用户位于电子设备附近以便执行所想要的功能。在悬浮触控的应用场景下,术语“触摸”、“接触”等不会暗示用于直接接触触摸屏,而是附近或接近的接触。可以进行悬浮触控的触控板104-1可以采用电容式、红外光感以及超声波等实现。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型来实现触控板104-1。显示器(也可以称为显示屏)104-2可用于显示由用户输入的信息或提供给用户的信息以及手机100的各种菜单。可以采用液晶显示器、有机发光二极管等形式来配置显示器104-2。触控板104-1可以覆盖在显示器104-2之上,当触控板104-1检测到在其上或附近的触摸事件后,传送给处理器101以确定触摸事件的类型,随后处理器101可以根据触摸事件的类型在显示器104-2上提供相应的视觉输出。虽然在图1中,触控板104-1与显示器104-2是作为两个独立的部件来实现手机100的输入和输出功能,但是在某些实施例中,可以将触控板104-1与显示器104-2集成而实现手机100的输入和输出功能。可以理解的是,触摸屏104是由多层的材料堆叠而成,本申请实施例中只展示出了触控板(层)和显示屏(层),其他层在本申请实施例中不予记载。另外,在本申请其他一些实施例中,触控板104-1可以覆盖在显示器104-2之上,并且触控板104-1的尺寸大于显示器104-2的尺寸,使得显示器104-2全部覆盖在触控板104-1下面,或者,上述触控板104-1可以以全面板的形式配置在手机100的正面,也即用户在手机100正面的触摸均能被手机感知,这样就可以实现手机正面的全触控体验。在其他一些实施例中,触控板104-1以全面板的形式配置在手机100的正面,显示器104-2也可以以全面板的形式配置在手机100的正面,这样在手机的正面就可以实现无边框(Bezel)的结构。
手机100还可以包括蓝牙装置105,用于实现手机100与其他短距离的电子设备(例如手机、智能手表等)之间的数据交换。本申请实施例中的蓝牙装置可以是集成电路或者蓝牙芯片等。
手机100还包括至少一种传感器106,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节触摸屏104的显示器的亮度,接近传感器可在手机100移动到耳边时,关闭显示器的电源。
在本申请中作为运动传感器的一种,采用加速计传感器检测各个方向上(一般为三轴)加速度的大小,利用该加速度传感器采集运动目标的加速度数据,处理器101处理该加速度数据得到运动目标的移动距离。
加速计传感器还可用于静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比 如计步器、敲击)等;至于手机100还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
Wi-Fi装置107,用于为手机100提供遵循Wi-Fi相关标准协议的网络接入,手机100可以通过Wi-Fi装置107接入到Wi-Fi接入点,进而帮助用户收发电子邮件、浏览网页和访问流媒体等,它为用户提供了无线的宽带互联网访问。在其他一些实施例中,该Wi-Fi装置107也可以作为Wi-Fi无线接入点,可以为其他电子设备提供Wi-Fi网络接入。
定位装置108,用于为手机100提供地理位置。可以理解的是,该定位装置108具体可以是全球定位***(GPS)或北斗卫星导航***、俄罗斯GLONASS等定位***的接收器。定位装置108在接收到上述定位***发送的地理位置后,将该信息发送给处理器101进行处理,或者发送给存储器103进行保存。在另外的一些实施例中,该定位装置108还可以是辅助全球卫星定位***(AGPS)的接收器,AGPS***通过作为辅助服务器来协助定位装置108完成测距和定位服务,在这种情况下,辅助定位服务器通过无线通信网络与电子设备例如手机100的定位装置108(即GPS接收器)通信而提供定位协助。在另外的一些实施例中,该定位装置108也可以是基于Wi-Fi接入点的定位技术。由于每一个Wi-Fi接入点都有一个全球唯一的MAC地址,电子设备在开启Wi-Fi的情况下即可扫描并收集周围的Wi-Fi接入点的广播信号,因此可以获取到Wi-Fi接入点广播出来的MAC地址;电子设备将这些可以标示Wi-Fi接入点的数据(例如MAC地址)通过无线通信网络发送给位置服务器,由位置服务器检索出每一个Wi-Fi接入点的地理位置,并结合Wi-Fi广播信号的强弱程度,计算出该电子设备的地理位置并发送到该电子设备的定位装置108中。
音频电路109、扬声器113、麦克风114可提供用户与手机100之间的音频接口。音频电路109可将接收到的音频数据转换后的电信号,传输到扬声器113,由扬声器113转换为声音信号输出。另一方面,麦克风114将收集的声音信号转换为电信号,由音频电路109接收后转换为音频数据,再将音频数据输出至RF电路102以发送给比如另一手机,或者将音频数据输出至存储器103以便进一步处理。
外设接口110,用于为外部的输入/输出设备(例如键盘、鼠标、外接显示器、外部存储器、用户识别模块卡等)提供各种接口。例如通过通用串行总线(USB)接口与鼠标连接,通过用户识别模块卡卡槽上的金属触点与电信运营商提供的用户识别模块卡(SIM)卡进行连接。外设接口110可以被用来将上述外部的输入/输出***设备耦接到处理器101和存储器103。
手机100还可以包括给各个部件供电的电源装置111(比如电池和电源管理芯片),电池可以通过电源管理芯片与处理器101逻辑相连,从而通过电源装置111实现管理充电、放电、以及功耗管理等功能。
尽管图1未示出,手机100还可以包括摄像头(前置摄像头和/或后置摄像头)、闪光灯、微型投影装置、近距离无线通信(near field communication,NFC)装置等,在此不再赘述。
本申请实施例提供的移动距离计算方法应用于如图2所示的移动距离计算***中。如图2所示,该移动距离计算***包括:终端201和与终端通信的服务器202。
其中,终端201用于获取运动目标的加速度数据,并根据运动目标的加速度数据确定运动目标的移动距离。
服务器202用于获取多个运动目标的历史数据,并对运动目标的历史数据根据步频和加速度数据划分为N类。服务器202还用于分别对每类历史数据进行模型训练,得到N个预设运动模型。
结合图2,如图3所示,该终端201可以包括处理器2012,以及与处理器2012连接的传感器2011和存储器2013。
其中,传感器2011用于检测采集运动目标的加速度信息,以及向处理器2012发送采集到的加速度数据。示例性的,该传感器2011可以为加速度传感器。此外,该传感器2011还用于检测运动目标是否处于运动状态。
存储器2013用于存储N个预设运动模型。示例性的,该存储器2013可以为只读存储器(read only memory,ROM)。
处理器2012用于接收传感器2011发送的加速度信息,从存储器2013中获取N个预设运动模型。处理器2012还可以用于根据加速度信息确定运动目标的移动距离。示例性的,处理器2012为中央处理器(central processing unit,CPU)。
处理器2012还可以根据N个预设运动模型对上述加速度信息进行处理,得到运动目标的移动距离。
在本申请中终端示例性的可以为手机或者运动手环,手机和运动手环均具有显示界面,能够显示运动目标的运动数据。
如图4a所示,以终端为手机为例,手机上可以运行一个用于显示运动目标的运动数据的应用(application,APP),当该APP运行时,运动目标的运动数据如图4a所示。该运动目标的运动数据可以包括:运动距离、运动时间、平均速度、步数和步幅。可选的,该运动目标的运动数据还可以包括:热量、平均配速、平均心率以及平均步数。
应理解,该APP显示的运动目标的运动数据仅仅为示例性的。在实际的显示中,运动目标的运动数据可以为图示的全部数据或部分数据,运动目标的运动数据还可以是图示的数据以外的数据。
如图4b所示,以终端为运动手环为例,运动手环的显示屏中可以显示如图4b所示的运动目标的运动数据。该运动目标的运动数据包括:运动距离、运动时间、平均速度、步数和步幅。可选的,该运动目标的运动数据还可以包括:热量以及平均步数。
应理解,该运动手环的显示屏中显示的运动目标的运动数据仅仅为示例性的。在实际的显示中,运动目标的运动数据可以为图示的全部数据或部分数据,运动目标的运动数据还可以是图示的数据以外的数据。
在本申请的一种可实现的方式中,运动手环还可以将上述运动目标的运动数据发送至手机,以使手机显示如图4a所示的运动目标的运动数据。
以下,将结合具体实施例详细阐述本申请实施例提供的一种移动距离计算方法,如图5所示,该方法包括:
步骤101、终端检测到运动目标处于运动状态的情况下,终端确定运动目标的加速度信息和第一运动参数。
示例性的,运动状态可以为行走、跑步或者骑行等。第一运动参数为运动目标的步数或者运动目标的运动时间。加速度信息包括加速度方差和步频。
本申请实施例中加速度信息由终端根据传感器采集到的加速度数据进行处理得到。
如果第一运动参数为步数,第一运动参数可以由终端根据计步算法对传感器采集到的加速度数据进行处理得到。
运动目标在运动状态下,加速度随时间变化而变化(在运动目标的行走或者跑步过程中,以时间为横轴,加速度为纵轴记录运动目标的加速度,加速度曲线接近正弦曲线)。
本申请实施例中终端检测到运动目标处于运动状态可以通过以下两种方式实现:
方式一、终端获取运动目标的加速度数据。终端对运动目标的加速度数据进行分析确定运动目标的加速度特征。若加速度特征满足预设条件则终端确定运动目标处于运动状态。
示例性的,上述加速度特征为加速度方差。预设条件为:若加速度方差大于预设阈值。当终端确定运动目标的加速度方差大于预设阈值时,确定运动目标处于运动状态。应理解,加速度特征还可以是运动目标加速度的其他特征,例如卡方分布等。本申请对此不作限定。
方式二、终端通过计步算法对运动目标的加速度数据进行处理,判断加速度数据是否满足计步条件(即加速度数据中的加速度的波形周期是否存在波峰-波谷-波峰,或者波谷-波峰-波谷的特征的加速度周期),如果加速度数据满足计步条件,则终端确定运动目标处于运动状态。
示例性的,终端确定运动目标的加速度信息可以通过以下方式1或方式2实现:
方式1、终端中的传感器实时检测运动目标的加速度数据,并向终端中的处理器发送加速度数据。处理器接收传感器发送的加速度数据,然后处理器根据加速度数据获取加速度信息。
方式2、传感器实时检测运动目标的加速度数据。传感器对加速度数据处理后得到加速度信息,然后将加速度信息发送给处理器。
示例性的,终端检测到运动目标的加速度变化之后,根据计步算法对传感器采集到的加速度数据处理得到的加速度信息的过程具体为:
终端统计该记录周期内的加速度,统计所有加速度的变化趋势。每当运动目标加速度出现一次峰值,则记为一步。在记录周期结束后,根据计算加速度方差的公式计算本次记录周期内的加速度方差,将运动目标的步数除以本次记录周期的时长确定运动目标的步频。
示例性的,加速度方差可通过下述公式计算:
Figure PCTCN2020086524-appb-000005
其中,s为加速度方差,a 1、a 2、…a n分别为该周期内记录的n个加速度。b为该n个加速度的平均值,
Figure PCTCN2020086524-appb-000006
步骤102、终端根据加速度信息和N个预设运动模型确定运动目标在运动时间内的第二运动参数。其中,N为大于或等于2的整数。
示例性的,N个预设运动模型可以为步幅运动模型或速度运动模型。其中,步幅运动模型用于计算运动目标的步幅。速度运动模型可用于计算运动目标的速度。
该N个预设运动模型为服务器对多个运动目标的对历史数据按照加速度方差和步频进行分类后进行数学模型训练得到的多个运动模型。
当第一运动参数为运动目标的步数时,第二运动参数为运动目标的步幅。当第一运动参数为运动目标的运动时间时,第二运动参数为运动目标的运动速度。
具体的,该N个预设运动模型可以由多个历史数据训练得到。为了更加准确的计算 运动目标在不同运动状态下的移动距离,本申请实施例中该N个预设运动模型的运动类型不同。例如,N个预设运动模型的运动类型可以包括以下中的任一个或多个组合:运动目标在跑步状态时的运动模型,运动目标在行走状态或运动目标在骑行状态下的运动模型。
该N个预设运动模型可以由终端从服务器处获取。当然,该N个预设运动模型也可以预先存储在终端(例如,存储在终端的ROM中)中。
如果该N个预设运动模型是由终端从服务器处获取的,则本申请实施例提供的方法还包括:终端向服务器发送获取请求,该获取请求用于获取该N个预设运动模型。服务器接收来自终端的获取请求。服务器向终端发送N个预设运动模型,以使得终端从服务器处获取N个预设运动模型。
应理解,在终端中预先存储有N个预设运动模型的情况下,终端也可以从服务器处获取N个预设运动模型,这时终端从服务器处获取的N个预设运动模型的优先级高于终端中预先存储的N个预设运动模型的优先级,也即终端可以使用从服务器处获取到的N个预设运动模型计算第二运动参数。
步骤103、终端根据第一运动参数和第二运动参数确定运动目标的移动距离。
示例1)、第一运动参数为运动目标的步数,第二运动参数为运动目标的步幅。
在一种可能的实现方式中,本申请实施例中的步骤103可以通过以下方式具体实现:终端根据运动目标的步数以及运动目标的步幅确定运动目标的移动距离。具体的,终端根据步数和步幅的乘积确定移动距离。
示例2)、第一运动参数为运动目标的运动时间,第二运动参数为运动目标的运动速度。
在另一种可能的实现方式中,本申请实施例中的步骤103可以通过以下方式具体实现:终端根据运动目标的步数以及运动目标的步幅确定运动目标的移动距离。具体的,终端根据运动时间以及运动速度的乘积确定移动距离。
本申请实施例提供一种移动距离计算方法,当终端检测到运动目标处于运动状态的情况下,终端确定运动目标的加速度信息和第一运动参数。终端根据加速度信息和N个预设运动模型确定运动目标在运动时间内的第二运动参数。其中,第一运动参数为运动目标的步数,第二运动参数为运动目标的步幅;或者,第一运动参数为运动目标的运动时间,第二运动参数为运动目标的运动速度;N为大于或等于2的整数;终端根据第一运动参数和第二运动参数确定运动目标的移动距离。利用N个预设运动模型计算运动目标的移动距离。可以综合N个预设运动模型的计算结果确定第二运动参数,避免了通过单一预设运动模型计算运动目标的移动距离时,因单一预设运动模型的加速度与运动目标的加速度信息差别较大而导致的移动距离计算误差较大的问题,因此可以提高计算运动目标的移动距离的准确度。
结合图5,如图6所示,在步骤102之前,本申请实施例提供的方法还包括:
步骤201、终端向服务器发送获取请求,该获取请求用于请求获取N个预设运动模型。
可选的,该获取请求中还可以携带运动目标的身高或者年龄中的任何一个。
应理解,如果由服务器从M个预设运动模型中选择N个预设运动模型,则终端向服务器发送的获取请求中还需要携带运动目标的加速度信息。
步骤202、服务器接收来自终端的获取请求。
步骤203、服务器向终端发送N个预设运动模型。
本申请实施例中服务器可以在训练N个预设运动模型之后,主动向终端发送N个预设运动模型,也可以在终端发送的获取请求的触发下,向终端发送N个预设运动模型。在由服务器主动向终端发送N个预设运动模型的情况下,步骤201和步骤202可以省略。
步骤204、终端接收来自服务器的N个预设运动模型。
结合图5,如图7所示,本申请实施例中的步骤102具体可以通过以下方式实现:
步骤1021、终端将加速度信息输入N个预设运动模型,得到N个预设运动模型中每个预设运动模型对应的第三运动参数。
在一种具体实现中,N个预设运动模型中不同预设运动模型对应的第三运动参数的值不同。当然,N个预设运动模型中也可以存在任意两个或两个以上的预设运动模型中对应的第三运动参数的值相同。
具体为,终端计算本次记录周期内的加速度数据,得到运动目标的加速度信息。终端将加速度信息分别输入到上述N个预设运动模型的每个预设运动模型中。每个预设运动模型分别会输出一个第三运动参数。该第三运动参数与前述第二运动参数的参数类型相同。也即若第二运动参数为步幅,则第三运动参数同样为步幅。若第二运动参数为速度,则第三运动参数同样为速度。
一种示例,以预设运动模型为步幅运动模型为例,当第二运动参数为运动目标的步幅时,步幅运动模型可以用如下数学模型表示:
X i=a i*f+b i*v+d i
其中,f表示步频,v表示加速度方差。a i,b i,d i为表示编号为i的运动类型的模型参数。示例性的,a i,b i,d i可以为通过模型训练后得到的常数。i表示运动类型的编号。X i表示编号为i的运动类型的步幅。
对于不同运动类型的历史数据训练得到的运动模型的模型参数a i,b i,d i不同。
在一种实现方式中,服务器在对历史数据进行模型训练时,除了考虑运动目标的步频以外,还加入了运动目标的身高因素。终端计算运动目标的移动距离时,将运动目标的身高与运动目标的运动参数同时输入到运动目标运动模型中,以提高计算移动距离的准确度。当然,该N个预设运动模型还可以结合不同年龄段或者不同的身高来划分。具体的,服务器或者终端可以结合运动目标的身高选择与身高匹配的N个预设运动模型。服务器或者终端可以结合运动目标的年龄选择与年龄匹配的N个预设运动模型。
另一种示例,以预设运动模型为速度运动模型为例,当第二运动参数为运动目标的运动速度时,速度运动模型可以用如下数学模型表示:Y j=a j*f+b j*v+d j。其中,a j,b j,d j为表示编号为j的运动类型的模型参数。示例性的,a j,b j,d j可以为通过模型训练后得到的常数。j表示运动类型的编号。Y j表示编号为j的运动类型的运动速度。
在一种可能的实现方式中,若对预设运动模型进行训练时,加入了多个运动目标的身高,则步幅运动模型还可以用如下数学模型表示:X i=a i*f+b i*v+c i*h+d i。h表示运动目标的身高。c i可以为通过模型训练后得到的常数。速度运动模型还可以用如下数学模型表示:Y j=a j*f+b j*v+c j*h+d j。c j可以为通过模型训练后得到的常数。
举例说明,以加速度信息为a,该N个预设运动模型分别为第一预设运动模型和第二预设运动模型,预设运动模型的输出为步幅为例,则将a输入至第一预设运动模型中, 得到第三运动参数X 1。则将a输入至第二预设运动模型中,得到第三运动参数X 2
步骤1022、终端根据每个预设运动模型对应的第三运动参数以及每个预设运动模型各自的权重,确定第二运动参数。
其中,每个预设运动模型分别对应一个权重,一个预设运动模型对应的权重与其他预设运动模型对应的权重可以相同,也可以不同。N个预设运动模型的权重之和等于1。
该权重用于表示在该记录周期内预设运动模型与运动目标运动过程的相关程度。应理解,该N个预设运动模型中一个预设运动模型的权重越大表示该预设运动模型与运动目标运动过程的相关程度越高。该N个预设运动模型中一个预设运动模型的权重越小表示该预设运动模型与运动目标运动过程的相关程度越低。
例如,在训练预设运动模型的过程中,每个预设运动模型均会有一个对应的加速度。
具体为,终端将各个预设运动模型输出的第三运动参数与该预设运动模型对应的权重按预设算法进行计算,得到第二运动参数。
示例性的,当第二运动参数为运动目标的步幅时,步骤1022具体可以通过以下方式实现:终端根据公式
Figure PCTCN2020086524-appb-000007
确定第二运动参数。
其中,
Figure PCTCN2020086524-appb-000008
表示运动目标运动的步幅,w i表示编号为i的预设运动模型的权重,X i表示表示编号为i的运动类型的步幅,i为运动类型的编号,i取自1,2,…,N。
示例性的,当第二运动参数为运动目标的运动速度时,步骤1022具体可以通过以下方式实现:终端根据公式
Figure PCTCN2020086524-appb-000009
确定第二运动参数。
其中,
Figure PCTCN2020086524-appb-000010
表示运动目标的运动速度,λ j表示编号为j的预设运动模型的权重,Y j表示编号为j的运动类型的运动速度。
举例说明,以加速度信息为a,该N个预设运动模型分别为第一预设运动模型和第二预设运动模型为例,第一预设运动模型的权重为
Figure PCTCN2020086524-appb-000011
第二预设运动模型的权重为
Figure PCTCN2020086524-appb-000012
则第二运动参数
Figure PCTCN2020086524-appb-000013
本申请实施例中每个预设运动模型各自的权重可以由终端从服务器处获取,也即服务器为每个预设运动模型各自分配一个权重,然后将每个预设运动模型与各自的权重之间的映射关系发送给终端。或者,该每个预设运动模型各自的权重由终端自行分配。具体的,终端自行为每个预设运动模型分配权重可以通过以下步骤104实现。
结合图7,如图8所示,本申请实施例提供的方法在步骤1021之前还包括:
步骤104、终端根据加速度信息与N个预设运动模型中每个预设运动模型的相似度,确定每个预设运动模型各自的权重。
结合图8,如图9所示,本申请实施例中的步骤104具体可以通过以下步骤实现:
步骤1041、终端确定预设运动模型的加速度方差平均值和步频平均值。
具体为,在服务器训练N个预设运动模型的过程中,在训练完成之后,会得到各个预设运动模型对应的加速度方差的平均值和步频的平均值。终端接收来自服务器的N个预设运动模型时,同时获取各个预设运动模型的加速度方差的平均值和步频的平均值。
在本步骤的一种实现方式中,终端或者服务器还可以预先为每个预设运动模型配置一个权重。终端可以直接将加速度信息输入每个预设运动模型,以得到加速度信息在每个预设运动模型中分别对应的第三运动参数。终端将每个预设运动模型对应的第三运动参数乘以每个预设运动模型对应的权重之后累加得到第二运动参数。通过服务器为各个 预设运动模型分配权重,可以减少终端的计算量。
步骤1042、终端根据预设运动模型的加速度方差平均值和步频平均值以及加速度信息的加速度方差和步频,确定加速度信息和预设运动模型的相似度。
具体为,终端中预先配置有计算预设运动模型和运动目标运动的相似度的算法。分别将上述预设运动模型的加速度方差平均值和步频平均值以及加速度信息的加速度方差和步频带入上述相似度算法中,得到加速度信息和预设运动模型的相似度。
示例性的,本申请实施例中可以计算预设运动模型的加速度方差平均值和步频平均值以及加速度信息的加速度方差和步频之间的欧式距离。将欧式距离作为预设运动模型和加速度信息的相似度。欧式距离的计算公式为:
Figure PCTCN2020086524-appb-000014
其中,l表示预设运动模型与加速度信息的欧式距离,a 1表示预设运动模型的加速度方差的归一化平均值,a 2表示加速度信息的加速度方差的归一化值,b 1表示预设运动模型的步频的归一化平均值,b 2表示加速度信息的步频的归一化值。
应理解,上述以欧式距离作为加速度信息和预设运动模型的相似度是为了以一种更加直观、更加容易理解的方式解释上述相似度的计算方法,而不应将其理解为对本申请求相似度方法的限定。本领域的技术人员可以通过多种方法确定加速度信息和预设运动模型的相似度,本申请对此不做限定。
一种实现方式中,由于加速度方差的值通常较小,步频的值通常较大,若直接计算预设运动模型的加速度方差平均值和步频平均值以及加速度信息的加速度方差和步频之间的欧式距离,则加速度方差所占的比重较小,会导致相似度计算不准确。因此,需要首先对预设运动模型的加速度方差平均值和步频平均值以及加速度信息的加速度方差和步频进行归一化处理。具体为:
Figure PCTCN2020086524-appb-000015
其中a x表示预设运动模型的加速度方差的平均值,a xmin预设运动模型的加速度方差的最小值,a xmax预设运动模型的加速度方差的最大值。
Figure PCTCN2020086524-appb-000016
其中a y表示加速度信息的加速度方差,a ymin加速度信息的加速度方差的最小值,a ymax加速度信息的加速度方差的最大值。
Figure PCTCN2020086524-appb-000017
其中b x表示预设运动模型的步频的平均值,b xmin预设运动模型的步频的最小值,b xmax预设运动模型的步频的最大值。
Figure PCTCN2020086524-appb-000018
其中b y表示加速度信息的步频,b ymin加速度信息的步频的最小值,b ymax加速度信息的步频的最大值。
步骤1043、终端根据加速度信息和预设运动模型的相似度确定预设运动模型的权重。
在步骤1043的一种实现方式中,终端根据加速度信息和预设运动模型的相似度确定预设运动模型的权重,具体可以实现为:
终端确定加速度信息与上述N个预设运动模型的相似度之和,得到相似度总和。
终端确定N个预设运动模型中的每个预设运动模型的相似度在相似度总和中的占比。
终端将每个预设运动模型的相似度在相似度总和中的占比,确定为每个预设运动模型各自的权重。
示例性的,以N=5,N个预设运动模型分别为第一预设运动模型、第二预设运动模型、第三预设运动模型、第四预设运动模型、第五预设运动模型。该第一至第五预设运动模型与加速度信息的相似度分别为10、30、2、5、3。则加速度信息与该第一至第五预设运动模型的相似度总和为50,计算得到加速度信息与该第一至第五预设运动模型的相似度占上述相似度总和的比例分别为20%,60%、4%、10%、6%。将20%,60%、4%、10%、6%分别作为上述第一至第五预设运动模型的权重。也即第一预设运动模型的权重为20%、第二预设运动模型的权重为60%、第三预设运动模型的权重为4%、第四预设运动模型的权重为10%、第五预设运动模型的权重为6%。
在本申请的一种实现方式中,服务器根据加速度方差和步频可以将运动状态分为多种运动类型(例如,将运动状态划分为行走和跑步。还可以进一步将对行走和跑步的状态进行划分,例如将走路划分为5级,各级之间的运动状态不同。将跑步划分为5级,各级之间的运动状态不同)。由于运动目标在此次运动周期内通常只与几个运动类型比较相近。例如,运动目标在走路的状态下与跑步的状态相差较大。此时,若将运动目标本次记录周期内的加速度信息分别带到全部的加速度模型中,可能会导致不必要的计算量增加,并且与运动目标的加速度信息相似度较低的模型可能会降低计算结果的精确度。
为了降低终端的计算量,避免相似度过低的预设运动模型对移动距离的计算产生干扰,本申请实施例提供的方法还包括:N个预设运动模型为M个预设运动模型中相似度大于或等于预设阈值的预设运动模型,M为大于或等于N的整数。
具体为:服务器对根据历史数据中各次运动的加速度和步频按照预设规则划分为M类。服务器对M类中每类历史数据进行训练,以得到M个预设运动模型。服务器向终端发送该M个预设运动模型,终端接收来自服务器的M个预设运动模型,终端按照上述步骤1042和步骤1043所记载的方法计算得到该M个预设运动模型的中各个预设运动模型与加速度信息的相似度。取该M个预设运动模型中与加速度信息的相似度大于预设阈值的N个预设运动模型,或者取该M个预设运动模型中与加速度信息的相似度最大的N个预设运动模型。当然,也可以由服务器为终端从M个预设运动模型中选择与加速度信息的相似度最大的N个预设运动模型。应理解,在由终端从M个预设运动模型中选择N个预设运动模型时,终端从服务器处获取M预设运动模型。
在本申请实施例的一种实现方式中,当终端根据运动目标的运动速度和运动时间计算运动目标的移动距离时,由于运动目标在不同时间段内可能处于不同的运动状态(例如运动目标步行前往训练场地,然后开始进行跑步锻炼,跑步锻炼之后在行走一段距离)。如果将该多个运动状态记录在一个周期内进行移动距离计算将会导致计算结果误差较大。
因此,本申请实施例还可以将该运动时间划分为多个时间窗口(例如以每秒或者每分钟为时间长度划分时间窗口),终端根据每个时间窗口对应的第一加速度信息,以及N个预设运动模型确定每个时间窗口对应的运动速度。
具体为,加速度信息包括运动时间内的多个时间窗口中每个时间窗口对应的第一加速度信息。终端根据每个时间窗口对应的第一加速度信息,以及N个预设运动模型确定每个时间窗口对应的运动速度。
终端根据每个时间窗口对应的运动速度以及每个时间窗口各自的时间长度,确定运 动目标的移动距离。
更具体的,终端将运动时间按照预设时长划分为多个时间窗口。终端分别将每个时间窗口内的加速度信息带入到N个预设运动模型中,得到每个时间窗口内运动目标的运动速度(该过程与本申请实施例前文过程相同,此处不再赘述)。终端将每个时间窗口内运动目标的运动速度乘以该时间窗口的时间长度,得到运动目标在每个时间窗口内的移动距离。终端将每个时间窗口内运动目标的移动距离求和,得到运动目标的总的移动距离。
如图10所示,图10示出了服务器训练得到N个预设运动模型的过程,该方法包括:
步骤301、服务器获取历史数据。
其中,该历史数据中包括不同运动类型的运动数据。该历史数据为采集的多个运动目标的运动轨迹的数据,这些历史数据中包括各个运动目标在各个运动轨迹中的加速度方差、步频、步数、步幅(或者运动速度、运动时间)以及移动距离。
上述历史数据可以存储在服务器中,也可以存储在与服务器建立通信连接的其他存储设备中。
步骤302、服务器将历史数据划分为N类历史数据。
具体为,服务器按照预设的加速度方差区间和步频区间对历史数据进行步态分类。
示例性的,将运动目标的步态类型划分为五类,分别为第一步态类型、第二步态类型、第三步态类型、第四步态类型和第五步态类型。历史数据中全部可能的数据的加速度方差范围为c 1至c 6;步频的范围为d 1至d 6
将加速度方差在c 1至c 2之间,步频在d 1至d 2之间的历史数据划分为第一步态类型。将加速度方差在c 2至c 3之间,步频在d 2至d 3之间的历史数据划分为第二步态类型。将加速度方差在c 3至c 4之间,步频在d 3至d 4之间的历史数据划分为第三步态类型。将加速度方差在c 4至c 5之间,步频在d 4至d 5之间的历史数据划分为第四步态类型。将加速度方差在c 5至c 6之间,步频在d 5至d 6之间的历史数据划分为第五步态类型。
步骤303、服务器对N类历史数据进行预设运动模型训练,得到N个预设运动模型。
具体为,服务器将分类之后的历史数据输入到对应的数学模型中进行训练。服务器对历史数据进行模型训练的方法有多种。例如服务器通过最小二乘法对历史数据进行运算,确定预设运动模型。
服务器通过最小二乘法对历史数据进行运算,确定预设运动模型的具体过程包括:
服务器提取历史数据中各个时间点的步频和加速度方差。服务器将这些点在以步频和加速度方差为轴的坐标系中进行排列。这些点基本上呈带状分布。通过寻找一条直线,使上述所有点与该直线的距离的平方和最小。该直线的数学表达式即为我们训练得到的预设运动模型。
在本申请实施例的一种实现方式中,在步骤103之后,服务器还可以接受终端或其他设备发送的第二历史数据。该第二历史数据为终端在对运动目标的移动距离进行计算的过程中产生的历史数据。并结合上述历史数据和上述其他历史数据进一步分类并进行预设运动模型训练。得到新的N个预设训练模型。将该N个预设训练模型发送至终端以使终端根据该N个预设训练模型确定运动目标的移动距离。
应理解,该第二历史数据信息还可以为其他历史数据,例如其他设备采集的其他运动目标的运动的历史数据。
可以理解的是,上述终端或服务器等为了实现上述功能,其包含了执行各个功 能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例可以以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。
本申请实施例可以根据上述方法示例对上述终端或服务器等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用对应各个功能划分各个功能模块的情况下,图11示出了上述实施例中所涉及的一种移动距离计算装置的一种可能的结构示意图,该移动距离计算装置包括:处理单元301。
在一种可能的实现方式,该移动距离计算装置还可以包括:通信单元302。
一种示例,该移动距离计算装置为终端或者为应用于终端中的芯片,该处理单元301用于执行上述步骤101、步骤102以及步骤103。
一种可能的实现方式,该处理单元301还用于执行步骤1021、步骤1022、步骤104、步骤1041、步骤1042以及步骤1043。
一种可能的实现方式,该通信单元302用于执行上述步骤201和步骤204。
另一种示例,该移动距离计算装置为服务器或者为应用于服务器中的芯片,该处理单元301用于上述步骤302和步骤303。
一种可能的实现方式,该通信单元302用于执行上述步骤301、步骤202和步骤203。
可选的,移动距离计算装置还可以包括存储单元。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
在采用集成的单元的情况下,图12示出了上述实施例中所涉及的移动距离计算装置的一种可能的结构示意图。该移动距离计算装置包括:处理模块412和通信模块413。处理模块412用于对移动距离计算装置的动作进行控制管理。通信模块413用于支持移动距离计算装置与其他网络实体的通信。该移动距离计算装置还可以包括存储模块411,用于存储移动距离计算装置的程序代码和数据。
一种示例,该移动距离计算装置为终端或者为应用于终端中的芯片,该处理模块412用于执行上述步骤101、步骤102以及步骤103。
一种可能的实现方式,该处理模块412还用于执行步骤1021、步骤1022、步骤104骤、步骤1041、步骤1042以及步骤1043。
一种可能的实现方式,该通信模块413用于执行上述步骤201和步骤204。
另一种示例,该移动距离计算装置为服务器或者为应用于服务器中的芯片,该处理模块412用于执行上述步骤302和步骤303。
一种可能的实现方式,该通信模块413用于执行上述步骤301、步骤202和步骤203。
其中,处理模块412可以是处理器或控制器,例如可以是中央处理器(Central  Processing Unit,CPU),通用处理器,数字信号处理器(Digital Signal Processor,DSP),专用集成电路(Application-Specific Integrated Circuit,ASIC),现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信模块413可以是通信接口等。存储模块411可以是存储器。
当处理模块412为处理器101,通信模块413为射频电路102,存储模块411为存储器103时,本申请实施例所提供的终端可以为图1所示的终端。
在本申请的另外一些实施例中,提供了一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令被运行时,使得移动距离计算装置执行实施例中的步骤101、步骤102以及步骤103。
一方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令被运行时,使得移动距离计算装置执行实施例中的步骤1021、步骤1022、步骤104骤、步骤1041、步骤1042以及步骤1043。
一方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令被运行时,使得移动距离计算装置执行实施例中的步骤201和步骤204。
另一方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令被运行时,使得移动距离计算装置执行实施例中的步骤302和步骤303。
一方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令被运行时,使得移动距离计算装置执行实施例中的步骤301、步骤202和步骤203。
前述的可读存储介质可以包括:U盘、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
一方面,提供一种包括指令的计算机程序产品,计算机程序产品中存储有指令,当指令被运行时,使得移动距离计算装置执行实施例中的步骤101、步骤102、步骤103、步骤1021、步骤1022、步骤104骤、步骤1041、步骤1042以及步骤1043。
另一方面,提供一种包括指令的计算机程序产品,计算机程序产品中存储有指令,当指令被运行时,使得移动距离计算装置执行步骤201和步骤204。
又一方面,提供一种包括指令的计算机程序产品,计算机程序产品中存储有指令,当指令被运行时,使得移动距离计算装置执行步骤302和步骤303。
又一方面,提供一种包括指令的计算机程序产品,计算机程序产品中存储有指令,当指令被运行时,使得移动距离计算装置执行步骤301、步骤202和步骤203。
在上述实施例中,可以全部或部分的通过软件,硬件,固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式出现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心传输。 所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘,硬盘、磁带)、光介质(例如,DVD)或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (21)

  1. 一种移动距离计算方法,其特征在于,包括:
    终端检测到运动目标处于运动状态的情况下,所述终端确定所述运动目标的加速度信息和第一运动参数;
    所述终端根据所述加速度信息和N个预设运动模型确定所述运动目标在运动时间内的第二运动参数;其中,所述第一运动参数为所述运动目标的步数,所述第二运动参数为所述运动目标的步幅;或者,所述第一运动参数为所述运动目标的运动时间,所述第二运动参数为所述运动目标的运动速度;N为大于或等于2的整数;
    所述终端根据所述第一运动参数和所述第二运动参数确定所述运动目标的移动距离。
  2. 根据权利要求1所述的方法,其特征在于,所述终端根据所述加速度信息和N个预设运动模型确定所述运动目标在运动时间内的第二运动参数,包括:
    所述终端将所述加速度信息输入所述N个预设运动模型,得到所述N个预设运动模型中每个预设运动模型对应的第三运动参数;
    所述终端根据所述每个预设运动模型对应的第三运动参数以及所述每个预设运动模型各自的权重,确定所述第二运动参数。
  3. 根据权利要求1-2任一项所述的方法,其特征在于,所述方法还包括:
    所述终端根据所述加速度信息与所述N个预设运动模型中每个预设运动模型的相似度,确定所述每个预设运动模型各自的权重。
  4. 根据权利要求3所述的方法,其特征在于,所述终端根据所述加速度信息与所述N个预设运动模型中每个预设运动模型的相似度,确定所述每个预设运动模型各自的权重,包括:
    所述终端确定所述每个预设运动模型的加速度方差平均值和步频平均值;
    所述终端根据所述每个预设运动模型的加速度方差平均值和步频平均值以及所述加速度信息的加速度方差和步频,确定所述加速度信息和所述每个预设运动模型的相似度;
    所述终端根据所述加速度信息和所述每个预设运动模型的相似度确定所述每个预设运动模型的权重。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述N个预设运动模型为M个预设运动模型中的预设运动模型,且所述N个预设运动模型和所述加速度信息之间的相似度大于或等于预设阈值,M为大于N的整数。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述加速度信息包括所述运动时间内的多个时间窗口中每个时间窗口对应的第一加速度信息;所述第二运动参数为所述运动目标的运动速度时,所述终端根据所述加速度信息和N个预设运动模型确定所述运动目标在运动时间内的第二运动参数,包括:
    所述终端根据所述每个时间窗口对应的第一加速度信息,以及所述N个预设运动模型确定所述每个时间窗口对应的运动速度。
  7. 根据权利要求6所述的方法,其特征在于,所述终端根据所述第一运动参数和所述第二运动参数确定所述运动目标的移动距离,包括:
    所述终端根据所述每个时间窗口对应的运动速度以及所述每个时间窗口各自的时间长度,确定所述运动目标的移动距离。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法还包括:
    所述终端从服务器处获取所述N个预设运动模型。
  9. 一种移动距离计算装置,其特征在于,所述装置包括:
    处理器,用于检测到运动目标处于运动状态的情况下,确定所述运动目标的加速度信息和第一运动参数;
    所述处理器,还用于根据所述加速度信息和N个预设运动模型确定所述运动目标在运动时间内的第二运动参数;其中,所述第一运动参数为所述运动目标的步数,所述第二运动参数为所述运动目标的步幅;或者,所述第一运动参数为所述运动目标的运动时间,所述第二运动参数为所述运动目标的运动速度;N为大于或等于2的整数;
    所述处理器,还用于根据所述第一运动参数和所述第二运动参数确定所述运动目标的移动距离。
  10. 根据权利要求9所述的装置,其特征在于,所述处理器,还具体用于:
    将所述加速度信息输入所述N个预设运动模型,得到所述N个预设运动模型中每个预设运动模型对应的第三运动参数;
    根据所述每个预设运动模型对应的第三运动参数以及所述每个预设运动模型各自的权重,确定所述第二运动参数。
  11. 根据权利要求9-10任一项所述的装置,其特征在于,所述处理器,还具体用于:
    根据所述加速度信息与所述N个预设运动模型中每个预设运动模型的相似度,确定所述每个预设运动模型各自的权重。
  12. 根据权利要求11所述的装置,其特征在于,所述处理器,还具体用于:
    确定所述每个预设运动模型的加速度方差平均值和步频平均值;
    根据所述每个预设运动模型的加速度方差平均值和步频平均值以及所述加速度信息的加速度方差和步频,确定所述加速度信息和所述每个预设运动模型的相似度;
    根据所述加速度信息和所述每个预设运动模型的相似度确定所述每个预设运动模型的权重。
  13. 根据权利要求9-12任一项所述的装置,其特征在于,所述N个预设运动模型为M个预设运动模型中的预设运动模型,且所述N个预设运动模型和所述加速度信息之间的相似度大于或等于预设阈值,M为大于N的整数。
  14. 根据权利要求9-13任一项所述的装置,其特征在于,所述加速度信息包括所述运动时间内的多个时间窗口中每个时间窗口对应的第一加速度信息;所述处理器,还具体用于:
    根据所述每个时间窗口对应的第一加速度信息,以及所述N个预设运动模型确定所述每个时间窗口对应的运动速度。
  15. 根据权利要求14所述的装置,其特征在于,所述处理器,还具体用于:
    根据所述每个时间窗口对应的运动速度以及所述每个时间窗口各自的时间长度,确定所述运动目标的移动距离。
  16. 根据权利要求9-15任一项所述的装置,其特征在于,所述装置还包括:通信接口;
    所述通信接口,用于从服务器处获取所述N个预设运动模型。
  17. 一种移动距离计算装置,其特征在于,包括:处理器和通信接口;所述通信接口和所述处理器耦合,所述处理器用于运行计算机程序或指令,以实现如权利要求1-8任一项所述的移动距离计算方法。
  18. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在终端上运行时,使得所述终端执行如权利要求1-8中任一项所述的移动距离计算方法。
  19. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在终端上运行时,使得所述终端执行如权利要求1-8中任一项所述的移动距离计算方法。
  20. 一种芯片,其特征在于,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行计算机程序或指令,以实现如权利要求1-8任一项所述的方法。
  21. 一种移动距离计算***,其特征在于,包括:终端,以及与所述终端通信的服务器,所述服务器用于确定N个预设运动模型,所述终端用于执行权利要求1-8中任一项所描述的方法。
PCT/CN2020/086524 2019-04-30 2020-04-24 一种移动距离计算方法、装置以及*** WO2020221109A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910364520.3A CN110246561A (zh) 2019-04-30 2019-04-30 一种移动距离计算方法、装置以及***
CN201910364520.3 2019-04-30

Publications (1)

Publication Number Publication Date
WO2020221109A1 true WO2020221109A1 (zh) 2020-11-05

Family

ID=67883606

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/086524 WO2020221109A1 (zh) 2019-04-30 2020-04-24 一种移动距离计算方法、装置以及***

Country Status (2)

Country Link
CN (1) CN110246561A (zh)
WO (1) WO2020221109A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110246561A (zh) * 2019-04-30 2019-09-17 华为技术有限公司 一种移动距离计算方法、装置以及***
CN112781580B (zh) * 2019-11-06 2024-04-26 佛山市云米电器科技有限公司 家庭设备的定位方法、智能家居设备及存储介质
CN113534118A (zh) * 2020-04-17 2021-10-22 北京小米移动软件有限公司 移动距离确定方法、装置及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105403228A (zh) * 2015-12-18 2016-03-16 北京朗动科技有限公司 一种运动距离的确定方法和装置
CN105628028A (zh) * 2016-01-04 2016-06-01 成都卫士通信息产业股份有限公司 一种基于手机内置传感器的室内三维定位***及定位方法
CN106289311A (zh) * 2016-08-04 2017-01-04 北京妙医佳信息技术有限公司 一种运动时长和距离的检测方法
WO2019047410A1 (zh) * 2017-09-11 2019-03-14 上海斐讯数据通信技术有限公司 一种步数的统计方法及装置
CN110246561A (zh) * 2019-04-30 2019-09-17 华为技术有限公司 一种移动距离计算方法、装置以及***

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184549B (zh) * 2011-04-29 2012-10-10 闫文闻 一种运动参数确定方法、装置和运动辅助设备
KR102292683B1 (ko) * 2014-09-12 2021-08-23 삼성전자주식회사 보행 환경 인식 방법 및 장치
CN107506684B (zh) * 2016-06-14 2022-03-01 中兴通讯股份有限公司 步态识别方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105403228A (zh) * 2015-12-18 2016-03-16 北京朗动科技有限公司 一种运动距离的确定方法和装置
CN105628028A (zh) * 2016-01-04 2016-06-01 成都卫士通信息产业股份有限公司 一种基于手机内置传感器的室内三维定位***及定位方法
CN106289311A (zh) * 2016-08-04 2017-01-04 北京妙医佳信息技术有限公司 一种运动时长和距离的检测方法
WO2019047410A1 (zh) * 2017-09-11 2019-03-14 上海斐讯数据通信技术有限公司 一种步数的统计方法及装置
CN110246561A (zh) * 2019-04-30 2019-09-17 华为技术有限公司 一种移动距离计算方法、装置以及***

Also Published As

Publication number Publication date
CN110246561A (zh) 2019-09-17

Similar Documents

Publication Publication Date Title
WO2020221109A1 (zh) 一种移动距离计算方法、装置以及***
CN109997348B (zh) 一种终端界面的显示方法及终端
CN108701495B (zh) 用于整合和提供从多个设备收集的数据的方法以及用于实现该方法的电子设备
US20240203549A1 (en) Location-based healthcare collaboration, data management and access control
WO2018223270A1 (zh) 一种显示的处理方法及装置
EP3640782A1 (en) Anti-misoperation method and terminal
US20160144236A1 (en) Exercise information providing method and electronic device supporting the same
US10949019B2 (en) Electronic device and method for determining touch coordinate thereof
US20140031959A1 (en) Determining authenticity of reported fitness-related activities
CN106705989B (zh) 记步方法、设备及终端
CN111050370A (zh) 网络切换方法、装置、存储介质及电子设备
CN109753327A (zh) 一种控件布局方法、终端及计算机可读存储介质
US11059438B2 (en) Vehicle on-boarding recognition method and electronic device implementing same
CN109857245A (zh) 一种手势识别方法和终端
US9619626B2 (en) Method and apparatus for identifying exercise information of user
CN108886548B (zh) 一种确定电子设备的器件功耗的方法、电子设备以及存储介质
CN107784298A (zh) 一种识别方法及装置
CN107943406B (zh) 一种触摸屏触控点确定方法及终端
CN109688175B (zh) 资源包发放方法、资源包获取方法、装置及存储介质
CN108989546A (zh) 电子装置的接近检测方法及相关产品
WO2019204968A1 (zh) 用户运动距离的获取方法和终端设备
CN117387655B (zh) 计步方法、装置、终端及存储介质
CN109829278A (zh) 终端解锁方法、移动终端及计算机可读存储介质
WO2020087364A1 (zh) 一种运动指标评估方法及装置
WO2020000155A1 (zh) 一种指纹采集方法和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20798252

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20798252

Country of ref document: EP

Kind code of ref document: A1