Method and electronic device for monitoring deviation of moving trajectory from reference path trajectory
By dynamically adjusting the deviation judgment time point and combining the user's real-time situation and fault tolerance value, the problem of high power consumption when monitoring movement trajectory deviation in the existing technology is solved, and the effects of timely and accurate monitoring and power consumption reduction are achieved.
Patent Information
- Application Number
- CN202311113675.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-08-30
AI Technical Summary
When the existing technology monitors whether the movement trajectory deviates from the reference path trajectory, it is difficult to make timely and accurate judgments while reducing the power consumption of the device, resulting in problems such as device heating and rapid battery consumption.
By dynamically adjusting the time point for the next deviation judgment, and based on the user's real-time location, moving direction, moving speed and pre-configured fault tolerance value, the moment to collect the user's real-time position is dynamically determined to avoid excessive power consumption caused by frequent position collection.
It realizes timely monitoring when the user deviates from the reference path trajectory, reduces the power consumption of the device, avoids the problems of device heating and excessive battery consumption, and improves the accuracy and efficiency of monitoring.
Smart Images

Figure CN117723074B
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a method and electronic device for monitoring the deviation of a moving trajectory from a reference path trajectory. Background Art
[0002] With the rapid development of mobile devices such as mobile phones and wearable devices, mobile devices can provide users with more and more functions and services. For example, mobile devices can provide navigation functions, sports and health functions, etc. In some scenarios of navigation, sports and health functions, it is necessary to judge the user's movement trajectory in real time to determine whether the user's movement trajectory deviates from the pre-selected path trajectory. Furthermore, when it is determined that the user's movement trajectory deviates from the pre-selected path trajectory, it can also issue a prompt to the user and perform route corrections.
[0003] The process of determining whether a trajectory has deviated typically consumes device power. In existing technologies, timely and accurate detection of trajectory deviations often results in significant power consumption, leading to issues like device overheating and rapid battery drain. Reducing power consumption also results in inability to detect trajectory deviations in a timely manner, potentially causing users to stray too far from their intended path. Summary of the Invention
[0004] The embodiments of the present application provide a method and electronic device for monitoring deviation of a moving trajectory from a reference path trajectory, which can reduce the power consumption of the device while timely and accurately judging the deviation of the moving trajectory.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a method for monitoring deviations of a movement trajectory from a reference path trajectory is provided. The method is applied to an electronic device, wherein the electronic device obtains a reference path trajectory; the electronic device obtains a first real-time location and a first movement direction of a user at a first moment; and the electronic device further obtains a first reference position on the reference path trajectory; the first reference position is the geographic coordinate position corresponding to the first moment on the reference path trajectory, i.e., the reference position corresponding to the first real-time location. At the first moment, the electronic device first determines whether the user's movement trajectory deviates from the reference path trajectory. At the first moment, the electronic device further determines a first time interval based on an offset (first offset) between the first real-time location and the first reference position, an angle (first angle) between the first movement direction and the reference path trajectory, the user's movement speed at the first moment, and a preconfigured tolerance value, and determines a second moment based on the first moment and the first time interval. Then, the electronic device obtains a second real-time location of the user at a second moment and determines whether the user's movement trajectory deviates from the reference path trajectory. The first offset is negatively correlated with the first time interval, the first angle is negatively correlated with the first time interval, the user's movement speed at the first moment is negatively correlated with the first time interval, and the preconfigured tolerance value is positively correlated with the first time interval.
[0007] In this method, the further the current user deviates from the reference path trajectory (i.e., the larger the first offset), the larger the deviation angle between the user's moving direction and the reference path trajectory (i.e., the larger the first angle), the faster the user's moving speed, and / or the smaller the pre-configured fault tolerance value, the earlier the next time the user's real-time position is collected and the moment of deviation judgment is initiated (the second moment). The closer the current user deviates from the reference path trajectory (i.e., the smaller the first offset), the smaller the deviation angle between the user's moving direction and the reference path trajectory (i.e., the smaller the first angle), the slower the user's moving speed, and / or the larger the pre-configured fault tolerance value, the later the next time the user's real-time position is collected and the moment of deviation judgment is initiated (the second moment). In this way, the probability of detecting deviation before the user deviates from the reference path trajectory can be increased, and timely monitoring of the deviation of the user's moving trajectory from the reference path trajectory can be achieved. Furthermore, there is no need to collect the user's real-time location at a fixed period. The second moment is dynamically determined based on the moment (first moment) when the user's real-time location was last collected and deviation judgment was made, and the user's actual situation (first offset, first angle, moving speed). The user's real-time location is collected and deviation judgment is made at the second moment, and the user's real-time location is not collected before the second moment, thereby avoiding the problem of excessive power consumption of electronic devices caused by frequent collection of the user's real-time location.
[0008] In conjunction with the first aspect, in one possible implementation, if the first offset is greater than a preconfigured tolerance value, the electronic device determines that the user's movement trajectory deviates from the reference path trajectory at the first moment; if the first offset is less than or equal to the preconfigured tolerance value, the electronic device determines that the user's movement trajectory does not deviate from the reference path trajectory at the first moment. That is, the offset determination is performed at the first moment.
[0009] In combination with the first aspect, in a possible implementation, the electronic device obtains a first duration according to the formula T'=(fO) / sin(α)*V; wherein T' represents the first duration, f represents the fault tolerance value, O represents the offset between the user's real-time position and the corresponding reference position at the same moment, α represents the angle between the user's moving direction and the reference path trajectory, and V represents the user's moving speed; the electronic device determines the first time interval based on the first duration.
[0010] In this method, based on the user's real-time situation at a first moment (first offset, first angle, movement speed, and tolerance), the time at which the offset between the user's real-time position and the reference position exceeds a preset tolerance is predicted. The next deviation determination is performed before this predicted time. This allows for timely monitoring of deviations from the reference path trajectory.
[0011] In one possible implementation, the first time interval is a first duration; or the first time interval is a second duration, and the second duration is obtained by rounding down the first duration. In this way, it is possible to better avoid the failure to timely detect that the user deviates from the preset path trajectory.
[0012] In combination with the first aspect, in a possible implementation, if the first duration is greater than a preset maximum time interval, the first time interval is the maximum time interval; if the first duration is less than a preset minimum time interval, the first time interval is the minimum time interval.
[0013] This can avoid not performing deviation judgment for too long, which may result in failure to timely monitor the deviation of the user's movement trajectory from the reference path trajectory; or performing deviation judgment too frequently, which may result in excessive power consumption of the mobile device.
[0014] In combination with the first aspect, in a possible implementation, the method further includes: the electronic device obtains the user's movement mode; for example, walking, running or cycling; and the electronic device obtains the user's movement speed at the first moment based on the user's movement mode.
[0015] In a possible implementation, the moving speed of the user at the first moment is the maximum speed corresponding to the user's motion mode; wherein the maximum speed corresponding to the motion mode is preconfigured.
[0016] The user's actual movement speed is generally lower than the maximum speed corresponding to the movement pattern. By using the maximum speed corresponding to the user's movement pattern as the user's movement speed at the first moment, the calculated first time interval is shorter than the actual situation, and accordingly, the next deviation determination is made earlier. This can avoid delays in detecting deviations of the user's movement trajectory from the baseline path.
[0017] In combination with the first aspect, in a possible implementation, different movement modes correspond to different values of the fault tolerance value.
[0018] In a possible implementation, walking corresponds to a first tolerance value, running corresponds to a second tolerance value, and cycling corresponds to a third tolerance value; wherein the first value is smaller than the second value, and the second value is smaller than the third value.
[0019] In conjunction with the first aspect, in one possible implementation, the method further includes: the electronic device receiving a configuration value of the fault tolerance value from a server; and the electronic device updating a stored fault tolerance value based on the configuration value of the fault tolerance value. In this way, a configuration person can dynamically configure the fault tolerance value based on actual usage.
[0020] In combination with the first aspect, in a possible implementation, the electronic device does not collect the real-time location of the user after the first moment and before the second moment.
[0021] Between the first and second moments, there is no need to collect the user's real-time location, nor is there any need to determine whether the user's movement trajectory deviates from the reference path trajectory. This avoids the power consumption caused by frequent collection of user locations, and can reduce the probability of problems such as mobile device overheating and rapid battery drain.
[0022] In a second aspect, an electronic device is provided that has the functionality to implement the method described in the first aspect. The functionality can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functionality described above.
[0023] In a third aspect, an electronic device is provided, comprising: a processor, a positioning module, a sensor, and a memory; the positioning module is used to obtain the real-time location of the user, the sensor is used to obtain the user's movement direction, and the memory is used to store computer-executable instructions. When the electronic device is running, the processor executes the computer-executable instructions stored in the memory, so that the electronic device performs a method as described in any one of the above-mentioned first aspects.
[0024] In a fourth aspect, an electronic device is provided, comprising: a processor; the processor is configured to be coupled to a memory, and after reading instructions in the memory, execute a method as described in any one of the above-mentioned first aspects according to the instructions.
[0025] In a fifth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a computer, the computer can execute any one of the methods in the first aspect.
[0026] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any one of the methods described in the first aspect.
[0027] In a seventh aspect, a device (for example, a chip system) is provided, which includes a processor for supporting an electronic device in implementing the functions described in the first aspect. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it can be composed of a chip or include a chip and other discrete devices.
[0028] Among them, the technical effects brought about by any design method in the second to seventh aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of a scenario applicable to the method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of a principle of a method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0032] Figure 4A A schematic diagram of a scenario example of the method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0033] Figure 4B A schematic diagram of a scenario example of the method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0034] Figure 5 A schematic flow chart of a method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0035] Figure 6 A schematic diagram of a method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0036] Figure 7A schematic diagram of a method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0037] Figure 8 A schematic diagram of a method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0038] Figure 9 A schematic diagram of a method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0039] Figure 10 A schematic diagram of a method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0040] Figure 11 A schematic diagram of module interaction in a method for monitoring deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application;
[0041] Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0042] Figure 13 A schematic diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: the situation where A exists alone, A and B exist at the same time, and B exists alone, wherein A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.
[0044] References to "one embodiment" or "some embodiments" etc. described in this specification mean that the specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way. The term "connected" includes direct and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0045] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0046] When a user moves along a path with a mobile device such as a mobile phone or wearable device, the mobile device can obtain the user's movement trajectory in real time. In some scenarios, the mobile device needs to determine whether the user's movement trajectory conforms to a pre-set path trajectory.
[0047] In one scenario, all popular sports and health applications (applications, apps) can provide sports ranking functions. That is, multiple users run, walk, ride, and other sports along the same route, and the performance is ranked according to the length of time the users spend on the same sports. For example, Figure 1 As shown in (a), after the user completes an exercise, the mobile device can obtain the path trajectory of the user's exercise process, including the path starting point, path end point, and each trajectory point along the path, etc.; it can also obtain corresponding exercise information, such as exercise time, average pace, calories consumed, etc. Furthermore, the mobile device can upload the path trajectory and exercise information of the user's exercise to the cloud server. In this way, each user can obtain this path trajectory and corresponding exercise information from the cloud server. Other users can exercise based on the path trajectory and rank their performance based on exercise information (exercise time, average pace, etc.). For example, Figure 1As shown in (b), two users are moving along the path starting from the East Gate of Central Park and ending at the South Gate of D1. The mobile device determines that the two users are moving along the same path and ranks them based on their movement information (movement time, average pace, etc.) on the path. For example, Figure 1 As shown in (b), the mobile phone shows that the exercise time of user 1 is 20 minutes and 51 seconds, with an average pace of 4 minutes and 34 seconds; the exercise time of user 2 is 24 minutes and 56 seconds, with an average pace of 4 minutes and 37 seconds. In this scenario, it is necessary to ensure that the user exercises according to the preset path trajectory. If the user's movement trajectory is detected to deviate too far from the preset path trajectory, the user's exercise performance will not be included in the performance ranking; this can ensure the fairness of the competition. For example, Figure 1 As shown in (c), after determining that the user's movement trajectory deviates from the reference path trajectory, a prompt can be issued to the user (for example, a voice message "You have deviated from the established path" can be played).
[0048] In another scenario, after the user pre-sets a navigation path on a navigation app, the mobile device monitors the user's real-time movement trajectory. If it is determined that the user's movement trajectory deviates from the pre-set navigation path, a prompt is issued to the user.
[0049] In one implementation, the mobile device periodically collects the user's real-time location at a certain time interval to determine whether the user's location deviates from the pre-set path trajectory. If it is detected that the user's location deviates from the pre-set path trajectory, a prompt is issued to implement real-time deviation correction. In this implementation, a fixed time interval is pre-set, the user's real-time location is periodically collected, and the deviation between the user's location and the reference path trajectory is calculated. If timely deviation correction is to be achieved, the time interval needs to be set to a smaller value; however, frequent collection of the user's real-time location by the mobile device will cause the mobile device to consume too much power, resulting in problems such as heating and rapid battery consumption. If the time interval is set to a larger value, it will result in failure to correct the deviation in a timely manner, and the user may have deviated far from the path trajectory and the mobile device has not yet detected it.
[0050] The present application provides a method for monitoring deviations of a movement trajectory from a reference path. Rather than periodically collecting the user's real-time location at fixed intervals for deviation determination (to determine whether the user's movement trajectory has deviated from the reference path), this method dynamically adjusts the time point for initiating the next deviation determination based on information such as the user's real-time location, movement direction, and movement speed at the time of the current deviation determination. It is not necessary to collect the user's real-time location or perform a deviation determination before initiating the next deviation determination.
[0051] It can be understood that the path trajectory or user movement trajectory can generally be represented as a sequence of trajectory points; wherein the i-th trajectory point can be represented as Pi = (x, y, t), indicating that the geographic coordinate position of the trajectory point Pi at time t is [x, y], where x represents the latitude value and y represents the longitude value.
[0052] Exemplary, reference Figure 2 , collect the user's real-time position at time t1, and obtain the corresponding reference position based on the reference path trajectory and time t1. Among them, the trajectory point on the path trajectory corresponding to the moment of collecting the user's real-time position is the reference position corresponding to the user's real-time position at that moment. There may be an offset between the real-time position and the reference position at the same moment. If the offset between the real-time position and the reference position at the same moment is greater than the fault tolerance interval, it is determined that the monitored movement trajectory deviates from the reference path trajectory. If the offset between the real-time position and the reference position at the same moment is less than or equal to the fault tolerance interval, it is determined that the user's movement trajectory has not deviated from the reference path trajectory. Among them, the fault tolerance interval can also be called the fault tolerance value, which is the maximum value of the offset between the real-time position and the reference position corresponding to the same moment, which is preset. As Figure 2 As shown, at time t1, the offset between the real-time position and the reference position is less than the error tolerance interval. The method for monitoring the deviation of the moving trajectory from the reference path trajectory provided by the embodiment of the present application is, at the first moment (for example Figure 2 At time t1 in the middle), the time when the offset between the user's real-time position and the reference position reaches the preset error tolerance interval is determined based on the user's real-time position, the reference position corresponding to the real-time position, the user's moving direction and moving speed, and the next deviation judgment is initiated before the time when the offset exceeds the preset error tolerance interval (second time) as expected at the first time. For example, Figure 2As shown, based on the user's real-time location, reference location, user movement direction, and movement speed at time t1, it is determined that after a period of time T, the offset between the real-time location and the reference location will reach a preset tolerance interval. In this case, at time t2 (t2-t1 is less than or equal to T), the user's real-time location is collected again, and the reference location corresponding to time t2 is obtained. A determination is made as to whether the offset between the real-time location and the reference location at time t2 is greater than the tolerance interval. If the offset between the real-time location and the reference location at time t2 is greater than the tolerance interval, it is determined that the movement trajectory detected at time t2 deviates from the reference path trajectory. If the offset between the real-time location and the reference location at time t2 is less than or equal to the tolerance interval, it is determined that the movement trajectory at time t2 does not deviate from the reference path trajectory. Furthermore, based on the user's real-time location, reference location, user movement direction, and movement speed at time t2, the next time the offset between the real-time location and the reference location reaches the preset tolerance interval is determined. In other words, the next deviation determination is made before the calculated offset between the real-time location and the reference location exceeds the preset tolerance interval. In this way, it is possible to timely monitor the situation where the user's movement trajectory deviates from the reference path trajectory.
[0053] Moreover, before the next deviation judgment (for example, after time t1 and before time t2), there is no need to collect the user's real-time location or perform a deviation judgment, which avoids the power consumption caused by frequent collection of user locations and can reduce the probability of problems such as mobile device heating and rapid battery consumption.
[0054] The method for monitoring the deviation of a mobile trajectory from a reference path provided in the embodiments of the present application can be applied to any electronic device with computing capabilities. For example, the electronic device can be a mobile device. The above-mentioned mobile device can include a mobile phone, a wearable device (such as a smart watch, a smart bracelet, etc.), a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a vehicle-mounted device, a virtual reality device, etc., and the embodiments of the present application do not impose any restrictions on this.
[0055] For example, please refer to Figure 3 , which shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, an audio module 130, a speaker 130A, a microphone 130B, a display 140, a communication module 150, a power module 160, an input device 170, a sensor module 180, and the like.
[0056] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0057] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110.
[0058] The controller is the nerve center and command center of the electronic device 100. It can generate operation control signals according to instruction operation codes and timing signals to complete the control of instruction fetching and execution.
[0059] The application processor can run the operating system of the electronic device 100, which is used to manage the hardware and software resources of the electronic device 100. For example, it manages and configures memory, determines the priority of system resource supply and demand, controls input and output devices, operates the network, manages the file system, and manages drivers. The operating system also provides an operating interface for users to interact with the system. Various software can be installed within the operating system, such as drivers and application programs (apps).
[0060] The NPU is a neural network (NN) computing processor that rapidly processes input information and can continuously self-learn by drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain. The NPU can be used to implement applications such as intelligent cognition in electronic device 100.
[0061] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0062] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface.
[0063] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0064] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0065] The internal memory 121 can be used to store one or more computer programs, which include instructions. The processor 110 can execute the above instructions stored in the internal memory 121, so that the electronic device 100 executes the application running method provided in some embodiments of the present application, as well as various applications and data management. The internal memory 121 may include a code storage area and a data storage area. Among them, the data storage area can store data created during the use of the electronic device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In some embodiments, the processor 110 can execute the application running method provided in the embodiments of the present application, as well as other applications and data management by running the instructions stored in the internal memory 121, and / or the instructions stored in the memory provided in the processor 110.
[0066] The electronic device 100 can implement audio functions through the audio module 130, speaker 130A, microphone 130B, and application processor. For example, music playback, recording, etc. The audio module 130 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 130 can also be used to encode and decode audio signals. In some embodiments, the audio module 130 can be provided in the processor 110, or some functional modules of the audio module 130 can be provided in the processor 110.
[0067] The speaker 130A, also called a "horn", is used to convert audio electrical signals into sound signals.
[0068] The microphone 130B, also called a "microphone" or "speaker", is used to convert sound signals into electrical signals. A user can speak by putting their mouth close to the microphone 130B to input the sound signal into the microphone 130B.
[0069] The communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2 and the communication module 150.
[0070] The communication module 150 can provide wireless communication solutions including cellular, Wi-Fi, Bluetooth (BT), wireless data transmission modules (for example, 433MHz, 868MHz, 915MHz), etc. applied to the electronic device 100. The communication module 150 can be one or more devices integrating at least one communication processing module. The communication module 150 receives electromagnetic waves via antenna 1 or antenna 2, filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 110. The communication module 150 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through antenna 1 or antenna 2. For example, the electronic device 100 can obtain the source database and the destination database through the communication module 150; wherein the source database is the database before data integration, and the destination database is the database after data integration. The data in the source database is extracted and integrated to form the destination database.
[0071] Electronic device 100 implements display functionality through a GPU, display screen 140, and an application processor. The GPU is a microprocessor for image processing that connects display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0072] The display screen 140 is used to display images, videos, etc. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 140, where N is a positive integer greater than 1. In an embodiment of the present application, the display screen 140 can be used to display a UI and receive user operations on the UI. For example, the difference data between the source database and the destination database obtained according to the method provided in the embodiment of the present application can be displayed on the display screen 140.
[0073] In some embodiments, the display screen 140 is provided with a pressure sensor, a touch sensor, and the like. The pressure sensor is used to sense pressure signals and can convert pressure signals into electrical signals. When a touch operation is applied to the display screen 140, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor. The touch sensor, also known as a "touch panel", can form a touch screen, also known as a "touch screen", with the display screen 140. The touch sensor is used to detect touch operations applied thereto or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can also be provided through the display screen 140.
[0074] The power module 160 can be used to supply power to various components included in the electronic device 100. In some embodiments, the power module 160 can be a battery, such as a rechargeable battery.
[0075] The input device 170 may include a keyboard, a mouse, and the like. The keyboard is used to input English letters, numbers, punctuation marks, and the like into the electronic device 100, thereby issuing commands to the electronic device 100 and inputting data. The mouse is an indicator for the vertical and horizontal coordinates of the display system of the electronic device 100 and is used to input instructions to the electronic device 100. The input device 170 may be connected to the electronic device 100 via a wired connection, for example, via a GPIO interface, a USB interface, or the like. The input device 170 may also be connected to the electronic device 100 wirelessly, for example, via Bluetooth, infrared, or the like.
[0076] The sensor module 180 may include a fingerprint sensor, a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
[0077] In conjunction with the accompanying drawings, the following describes in detail the method for monitoring the deviation of a moving trajectory from a reference path trajectory provided by an embodiment of the present application, taking the sports competition ranking scenario provided by a sports health app as an example.
[0078] The user can select the path track and exercise mode of the current exercise process on the mobile device. In response to the user's selection operation, the mobile device obtains the path track and exercise mode of the user's current exercise process.
[0079] In one example, the exercise mode includes walking, running, cycling, etc. The user can select the exercise mode of the current exercise process on the user interface provided by the mobile device.
[0080] For example, Figure 4A As shown, mobile phone 100 displays an "Exercise" interface 101, which includes various exercise options, such as "Indoor Running," "Walking," "Outdoor Running," and "Cycling." The user can select one of the exercise options. When the mobile phone receives a click on the "Outdoor Running" option, it determines that the user's exercise mode for this exercise is running. For example, in response to the user's click on the "Outdoor Running" option, the mobile phone displays an "Outdoor Running" interface 102, where the user can set information related to outdoor running.
[0081] In one implementation, the mobile device presets speed ranges corresponding to various exercise modes, namely, the minimum and maximum speeds corresponding to the user's various exercise modes. After the mobile device obtains the user's exercise mode during the current exercise process, it can obtain the corresponding speed range based on the exercise mode during the current exercise process.
[0082] For example, the speed ranges corresponding to various motion modes stored on the mobile device are shown in Table 1.
[0083] Table 1
[0084] Exercise Minimum speed (m / s) Maximum speed (m / s) walk 1.1 1.5 running 1.7 2 Cycling 5 7
[0085] For example, if the mobile device obtains that the user's current exercise mode is walking, the corresponding speed range is determined to be: [minimum speed - maximum speed] -> [1.1 m / s to 1.5 m / s].
[0086] In one implementation, the mobile device may also calculate and store the user's historical average speed for various exercise modes. In one example, the mobile device calculates the historical average speed of the user's exercise mode while carrying the mobile device. For example, if the first run covered a 2,000-meter path with a duration of 19 minutes and 16 seconds, the second run covered a 1,500-meter path with a duration of 12 minutes and 26 seconds, and the third run covered a 1,000-meter path with a duration of 8 minutes and 50 seconds, the mobile device would determine that the historical average speed for the exercise mode, running, is 1.81 m / s.
[0087] For example, Table 2 shows an example of historical average speeds corresponding to various motion modes stored on a mobile device.
[0088] Table 2
[0089] Exercise Average speed (m / s) walk 1.3 running 1.81 Cycling 6
[0090] The mobile device can also obtain the path trajectory of the user's current movement process based on the user's operation, which is the reference path trajectory. Thereafter, during the user's current movement process, the mobile device monitors whether the user's movement trajectory deviates from the reference path trajectory.
[0091] In one example, the mobile device may store some path trajectory information, or obtain some path trajectory information from a server. These path trajectories may be predefined by the system or uploaded by other users, or generated by other users' movement processes. Then, based on the user's selection operation, one of these path trajectories is determined as the reference path trajectory. For example, Figure 4B As shown, the "outdoor running" interface 102 also includes a path selection page. For example, the "outdoor running" interface 102 includes the path "Central Park East Gate-D1 South Gate" recommended by the mobile phone. The "outdoor running" interface 102 also includes a "Go Challenge" button. Optionally, the "outdoor running" interface 102 also includes a "Popular Sections" option for displaying more path information. Exemplarily, in response to the user clicking the "Go Challenge" button, the mobile phone displays interface 103, and interface 103 is used to display detailed information on the path "Central Park East Gate-D1 South Gate". Interface 103 includes a "Departure" button, and the user can click the "Departure" button to confirm the selection of the path "Central Park East Gate-D1 South Gate". Exemplarily, in response to the user clicking the "Departure" button, the mobile phone sets the path "Central Park East Gate-D1 South Gate" as the baseline path trajectory.
[0092] In some embodiments, when the mobile device detects that the user has reached the starting point of the reference path, the system is initialized. In one implementation, the system initialization includes setting parameters such as the movement mode and error tolerance interval of the current movement process, and obtaining the reference path.
[0093] Among them, the exercise mode can be set according to user operation.
[0094] The tolerance interval is preconfigured and can reflect the tolerance for a user's deviation from a preset path. That is, if the offset between the user's real-time location and the corresponding reference location is greater than the tolerance interval, the user's movement trajectory is determined to have deviated from the reference path. In one implementation, corresponding tolerance interval values can be set for different exercise modes. For example, the tolerance interval value for cycling is greater than the tolerance interval value for running, which is greater than the tolerance interval value for walking. For example, the tolerance interval for walking is 20 meters, the tolerance interval for running is 50 meters, and the tolerance interval for cycling is 100 meters. After the mobile device determines the exercise mode, it can determine the corresponding tolerance interval based on the exercise mode. In another implementation, the tolerance interval can also be set to a uniform value. Optionally, in one implementation, the mobile device can dynamically update the value of the tolerance interval. For example, a server can dynamically send the value of the tolerance interval to the mobile device, and the mobile device can update the locally stored value of the tolerance interval based on the value of the tolerance interval sent by the server.
[0095] The mobile device may determine a reference path trajectory according to a user operation, and obtain information of the reference path trajectory from a server.
[0096] The mobile device also obtains the user's moving direction when detecting that the user has reached the starting point of the reference path trajectory. In one implementation, the mobile device can obtain the user's moving direction through a sensor (such as a gyroscope sensor) and then determine the angle between the user's moving direction and the reference path trajectory.
[0097] Exemplary, reference Figure 5 When the user reaches the starting point of the baseline path, the health and fitness app determines the movement mode based on the user's actions. It then uses the navigation app to obtain a map of the baseline path, the angle between the user's movement direction and the baseline path, and the configured tolerance interval, completing data initialization. The health and fitness app also performs system initialization, setting various system parameters to their initial values.
[0098] Furthermore, when the mobile device detects that the user has reached the starting point of the reference path (recorded as time t0), it determines the time for collecting the user's real-time location next time (recorded as time t1) based on the user's real-time location, moving direction, moving speed, and error tolerance interval. In one implementation, at time t0, the mobile device starts a timer with a duration of T0 (T0 = t1-t0).
[0099] After the timer with a duration of T0 expires (i.e., at time t1), the mobile device collects the user's real-time location and movement direction at time t1. Based on the user's real-time location at time t1 and the reference position at time t1, the mobile device can determine whether the user's movement trajectory has deviated from the reference path trajectory (perform a deviation determination). Furthermore, based on the user's real-time location, movement direction, movement speed, and tolerance interval at time t1, the mobile device determines the next time to collect the user's real-time location (recorded as time t2). At time t2, the mobile device collects the user's real-time location and movement direction at time t2. Based on the user's real-time location at time t2 and the reference position at time t2, the mobile device can determine whether the user's movement trajectory has deviated from the reference path trajectory (perform a deviation determination). Based on the user's real-time location, movement direction, movement speed, and tolerance interval at time t2, the mobile device determines the next time to collect the user's real-time location (recorded as time t3). Similarly, each time the user's real-time location is collected, a deviation determination is performed based on the user's real-time location, and the next time to collect the user's real-time location is determined. Before the time for collecting the user's real-time location next time, there is no need to collect the user's real-time location, nor is there any need to perform deviation judgment.
[0100] In one embodiment, the mobile device determines the time interval T between the next time the user's real-time location is collected (the second time) and the time when the user's real-time location is obtained this time based on the user's real-time location, moving direction, moving speed, and tolerance interval at the current time (the first time), so that the next time the user's real-time location is collected (the second time) can be determined.
[0101] The mobile device can obtain the real-time location of the user through the global navigation satellite system (GNSS). The GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS), etc. Exemplarily, the coordinates of the real-time location g of the user obtained by the mobile device are [x, y], where x represents the latitude value and y represents the longitude value; for example, g = ["x":116.478928,"y":39.997761]. Further, the offset O at the first moment can be obtained based on the real-time location g of the user and the corresponding reference position at the first moment. The offset O is the distance between the real-time location of the user and the corresponding reference position at the same moment, indicating the distance the user currently deviates from the reference path. Exemplarily, with reference to Figure 6 At time t1, the distance between the user's real-time location and the corresponding reference location is O1; at time t2, the distance between the user's real-time location and the corresponding reference location is O2; at time t3, the distance between the user's real-time location and the corresponding reference location is O3; and at time t4, the distance between the user's real-time location and the corresponding reference location is O4. In one embodiment, at the first moment, the larger the value of offset O, the smaller the value of T, i.e., the earlier the next time the user's real-time location is collected (the second moment). In other words, the further the current user deviates from the reference path, the shorter the time until the next deviation determination is initiated.
[0102] The angle between the user's moving direction and the reference path is recorded as the direction angle α. In one implementation, the mobile device can obtain the user's moving direction through a sensor (such as a gyroscope sensor). Figure 7 At time t1, the value of the direction angle α1 is the angle between the user's movement direction at time t1 and the tangent line on the reference path at the reference position at time t1. The value of the direction angle α2 at time t2 is the angle between the user's movement direction at time t2 and the tangent line on the reference path at the reference position at time t2. In one embodiment, at the first moment, the larger the value of the direction angle α, the smaller the value of T is determined, that is, the earlier the next time the user's real-time location is collected (the second moment).
[0103] The mobile device may also obtain the user's movement speed V at the first moment. In one implementation, the mobile device determines the user's movement speed at the first moment based on the user's movement mode during the current exercise process. For example, the user's movement speed at the first moment is determined to be the maximum speed corresponding to the user's movement mode during the current exercise process. For example, if the movement mode is walking, according to Table 1, the maximum speed corresponding to walking is 1.5 m / s, then the user's movement speed at the first moment is determined to be 1.5 m / s. For example, the user's movement speed at the first moment is determined to be the historical average speed corresponding to the user's movement mode during the current exercise process. For example, if the movement mode is walking, according to Table 2, the corresponding historical average speed is 1.3 m / s, then the user's movement speed at the first moment is determined to be 1.3 m / s. If the movement mode is running, according to Table 2, the corresponding historical average speed is 1.81 m / s, then the user's movement speed at the first moment is determined to be 1.81 m / s. If the movement mode is cycling, according to Table 2, the corresponding historical average speed is 6 m / s, then the user's movement speed at the first moment is determined to be 6 m / s. In another implementation, the mobile device determines the user's movement speed at the first moment based on the speed of the user's current movement process. In one example, the mobile device calculates the user's average movement speed in real time during the user's current movement process, and determines the user's movement speed at the first moment as the real-time average speed of the user's current movement process. In another example, the mobile device calculates the user's average speed within a recent preset time period (e.g., 2 minutes) at the first moment, and determines the user's movement speed at the first moment as the average speed within the recent preset time period. In one embodiment, at the first moment, the greater the value of the user's movement speed V, the smaller the value of T is determined, that is, the next time the user's real-time location is collected (the second moment) is earlier.
[0104] The mobile device may also obtain the value of the configured error tolerance interval f. In one embodiment, the smaller the value of the error tolerance interval f, the smaller the value of T is determined to be, that is, the next time the user's real-time location is collected (the second time) is earlier. For example, Figure 8 As shown in the figure, when the offset between the user's real-time location and the reference location remains unchanged, the probability of the user deviating from the reference path is higher when the tolerance interval is 20m than when it is 50m. Accordingly, the smaller the value of T, the earlier the next time the user's real-time location is collected. This allows for timely detection of user deviations from the preset path.
[0105] In one embodiment, the duration T' is calculated according to formula (1).
[0106] T'=(fO) / sin(α)*V Formula (1)
[0107] Among them, f is the fault tolerance interval, O is the offset, α is the direction angle, and V is the moving speed.
[0108] In one implementation, a time interval T=T′ between the time of next collecting the user's real-time location and the time of obtaining the user's real-time location this time is determined.
[0109] Optionally, if the value of T' is a decimal, the time interval T between the next time the user's real-time location is collected and the current time the user's real-time location is obtained is determined to be the value obtained by rounding down T'. For example, if the value of T' calculated according to formula (1) is 4.5 seconds, the value of T is determined to be 4 seconds. In this way, it is possible to better avoid the failure to detect the user's deviation from the preset path in a timely manner.
[0110] refer to Figure 9 In the method for monitoring the deviation of a moving trajectory from a reference path trajectory provided in an embodiment of the present application, at time t1, the user's real-time position is collected, and the offset value O1 is obtained based on the user's real-time position and the corresponding reference position. The user's direction angle α1 and moving speed V1 are also obtained. The value of the fault tolerance interval f configured on the mobile device is also obtained. Further, the values of O1, α1, V1 and f are substituted into formula (1) to calculate T1', and T1 is determined based on T1'. Then, the mobile device starts a timer with a duration of T1. After the timer with a duration of T1 times out (at time t2), the user's real-time position is collected, and the offset value O2 is obtained based on the user's real-time position and the corresponding reference position. Whether the user's moving trajectory deviates from the reference path trajectory is determined based on the values of O2 and f. At time t2, the mobile device also obtains the user's direction angle α2 and moving speed V2, and the value of the fault tolerance interval f configured on the mobile device. Further, the values of O2, α2, V2 and f are substituted into formula (1) to calculate T2', and T2 is determined based on T2'. The mobile device then starts a timer with a duration of T2. Similarly, time t2 is determined by the mobile device at time t1 based on the actual user's movement trajectory. It is estimated that before time t2, the probability of the user's movement trajectory deviating from the baseline path is low. At time t2, the next determination is made based on the actual user's movement trajectory. This allows for timely detection of deviations from the baseline path.
[0111] Between t1 and t2, there's no need to collect the user's real-time location, nor is there any need to determine whether the user's movement trajectory deviates from the baseline path. This avoids the power consumption associated with frequent location collection, reducing the likelihood of mobile device overheating and battery drain.
[0112] In some embodiments, the maximum time interval T is preset. max and the minimum time interval Tmix If the time interval T' determined at the first moment based on the offset O, direction angle α, moving speed V and error tolerance interval f is greater than T max , then determine T=T max If the time interval T' determined at the first moment based on the offset O, direction angle α, moving speed V and error tolerance interval f is less than T mix , then determine T=T mix This can avoid not making deviation judgments for too long, which may result in the inability to timely monitor the user's movement trajectory deviating from the baseline path trajectory; or making deviation judgments too frequently, which may result in excessive power consumption of the mobile device.
[0113] In one implementation, a sports and health app implements the method for monitoring the deviation of a moving trajectory from a reference path provided in an embodiment of the present application. For example, Figure 10 Shows a module division method for sports and health apps. Figure 10 As shown, the sports and health app includes a path planning module, a pace module, an algorithm module, and a timer module.
[0114] The path planning module handles the acquisition, storage, and matching of paths during exercise. For example, upon receiving a user's selection of a path, the path planning module retrieves the user's path for this exercise based on this selection. Furthermore, the path planning module can also obtain information about the path's trajectory through navigation apps.
[0115] The pacing module is used to determine the user's movement speed. In one implementation, after receiving an instruction from the user to select an exercise mode, the pacing module obtains the user's exercise mode for the current exercise process based on the user's exercise mode selection. Based on the user's exercise mode for the current exercise process, the pacing module obtains a speed range corresponding to the exercise mode. Optionally, based on the speed range corresponding to the user's exercise mode for the current exercise process, the maximum speed corresponding to the exercise mode is determined as the user's movement speed for the current exercise process.
[0116] When it is detected that the user has reached the starting position of the reference path trajectory, the Sports Health App starts the system initialization and sets the values of relevant parameters (such as the coordinates and direction angles of the user at the starting position of the reference path trajectory, such as the fault tolerance interval, the user's movement speed, etc.). In one example, the hardware module in the mobile device includes a sensor, such as a gyroscope sensor. The gyroscope sensor can be used to determine the motion posture of the mobile device. In some embodiments, the angular velocity of the mobile device around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor to obtain the user's movement direction. The direction angle of the user at any position can be determined based on the user's movement direction and the path trajectory of this movement process.
[0117] After detecting that the user starts moving, the position offset algorithm module of the algorithm module determines the time to collect the user's real-time position next time based on the coordinates, direction angle, movement speed and tolerance interval of the user at the starting position of the reference path trajectory.
[0118] The timer module starts the timer based on the next time the user's real-time location is collected. After the timer expires, the user's real-time location is collected again, the corresponding direction angle is obtained, and the next time the user's real-time location is collected is determined based on the user's coordinates, direction angle, movement speed, and error tolerance at that location. This process continues until the user's current exercise session ends.
[0119] During this process, the cloud configuration module of the server can send an updated fault tolerance interval value to the mobile device. The sports health app updates the locally stored fault tolerance interval value based on the fault tolerance interval value.
[0120] For example, combined Figure 10 , Figure 11 A schematic diagram of module interaction in a method for monitoring deviation of a moving trajectory from a reference path trajectory provided by an embodiment of the present application is shown.
[0121] like Figure 11 As shown, according to the operation of the user selecting a path, the path planning module obtains the path of the user's current movement process. According to the operation of the user selecting a movement mode, the pace module obtains the movement mode of the user's current movement process, and obtains the user's movement speed during the current movement process based on the movement mode and the speed interval corresponding to the various configured movement modes. Optionally, the cloud configuration module of the server can send an updated fault tolerance interval value to the mobile device. The algorithm module obtains the path of the user's current movement process from the path planning module, and obtains the path trajectory of the user's current movement process. The algorithm module can determine the offset based on the user's real-time position and path trajectory. The algorithm module obtains the user's movement speed during the current movement process from the pace module. The algorithm module obtains the movement posture of the mobile device from the hardware module, and obtains the user's movement direction based on the movement posture of the mobile device, and then determines the direction angle. The algorithm module can also obtain an updated fault tolerance interval value from the cloud configuration module.
[0122] The algorithm module calculates the next time interval for collecting the user's real-time location based on the offset, direction, user speed, and tolerance interval. The timer module starts a timer based on this time interval. After the timer expires, the next time the user's real-time location is collected is performed.
[0123] It is understandable that the electronic device (mobile device) provided in the embodiment of the present application includes a hardware structure and / or software module for performing each function in order to realize the above functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiment of the present application.
[0124] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0125] In one example, see Figure 12 , which shows a possible structural diagram of the electronic device involved in the above embodiment. The electronic device 900 includes: a processing unit 910 and a storage unit 920.
[0126] The processing unit 910 is used to control and manage the actions of the electronic device 900. The storage unit 920 is used to store program codes and data of the electronic device 900. The processing unit 910 calls the program codes stored in the storage unit 920 to execute the various steps in the above method embodiment.
[0127] Of course, the unit modules in the electronic device 900 include, but are not limited to, the processing unit 910 and storage unit 920. For example, the electronic device 900 may also include a display unit, a communication unit, a power supply unit, and the like. The display unit is used to display the user interface of the electronic device 900. The communication unit is used for the electronic device 900 to communicate with other electronic devices; for example, the electronic device 900 receives path trajectory information and motion information from other devices via the communication unit. The power supply unit is used to supply power to the electronic device 900.
[0128] The processing unit 910 may be a processor or controller, such as a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The storage unit 920 may be a memory. The display unit may be a display screen, etc.
[0129] For example, the processing unit 910 is a processor (such as Figure 3 The processor 110 shown in FIG. 1 ), the storage unit 920 may be a memory (such as Figure 3 The internal memory 121 shown in FIG. 1 ) and the display unit may be a display screen (such as Figure 3 The electronic device 900 provided in the embodiment of the present application may be Figure 3 The electronic device 100 shown in FIG. 1 , wherein the processor, memory, display screen, etc. may be connected together, for example, via a bus. The processor calls the program code stored in the memory to execute each step in the above method embodiment.
[0130] The present application also provides a chip system (eg, a system on a chip (SoC)). Figure 13 As shown, the chip system includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1002 can be used to send signals to other devices (such as the processor 1001 or the touch screen of an electronic device). Exemplarily, the interface circuit 1002 can read instructions stored in the memory and send the instructions to the processor 1001. When the instructions are executed by the processor 1001, the electronic device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete components, which are not specifically limited in the embodiments of the present application.
[0131] An embodiment of the present application further provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.
[0132] The embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute each function or step in the above method embodiment.
[0133] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0134] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0135] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0137] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0138] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for monitoring the deviation of a moving trajectory from a reference path trajectory, applied to an electronic device, characterized in that: The method comprises: The electronic device acquires a reference path trajectory; The electronic device obtains a first real-time position and a first moving direction of the user at a first moment; the first moment is the moment when the electronic device first determines whether the user's moving trajectory deviates from the reference path trajectory; The electronic device acquires a first reference position on the reference path trajectory; the first reference position is a geographical coordinate position corresponding to the first moment on the reference path trajectory; The electronic device determines a first time interval based on a first offset, a first angle, a moving speed of the user at a first moment, and a pre-configured tolerance value; the first offset is an offset between the first real-time position and the first reference position, and the first angle is an angle between the first moving direction and the reference path trajectory; wherein the first offset is negatively correlated with the first time interval, the first angle is negatively correlated with the first time interval, the moving speed of the user at the first moment is negatively correlated with the first time interval, and the pre-configured tolerance value is positively correlated with the first time interval; The electronic device determines a second moment based on the first moment and the first time interval; the second moment is the moment when the electronic device determines for the second time whether the user's movement trajectory deviates from the reference path trajectory, and the second moment is the moment after the first moment and after the first time interval. The electronic device does not collect the user's real-time location after the first moment and before the second moment.
2. The method according to claim 1, characterized in that The method further comprises: If the first offset is greater than the pre-configured error tolerance value, the electronic device determines that the user movement trajectory deviates from the reference path trajectory at the first moment; If the first offset is less than or equal to the preconfigured tolerance value, the electronic device determines that the user movement trajectory does not deviate from the reference path trajectory at the first moment.
3. The method according to claim 1, characterized in that The electronic device determining the first time interval according to the first offset, the first angle, the moving speed of the user at the first moment, and a pre-configured error tolerance value includes: The electronic device obtains a first duration according to the formula T'=(fO) / sin(α)*V; wherein T' represents the first duration, f represents the error tolerance value, O represents the offset between the user's real-time position and the corresponding reference position at the same moment, α represents the angle between the user's moving direction and the reference path trajectory, and V represents the user's moving speed; The electronic device determines the first time interval according to the first duration.
4. The method according to claim 3, characterized in that The first time interval is the first duration; or, The first time interval is a second duration, and the second duration is obtained by rounding down the first duration.
5. The method according to claim 3, characterized in that If the first duration is greater than a preset maximum time interval, the first time interval is the maximum time interval; If the first duration is less than a preset minimum time interval, the first time interval is the minimum time interval.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The electronic device acquires the user's exercise mode; the exercise mode includes walking, running or cycling; The electronic device obtains the moving speed of the user at a first moment according to the movement pattern of the user.
7. The method according to claim 6, characterized in that The moving speed of the user at the first moment is the maximum speed corresponding to the movement mode of the user; wherein the maximum speed corresponding to the movement mode is pre-configured.
8. The method according to claim 6, characterized in that Different movement modes correspond to different values of fault tolerance.
9. The method according to claim 8, characterized in that Walking corresponds to a first tolerance value, running corresponds to a second tolerance value, and cycling corresponds to a third tolerance value; wherein, the first value is smaller than the second value, and the second value is smaller than the third value.
10. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The electronic device receives the configuration value of the fault tolerance value from the server; The electronic device updates the stored fault tolerance value according to the configuration value of the fault tolerance value.
11. An electronic device, characterized in that: include: A processor, a positioning module, a sensor, and a memory; the positioning module is used to obtain the real-time location of the user, the sensor is used to obtain the direction of movement of the user, and the memory stores one or more computer programs, the one or more computer programs including instructions, which, when executed by the electronic device, enable the electronic device to execute the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that The method comprises computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 10.
