Similar path matching method and electronic device
By dividing the earth's surface area into sub-areas and using the ElasticSearch engine and the longest common subsequence algorithm, the problem of insufficient applicability of similar path matching methods in the existing technology to path trajectories at any location is solved, and efficient tracking of any path trajectories is achieved. Matching and accuracy improved.
Patent Information
- Application Number
- CN202311088810.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-08-25
AI Technical Summary
Existing similar path matching methods are usually only effective within preset address fences and cannot be applied to path trajectories anywhere on the earth, and are less effective for free movement trajectories such as mountain climbing and cycling.
By dividing the earth's surface area into multiple sub-areas, using the ElasticSearch engine for rough matching to reduce the number of unmatched paths, and using the longest common subsequence algorithm to calculate trajectory similarity, it supports subsequence matching and anti-noise points to realize any path. Efficient similar path matching for trajectories.
It achieves efficient similar path matching for path trajectories at any location on the earth, improves calculation efficiency and accuracy, and is suitable for various motion scenarios, including free motion trajectories.
Smart Images

Figure CN117725137B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a similar path matching method and electronic device. Background Art
[0002] With the rapid development of mobile terminals such as mobile phones and wearable devices, mobile terminals can provide users with more and more functions and services. For example, mobile terminals can provide navigation functions, sports and health functions, etc. In some scenarios of navigation, sports and health functions, it is necessary to compare the trajectory similarity of each path and match similar paths.
[0003] In the prior art, the application scenarios of similar path matching methods generally have some limitations. For example, some similar path matching methods are only applicable to the case where the path trajectory is within a pre-set address fence. For example, some similar path matching methods bind the path trajectory to the road network and use the information of the road network to perform similar path matching. If the path trajectory does not meet the restriction conditions, these similar path matching methods in the prior art will fail. Summary of the invention
[0004] The embodiments of the present application provide a similar path matching method and an electronic device, which can efficiently perform similar path matching on a path trajectory at any location on the earth and quickly acquire a similar path.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a similar path matching method is provided, the method comprising: obtaining trajectory information of a target path and trajectory information of multiple paths; wherein the trajectory information comprises coordinates of each trajectory point constituting the path trajectory, the above-mentioned trajectory point may be any point on the surface area of the earth, and the surface area of the earth is divided into multiple sub-areas according to a preset rule. According to the trajectory information of the target path, an identifier of at least one sub-area on the surface area of the earth through which the target path passes is obtained; according to the sub-area through which the target path passes and the sub-area through which each of the multiple paths passes, a first path among the multiple paths is obtained; the first path is a path whose sub-area passed is included in the sub-area through which the target path passes; and a path in the first path whose trajectory similarity with the target path is greater than or equal to a preset threshold is obtained.
[0007] In this method, the similarity of the paths is roughly matched according to the squares (sub-areas) that the paths pass through, and the paths whose squares do not match the target path are excluded, thereby reducing the number of paths that are further finely matched with the target path (matched according to trajectory similarity). Then, the paths whose trajectory similarity with the target path is greater than or equal to a preset threshold are obtained. Since the similarity of the paths is roughly matched according to the squares that the paths pass through, the number of paths that further calculate the trajectory similarity with the target path is reduced, the amount of calculation for calculating the trajectory similarity between each path and the target path is reduced, and the efficiency of obtaining similar paths to the target path is improved.
[0008] In combination with the first aspect, in a possible implementation, the preset rule includes: separating the earth's surface areas according to an interval of every M degrees of longitude and an interval of every M degrees of latitude; wherein M>0.
[0009] In combination with the first aspect, in a possible implementation, a first path among multiple paths is obtained based on a sub-area passed by a target path and a sub-area passed by each of the multiple paths, including: inputting the sub-area passed by the target path and the sub-area passed by each of the multiple paths into an ElasticSearch engine to obtain the first path among the multiple paths.
[0010] The ES (ElasticSearch) engine is a distributed, highly scalable, and highly real-time search and data analysis engine that can easily enable large amounts of data to be searched, analyzed, and explored. Using the ES engine to obtain the first path can efficiently and quickly search for the first path among multiple paths. In addition, the ES engine can perform subsequence matching, that is, including the case where the target path is part of the first path.
[0011] In combination with the first aspect, in a possible implementation, the method further includes: using a longest common subsequence algorithm to calculate the trajectory similarity between each first path and the target path.
[0012] That is to say, the longest common subsequence algorithm is used to compare the trajectory similarity of the target path and each first path one by one. The LCSS algorithm processes the noise points, that is, because there is no trajectory point close to the noise point due to the deviation of the noise point, the noise point will not be calculated in the final result. This step effectively combats noise and has the advantage of being resistant to noise points. In addition, the LCSS algorithm can find the longest common subsequence of two sequences and is compatible with submatching, that is, it supports the calculation of the similarity between the first path and one section of the target path.
[0013] In combination with the first aspect, in a possible implementation, based on the sub-area passed by the target path and the sub-area passed by each of the multiple paths, before obtaining the first path among the multiple paths, the identifier of the sub-area passed by each of the multiple paths is also obtained based on the trajectory information of the multiple paths.
[0014] In combination with the first aspect, in a possible implementation, if the distance between a first trajectory point on the target path and a first boundary of a sub-region where the first trajectory point is located is less than a preset value, a sub-region on the earth's surface area that shares a first boundary with the sub-region where the first trajectory point is located is added to the sub-region through which the target path passes.
[0015] In this way, even when the trajectory point is close to the sub-region boundary, it can be accurately matched.
[0016] In combination with the first aspect, in a possible implementation, the horizontal coordinate of the trajectory point is the longitude value of the trajectory point, and the vertical coordinate of the trajectory point is the latitude value of the trajectory point.
[0017] In combination with the first aspect, in a possible implementation, if the value of M is less than or equal to a preset threshold, the identifier of the sub-area passed by each of the multiple paths is stored in a sixty-four-digit counting manner.
[0018] When the value of M is smaller, the area of each sub-region is smaller, and the number of sub-regions that a path passes through is more. In this way, it is easier to distinguish two different paths. Correspondingly, when the value of M is smaller, the number of sub-regions is more, the value of the sub-region identifier is larger, the list of sub-region identifiers that the path passes through is longer, and the storage space required to record the list of sub-region identifiers that the path passes through is larger. The path identifier is expressed in a hexadecimal counting method, so that the path identifier length can be compressed and storage space can be saved.
[0019] In combination with the first aspect, in a possible implementation manner, the target path and the multiple paths are paths formed by user motion trajectories.
[0020] Wherein, obtaining the trajectory information of the target path includes: receiving a first message triggered by a sports and health application, the first message including the trajectory information of the target path; and obtaining the trajectory information of the target path according to the first message.
[0021] In a second aspect, an electronic device is provided, which has the function of implementing the method described in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0022] In a third aspect, an electronic device is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the electronic device is running, the processor executes the computer execution instructions stored in the memory to enable the electronic device to perform a method as described in any one of the above-mentioned first aspects.
[0023] In a fourth aspect, an electronic device is provided, comprising: a processor; the processor is used to couple with 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.
[0024] In a fifth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer can execute any of the methods described in the first aspect.
[0025] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect.
[0026] In a seventh aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the first aspect above. 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 may be composed of a chip, or may include a chip and other discrete devices.
[0027] 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
[0028] Figure 1 A schematic diagram of a scenario applicable to the similar path matching method provided in an embodiment of the present application;
[0029] Figure 2 A schematic diagram of another scenario applicable to the similar path matching method provided in the embodiment of the present application;
[0030] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0031] Figure 4 A schematic diagram of a similar path matching method provided in an embodiment of the present application;
[0032] Figure 5 A schematic diagram of a scenario example of a similar path matching method provided in an embodiment of the present application;
[0033] Fig. 6A A schematic diagram of a scenario example of a similar path matching method provided in an embodiment of the present application;
[0034] Figure 6B A schematic diagram of a scenario example of a similar path matching method provided in an embodiment of the present application;
[0035] Figure 7 A schematic diagram of a scenario example of a similar path matching method provided in an embodiment of the present application;
[0036] Figure 8 A schematic diagram of a scenario example of a similar path matching method provided in an embodiment of the present application;
[0037] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0038] Fig.10 A schematic diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] 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 to the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include such expressions 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: A exists alone, A and B exist at the same time, and B exists alone, where 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.
[0040] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear 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 other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0041] In the embodiments of the present 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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0042] In some scenarios, it is necessary to search for similar paths. It is understandable that in the embodiments of the present application, similar paths refer to paths whose trajectory similarity is greater than or equal to a preset threshold. Depending on the specific situation, similar paths can also be referred to as the same path, similar trajectory, the same trajectory, etc.
[0043] Exemplarily, in one scenario, a mobile device can provide sports and health functions, such as a sports and health application (application, App) installed on a mobile phone. Sports and health functions can obtain the trajectory information of the path passed by the user during exercise (such as running, walking, cycling, etc.) and the movement information on the path. The trajectory of the path consists of a large number of trajectory points. In one implementation, the mobile device periodically collects the coordinates of the user's location (for example, the longitude and latitude values of the location are collected), and the position corresponding to each collection point forms a trajectory point, and the coordinates of the position are the coordinates of the corresponding trajectory point. The trajectory information includes the coordinates of each trajectory point that makes up the path trajectory, and the movement information includes exercise duration, pace, average speed, etc.
[0044] The mobile device can save the trajectory information and motion information corresponding to the path that the user passes through during each exercise. Optionally, the mobile device can also send the acquired trajectory information and motion information of the path to a designated device (such as a designated mobile device, server, etc.). After the mobile device or designated device acquires the trajectory information and motion information of multiple paths, it can provide some personalized functions to the user based on the trajectory information and motion information of multiple paths to improve the user experience.
[0045] Exemplarily, multiple similar paths may be searched out based on the trajectory information of multiple paths, and then the performance ranking may be performed based on the motion information corresponding to the similar paths.
[0046] In some examples, the mobile device reports the trajectory information and motion information of the path that the user passes through during exercise to the server. After the server obtains the trajectory information and motion information of multiple paths reported by each mobile device, it can determine a group of paths whose trajectory similarity is greater than or equal to a preset threshold by comparing the trajectory information of the paths. This group of paths can be confirmed as similar paths. Furthermore, it is also possible to determine the paths belonging to the same exercise type (such as running, walking, or cycling, etc.) in a group of paths (similar paths) based on the motion information corresponding to the paths. In this way, the performance of users' exercises of the same exercise type on similar paths can be ranked according to the motion information (such as pace, average speed, etc.). For example, Figure 1 As shown, after detecting that the current user has completed an exercise process, the mobile phone displays the "Exercise Sharing" interface 101 of the Sports Health App. The "Exercise Sharing" interface 101 includes a path display page 102, which includes a navigation image of a path. The path is the path that the user passes through during this exercise process. The starting point of the path is the east gate of the Central Park and the end point is the south gate of D1. A group of paths whose trajectory similarity to the path is greater than or equal to a preset threshold are stored in the server, and these paths are confirmed as similar paths. The creator of the similar path is user 1, and the number of users who have run through the path is 9527. Further, the "Exercise Sharing" interface 101 also includes a ranking page 103, which is used to display the ranking of the user's performance in exercising on the similar path (the path displayed in the path display page 102). Exemplarily, the top 3 scores are displayed in the ranking page 103. Optionally, in response to a user clicking operation on the ranking page 103 , the mobile phone displays a ranking page 104 , which is used to display the rankings of the exercise performance of more users on the similar path (the path displayed in the path display page 102 ).
[0047] In other examples, the user can actively upload the trajectory information and motion information (performance) of the path of a certain exercise to the server. The server uses the path as the target path. When the trajectory information and motion information of the path uploaded by each mobile device are subsequently received, it is matched with the target path. If the trajectory similarity between a certain path and the target path is determined to be greater than or equal to a preset threshold (similar path) based on the trajectory information of the path, and if it is determined based on the motion information of the path that the similar paths correspond to the same type of exercise (such as running, walking or cycling, etc.), then the path is successfully matched with the target path. In this way, for a group of successfully matched paths, the performance can be ranked according to the motion information (such as pace, average speed, etc.). For example, Figure 2 As shown, after the user completes an exercise, the user can click button 105 to save relevant information of this exercise (such as path trajectory, exercise duration, pace, heart rate, etc.). The mobile phone receives the user's click operation on button 105, and determines that the user has completed an exercise. The mobile phone saves the relevant information of the user's exercise. Optionally, the mobile phone can display page 106, which is used to display detailed information of the user's exercise, for example, the user's pace and time per kilometer in this exercise. Furthermore, in response to user operations, the mobile phone can also upload the trajectory information and exercise information of the path of this exercise to the server, so that the server can match the path and display the exercise record on the matching path. Exemplary, such as Figure 2 As shown, the mobile phone displays the “Sports Record” page 107 or the “Sports Record” page 108 .
[0048] In the prior art, the application scenarios of similar path matching methods generally have some limitations. In one embodiment, an address fence is pre-set, and when the user's motion trajectory enters the address fence, similar path matching can be triggered. If the user's motion trajectory does not enter the address fence, similar path matching is not performed. In another embodiment, the path trajectory is bound to the road network, and similar path matching is performed using the information of the road network.
[0049] However, users have a high degree of freedom in movement, especially mountaineering, cycling and other sports that are not restricted by fixed venues and cannot be bound to address fences. The trajectories of user movements such as running and walking are also relatively random, and it is not convenient to bind them to the road network considering safety and freedom. The effect of similar path matching methods in the prior art is poor.
[0050] The embodiment of the present application provides a similar path matching method, which can efficiently and quickly perform similar path matching on path trajectories at any location on the earth.
[0051] The similar path matching method provided in the embodiment of the present application can be applied to any electronic device with computing capabilities. For example, the electronic device can be the above-mentioned server or a specified mobile device. The above-mentioned mobile device can include a mobile phone, a tablet computer, a laptop computer, a personal computer (personal computer, PC), an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a handheld computer, a netbook, a smart home device (for example, a smart TV, a smart screen, a large screen, a smart speaker, a smart air conditioner, etc.), a personal digital assistant (personal digital assistant, PDA), a wearable device (for example, a smart watch, a smart bracelet, etc.), a vehicle-mounted device, a virtual reality device, etc., and the embodiment of the present application does not impose any restrictions on this.
[0052] For example, please refer to Figure 3 , which shows a schematic diagram of the structure 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 screen 140, a communication module 150, a power module 160, an input device 170, and the like.
[0053] It is to be understood that the structure illustrated in the embodiment of the present application does 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0054] 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 processor (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.
[0055] 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 fetching and executing instructions.
[0056] 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, manages drivers, etc. The operating system can also be used to provide an operating interface for users to interact with the system. Among them, various types of software can be installed in the operating system, such as drivers, applications (applications, Apps), etc.
[0057] NPU is a neural network (NN) computing processor, which can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain. NPU can realize applications such as intelligent cognition of electronic device 100.
[0058] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0059] In some embodiments, the processor 110 may include one or more interfaces. The interface 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, etc.
[0060] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic 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 in the above embodiments, or a combination of multiple interface connection methods.
[0061] 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 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0062] The internal memory 121 can be used to store one or more computer programs, which include instructions. The processor 110 can enable the electronic device 100 to execute the application running method provided in some embodiments of the present application, as well as various applications and data management, etc. by running the above instructions stored in the internal memory 121. 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, etc. 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, a flash memory component, a universal flash storage (universal flash storage, UFS), etc. In some embodiments, the processor 110 can enable the electronic device 100 to execute the application running method provided in the embodiment of the present application, as well as other applications and data management by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor 110.
[0063] The electronic device 100 can implement audio functions through the audio module 130, the speaker 130A, the microphone 130B, and the application processor, etc. For example, music playing, 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 arranged in the processor 110, or some functional modules of the audio module 130 can be arranged in the processor 110.
[0064] The speaker 130A, also called a "horn", is used to convert audio electrical signals into sound signals.
[0065] The microphone 130B, also called a "microphone" or "microphone", is used to convert a sound signal into an electrical signal. A user can make a sound by approaching the microphone 130B with his or her mouth, and input the sound signal into the microphone 130B.
[0066] The communication function of the electronic device 100 can be realized through the antenna 1, the antenna 2 and the communication module 150.
[0067] The communication module 150 can provide solutions for wireless communications including cellular, Wi-Fi, Bluetooth (BT), wireless data transmission modules (for example, 433MHz, 868MHz, 915MHz) 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 of the source database is extracted and integrated to form the destination database.
[0068] The electronic device 100 implements the display function through a GPU, a display screen 140, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0069] 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 by the method provided in the embodiment of the present application can be displayed on the display screen 140.
[0070] 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 according to the pressure sensor. The electronic device 100 can also calculate the position of the touch according to 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 thereabout. 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.
[0071] 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.
[0072] The input device 170 may include a keyboard, a mouse, etc. The keyboard is used to input English letters, numbers, punctuation marks, etc. into the electronic device 100, thereby issuing commands to the electronic device 100, inputting data, etc. 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, etc. to the electronic device 100. Among them, the input device 170 can be connected to the electronic device 100 through a wired connection, for example, the input device 170 is connected to the electronic device 100 through a GPIO interface, a USB interface, etc. The input device 170 can also be connected to the electronic device 100 wirelessly, for example, the input device 170 is connected to the electronic device 100 through Bluetooth, infrared, etc.
[0073] Exemplary, reference Figure 4 , the similar path matching method provided in the embodiment of the present application may include:
[0074] S401: The electronic device obtains trajectory information of a target path and trajectory information of multiple paths.
[0075] The trajectory information includes the coordinates of each trajectory point that constitutes the path trajectory, which can be expressed as a sequence of GPS points. In one example, the GPS point can be expressed as [X, Y], where X represents the longitude value and Y represents the latitude value. Exemplarily, the trajectory information of 5 paths is obtained, and the trajectory information of path A includes [X, Y, X ... a1 , Y a1 ],[X a2 , Y a2 ],[X a3 , Y a3 ], ...; the trajectory information of path B includes [X b1 , Y b1 ],[X b2 , Y b2 ],[X b3 , Y b3 ], ...; the trajectory information of path C includes [X c1 , Y c1 ],[X c2 , Y c2 ],[X c3 , Y c3 ], ...; the trajectory information of path D includes [X d1 , Y d1 ],[X d2 , Y d2 ],[X d3 , Y d3 ], ...; the trajectory information of path E includes [X e1 , Y e1 ],[X e2 , Y e2 ],[X e3 , Ye3 ],…….
[0076] The target path is path B. That is, among paths A, C, D, and E, the paths whose trajectory similarity with path B is greater than or equal to a preset threshold are obtained.
[0077] In one example, the electronic device is the above-mentioned designated device. The track information of the multiple paths is reported by each mobile device to the designated device. In another example, the electronic device is a mobile device, and the track information of the multiple paths is the track information of the multiple paths generated by the user's movement on the mobile device.
[0078] S402, acquiring the squares (sub-areas) passed by the target path according to the trajectory information of the target path; acquiring the squares (sub-areas) passed by each of the multiple paths according to the trajectory information of the multiple paths.
[0079] In one implementation, the plane area corresponding to the earth surface after being stretched into a plane is used as the earth surface area, and the earth surface area is divided into N (N>1) squares (sub-areas) according to a preset rule. Each square corresponds to a square identifier, which is used to uniquely identify a square. For example, Figure 5 As shown, the grids in the region are labeled 1 to 45. It should be noted that the grids described in the embodiment of the present application are only the names of sub-regions in the earth surface region, and the shape of the sub-region may not be a strict square. For example, the shape of the grid is approximately a square.
[0080] Each track point of any path uniquely belongs to a square, and any path passes through at least one square. All track points of the path are obtained according to the track information of the path, and the square (square identifier) corresponding to each track point is obtained, so that the squares passed by the path can be obtained.
[0081] For example, Figure 5 As shown, the square marks passed by the trajectory points of path A include 2, 12, 13, 14, 23, 24, 25 and 35, the square marks passed by the trajectory points of path B include 2, 12, 13, 14, 23, 24, 25 and 35, the square marks passed by the trajectory points of path C include 2, 12, 13, 14, 23, 24, 25 and 35, the square marks passed by the trajectory points of path D include 11, 12, 21, 22, 23, 24, 15, 16, 25, 26 and 35, and the square marks passed by the trajectory points of path E include 29, 30, 31, 32, 41 and 42.
[0082] Exemplarily, the track points and grid marks passed by path A, path B, path C, path D, and path E are shown in Table 1.
[0083] Table 1
[0084]
[0085] S403: Acquire a first path among the multiple paths according to the squares passed by the target path and the squares passed by each of the multiple paths.
[0086] The squares passed by the target path include the squares passed by the first path. In one possible example, the squares passed by the first path are the same as the squares passed by the target path; in another possible example, the squares passed by the first path are part of the squares passed by the target path.
[0087] In one implementation, the squares passed by the target path and the squares passed by each of the multiple paths are input into an elastic search (ElasticSearch, ES) engine, and the paths whose squares are included in the squares passed by the target path are searched in the multiple paths, that is, the first path is obtained. The ES engine is a distributed, highly scalable, and highly real-time search and data analysis engine, which can easily enable large amounts of data to have the ability to search, analyze, and explore. Using the ES engine to obtain the first path can efficiently and quickly search for the first path in multiple paths.
[0088] In one example, using the structured query language (SQL) in a relational database: Select * from xxx where the grid identifier list = "grid identifiers passed by the target path", the first path obtained can be the same as the grids passed by the target path. For example, the grid identifiers passed by the target path include 2, 12, 13, 14, 23, 24, 25, and 35. The first path obtained using this SQL is a path whose grid identifier list is 2, 12, 13, 14, 23, 24, 25, and 35. Among them, xxx is a file that stores the grid identifier list, such as Table 1.
[0089] In another example, using SQL in a relational database: Select * from xxx where square identifier list like "square identifiers passed by the target path", it can be achieved that the squares passed by the first path are part of the squares passed by the target path. For example, the square identifiers passed by the target path include 2, 12, 13, 14, 23, 24, 25, 35, and the first path obtained by using this SQL is a path whose square identifier list is part of 2, 12, 13, 14, 23, 24, 25, and 35. For example, the square identifier list passed by the first path is 2, 12, 13, and 14; for example, the square identifier list passed by the first path is 13, 14, 23, 24, and 25.
[0090] Exemplarily, in the example shown in Table 1, the target path is path B, and the list of square identifiers that path B passes through is 2, 12, 13, 14, 23, 24, 25, and 35. The square identifiers that path A, path B, path C, path D, and path E pass through are input into the ES engine, and the first path including path A and path C is obtained.
[0091] After step S403, the sections D and E of the above five paths are excluded from the similar paths of path B. By adopting this method, similar paths of the target path can be roughly retrieved according to the squares passed by the path, and most of the paths on the global map (surface area of the earth) can be excluded, which is equivalent to excluding 99% of the path data; thus, the efficiency of matching similar paths is greatly improved.
[0092] In some examples, some of the trajectory points of the path are very close to the border of the grid. There may be a situation where the distance between the trajectory points of two paths is very close, but they belong to different grids. For example, Fig. 6A As shown in the figure, the distance between trajectory point P and trajectory point Q is very close, and the two paths have high similarity, but trajectory point P and trajectory point Q belong to different squares. If the two paths are determined to pass through different squares when matching similar paths based on the squares they pass through, and the two paths are excluded as similar paths, the matching results will be inaccurate.
[0093] In some embodiments, when the ES engine is used to obtain the first path, if the distance between a track point in the target path and a certain boundary (first boundary) of the square where the track point is located is less than a preset value, the adjacent square of the square where the track point is located is also added to the list of square identifiers passed by the target path. The adjacent square is a square that shares the first boundary with the square where the track point is located.
[0094] Exemplary, reference Fig. 6A , the square where the track point P in the target path is located is square 1, and the distance between the track point P and the lower boundary of square 1 is less than the preset value, then the adjacent square of square 1 (square 10) is also added to the list of square identifiers passed by the target path. In this case, the list of square identifiers passed by the target path is: 1, 10, 2.
[0095] For example, the first path may be obtained by using SQL in a relational database: Select * from xxx where square identifier list like "1, 10, 2".
[0096] For example, the first path may be obtained by using SQL in a relational database: Select * from xxx where square identifier list like "1, 2", and Select * from xxx where square identifier list like "10, 2".
[0097] In this way, the path where the trajectory point Q is located will not be excluded from the similar path where the trajectory point P is located.
[0098] In some embodiments, the adjacent squares can be determined in the squares adjacent to the square where the trajectory point is located according to the distance between the trajectory point and the boundary. The adjacent square to the left of the square where the trajectory point is located is marked as the square where the trajectory point is located minus 1; the adjacent square to the right of the square where the trajectory point is located is marked as the square where the trajectory point is located plus 1; the adjacent square above the square where the trajectory point is located is marked as the square where the trajectory point is located minus 360*(1 / M); the adjacent square below the square where the trajectory point is located is marked as the square where the trajectory point is located plus 360*(1 / M). Exemplarily, as Figure 6B As shown, the square where the track point is located is marked as 721, and the squares adjacent to square 721 include square 0, square 1, square 2, square 720, square 722, square 1440, square 1441, and square 1442. If the distance between the track point and the upper boundary of square 721 is less than a preset value, the adjacent square of square 721 is determined to be square 1; if the distance between the track point and the lower boundary of square 721 is less than a preset value, the adjacent square of square 721 is determined to be square 1441; if the distance between the track point and the left boundary of square 721 is less than a preset value, the adjacent square of square 721 is determined to be square 720; if the distance between the track point and the right boundary of square 721 is less than a preset value, the adjacent square of square 721 is determined to be square 722; if the distance between the track point and the upper boundary and the left boundary of square 721 is less than a preset value, the adjacent square of square 721 is determined to be square 722. If the distances between the trajectory point and the upper and right boundaries of the square 721 are both less than the preset values, the adjacent squares of the square 721 are determined to be the squares 0, 1 and 720; if the distances between the trajectory point and the lower and left boundaries of the square 721 are both less than the preset values, the adjacent squares of the square 721 are determined to be the squares 1, 2 and 722; if the distances between the trajectory point and the lower and left boundaries of the square 721 are both less than the preset values, the adjacent squares of the square 721 are determined to be the squares 720, 1440 and 1441; if the distances between the trajectory point and the lower and right boundaries of the square 721 are both less than the preset values, the adjacent squares of the square 721 are determined to be the squares 722, 1441 and 1442.
[0099] If the square where the track point is located is the square of the first row, there is no square adjacent to the top of the square where the track point is located; if the square where the track point is located is the square of the last row, there is no square adjacent to the bottom of the square where the track point is located.
[0100] S404: Compare the trajectory similarity between the first path and the target path, and obtain a path in the first path whose trajectory similarity with the target path is greater than or equal to a preset threshold.
[0101] In one implementation, the first path is measured for trajectory similarity with the target path one by one. Exemplarily, trajectory similarity calculation methods such as Euclidean distance, dynamic time warping (DTW), longest common sub-sequence (LCSS), edit distance on real sequence (EDR), Hausdorff distance, Fréchet distance, and locality in-between polylines (LIP) can be used to calculate the trajectory similarity between the first path and the target path.
[0102] In one example, the LCSS algorithm is used to measure the trajectory similarity of the first path and the target path one by one, calculate the trajectory similarity between each first path and the target path, and obtain the path in the first path whose trajectory similarity with the target path is greater than or equal to the preset threshold. The LCSS algorithm processes the noise points, that is, because there is no trajectory point close to the noise point due to the deviation of the noise point, the noise point will not be calculated in the final result. This step effectively combats noise and has the advantage of anti-noise points. In addition, the LCSS algorithm can find the longest common subsequence of two sequences and is compatible with sub-matching, that is, it supports the calculation of the similarity between the first path and one section of the target path.
[0103] Exemplarily, in the example shown in Table 1, the target path is path B, and the first path includes path A and path C. The LCSS algorithm is used to calculate the trajectory similarity between path A and path B, and the trajectory similarity between path A and path B is 60%; the LCSS algorithm is used to calculate the trajectory similarity between path C and path B, and the trajectory similarity between path C and path B is 95%. For example, if the preset threshold is 90%, the path whose trajectory similarity with the target path (path B) is greater than or equal to the preset threshold is path C.
[0104] The similar path matching method provided in the embodiment of the present application first roughly matches the similarity of the path according to the squares that the path passes through, excludes the path that does not match the target path through the squares, and reduces the number of paths that are further finely matched with the target path (matched according to the trajectory similarity). Then, the path that successfully matches the target path according to the squares that the path passes through is calculated one by one using the trajectory similarity calculation method to calculate the trajectory similarity with the target path, and obtains the path whose trajectory similarity with the target path is greater than or equal to the preset threshold. Since the similarity of the path is roughly matched according to the squares that the path passes through, the number of paths that further calculate the trajectory similarity with the target path is reduced, the amount of calculation for calculating the trajectory similarity between each path and the target path is reduced, and the efficiency of obtaining similar paths to the target path is improved.
[0105] In this case, by using the similar path matching method provided in the embodiment of the present application, the mobile device can efficiently determine the similarity between paths and provide some personalized functions for the user.
[0106] For example, Figure 7 As shown in (a), the target path is the path that user 1 has created, starting from the east gate of the central park and ending at the south gate of D1. Figure 7 As shown in (b), the current user carries a mobile phone to perform an exercise, and the mobile phone obtains and records the trajectory information and movement information of the user's path in this exercise. When the end of this exercise is detected, the complete path of this exercise is obtained, and the similarity between the path generated by this exercise and the target path is determined by the similar path matching method provided in the embodiment of the present application. If it is determined that the trajectory similarity between the path generated by this exercise and the target path is greater than or equal to a preset threshold, for example, the trajectory similarity between the path generated by this exercise and the target path is greater than 90%, it is determined that the exercise performance of this exercise can participate in the ranking list of the target path.
[0107] In the similar path matching method provided in the embodiment of the present application, the surface area of the earth is divided into N (N>1) squares (sub-areas) according to a preset rule. In some embodiments, the preset rule is to divide the surface area of the earth according to the longitude and latitude, and each square has a span of M degrees in the longitude direction and the latitude direction. That is, in the longitude direction and the latitude direction, the surface area of the earth is evenly divided according to an interval of every M degrees.
[0108] For example, take M=0.5.
[0109] In the latitude direction, from latitude -90 degrees to 90 degrees, it can be divided into:
[0110] [-90.0,-89.5),
[0111] [-89.5,-89.0),
[0112] [-89.0,-88.5),
[0113] …
[0114] [89.5,90]
[0115] Thus, in the latitude direction, it is evenly divided into [90-(-90)] / 0.5=360 intervals.
[0116] In the longitude direction, from longitude -108 degrees to 180 degrees, it can be divided into:
[0117] [-180.0,-179.5),
[0118] [-179.5,-179.0),
[0119] [-179.0,-178.5),
[0120] …
[0121] [179.5,180]
[0122] Thus, in the longitude direction, it is evenly divided into [180-(-180)] / 0.5=720 intervals.
[0123] That is to say, an interval in the latitude direction and an interval in the longitude direction uniquely determine a square.
[0124] For example, as shown in Table 2, the rows of Table 2 represent latitude, the columns of Table 2 represent longitude, and each grid in Table 2 corresponds to the longitude and latitude range of a grid. As shown in Table 2, each row of Table 2 includes 720 grids, corresponding to 720 intervals in the longitude direction; each column of Table 2 includes 360 grids, corresponding to 360 intervals in the latitude direction; Table 2 includes 720*360=259200 grids in total, corresponding to 259200 grids. The serial numbers of these grids range from 0 to 259199.
[0125] Table 2
[0126] Interval = 0.5 degrees [-180.0,-179.5) [-179.5,-179.0) [-179.0,-178.5) … [179.5,180] [-90.0,-89.5) 0 1 2 … 719 [-89.5,-89.0) 720 721 722 … 1439 [-89.0,-88.5) 1440 1441 1442 … 2159 … … … … … … [89.5,90] 258480 258481 258482 … 259199
[0127] It can be understood that the smaller the value of M is (that is, the smaller the span of each square in the longitude and latitude directions), the more squares there are; the smaller the area of each square is. For example, when M = 0.5, the number of squares included in the earth's surface area (the value of N) is 259,200, and the area of each square is about 55km*55km; when M = 0.001, the number of squares included in the earth's surface area (the value of N) is 64799750000, and the area of each square is about 110m*110m.
[0128] When the value of M is smaller, the area of each square is smaller, and a path passes through more squares. In this way, it is easier to distinguish two different paths. For example, refer to Figure 8 , for the same path ① and path ②, in Figure 8 In (a), the area of each square is larger (the value of M is larger), and path ① and path ② pass through the same 6 squares; Figure 8 In (b), the area of each square is small (the value of M is small), and both path ① and path ② pass through 14 squares, but the squares passed by path ① and path ② are not exactly the same. Based on the squares passed by the path, it is easy to distinguish path ① from path ②.
[0129] Correspondingly, when the value of M is smaller, the number of squares is greater, the value of the square identifier is also larger, the list of square identifiers passed by the path is longer, and the storage space required to record the list of square identifiers passed by the path is larger. For example, the list of square identifiers passed by the path is: 64799749997, 64799749998 and 64799749999. The storage space required to record the list of square identifiers is larger.
[0130] In one implementation, when the value of M is less than or equal to a preset threshold (for example, the preset threshold is 0.5), the path identifier is expressed in a sexagesimal counting method, so that the path identifier length can be compressed and storage space can be saved. In one example, each bit of the sexagesimal number is composed of 64 different characters, for example, the 64 different characters are 0 to 9, a to z, A to Z, and two special symbols (such as #, *, etc.).
[0131] For example, the decimal number 64799750000 is represented as hexadecimal number YmnrtM, which greatly compresses the data length.
[0132] It is understandable that the electronic device provided in the embodiment of the present application includes a hardware structure and / or software module corresponding to each function in order to realize the above functions. Those skilled in the art should easily realize that, in conjunction 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.
[0133] 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.
[0134] In one example, see Fig. 9 , 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.
[0135] 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 the program code and data of the electronic device 900. The processing unit 910 calls the program code stored in the storage unit 920 to execute each step in the above method embodiment.
[0136] Of course, the unit modules in the above-mentioned electronic device 900 include but are not limited to the above-mentioned 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, etc. 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 the trajectory information and motion information of the path from other devices through the communication unit. The power supply unit is used to supply power to the electronic device 900.
[0137] The processing unit 910 may be a processor or a 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.
[0138] 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 (eg, 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 can be Figure 3 The electronic device 100 shown in FIG. 1 is a schematic diagram of an electronic device 100. 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.
[0139] The present application also provides a chip system (eg, a system on a chip (SoC)), such as Fig.10 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 a processor 1001 or a 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 may also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0140] An embodiment of the present application also 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.
[0141] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step in the above method embodiment.
[0142] 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.
[0143] In the several embodiments provided in the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another 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.
[0144] The units described as separate components may or may not be physically separated, 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 different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0145] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0146] 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, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0147] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A similar path matching method, It is characterized in that include: Obtain the trajectory information of the target path and the trajectory information of multiple paths; The trajectory information includes coordinates of each trajectory point constituting the path trajectory, the trajectory point is any point on the surface area of the earth, and the surface area of the earth is divided into multiple sub-areas according to a preset rule; Acquire identifications of sub-areas passed by the target path according to the trajectory information of the target path; Acquire, according to the trajectory information of the multiple paths, an identifier of a sub-area passed by each of the multiple paths; According to the sub-area passed by the target path and the sub-area passed by each of the multiple paths, a first path among the multiple paths is acquired; the first path is a path whose sub-area passed by the multiple paths is included in the sub-area passed by the target path; A path in the first path whose trajectory similarity to the target path is greater than or equal to a preset threshold is obtained.
2. The method according to claim 1, It is characterized in that The preset rules include: The Earth surface regions are separated by intervals of every M degrees of longitude and every M degrees of latitude; where M>0.
3. The method according to claim 1, It is characterized in that The acquiring, according to the sub-area passed by the target path and the sub-area passed by each of the multiple paths, a first path among the multiple paths comprises: The sub-area passed by the target path and the sub-area passed by each of the multiple paths are input into an ElasticSearch engine to obtain a first path among the multiple paths.
4. The method according to claim 1, It is characterized in that The method further comprises: The longest common subsequence algorithm is used to calculate the trajectory similarity between each of the first paths and the target path.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: If the distance between the first trajectory point on the target path and the first boundary of the sub-area where the first trajectory point is located is less than a preset value, a sub-area on the earth's surface area that shares the first boundary with the sub-area where the first trajectory point is located is added to the sub-area through which the target path passes.
6. The method according to any one of claims 1 to 4, It is characterized in that The horizontal coordinate of the track point is the longitude value of the track point, and the vertical coordinate of the track point is the latitude value of the track point.
7. The method according to claim 2, It is characterized in that If the value of M is less than or equal to the preset threshold, the identifier of the sub-area passed by each of the multiple paths is saved in a sixty-four-decimal counting manner.
8. The method according to any one of claims 1 to 4, It is characterized in that The target path and the multiple paths are paths formed by user motion trajectories.
9. The method according to claim 8, It is characterized in that The step of obtaining the target path trajectory information includes: receiving a first message, wherein the first message includes the trajectory information of the target path; the first message is triggered by a sports and health application; The trajectory information of the target path is obtained according to the first message.
10. An electronic device, It is characterized in that include: Processor and memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, It is characterized in that The method comprises computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 9.
