Positioning method and related apparatus
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2025-01-09
- Publication Date
- 2026-07-10
AI Technical Summary
GPS cannot provide high-precision positioning in weak signal environments such as tunnels and underground parking lots, and inertial navigation systems are prone to drift during long-term use, which leads to a decrease in the accuracy of positioning results.
By acquiring the first geomagnetic data sequence of a preset road segment and the second geomagnetic data sequence of the device to be located, the characteristic differences and matching probability distribution between the two are determined, and the location is performed based on the geomagnetic data.
Accurate positioning was achieved in environments with weak satellite signals, reducing the accumulation of positioning errors and improving positioning accuracy.
Smart Images

Figure CN122360431A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of positioning technology, and in particular to a positioning method and related apparatus. Background Technology
[0002] The Global Positioning System (GPS) is a satellite-based positioning system that provides accurate location, velocity, and time information globally. However, GPS currently cannot provide high-precision positioning services in weak signal environments such as tunnels and underground parking lots, which significantly impacts map navigation, device positioning, and other related functions.
[0003] In related technologies, positioning in the aforementioned weak signal environment typically relies on the device's inertial navigation system (INS). Specifically, the device's position can be estimated based on data measured by inertial measurement units (IMUs) such as accelerometers and gyroscopes. However, IMUs are prone to drift during prolonged use. This drift leads to a gradual accumulation of errors in position estimation, thereby reducing the accuracy of the positioning results. Summary of the Invention
[0004] This application provides a positioning method and related apparatus that can accurately locate an object based on geomagnetic data in an environment with weak satellite signals.
[0005] A first aspect of this application provides a positioning method, the method comprising:
[0006] Acquire a first geomagnetic data sequence for a preset road segment, and acquire a second geomagnetic data sequence collected by the device to be located for the preset road segment. The first geomagnetic data sequence includes multiple first geomagnetic data, and the second geomagnetic data sequence includes multiple second geomagnetic data.
[0007] Determine a first data feature of the first geomagnetic data sequence and a second data feature of the second geomagnetic data sequence. The first data feature includes a first feature vector of each first geomagnetic data item within a preset geomagnetic data range. The second data feature includes a second feature vector of each second geomagnetic data item in the second geomagnetic data sequence.
[0008] Determine the feature difference between the first data feature and the second data feature, and determine matching observation data based on the feature difference. The matching observation data includes the matching cost corresponding to each of the various pairing methods between multiple first geomagnetic data and multiple second geomagnetic data within the preset geomagnetic data range.
[0009] Based on the matching observation data, a matching probability distribution is determined, which includes the matching probability of each of the multiple first geomagnetic data in the first geomagnetic data sequence with the last second geomagnetic data in the second geomagnetic data sequence in terms of time sequence.
[0010] Based on the matching probability distribution, target geomagnetic data that meets the preset matching conditions with the last item of the second geomagnetic data in the time series is determined from the plurality of first geomagnetic data;
[0011] The positioning result of the device to be located is determined based on the index of the target geomagnetic data in the first geomagnetic data sequence.
[0012] A second aspect of this application provides a positioning device, the device comprising:
[0013] The acquisition module is used to acquire a first geomagnetic data sequence of a preset road segment and a second geomagnetic data sequence collected by the device to be located for the preset road segment. The first geomagnetic data sequence includes multiple first geomagnetic data and the second geomagnetic data sequence includes multiple second geomagnetic data.
[0014] The feature determination module is used to determine a first data feature of the first geomagnetic data sequence and a second data feature of the second geomagnetic data sequence. The first data feature includes a first feature vector of each first geomagnetic data item within a preset geomagnetic data range, and the second data feature includes a second feature vector of each second geomagnetic data item in the second geomagnetic data sequence.
[0015] A matching observation module is used to determine the feature difference between the first data feature and the second data feature, and to determine matching observation data based on the feature difference. The matching observation data includes the matching cost corresponding to each of the various pairing methods between multiple first geomagnetic data and multiple second geomagnetic data within the preset geomagnetic data range.
[0016] The conversion module is used to determine the matching probability distribution based on the matching observation data. The matching probability distribution includes the matching probability of each of the multiple first geomagnetic data in the first geomagnetic data sequence with the last second geomagnetic data in the second geomagnetic data sequence in terms of time sequence.
[0017] The result determination module is used to determine, based on the matching probability distribution, target geomagnetic data that meets preset matching conditions with the last item of the second geomagnetic data in the time series from the plurality of first geomagnetic data; and to determine the positioning result of the device to be located according to the index of the target geomagnetic data in the first geomagnetic data sequence.
[0018] A third aspect of this application provides a computer device, the device comprising a processor and a memory:
[0019] The memory is used to store computer programs;
[0020] The processor is configured to perform the steps of the positioning method as described in the first aspect above, according to the computer program.
[0021] A fourth aspect of this application provides a computer-readable storage medium for storing a computer program for performing the steps of the positioning method described in the first aspect.
[0022] A fifth aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of the positioning method described in the first aspect.
[0023] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0024] This application provides a positioning method that addresses weak satellite signal environments such as tunnels by providing a geomagnetic data-based positioning mechanism. The method includes: acquiring a first geomagnetic data sequence (including multiple first geomagnetic data sets) for a preset road segment; and acquiring a second geomagnetic data sequence (including multiple second geomagnetic data sets) collected by the device to be positioned on the preset road segment. Based on this, the positioning result of the device to be positioned in the preset road segment can be determined in real time by matching the geomagnetic data sequence collected in real time by the device to be positioned on the preset road segment with a pre-determined geomagnetic data sequence for the preset road segment. When matching two geomagnetic data sequences, the first step is to determine the first data feature of the first geomagnetic data sequence and the second data feature of the second geomagnetic data sequence. The first descriptive feature includes a first feature vector for each first geomagnetic data item within a preset geomagnetic data range. The preset geomagnetic data range is the range of geomagnetic data in the first geomagnetic data sequence that is feature-matched with the second geomagnetic data sequence. That is, the range of geomagnetic data in the first geomagnetic data sequence that is feature-matched with the second geomagnetic data sequence can be determined, thereby determining the first data feature used to indicate the characteristics of each first geomagnetic data item within this range. The second data feature includes a second feature vector for each second geomagnetic data item in the second geomagnetic data sequence, that is, the second data feature indicates the characteristics of each second geomagnetic data item in the second geomagnetic data sequence. Then, the feature difference between the first and second data features is determined. Based on this feature difference, matching observation data is determined. This matching observation data includes the matching costs corresponding to various pairing methods between multiple first geomagnetic data items and multiple second geomagnetic data items within the preset geomagnetic data range. Furthermore, a matching probability distribution can be determined based on the matched observation data. This matching probability distribution includes the matching probability of each of the first geomagnetic data points in the first geomagnetic data sequence with the last temporally significant second geomagnetic data point in the second geomagnetic data sequence. In other words, the probability distribution more intuitively and concretely represents the matching probability of each of the first geomagnetic data points in the first geomagnetic data sequence with the last temporally significant second geomagnetic data point in the second geomagnetic data sequence. Finally, based on the matching probability distribution, target geomagnetic data points that satisfy preset matching conditions with the last temporally significant second geomagnetic data point are determined from the first geomagnetic data points included in the first geomagnetic data sequence. Then, based on the index of the target geomagnetic data point in the first geomagnetic data sequence, the positioning result of the device to be located is determined. Since the target geomagnetic data point is the matching result of the last temporally significant second geomagnetic data point in the first geomagnetic data sequence, the location corresponding to the target geomagnetic data point can be determined based on its index in the first geomagnetic data sequence, and the location of the device to be located when collecting the second geomagnetic data sequence can be determined accordingly, serving as the positioning result.As can be seen, by using the above method, geomagnetic data can be matched with the geomagnetic data sequence of the device to be located in real time on the preset road section and the geomagnetic data sequence of the preset road section in advance. Then, the positioning result of the device to be located can be determined based on the matching result, so as to achieve accurate positioning in the weak satellite signal environment. Attached Figure Description
[0025] Figure 1 This is a schematic diagram illustrating an application scenario of the positioning method provided in the embodiments of this application;
[0026] Figure 2 A flowchart illustrating the positioning method provided in an embodiment of this application;
[0027] Figure 3 A schematic diagram illustrating the determination of feature vectors for geomagnetic data provided in an embodiment of this application;
[0028] Figure 4 A schematic diagram of the matching probability distribution provided in the embodiments of this application;
[0029] Figure 5 A schematic diagram illustrating the determination of the posterior probability distribution provided in an embodiment of this application;
[0030] Figure 6 This is a schematic diagram of target matching observation data provided in an embodiment of this application;
[0031] Figure 7 A flowchart illustrating the process of determining a first geomagnetic data sequence for a preset road segment, provided in an embodiment of this application;
[0032] Figure 8 This is a schematic diagram of the positioning method provided in the embodiments of this application;
[0033] Figure 9 This is a schematic diagram of the positioning device provided in the embodiments of this application;
[0034] Figure 10 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application;
[0035] Figure 11 This is a schematic diagram of the server structure provided in an embodiment of this application. Detailed Implementation
[0036] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0037] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0038] The positioning method provided in this application can be executed by a computer device, which can be a terminal device or a server. The terminal device includes, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, and aircraft. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server.
[0039] It should be noted that the information, data and signals involved in the embodiments of this application are all authorized by the relevant parties or fully authorized by all parties, and the collection, use and processing of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0040] To facilitate understanding of the positioning method provided in the embodiments of this application, the following example uses a terminal device as the executing subject of the positioning method to illustrate the application scenarios of the positioning method.
[0041] See Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of the positioning method provided in the embodiments of this application. For example... Figure 1 As shown, this application scenario includes a terminal device 110, which has a magnetometer module for collecting geomagnetic data. The terminal device 110 can serve as a positioning device. After entering a preset road segment that can be located using geomagnetic positioning, the terminal device 110 can collect a second geomagnetic data sequence through its built-in magnetometer module. Furthermore, the terminal device 110 can pre-obtain a first geomagnetic data sequence for the preset road segment from a server. Further, the terminal device 110 can match the first geomagnetic data sequence with the second geomagnetic data sequence collected in real-time on the preset road segment to determine its positioning result in that segment.
[0042] In the process of matching the second geomagnetic data sequence with the first geomagnetic data sequence, the terminal device 110 can first determine the first data feature of the first geomagnetic data sequence and the second data feature of the second geomagnetic data sequence. The first data feature includes the first feature vector of each first geomagnetic data item within a preset geomagnetic data range. The preset geomagnetic data range is the geomagnetic data range in the first geomagnetic data sequence that is feature-matched with the second geomagnetic data sequence. In other words, the geomagnetic data range that is feature-matched with the second geomagnetic data sequence can be determined in the first geomagnetic data sequence. Then, based on the first geomagnetic data included in the geomagnetic data range, the first data feature used to indicate the feature of each first geomagnetic data item within the geomagnetic data range can be determined. The second data feature includes the second feature vector of each second geomagnetic data item in the second geomagnetic data sequence. That is, the feature of each second geomagnetic data item in the second geomagnetic data sequence can be indicated by the second data feature.
[0043] Then, the terminal device 110 can determine the feature difference between the first data feature and the second data feature, and determine the matching observation data based on the feature difference. The matching observation data includes the matching cost corresponding to each of the various pairing methods between multiple first geomagnetic data and multiple second geomagnetic data in the preset geomagnetic data range. That is, based on the feature difference between the first data feature and the second data feature, the matching cost of each of the various pairing methods between multiple first geomagnetic data and multiple second geomagnetic data can be determined.
[0044] Furthermore, the terminal device 110 can determine the matching probability distribution based on the matching observation data. The matching probability distribution includes the matching probability of each of the first geomagnetic data in the first geomagnetic data sequence with the last second geomagnetic data in the second geomagnetic data sequence in terms of time. That is, the matching probability of each of the first geomagnetic data in the first geomagnetic data sequence with the last second geomagnetic data in the second geomagnetic data sequence in terms of time is represented more intuitively and concretely through the probability distribution.
[0045] Finally, based on the matching probability distribution, the terminal device 110 can determine the target geomagnetic data that meets the preset matching conditions with the last item of the second geomagnetic data in the time sequence from the first geomagnetic data included in the first geomagnetic data sequence. Then, based on the index of the target geomagnetic data in the first geomagnetic data sequence, the positioning result of the device to be located can be determined. Since the target geomagnetic data is the matching result of the last item of the second geomagnetic data in the time sequence within the first geomagnetic data sequence, the position corresponding to the target geomagnetic data can be determined based on its index in the first geomagnetic data sequence. Therefore, the position of the terminal device 110 when collecting the second geomagnetic data sequence can be determined as the positioning result.
[0046] It should be understood that Figure 1 The application scenarios shown are merely examples. In practical applications, the positioning method provided in this application embodiment can also be applied to other scenarios. No limitation is made here on the application scenarios of the positioning method provided in this application embodiment.
[0047] The positioning method provided in this application will be described in detail below through method embodiments.
[0048] See Figure 2 , Figure 2 This is a flowchart illustrating the positioning method provided in an embodiment of this application. For ease of description, the following description uses a terminal device as the executing entity of the positioning method; specifically, the terminal device can be the device to be located. Figure 2 As shown, the positioning method includes the following steps:
[0049] S201: Obtain a first geomagnetic data sequence for a preset road segment, and obtain a second geomagnetic data sequence collected by the device to be located for the preset road segment. The first geomagnetic data sequence includes multiple first geomagnetic data sets, and the second geomagnetic data sequence includes multiple second geomagnetic data sets.
[0050] In this application embodiment, the preset road segment can specifically be a geomagnetic positioning road segment, which refers to a road segment where positioning is based on geomagnetic data. As an example, all road segments in a road scenario can be used as preset road segments. That is, for each road segment in the road scenario, the positioning method provided in this application embodiment can be used to determine the specific location of the device to be positioned on that road segment. As another example, road segments suitable for geomagnetic positioning can also be pre-determined as preset road segments. Geomagnetic positioning is a positioning technology that uses identifiable geomagnetic data in the environment as location identification features. That is, road segments whose geomagnetic data meets specific requirements (e.g., the differences between geomagnetic data at different locations on the road segment meet preset difference conditions) can be pre-selected as preset road segments. For such road segments, the positioning method provided in this application embodiment can be used to determine the specific location of the device to be positioned on that road segment.
[0051] It should be understood that, in the embodiments of this application, the preset road segment may include road segments in environments with weak satellite signals, such as tunnels and underground parking lots.
[0052] The first geomagnetic data sequence for the preset road segment, also known as the standard geomagnetic data sequence for the preset road segment, refers to a geomagnetic data sequence that represents the geomagnetic characteristics of the preset road segment. In geomagnetic positioning, the first geomagnetic data sequence serves as a reference sequence, providing a matching reference for the geomagnetic data sequence collected by the positioning device. The first geomagnetic data sequence consists of multiple geomagnetic data items arranged in their respective acquisition order. For example, the first geomagnetic data sequence may include 1000 geomagnetic data items, arranged in order of acquisition from front to back. For ease of distinction, in this embodiment, the geomagnetic data in the first geomagnetic data sequence is referred to as the first geomagnetic data.
[0053] In this embodiment, the first geomagnetic data sequence of a preset road segment can be obtained by collecting data on that preset road segment using specialized geomagnetic data acquisition equipment. For example, specialized geomagnetic data acquisition equipment can be deployed to the preset road segment to collect a specific number of geomagnetic data points according to preset collection requirements (such as preset sampling intervals), forming the first geomagnetic data sequence of the preset road segment. The first geomagnetic data sequence of the preset road segment can also be obtained through crowdsourcing. For example, a geomagnetic data collection activity for a preset road segment can be initiated on a map application. Users of the map application can participate in this activity, collecting multiple geomagnetic data points on the preset road segment using their terminal devices as they pass through it. The collected geomagnetic data is then used to form a geomagnetic data sequence, which is then uploaded to the map application's backend server. The backend server then determines the first geomagnetic data sequence of the preset road segment based on the geomagnetic data sequences uploaded by each user corresponding to the same preset road segment. Of course, in practical applications, other methods can also be used to determine the first geomagnetic data sequence for a preset road segment, and this embodiment does not limit this method.
[0054] The first geomagnetic data sequence of the aforementioned preset road segment can be stored in a database. The positioning device can obtain the first geomagnetic data sequence of the preset road segment from the database. After obtaining the first geomagnetic data sequence of the preset road segment, the positioning device can use this first geomagnetic data sequence as a reference sequence. The reference sequence refers to the matching reference used as geomagnetic positioning.
[0055] It should be noted that the first geomagnetic data in the first geomagnetic data sequence is usually obtained by converting geomagnetic data collected by a triaxial magnetometer. Specifically, this is done by converting the geomagnetic data collected by the triaxial magnetometer to the northeast-northeast coordinate system, thus obtaining the first geomagnetic data that makes up the first geomagnetic data sequence. This first geomagnetic data can specifically indicate the intensity and direction of the geomagnetic field, etc.
[0056] The device to be located refers to the object being located in geomagnetic positioning. For example, the device to be located can be a terminal device with a built-in magnetometer module or a vehicle with a built-in magnetometer module. When the device to be located enters a preset road segment that can be located using geomagnetic positioning, geomagnetic data can be collected by the triaxial magnetometer built into the device. Furthermore, the geomagnetic data collected by the triaxial magnetometer can be converted into geomagnetic data in the northeast-northeast coordinate system, thereby forming a second geomagnetic data sequence based on the geomagnetic data collected by the device to be located. The device to be located can use the second geomagnetic data sequence formed by its own collected geomagnetic data, and can use this second geomagnetic data sequence as a reference sequence. The reference sequence refers to the geomagnetic data sequence used to provide reference information when determining the positioning result. For ease of distinction, in this application embodiment, the geomagnetic data in the second geomagnetic data sequence is referred to as the second geomagnetic data.
[0057] It should be understood that multiple second geomagnetic data in this second geomagnetic data sequence are arranged according to their respective acquisition order, that is, the second geomagnetic data acquired earlier is ranked earlier in the second geomagnetic data sequence, and the second geomagnetic data acquired later is ranked later in the second geomagnetic data sequence.
[0058] In one possible implementation, "acquiring the first geomagnetic data sequence of the preset road segment" in S201 above may include:
[0059] Before the device to be located reaches a preset road segment that needs to be located by geomagnetic positioning, if it is determined from the satellite positioning information of the device to be located that the distance between the device to be located and the preset road segment is less than a preset distance threshold, then the first geomagnetic data sequence of the preset road segment is obtained.
[0060] or,
[0061] If the navigation route of the device to be located is determined to include a preset road segment that requires geomagnetic positioning, then the first geomagnetic data sequence of that preset road segment is obtained.
[0062] Satellite positioning information of the device to be positioned refers to the location information of the device to be positioned based on the satellite positioning system. The satellite positioning system is a system that uses artificial Earth satellites to measure position. For example, the satellite positioning information of the device to be positioned can be determined by GPS.
[0063] As an example, before the device to be located reaches a predetermined road segment that requires geomagnetic positioning, if the distance between the device and the predetermined road segment is determined to be less than a predetermined distance threshold based on the device's satellite positioning information, the first geomagnetic data sequence of the predetermined road segment can be obtained from the database. That is, the first geomagnetic data sequence of the predetermined road segment can be obtained in advance before the device reaches it. Specifically, the current location of the device can be determined using a satellite positioning system, and the location of the predetermined road segment requiring geomagnetic positioning (such as the starting point of the road segment) can be obtained from road network data. If the distance between the two is less than the predetermined distance threshold, the first geomagnetic data sequence of the predetermined road segment can be obtained from the database.
[0064] As another example, if the navigation route of the device to be located is determined to include a preset road segment that requires geomagnetic positioning, the first geomagnetic data sequence of that preset road segment can be obtained in advance. For example, a user can input a navigation start point and a navigation end point into the device to be located. The device can then display at least one navigation route based on the received start and end points. The user can select one of the at least one navigation route provided by the device as the geomagnetic positioning route. If the selected navigation route includes a preset road segment that requires geomagnetic positioning, that is, if the device detects that the user's selected current navigation route passes through a preset road segment that requires geomagnetic positioning, it can obtain the first geomagnetic data sequence of that preset road segment from the database in advance.
[0065] Therefore, using the above method, when the distance between the device to be positioned and the preset road segment requiring geomagnetic positioning is less than a preset distance threshold, i.e., before the device reaches the preset road segment, the first geomagnetic data sequence of that preset road segment can be obtained in advance. Alternatively, if the navigation route of the device to be positioned includes the preset road segment requiring geomagnetic positioning, the first geomagnetic data sequence of that preset road segment can also be obtained in advance. It is evident that the above method can obtain the first geomagnetic data sequence of the preset road segment requiring geomagnetic positioning in advance under different scenarios, facilitating timely geomagnetic positioning based on the first geomagnetic data sequence of that preset road segment.
[0066] S202: Determine the first data feature of the first geomagnetic data sequence and the second data feature of the second geomagnetic data sequence. The first data feature includes the first feature vector of each first geomagnetic data item within a preset geomagnetic data range, and the second data feature includes the second feature vector of each second geomagnetic data item in the second geomagnetic data sequence.
[0067] The first data feature of the first geomagnetic data sequence is a feature vector used to describe the geomagnetic data characteristics corresponding to a preset geomagnetic data range in the first geomagnetic data sequence. It is composed of the first feature vectors of multiple first geomagnetic data within the preset geomagnetic data range, and this first data feature can also be called a first geomagnetic feature. The preset geomagnetic data range refers to the geomagnetic data range in the first geomagnetic data sequence that is used for feature matching with the second geomagnetic data sequence. In this embodiment, a portion of the first geomagnetic data in the first geomagnetic data sequence can be determined according to a preset range determination rule, such as determining the first geomagnetic data within a specific index interval, to form the preset geomagnetic data range used for feature matching with the second geomagnetic data sequence. Alternatively, the entire first geomagnetic data sequence can be directly used as the preset geomagnetic data range. The first feature vector of the first geomagnetic data is used to indicate the geomagnetic characteristics of the first geomagnetic data, specifically based on the first geomagnetic data itself and other first geomagnetic data adjacent to the first geomagnetic data in the first geomagnetic data sequence to characterize the geomagnetic characteristics of the first geomagnetic data.
[0068] The second data feature of the second geomagnetic data sequence is a feature vector used to describe the characteristics of the geomagnetic data corresponding to the second geomagnetic data sequence. It is composed of the second feature vectors of each of the multiple second geomagnetic data included in the second geomagnetic data sequence. This second data feature can also be called a second geomagnetic feature. The second feature vector of the second geomagnetic data is used to indicate the geomagnetic characteristics of the second geomagnetic data, specifically based on the second geomagnetic data itself and other second geomagnetic data adjacent to it in the second geomagnetic data sequence, to characterize the geomagnetic characteristics of the second geomagnetic data.
[0069] Typically, the number of first geomagnetic data points included within the preset geomagnetic data range is greater than the number of second geomagnetic data points included in the second geomagnetic data sequence.
[0070] In one possible implementation, the step of "determining the first data feature of the first geomagnetic data sequence and the second data feature of the second geomagnetic data sequence" in step S202 above may include the following steps S2021 to S2024 (not shown in the figure):
[0071] S2021: For each second geomagnetic data item in the second geomagnetic data sequence, construct a sequence segment corresponding to the second geomagnetic data using the second geomagnetic data and other second geomagnetic data in the second geomagnetic data sequence whose interval with the second geomagnetic data is less than a preset interval threshold; and determine the second feature vector of the second geomagnetic data based on the sequence segment corresponding to the second geomagnetic data.
[0072] When determining the second feature vector for each second geomagnetic data in the second geomagnetic data sequence, the second geomagnetic data in the second geomagnetic data sequence whose interval with the second geomagnetic data is less than a preset interval threshold can be determined first. The preset interval threshold is a pre-set interval threshold used to determine the interval of adjacent geomagnetic data. That is, by using the preset interval threshold, the corresponding adjacent second geomagnetic data can be determined for each second geomagnetic data in the second geomagnetic data sequence.
[0073] For each second geomagnetic data item in the second geomagnetic data sequence, a sequence segment corresponding to that second geomagnetic data item can be constructed using that second geomagnetic data item and other second geomagnetic data items in the second geomagnetic data sequence whose intervals with that second geomagnetic data item are less than a preset interval threshold. For example, taking a second geomagnetic data sequence that includes 30 second geomagnetic data items (each corresponding to a number from 1 to 30), and a preset interval threshold of three geomagnetic data items as an example, when constructing the corresponding sequence segment for the second geomagnetic data item numbered 1 in the second geomagnetic data sequence, the sequence segment corresponding to the second geomagnetic data item numbered 1 can be constructed using the second geomagnetic data item itself, the second geomagnetic data item numbered 2, and the second geomagnetic data item numbered 3. This sequence segment can be specifically represented as [1,1,1,2,3] (where 1, 2, and 3 represent the second geomagnetic data item corresponding to that number, respectively); when constructing the corresponding sequence segment for the second geomagnetic data item numbered 2 in the second geomagnetic data sequence, the sequence segment can be constructed using the second geomagnetic data item numbered 1, the second geomagnetic data item itself, Using the second geomagnetic data numbered 3 and 4, a sequence segment corresponding to the second geomagnetic data numbered 2 is constructed, which can be specifically represented as [1,1,2,3,4]. When constructing the corresponding sequence segment for the second geomagnetic data numbered 3 in the second geomagnetic data sequence, the second geomagnetic data numbered 1, the second geomagnetic data numbered 2, the second geomagnetic data itself, the second geomagnetic data numbered 4, and the second geomagnetic data numbered 5 can be used to construct the sequence segment corresponding to the second geomagnetic data numbered 3, which can be specifically represented as [1,2,3,4,5]. This process continues until the sequence segment [28,29,30,30,30] corresponding to the second geomagnetic data numbered 30 is constructed.
[0074] Following the method described above, the sequence segment corresponding to each piece of second geomagnetic data in the second geomagnetic data sequence can be determined sequentially. Then, the second feature vector of each piece of second geomagnetic data can be determined based on its corresponding sequence segment. For example, the second feature vector of the second geomagnetic data corresponding to that sequence segment can be constructed by calculating the difference between two adjacent pieces of second geomagnetic data within that sequence segment.
[0075] As an example, the above-mentioned "determining the second feature vector of the second geomagnetic data based on the sequence segment corresponding to the second geomagnetic data" may include:
[0076] Based on each of the second geomagnetic data items in the sequence segment corresponding to the second geomagnetic data, the derivative features of the sequence segment corresponding to the second geomagnetic data are calculated and used as the second feature vector of the second geomagnetic data.
[0077] The derivative feature is used to describe the overall trend of change of each second geomagnetic data point within the sequence segment corresponding to the second geomagnetic data. After determining the sequence segment corresponding to each second geomagnetic data point, the derivative feature corresponding to that sequence segment can be calculated based on the second geomagnetic data points included in the sequence segment. For example, the difference between adjacent second geomagnetic data points in the sequence segment can be calculated as the derivative feature. See section 4. Figure 3 This is a schematic diagram illustrating the determination of feature vectors for geomagnetic data provided in this application embodiment. Taking the calculation of the second feature vector corresponding to the second geomagnetic data numbered 6 as an example, assuming that the sequence segment corresponding to the second geomagnetic data is [4, 5, 6, 7, 8], we can calculate the difference 1 obtained by subtracting the second geomagnetic data numbered 4 from the second geomagnetic data numbered 5, calculate the difference 2 obtained by subtracting the second geomagnetic data numbered 5 from the second geomagnetic data numbered 6, calculate the difference 3 obtained by subtracting the second geomagnetic data numbered 6 from the second geomagnetic data numbered 7, and calculate the difference 4 obtained by subtracting the second geomagnetic data numbered 7 from the second geomagnetic data numbered 8. After calculating the difference 1, difference 2, difference 3, and difference 4, each difference can be used as the derivative feature corresponding to the sequence segment. Thus, the derivative feature corresponding to the sequence segment can be used as the feature vector of the sequence segment. That is, the derivative features corresponding to the sequence segment [4, 5, 6, 7, 8] are [difference 1, difference 2, difference 3, and difference 4]. This derivative feature can be used as the second feature vector of the second geomagnetic data numbered 6.
[0078] It should be understood that in practical applications, other derivative algorithms can also be used to calculate the derivative characteristics of the sequence segment based on the various second geomagnetic data included in the sequence segment. The embodiments of this application do not limit the specific calculation method of the derivative characteristics.
[0079] As can be seen, the derivative features of the sequence segment can be calculated based on each second geomagnetic data item in the sequence segment using the above method. Furthermore, the second feature vector of the second geomagnetic data corresponding to the sequence segment can be determined based on the derivative features of the sequence segment. Since the sequence segment corresponding to the second geomagnetic data includes several second geomagnetic data items adjacent to the second geomagnetic data in the second geomagnetic data sequence, the derivative features of the sequence segment corresponding to the second geomagnetic data can more accurately reflect the geomagnetic changes at the location of the second geomagnetic data. Accordingly, determining the second feature vector of the second geomagnetic data based on the derivative features can ensure that the second feature vector more accurately describes the geomagnetic changes at the location corresponding to the second geomagnetic data.
[0080] S2022: The second data feature is formed by using the second feature vector of each second geomagnetic data item in the second geomagnetic data sequence.
[0081] After determining the second feature vector corresponding to each second geomagnetic data point in the second geomagnetic data sequence, these second feature vectors can be combined to form the second data feature of the second geomagnetic data sequence. For example, if the second geomagnetic data sequence includes 30 second geomagnetic data points, and a sequence segment of length 5 (containing 5 geomagnetic data points) is constructed for each second geomagnetic data point, a derivative feature of length 4 (including 4 differences) can be determined for each sequence segment by calculating the difference between adjacent geomagnetic data points in the sequence segment. This derivative feature is then used as the second feature vector of the second geomagnetic data point corresponding to that sequence segment. Furthermore, the second feature vectors of length 4 for each second geomagnetic data point in the second geomagnetic data sequence can be used to form a feature matrix of size 30*4, which serves as the second data feature of the second geomagnetic data sequence.
[0082] S2023: For each first geomagnetic data within the preset geomagnetic data range, construct a sequence segment corresponding to the first geomagnetic data using the first geomagnetic data and first geomagnetic data in the first geomagnetic data sequence whose interval with the first geomagnetic data is less than a preset interval threshold; and determine the first feature vector of the first geomagnetic data based on the sequence segment corresponding to the first geomagnetic data.
[0083] The first geomagnetic data in the first geomagnetic data sequence, whose interval with the first geomagnetic data is less than a preset interval threshold, is used to indicate the geomagnetic data required to construct the first feature vector corresponding to the first geomagnetic data.
[0084] For each first geomagnetic data item within a preset geomagnetic data range, a sequence segment corresponding to the first geomagnetic data item can be constructed using the first geomagnetic data item itself, as well as other first geomagnetic data items in the first geomagnetic data sequence whose interval with the first geomagnetic data item is less than a preset interval threshold. For example, taking a preset geomagnetic data range including 60 first geomagnetic data items (each corresponding to a number from 1 to 60), and a preset interval threshold of three geomagnetic data items as an example, when constructing the corresponding sequence segment for the first geomagnetic data item numbered 1 within the preset geomagnetic data range, the sequence segment corresponding to the first geomagnetic data item numbered 1 can be constructed using the first geomagnetic data item itself, the first geomagnetic data item numbered 2, and the first geomagnetic data item numbered 3. This sequence segment can be specifically represented as [1,1,1,2,3] (where 1, 2, and 3 represent the first geomagnetic data item corresponding to that number, respectively); when constructing the corresponding sequence segment for the first geomagnetic data item numbered 2 within the preset geomagnetic data range, the sequence segment can be constructed using the first geomagnetic data item numbered 1, the first geomagnetic data item itself, Using the first geomagnetic data numbered 3 and 4, a sequence segment corresponding to the first geomagnetic data numbered 2 is constructed. This sequence segment can be specifically represented as [1,1,2,3,4]. When constructing the corresponding sequence segment for the first geomagnetic data numbered 3 within the preset geomagnetic data range, the sequence segment corresponding to the first geomagnetic data numbered 3 can be constructed using the first geomagnetic data numbered 1, the first geomagnetic data numbered 2, the first geomagnetic data itself, the first geomagnetic data numbered 4, and the first geomagnetic data numbered 5. This sequence segment can be specifically represented as [1,2,3,4,5]. And so on, until the sequence segment [58,59,60,60,60] corresponding to the first geomagnetic data numbered 60 is constructed.
[0085] Following the method described above, the sequence segment corresponding to each first geomagnetic data item within the preset geomagnetic data range can be determined sequentially. Then, the first feature vector of each first geomagnetic data item can be determined based on its corresponding sequence segment. For example, the first feature vector of the first geomagnetic data item corresponding to each sequence segment can be constructed by calculating the difference between every two adjacent first geomagnetic data items within the sequence segment. The calculation method for the first feature vector of each first geomagnetic data item within the preset geomagnetic data range is the same as the calculation method for the second feature vector of each second geomagnetic data item in the second geomagnetic data sequence. That is, based on each first geomagnetic data item in the sequence segment corresponding to the first geomagnetic data item, the derivative feature of the sequence segment corresponding to that first geomagnetic data item can be calculated as the first feature vector of that first geomagnetic data item. This will not be elaborated further here.
[0086] S2024: Use the first feature vectors of each first geomagnetic data item within the preset geomagnetic data range to form the first data feature.
[0087] After determining the first feature vector corresponding to each first geomagnetic data item within the preset geomagnetic data range, the first feature vectors corresponding to each first geomagnetic data item within the preset geomagnetic data range can be combined to form the first data feature corresponding to the first geomagnetic data sequence. For example, if the preset geomagnetic data range includes 60 first geomagnetic data items, and a sequence segment of length 5 (i.e., including 5 geomagnetic data items) is constructed for each first geomagnetic data item, a derivative feature of length 4 (including 4 differences) can be determined for each sequence segment by calculating the difference between adjacent geomagnetic data items in the sequence segment. This derivative feature is then used as the first feature vector of the first geomagnetic data corresponding to that sequence segment. Furthermore, a feature matrix of size 60*4 can be formed using the first feature vectors of length 4 for each first geomagnetic data item within the preset geomagnetic data range, which serves as the first data feature of the first geomagnetic data sequence.
[0088] Therefore, by using the above method and a preset interval threshold, the sequence segment corresponding to each second geomagnetic data item in the second geomagnetic data sequence can be determined. Furthermore, based on the sequence segment corresponding to each second geomagnetic data item, the second feature vector corresponding to that second geomagnetic data item can be determined. By combining the second feature vectors corresponding to each second geomagnetic data item in the second geomagnetic data sequence, the second data feature corresponding to the second geomagnetic data sequence can be determined. Correspondingly, the first data feature corresponding to the first geomagnetic data sequence can be determined according to the above method. It is evident that in the process of determining the feature vector corresponding to geomagnetic data, the sequence segment corresponding to that geomagnetic data needs to be determined in advance. The sequence segment is determined based on the geomagnetic data and several adjacent geomagnetic data items. Therefore, the sequence segment corresponding to the geomagnetic data contains geomagnetic data information before and after the geomagnetic data. That is, the feature vector corresponding to the geomagnetic data can not only reflect the information of the geomagnetic data itself but also reflect the contextual information of the geomagnetic data in the sequence. Therefore, it can be ensured that the first and second data features determined accordingly contain comprehensive geomagnetic data information.
[0089] In one possible implementation, it can be pre-defined that the second geomagnetic data sequence includes a first preset number of second geomagnetic data points, and the second geomagnetic data sequence can be updated as the second geomagnetic data collected by the device to be located is updated. Based on this, the preset geomagnetic data range in S202 above can be determined in the following way:
[0090] When the second geomagnetic data sequence is the first second geomagnetic data sequence, the first geomagnetic data range is formed by the first geomagnetic data that ranks first in the first geomagnetic data sequence and the second preset number of first geomagnetic data. The first second geomagnetic data sequence is composed of the first set of second geomagnetic data collected by the device to be located, and the second preset number is greater than the first preset number.
[0091] When the second geomagnetic data sequence is the i-th second geomagnetic data sequence, a preset geomagnetic data range is determined in the first geomagnetic data sequence based on the matching probability distribution generated in the process of determining the positioning result based on the (i-1)-th second geomagnetic data sequence, where i is an integer greater than 1, and the i-th second geomagnetic data sequence is updated based on the (i-1)-th second geomagnetic data sequence.
[0092] It should be noted that the second geomagnetic data sequence includes a first preset number of second geomagnetic data points, and this second geomagnetic data sequence is updated as the geomagnetic data collected by the device to be located is updated. In other words, there is a limit to the number of second geomagnetic data points in the second geomagnetic data sequence. The second geomagnetic data points included in the second geomagnetic data sequence are updated as the second geomagnetic data collected by the device to be located is updated. Correspondingly, as the second geomagnetic data sequence is updated in real time, the positioning result determined based on the updated second geomagnetic data sequence is also updated in real time. For example, taking a first preset number of 30 as an example, the second geomagnetic data sequence includes the 1st to the 30th second geomagnetic data point. Based on this second geomagnetic data sequence, a positioning result can be determined. The second geomagnetic data sequence will be updated as the device to be located moves; that is, the second geomagnetic data sequence can be updated to include the 2nd to the 31st second geomagnetic data point collected by the device to be located. Based on this second geomagnetic data sequence, another positioning result can be determined, and so on, achieving real-time positioning of the device to be located based on the updates of the second geomagnetic data sequence.
[0093] The first second geomagnetic data sequence is composed of the first set of second geomagnetic data collected by the device to be located, representing a first preset number of data points. For example, if the first preset number is 30, the first second geomagnetic data sequence consists of the first to the 30th second geomagnetic data points collected by the device to be located. When the second geomagnetic data sequence is the first second geomagnetic data sequence, a preset geomagnetic data range can be formed using the first geomagnetic data points with a second preset number of data points that are ranked earlier in the first geomagnetic data sequence. The second preset number is greater than the first preset number; for example, the second preset number can be 60. This application does not specifically limit the first and second preset numbers. For example, if the second preset number is 60, when the second geomagnetic data sequence is the first second geomagnetic data sequence, the preset geomagnetic data range can be formed by the first to the 60th first geomagnetic data points in the first geomagnetic data sequence.
[0094] When the second geomagnetic data sequence is the i-th (i is an integer greater than 1) second geomagnetic data sequence, a preset geomagnetic data range can be determined in the first geomagnetic data sequence based on the matching probability distribution generated during the process of determining the positioning result based on the (i-1)-th second geomagnetic data sequence. The i-th second geomagnetic data sequence is obtained by updating the (i-1)-th second geomagnetic data sequence. For example, still taking the first preset quantity as 30, the (i-1)-th second geomagnetic data sequence can be composed of the (i-1)-th to (i+29)-th second geomagnetic data items collected by the device to be positioned. Correspondingly, the i-th second geomagnetic data sequence can be composed of the i-th to (i+30)-th second geomagnetic data items.
[0095] In the process of determining the positioning result based on the (i-1)th second geomagnetic data sequence, the matching probability between the (i+29)th second geomagnetic data item and each first geomagnetic data item in the first geomagnetic data sequence is determined. This yields the matching probability distribution determined during the positioning process based on the (i-1)th second geomagnetic data sequence. The specific method for determining this matching probability distribution can be found in the subsequent steps below. Furthermore, the first geomagnetic data item corresponding to the first non-zero matching probability can be selected from this matching probability distribution as the starting position of the preset geomagnetic data range corresponding to the i-th second geomagnetic data sequence. Similarly, the first geomagnetic data item corresponding to the last non-zero matching probability can be selected from this matching probability distribution as the ending position of the preset geomagnetic data range corresponding to the i-th second geomagnetic data sequence. This determines the geomagnetic data interval range within the first geomagnetic data sequence that constitutes the preset geomagnetic data range.
[0096] Therefore, using the above method, the preset geomagnetic data ranges corresponding to different second geomagnetic data sequences can be determined. Furthermore, the matching probability distribution corresponding to the previous second geomagnetic data sequence can be used to determine the preset geomagnetic data range corresponding to the next second geomagnetic data sequence. It is evident that since the preset geomagnetic data range includes less geomagnetic data than the first geomagnetic data sequence, determining the positioning result based on the preset geomagnetic data range not only reduces the computational load but also improves positioning efficiency.
[0097] S203: Determine the feature difference between the first data feature and the second data feature, and determine the matching observation data based on the feature difference. The matching observation data includes the matching cost corresponding to each of the various pairing methods between multiple first geomagnetic data and multiple second geomagnetic data within the preset geomagnetic data range.
[0098] Feature difference is used to indicate the difference between the first data feature and the second data feature. Feature difference can be specifically reflected as feature distance. Feature distance is used to indicate the distance between each first feature vector included in the first data feature and each second feature vector included in the second data feature. The smaller the distance between two feature vectors, the more similar the geomagnetic data corresponding to the two feature vectors are.
[0099] After determining the first and second data features, the feature distance between them can be calculated as the aforementioned feature difference. For example, the feature distance can be calculated using the Euclidean distance algorithm. This feature distance specifically represents the distance between each first feature vector included in the first data feature and each second feature vector included in the second data feature. Assuming the first data feature is a feature matrix of size 60*4 and the second data feature is a feature matrix of size 30*4, the feature distance calculated by the Euclidean distance algorithm should be a distance matrix of size 30*60, where the element in the i-th row and j-th column is the distance between the i-th second feature vector in the second data feature and the j-th first feature vector in the first data feature. That is, it represents the similarity between the i-th second geomagnetic data item in the second geomagnetic data sequence and the j-th first geomagnetic data item within the preset geomagnetic data range, where i is an integer greater than or equal to 1 and less than or equal to 30, and j is an integer greater than or equal to 1 and less than or equal to 60.
[0100] After determining the feature distance between the first and second data features, matching observation data can be further determined based on this feature distance. This matching observation data includes the matching costs of various pairing methods. These pairing methods are obtained by pairing multiple first geomagnetic data points within a preset geomagnetic data range with multiple second geomagnetic data points in a second geomagnetic data sequence. Each pairing method can indicate the pairing relationship between each second geomagnetic data point in the second geomagnetic data sequence and the first geomagnetic data points within the preset geomagnetic data range. That is, a pairing relationship can be constructed between the second geomagnetic data points included in the second geomagnetic data sequence and the first geomagnetic data points included in the preset geomagnetic data range, so that each second geomagnetic data point in the second geomagnetic data sequence corresponds to the same or different first geomagnetic data points. Thus, the pairing relationships constructed for each second geomagnetic data point in the second geomagnetic data sequence constitute a pairing method. In this way, by constructing different correspondences between the second geomagnetic data points included in the reference sequence and the first geomagnetic data points included in the search range, multiple pairing methods can be obtained. When a second geomagnetic data sequence includes 30 second geomagnetic data items, and a preset geomagnetic data range includes 60 first geomagnetic data items, a pairing method can indicate the pairing relationship between the 30 second geomagnetic data items in the second geomagnetic data sequence and the 60 first geomagnetic data items in the preset geomagnetic data range. For example, pairing the first second geomagnetic data item in the second geomagnetic data sequence with the first first geomagnetic data item in the preset geomagnetic data range, pairing the second second geomagnetic data item in the second geomagnetic data sequence with the third first geomagnetic data item in the second geomagnetic data sequence with the sixth first geomagnetic data item in the preset geomagnetic data range, and so on. It should be understood that different pairing methods indicate different pairing relationships between the geomagnetic data in the two sequences.
[0101] For example, assuming the second geomagnetic data sequence includes second geomagnetic data a1 and second geomagnetic data a2, and the preset geomagnetic data range includes first geomagnetic data b1, first geomagnetic data b2, and first geomagnetic data b3, different pairing relationships between the second and first geomagnetic data can be constructed, resulting in the following six pairing methods: Method 2 (a1 and a2 both correspond to b1), Method 3 (a1 corresponds to b1, a2 corresponds to b2), Method 4 (a1 and a2 both correspond to b2), Method 5 (a1 corresponds to b2, a2 corresponds to b3), and Method 6 (a1 and a2 both correspond to b3). It should be understood that when constructing the pairing methods, the relationship between the second and first geomagnetic data can be one-to-one or many-to-one.
[0102] The matching cost corresponding to the pairing method indicates the total cost incurred in pairing each item of second geomagnetic data in the second geomagnetic data sequence with first geomagnetic data within a preset geomagnetic data range according to this pairing method. This total cost is the sum of the distances between the feature vectors of each pair of geomagnetic data in the pairing method. When pairing each item of second geomagnetic data in the second geomagnetic data sequence with first geomagnetic data within a preset geomagnetic data range according to the pairing method, each pair of geomagnetic data in this pairing method can be identified. Each pair of geomagnetic data includes one item of second geomagnetic data belonging to the second geomagnetic data sequence and one item of first geomagnetic data belonging to the preset geomagnetic data range in the first geomagnetic data sequence. These two geomagnetic data items have a pairing relationship in this pairing method. Next, for each pair of geomagnetic data, the corresponding matching distance can be determined. The matching distance for a pair of geomagnetic data can be obtained from the feature distance between the first and second data features. Specifically, assuming that the i-th second geomagnetic data item in the second geomagnetic data sequence has a pairing relationship with the j-th first geomagnetic data item within a preset geomagnetic data range, then the matching distance corresponding to the pair of geomagnetic data consisting of the i-th second geomagnetic data item and the j-th first geomagnetic data item is the element in the i-th row and j-th column of the feature distance calculated based on the first and second data features. Furthermore, by calculating the sum of the matching distances corresponding to each pair of geomagnetic data in this pairing method, the matching cost corresponding to this pairing method can be obtained.
[0103] Taking the second geomagnetic data sequence, which includes second geomagnetic data a1 and second geomagnetic data a2, and the preset geomagnetic data range, which includes first geomagnetic data b1, first geomagnetic data b2 and first geomagnetic data b3, as an example, six pairing methods can be constructed based on the second geomagnetic data sequence and the preset geomagnetic data range. For method 1 (where both a1 and a2 correspond to b1), the matching distance between a1 and b1 and the matching distance between a2 and b1 can be obtained from the feature distance. Then, the sum of these two matching distances can be calculated to obtain the matching cost corresponding to method 1.
[0104] In one possible implementation, "determining matching observation data based on feature differences" in S203 above may include:
[0105] The cost matrix is calculated based on the distance matrix using the matching cost algorithm; the elements in the last row of the cost matrix are used as the matching observation data.
[0106] As an example, the feature difference is the feature distance, which is a distance matrix of size m*n, where m is the number of second geomagnetic data in the second geomagnetic data sequence, and n is the number of first geomagnetic data within a preset geomagnetic data range. The element in the j-th row and k-th column of this distance matrix represents the feature distance between the second data feature vector of the j-th second geomagnetic data in the second geomagnetic data sequence and the first data feature vector of the k-th first geomagnetic data within the preset geomagnetic data range. j is an integer greater than or equal to 1 and less than or equal to m, and k is an integer greater than or equal to 1 and less than or equal to n.
[0107] The matching cost algorithm refers to an algorithm that, based on a distance matrix, determines the matching cost corresponding to various pairing methods between each second geomagnetic data point in a second geomagnetic data sequence and a first geomagnetic data point within a preset geomagnetic data range. Specifically, this matching cost algorithm can be the Dynamic Time Warping (DTW) algorithm, which is used to measure the similarity between two time series and is mainly applicable to sequences of unequal lengths. Of course, this matching cost algorithm can also be a derivative or improved version of the DTW algorithm, or other algorithms capable of calculating the matching cost corresponding to different matching methods. This application does not limit the matching cost algorithm in any way.
[0108] After determining the distance matrix between the first data feature and the second data feature, the DTW algorithm can be used to calculate the corresponding cost matrix based on the distance matrix. The size of the cost matrix is also m*n. That is, the distance matrix of size m*n is used as the input data of the DTW algorithm. After the DTW algorithm processes the distance matrix, it will output the corresponding cost matrix of size m*n. The cost matrix is used to indicate the matching cost corresponding to each of the possible pairing methods between the second geomagnetic data in the second geomagnetic data sequence and the first geomagnetic data within the preset geomagnetic data range.
[0109] The element in the i-th row and j-th column of the cost matrix represents the matching cost of the optimal pairing method when the i-th second geomagnetic data in the second geomagnetic data sequence is paired with the j-th first geomagnetic data within the preset geomagnetic data range. The optimal pairing method refers to the pairing method that minimizes the sum of the matching distances when the i-th second geomagnetic data in the second geomagnetic data sequence is paired with the j-th first geomagnetic data within the preset geomagnetic data range. The element in the i-th row and j-th column of the cost matrix is the sum of the matching distances corresponding to this optimal pairing method. The calculation method of the sum of the matching distances can be found in the relevant description above.
[0110] After determining the cost matrix corresponding to the distance matrix, the elements of the last row of the cost matrix can be used as the matching observation data. Each element in the last row of the cost matrix indicates the matching cost of the optimal pairing method when the last item of the second geomagnetic data in the second geomagnetic data sequence is paired with each item of the first geomagnetic data within a preset geomagnetic data range. For example, the first element in the last row of the cost matrix can indicate the matching cost of the optimal pairing method when the last item of the second geomagnetic data in the second geomagnetic data sequence is paired with the first item of the first geomagnetic data within a preset geomagnetic data range, and so on. The elements of the last row of the determined cost matrix can be used as the matching observation data.
[0111] As can be seen, by using the matching cost algorithm and based on the distance matrix, the matching cost corresponding to each of the possible pairing methods between the first data feature and the second data feature can be determined. Furthermore, the last row of the cost matrix can be used as the matching observation data, that is, the minimum matching cost when the last item of the second geomagnetic data in the second geomagnetic data sequence is matched with each item of the first geomagnetic data within the preset geomagnetic data range can be used as the matching observation data. This helps to determine the first geomagnetic data in the first geomagnetic data sequence that best matches the last item of the second geomagnetic data in the second geomagnetic data sequence, thereby achieving accurate positioning.
[0112] S204: Determine the matching probability distribution based on the matching observation data. The matching probability distribution includes the matching probability of each of the first geomagnetic data in the first geomagnetic data sequence with the last item of the second geomagnetic data in the second geomagnetic data sequence in terms of time sequence.
[0113] The matching probability distribution includes the matching probability of each first geomagnetic data item in the first geomagnetic data sequence with the last second geomagnetic data item in the second geomagnetic data sequence in terms of time. This matching probability is used to indicate the degree of feature matching between each first geomagnetic data item in the first geomagnetic data sequence and the last second geomagnetic data item in the second geomagnetic data sequence in terms of time. It should be understood that the higher the matching probability between the last second geomagnetic data item in the second geomagnetic data sequence and a certain first geomagnetic data item in the first geomagnetic data sequence, the closer the location of the device to be located when collecting the last second geomagnetic data item in the time sequence is to the location corresponding to the first geomagnetic data item.
[0114] It should be noted that in the matching probability distribution, the matching probability of the first geomagnetic data within the preset geomagnetic data range of the first geomagnetic data sequence may not be 0, while the matching probability of the first geomagnetic data outside the preset geomagnetic data range is definitely 0. (See reference...) Figure 4 , Figure 4 This is a schematic diagram of the matching probability distribution provided in the embodiments of this application. In this schematic diagram, the horizontal axis represents each first geomagnetic data item in the first geomagnetic data sequence, and the vertical axis represents the matching probability between each first geomagnetic data item in the first geomagnetic data sequence and the last second geomagnetic data item in the second geomagnetic data sequence in terms of time sequence.
[0115] For example, the discrete Bayesian algorithm can be used to convert matching observation data into a matching probability distribution.
[0116] In one possible implementation, "determining the matching probability distribution based on matching observation data" in S204 above may include:
[0117] Based on the prior probability distribution and the preset transition vector, the prior transition distribution is determined; using the discrete Bayesian algorithm, the posterior probability distribution is calculated based on the prior transition distribution and the matched observation data, and is used as the matching probability distribution.
[0118] Specifically, when the second geomagnetic data sequence is the first second geomagnetic data sequence, the prior probability distribution is a preset probability distribution, and the first second geomagnetic data sequence consists of the first set of first preset number of second geomagnetic data collected by the device to be located; when the second geomagnetic data sequence is the i-th second geomagnetic data sequence, the prior probability distribution is the matching probability distribution generated in the process of determining the positioning result based on the (i-1)-th second geomagnetic data sequence, where i is an integer greater than 1, and the i-th second geomagnetic data sequence is updated based on the (i-1)-th second geomagnetic data sequence.
[0119] The prior probability distribution refers to a probability distribution obtained based on pre-set experience and analysis. It is used to indicate the initial estimate of the matching probability between the last item of the second geomagnetic data in the second geomagnetic data sequence and each item of the first geomagnetic data in the first geomagnetic data sequence under prior conditions. The transition vector refers to the distance and direction of the prior probability distribution's shift. For example, a transition vector of 1 to the right indicates that the prior probability distribution needs to be shifted one unit to the right. This application does not specifically limit the prior probability and the transition vector.
[0120] When the second geomagnetic data sequence is the first second geomagnetic data sequence, the prior probability distribution is a preset probability distribution. When the second geomagnetic data sequence is required to include a first preset number of second geomagnetic data points, and the preset geomagnetic data range includes a second preset number of first geomagnetic data points, this first second geomagnetic data sequence is composed of the first set of second geomagnetic data points collected by the device to be located, based on a first preset number of data points and a second preset number of data points, for example, when the second geomagnetic data sequence is the first second geomagnetic data sequence composed of the first to the 30th second geomagnetic data points collected by the device to be located, the prior probability distribution is that the first to the 60th first geomagnetic data points in the first geomagnetic data sequence each correspond to a matching probability of 1 / 60, and the remaining first geomagnetic data points in the first geomagnetic data sequence correspond to a matching probability of 0.
[0121] For reference Figure 5 , Figure 5 This is a schematic diagram of determining the posterior probability distribution provided in an embodiment of this application. Based on the prior probability distribution and the preset transition vector, the prior transition distribution can be determined. The prior transition distribution is used to indicate the prior probability distribution after transitioning based on the preset transition vector. Taking the preset transition vector as shifting 1 to the right as an example, the prior probability distribution of the first geomagnetic data item from the 1st to the 60th geomagnetic data item in the above-mentioned first geomagnetic data sequence, which all correspond to a matching probability of 1 / 60, is shifted one unit to the right to obtain the probability distribution of the second to the 61st geomagnetic data item in the first geomagnetic data sequence, which all correspond to a matching probability of 1 / 60. This probability distribution is the prior transition distribution.
[0122] After determining the prior transition distribution, the posterior probability distribution, as the matching probability distribution, can be calculated using the Discrete Bayesian algorithm based on the prior transition distribution and the matched observation data. The Discrete Bayesian algorithm refers to the application of Bayes' theorem in discrete probability space. Bayes' theorem describes the rules for updating the matching probability between the last item of the second geomagnetic data sequence and each item of the first geomagnetic data sequence after obtaining new evidence, i.e., matched observation data. The posterior probability distribution is the output of the Discrete Bayesian formula. It indicates the probability distribution obtained after correcting the prior transition distribution based on the input of the Discrete Bayesian formula (i.e., the matched observation data). In other words, it indicates the matching probability between the last item of the second geomagnetic data sequence and each item of the first geomagnetic data sequence.
[0123] For example, the prior transition distribution and the matched observation data can be used as input data for the Discrete Bayes algorithm. The Discrete Bayes algorithm can then output the posterior probability distribution. Furthermore, the posterior probability distribution can be used as the matching probability distribution.
[0124] It should be noted that when the second geomagnetic data sequence is the i-th second geomagnetic data sequence, the prior probability distribution is the matching probability distribution generated during the process of determining the positioning result based on the (i-1)-th second geomagnetic data sequence. That is, the posterior probability distribution corresponding to the (i-1)-th second geomagnetic data sequence can be used as the prior probability distribution of the i-th second geomagnetic data sequence to facilitate timely updates to the positioning result. Here, i is an integer greater than 1, and the i-th second geomagnetic data sequence is obtained by updating based on the (i-1)-th second geomagnetic data sequence.
[0125] Therefore, the prior transition distribution can be determined based on the prior probability distribution and the preset transition vector using the above method. Furthermore, the prior transition distribution and the matched observation data can be used as input data for the Discrete Bayesian algorithm. The posterior probability distribution can be obtained through the calculation of the Discrete Bayesian algorithm. Thus, the posterior probability distribution can be continuously updated based on the second geomagnetic data sequence that is constantly updated due to changes in location using the Discrete Bayesian algorithm. This enables real-time positioning of the device to be positioned based on the continuously updated second geomagnetic data sequence. Moreover, since the Discrete Bayesian algorithm has high robustness, the positioning results determined by it can also be guaranteed to have high accuracy.
[0126] In one possible implementation, the method provided in this application embodiment may further include:
[0127] Determine the entropy quantization value corresponding to the matching probability distribution;
[0128] If the entropy quantization value is within the preset entropy threshold range, then execute the subsequent S205; if the entropy quantization value exceeds the preset entropy threshold range, then abandon the execution of the subsequent S205.
[0129] Entropy is a measure of information uncertainty. The larger the entropy quantization value corresponding to a matching probability distribution, the higher the uncertainty of that matching probability distribution. The entropy quantization value refers to the specific quantification value of entropy, that is, the entropy quantization value is used to indicate the specific numerical value that reflects the uncertainty of the matching probability distribution.
[0130] After determining the matching probability distribution, the matching probability distribution can be substituted into the entropy quantization formula to calculate the entropy quantization value corresponding to the matching probability distribution.
[0131] The preset entropy threshold interval refers to a pre-defined entropy threshold interval used to determine whether to perform positioning based on the matching probability distribution. If the entropy quantization value corresponding to the matching probability distribution falls within this preset entropy threshold interval, it is considered that the currently calculated matching probability distribution can accurately reflect which first geomagnetic data item in the first geomagnetic data sequence corresponds to the last second geomagnetic data item in the second geomagnetic data sequence. Therefore, this matching probability distribution can be applied to further perform subsequent operations to determine the positioning result. Conversely, if the entropy quantization value corresponding to the matching probability distribution does not fall within this preset entropy threshold interval, it is considered that the currently calculated matching probability distribution cannot accurately reflect which first geomagnetic data item in the first geomagnetic data sequence corresponds to the last second geomagnetic data item in the second geomagnetic data sequence. There may be a situation where the matching probability of the last second geomagnetic data item in the second geomagnetic data sequence is similar to that of several first geomagnetic data items in the first geomagnetic data sequence, making it impossible to accurately determine the first geomagnetic data item that matches the last second geomagnetic data item. Therefore, it is possible to abandon the application of this matching probability distribution to further perform subsequent operations, i.e., abandon the determination of positioning result based on this matching probability distribution. In other words, matching geomagnetic data can only be determined based on the current matching probability distribution if the entropy quantization value corresponding to the matching probability distribution is within the preset entropy threshold range; otherwise, matching geomagnetic data cannot be determined based on the current matching probability distribution.
[0132] As can be seen, the above method can further filter the matching probability distribution based on the entropy quantization value corresponding to the matching probability distribution before determining the positioning result, in order to determine whether to apply the matching probability distribution for subsequent positioning result determination. This ensures that the positioning result is determined only based on a more accurate matching probability distribution, thus guaranteeing the accuracy of the positioning result. At the same time, it avoids affecting the overall accuracy of the positioning result and causing unnecessary waste of computing resources by determining the positioning result based on an inaccurate matching probability distribution.
[0133] S205: Based on the matching probability distribution, determine the target geomagnetic data that meets the preset matching conditions with the last item of the second geomagnetic data in the time series from multiple first geomagnetic data.
[0134] Preset matching conditions are used to indicate the criteria for judging target geomagnetic data. For example, a preset matching condition can be that the first geomagnetic data corresponding to the maximum matching probability is the target geomagnetic data. Here, the target geomagnetic data refers to the first geomagnetic data in the first geomagnetic data sequence that best matches the last item of the second geomagnetic data sequence in terms of time sequence.
[0135] Given a known matching probability distribution, we can identify target geomagnetic data that satisfy a preset matching condition between each item in the first geomagnetic data sequence and the last item in the second geomagnetic data sequence in terms of time sequence. For example, if the sixth item in the first geomagnetic data sequence has the highest matching probability value with the last item in the second geomagnetic data sequence in terms of time sequence, it means that the sixth item in the first geomagnetic data sequence satisfies the preset matching condition with the last item in the second geomagnetic data sequence in terms of time sequence, and this sixth item in the first geomagnetic data sequence can be used as the target geomagnetic data.
[0136] S206: Determine the positioning result of the device to be located based on the index of the target geomagnetic data in the first geomagnetic data sequence.
[0137] Furthermore, the positioning result of the device to be located can be determined based on the index of the target geomagnetic data in the first geomagnetic data sequence. The positioning result of the device to be located refers to the location information of the device in the preset road segment. The index indicates the position of the target geomagnetic data in the first geomagnetic data sequence. As described above regarding the first geomagnetic data sequence, the data are arranged in chronological order of acquisition time. Data acquired earlier in the sequence are ranked higher and have a smaller index; conversely, data acquired later in the sequence are ranked lower and have a larger index.
[0138] In this embodiment, it is assumed that each first geomagnetic data item in the first geomagnetic data sequence is collected at a uniform speed. Accordingly, the collection distance interval between any two adjacent first geomagnetic data items in the first geomagnetic data sequence is equal. Specifically, this interval can be calculated based on the total length of the preset road segment and the total number of first geomagnetic data items included in the first geomagnetic data sequence. Based on this, after determining the index of the target geomagnetic data in the first geomagnetic data sequence, the collection location of the target geomagnetic data can be determined according to the index and the collection distance interval between any two adjacent first geomagnetic data items in the first geomagnetic data sequence. This collection location is the positioning result of the device to be located. For example, assuming the total length of the preset road segment is 5000 meters, the first geomagnetic data sequence is composed of first geomagnetic data collected at a constant speed. The first geomagnetic data sequence includes 1001 first geomagnetic data points. Based on the above information, it can be known that the sampling distance interval between every two adjacent first geomagnetic data points is 5 meters. If the determined target geomagnetic data is the 11th first geomagnetic data point in the first geomagnetic data sequence, the positioning result of the device to be located can be determined to be 50 meters away from the starting point of the preset road segment.
[0139] In one possible implementation, the step of "determining the positioning result of the device to be located based on the index of the target geomagnetic data in the first geomagnetic data sequence" in S205 above may include:
[0140] Obtain the location information of representative points of a preset road segment; the representative points include at least one of the start and end points of the preset road segment;
[0141] Based on the index of the target geomagnetic data in the first geomagnetic data sequence, the number of first geomagnetic data in the first geomagnetic data sequence, and the location information of the representative point, the positioning result of the device to be located is determined.
[0142] A representative point refers to at least one of the start and end points of a preset road segment; that is, the representative point can be either the start or end point of the preset road segment.
[0143] As an example, when acquiring the first geomagnetic data sequence of a preset road segment, GPS information of a representative point of that preset road segment can be obtained from the road network data as the location information of the representative point.
[0144] After determining the location information of the representative point, the positioning result of the device to be positioned can be determined based on the index of the target geomagnetic data in the first geomagnetic data sequence, the number of geomagnetic data in the first geomagnetic data sequence, and the location information of the representative point.
[0145] The index of the target geomagnetic data in the first geomagnetic data sequence indicates its position within the sequence. The length of a preset road segment can be obtained from the road network data. Furthermore, based on the number of first geomagnetic data points in the first geomagnetic data sequence, the distance between any two adjacent first geomagnetic data points within the preset road segment can be determined. Further, based on the position of the target geomagnetic data in the first geomagnetic data sequence and the location information of the representative point, the positioning result of the device to be located can be determined. For example, when the target geomagnetic data is the 11th first geomagnetic data point in the first geomagnetic data sequence, if the representative point is the starting point of the preset road segment, and the distance between any two adjacent first geomagnetic data points in the preset road segment is 5 meters, then the positioning result of the device to be located can be determined to be 50 meters from the starting point of the preset road segment.
[0146] As can be seen, the above method can determine the positioning result of the device to be positioned in an environment with weak satellite signals, based on the index of the target geomagnetic data in the first geomagnetic data sequence, the number of first geomagnetic data in the first geomagnetic data sequence, and the location information of the representative points of the geomagnetic positioning preset road segment, thus improving the positioning accuracy.
[0147] The positioning method provided in this application provides a geomagnetic data-based positioning mechanism for environments with weak satellite signals, such as tunnels. The method includes: acquiring a first geomagnetic data sequence (including multiple first geomagnetic data sets) for a preset road segment; and acquiring a second geomagnetic data sequence (including multiple second geomagnetic data sets) collected by the device to be positioned on the preset road segment. Based on this, the positioning result of the device to be positioned in the preset road segment can be determined in real time by matching the geomagnetic data sequence collected in real time by the device to be positioned on the preset road segment with a pre-determined geomagnetic data sequence for the preset road segment. When matching two geomagnetic data sequences, the first step is to determine the first data feature of the first geomagnetic data sequence and the second data feature of the second geomagnetic data sequence. The first descriptive feature includes a first feature vector for each first geomagnetic data item within a preset geomagnetic data range. The preset geomagnetic data range is the range of geomagnetic data in the first geomagnetic data sequence that is feature-matched with the second geomagnetic data sequence. That is, the range of geomagnetic data in the first geomagnetic data sequence that is feature-matched with the second geomagnetic data sequence can be determined, thereby determining the first data feature used to indicate the characteristics of each first geomagnetic data item within this range. The second data feature includes a second feature vector for each second geomagnetic data item in the second geomagnetic data sequence, that is, the second data feature indicates the characteristics of each second geomagnetic data item in the second geomagnetic data sequence. Then, the feature difference between the first and second data features is determined. Based on this feature difference, matching observation data is determined. This matching observation data includes the matching costs corresponding to various pairing methods between multiple first geomagnetic data items and multiple second geomagnetic data items within the preset geomagnetic data range. Furthermore, a matching probability distribution can be determined based on the matched observation data. This matching probability distribution includes the matching probability of each of the first geomagnetic data points in the first geomagnetic data sequence with the last temporally significant second geomagnetic data point in the second geomagnetic data sequence. In other words, the probability distribution more intuitively and concretely represents the matching probability of each of the first geomagnetic data points in the first geomagnetic data sequence with the last temporally significant second geomagnetic data point in the second geomagnetic data sequence. Finally, based on the matching probability distribution, target geomagnetic data points that satisfy preset matching conditions with the last temporally significant second geomagnetic data point are determined from the first geomagnetic data points included in the first geomagnetic data sequence. Then, based on the index of the target geomagnetic data point in the first geomagnetic data sequence, the positioning result of the device to be located is determined. Since the target geomagnetic data point is the matching result of the last temporally significant second geomagnetic data point in the first geomagnetic data sequence, the location corresponding to the target geomagnetic data point can be determined based on its index in the first geomagnetic data sequence, and the location of the device to be located when collecting the second geomagnetic data sequence can be determined accordingly, serving as the positioning result.As can be seen, by using the above method, geomagnetic data can be matched with the geomagnetic data sequence of the device to be located in real time on the preset road section and the geomagnetic data sequence of the preset road section in advance. Then, the positioning result of the device to be located can be determined based on the matching result, so as to achieve accurate positioning in the weak satellite signal environment.
[0148] In one possible implementation, the method provided in this application embodiment may further include:
[0149] Interpolate the first geomagnetic data sequence to obtain at least one auxiliary first geomagnetic data sequence;
[0150] Determine the first auxiliary data feature corresponding to each auxiliary first geomagnetic data sequence; the first auxiliary data feature includes the first feature vector of each first geomagnetic data item within a preset geomagnetic data range in the auxiliary first geomagnetic data sequence;
[0151] For each auxiliary first geomagnetic data sequence, the feature difference between the second data feature and the first auxiliary data feature corresponding to the auxiliary first geomagnetic data sequence is determined, and the matching observation data corresponding to the auxiliary first geomagnetic data sequence is determined based on the feature difference;
[0152] Target matching observation data is selected from the matching observation data corresponding to the first geomagnetic data sequence and the matching observation data corresponding to each of the auxiliary first geomagnetic data sequences; the target matching observation data will be used to determine the matching probability distribution.
[0153] It should be noted that the first geomagnetic data sequence is composed of geomagnetic data collected at a uniform rate. In practical applications, it is impossible to effectively estimate the acquisition rate of geomagnetic data in the real-time acquired second geomagnetic data sequence. Therefore, the first geomagnetic data sequence can be adjusted to adapt to geomagnetic matching under different acquisition rates.
[0154] Interpolation refers to filling in or deleting data values in a known sequence to make the sequence length meet the expected requirements. For example, a first geomagnetic data sequence can be interpolated using linear interpolation to obtain at least one auxiliary first geomagnetic data sequence; that is, the first geomagnetic data sequence can be magnified or reduced through interpolation. This application does not specifically limit the method of interpolation.
[0155] The auxiliary first geomagnetic data sequence refers to a first geomagnetic data sequence adapted to different acquisition speeds. This auxiliary first geomagnetic data sequence can be a first geomagnetic data sequence that has been reduced through interpolation; for example, if the first geomagnetic data sequence includes 1000 first geomagnetic data points, the auxiliary first geomagnetic data sequence can include 800 first geomagnetic data points. Alternatively, the auxiliary first geomagnetic data sequence can be a first geomagnetic data sequence that has been enlarged through interpolation; for example, if the first geomagnetic data sequence includes 1000 first geomagnetic data points, the auxiliary first geomagnetic data sequence can include 1200 first geomagnetic data points. This application does not specifically limit the number of first geomagnetic data points included in the auxiliary first geomagnetic data sequence, nor the number of auxiliary first geomagnetic data sequences.
[0156] The first auxiliary data feature refers to the first data feature determined based on the auxiliary first geomagnetic data sequence. The first auxiliary data feature includes the first feature vector of each first geomagnetic data item within the preset geomagnetic data range in the auxiliary first geomagnetic data sequence. The determination method of the first auxiliary data feature is the same as the determination method of the first data feature corresponding to the first geomagnetic data sequence in S202 above, and will not be repeated here.
[0157] It should be understood that for auxiliary first geomagnetic data sequences of different lengths, the preset geomagnetic data range also has different lengths, that is, the number of first geomagnetic data points included in the preset geomagnetic data range varies. For example, for a first geomagnetic data sequence including 1000 first geomagnetic data points, the preset geomagnetic data range may include 60 first geomagnetic data points; for an auxiliary first geomagnetic data sequence including 800 first geomagnetic data points, the preset geomagnetic data range may include 48 first geomagnetic data points; and for an auxiliary first geomagnetic data sequence including 1200 first geomagnetic data points, the preset geomagnetic data range may include 72 first geomagnetic data points.
[0158] Taking the preset geomagnetic data range in the auxiliary first geomagnetic data sequence as including the first geomagnetic data items 1-48 in the auxiliary first geomagnetic data sequence as an example, the first auxiliary data feature corresponding to the auxiliary first geomagnetic data sequence can be, for example, a feature vector with a size of 48*4; taking the preset geomagnetic data range in the auxiliary first geomagnetic data sequence as including the first geomagnetic data items 1-72 in the auxiliary first geomagnetic data sequence as an example, the first auxiliary data feature corresponding to the auxiliary first geomagnetic data sequence can be, for example, a feature vector with a size of 72*4.
[0159] For each auxiliary first geomagnetic data sequence, the feature distance between the second data feature and the corresponding first auxiliary data feature can be determined, and the matching observation data corresponding to the auxiliary first geomagnetic data sequence can be determined based on this feature distance. The method for determining the feature distance between the second data feature and the corresponding first auxiliary data feature is the same as the method for determining the feature distance between the second data feature and the first data feature in S203 above, and will not be repeated here. Taking a 30*4 dimensional feature vector as the second data feature and a 48*4 dimensional feature vector as the first auxiliary data feature corresponding to the auxiliary first geomagnetic data sequence as an example, the feature distance between them can be represented by a 30*48 distance matrix; taking a 30*4 dimensional feature vector as the second data feature and a 72*4 dimensional feature vector as the first auxiliary data feature corresponding to the auxiliary first geomagnetic data sequence as an example, the feature distance between them can be represented by a 30*72 distance matrix.
[0160] After determining the feature distances between each auxiliary first geomagnetic data sequence and the second data feature, the matching observation data corresponding to each auxiliary first geomagnetic data sequence can be determined based on these feature distances. The method for determining the matching observation data corresponding to each auxiliary first geomagnetic data sequence is the same as the method for determining the matching observation data corresponding to the first geomagnetic data sequence in S203 above, and will not be repeated here. For example, if the number of auxiliary first geomagnetic data sequences is 2, and the first auxiliary data feature corresponding to the first auxiliary first geomagnetic data sequence is a feature vector of size 48*4, then the size of the matching observation data corresponding to this first auxiliary first geomagnetic data sequence is 1*48; if the first auxiliary data feature corresponding to the second auxiliary first geomagnetic data sequence is a feature vector of size 72*4, then the size of the matching observation data corresponding to this first auxiliary first geomagnetic data sequence is 1*72.
[0161] After determining the matching observation data corresponding to each auxiliary first geomagnetic data sequence, the matching observation data corresponding to each auxiliary first geomagnetic data sequence can be converted into matching observation data with the same size as the matching observation data of the first geomagnetic data sequence. For example, interpolation processing can be performed on the matching observation data corresponding to each auxiliary first geomagnetic data sequence to adjust the size of the matching observation data corresponding to each auxiliary first geomagnetic data sequence to the size of the matching observation data of the first geomagnetic data sequence. After determining the matching observation data corresponding to each auxiliary first geomagnetic data sequence, target matching observation data can be selected from the matching observation data corresponding to the first geomagnetic data sequence and the matching observation data corresponding to each auxiliary first geomagnetic data sequence. The target matching observation data will be used to determine the matching probability distribution; that is, a matching observation data that meets preset requirements can be selected as the target matching observation data. The selected target matching observation data needs to participate in subsequent geomagnetic positioning steps, meaning that the target matching observation data needs to be converted into a matching probability distribution.
[0162] For reference Figure 6 , Figure 6 This is a schematic diagram illustrating the target matching observation data provided in an embodiment of this application. Taking an example where the number of auxiliary first geomagnetic data sequences is two, interpolation processing is performed on the first geomagnetic data sequences to obtain auxiliary first geomagnetic data sequence 1 and auxiliary first geomagnetic data sequence 2. Then, according to the method for determining the first data features corresponding to the first geomagnetic data sequences, the first auxiliary data feature 1 corresponding to auxiliary first geomagnetic data sequence 1 and the first auxiliary data feature 2 corresponding to auxiliary first geomagnetic data sequence 2 can be determined. For the auxiliary first geomagnetic data sequence 1, the feature distance 1 between the second data feature and the first auxiliary data feature 1 corresponding to the auxiliary first geomagnetic data sequence 1 can be determined according to the method for determining the feature distance between the second data feature and the first data feature. Furthermore, the matching observation data 1 corresponding to the auxiliary first geomagnetic data sequence 1 can be determined based on this feature distance 1, according to the method for determining the matching observation data corresponding to the first geomagnetic data sequence. Similarly, for the auxiliary first geomagnetic data sequence 2, the feature distance 2 between the second data feature and the first auxiliary data feature 2 corresponding to the auxiliary first geomagnetic data sequence 2 can be determined according to the method for determining the feature distance between the second data feature and the first data feature. Furthermore, the matching observation data 2 corresponding to the auxiliary first geomagnetic data sequence 2 can be determined based on this feature distance 2, according to the method for determining the matching observation data corresponding to the first geomagnetic data sequence. Finally, target matching observation data can be selected from the matching observation data corresponding to the first geomagnetic data sequence, the matching observation data 1 corresponding to the auxiliary first geomagnetic data sequence 1, and the matching observation data 2 corresponding to the auxiliary first geomagnetic data sequence 2.
[0163] In one possible implementation, the above-mentioned "selecting target matching observation data from the matching observation data corresponding to the first geomagnetic data sequence and the matching observation data corresponding to each auxiliary first geomagnetic data sequence" may include:
[0164] For each matched observation, the smallest matching cost parameter is determined and used as the representative cost parameter for the matched observation.
[0165] The matching observation data that corresponds to the minimum representative cost parameter is determined as the target matching observation data.
[0166] For each matched observation data point, the smallest matching cost parameter can be selected from the matching cost parameters included in the matched observation data point as the representative cost parameter corresponding to that matched observation data point. The representative cost parameter refers to the matching cost parameter that represents that matched observation data point, and it is used to indicate the matching cost corresponding to the optimal geomagnetic matching method in that matched observation data point.
[0167] Taking a set of 3 matching observation data as an example, we can determine the representative cost parameter corresponding to each of the 3 matching observation data. Furthermore, we can determine the matching observation data with the smallest representative cost parameter as the target matching observation data. That is, we can select the matching observation data corresponding to the smallest representative cost parameter from the 3 representative cost parameters as the target matching observation data.
[0168] As can be seen, by using the above method, corresponding matching observation data can be determined for the first geomagnetic data sequence corresponding to different speeds, and the target matching observation data most suitable for the current travel speed of the device to be located can be selected from these matching observation data. Then, the positioning result of the device to be located can be determined based on the target matching observation data, thereby realizing the adaptive determination of the positioning result according to the travel speed of the device to be located, and ensuring the accuracy of the positioning result.
[0169] As can be seen, to adapt to geomagnetic matching at different speeds, at least one auxiliary first geomagnetic data sequence can be determined using the above method. Furthermore, corresponding matching observation data can be determined based on the auxiliary first geomagnetic data sequence. Finally, matching observation data that meets preset requirements can be selected from the matching observation data corresponding to the first geomagnetic data sequence and the matching observation data corresponding to each auxiliary first geomagnetic data sequence as the target matching observation data. That is, matching observation data suitable for the current travel speed of the device to be located can be selected from the geomagnetic matching results at different speeds for subsequent geomagnetic positioning, reducing the influence of speed on the positioning results and improving the accuracy of the positioning results. At the same time, this positioning method does not require the use of other sensors to be applicable to geomagnetic positioning at different travel speeds, reducing the limitation of dependence on external sensors. This allows the positioning method to be independent of specific hardware configurations, reducing its need for complex sensor systems.
[0170] In one possible implementation, this application also provides a method for determining a first geomagnetic data sequence for a preset road segment. The implementation process of this method can be found in [reference needed]. Figure 7 , Figure 7 This is a flowchart illustrating the process of determining the first geomagnetic data sequence of a preset road segment, as provided in an embodiment of this application. Figure 7 As shown, the method includes the following steps:
[0171] S701: Obtain geomagnetic data sequences of preset road segments uploaded by multiple acquisition devices, and use them as multiple original sequences associated with the preset road segment.
[0172] The data acquisition device refers to a terminal device or vehicle containing a magnetometer module, which is used to collect geomagnetic data in a preset road segment. After the geomagnetic data is collected in the preset road segment by the triaxial magnetometer in the data acquisition device, the collected geomagnetic data can be converted into geomagnetic data in the northeast-northeast coordinate system, so that a geomagnetic data sequence can be formed based on the geomagnetic data collected by the data acquisition device.
[0173] Multiple data acquisition devices can upload geomagnetic data sequences collected in a predetermined road segment to a server. The server can then use these geomagnetic data sequences, each corresponding to the same predetermined road segment, as multiple raw sequences associated with that predetermined road segment. These multiple raw sequences associated with the predetermined road segment refer to the data basis used to determine the first geomagnetic data sequence (i.e., the standard geomagnetic data sequence) for that predetermined road segment.
[0174] It should be noted that before the server associates the acquired geomagnetic data sequence with multiple raw sequences for a preset road segment, it can filter these geomagnetic data sequences. For example, while uploading the geomagnetic data sequence, the acquisition device can also associate and upload the location information (such as GPS information) of the start and end points of the preset road segment. For the server, for a geomagnetic data sequence uploaded by an acquisition device, it can associate and store the location information of the start and end points of the preset road segment uploaded by that acquisition device with that geomagnetic data sequence. Because the satellite signal for geomagnetic positioning of the preset road segment is relatively weak, the location information acquired by the acquisition device may have signal delays, causing a deviation between the actual location of the preset road segment (the location information of the start and end points of the preset road segment) and the acquired location information, thus affecting the accuracy of the geomagnetic data associated with that location information. Therefore, the actual location information of a preset road segment can be extracted from the road network data. Based on the actual location information of the preset road segment, the location information of the preset road segment collected by the acquisition device can be filtered out. The location information of the preset road segment that does not match the actual location information (such as the distance between the actual location information and the actual location information is greater than a preset distance threshold) can be removed. In addition, the geomagnetic data sequence associated with the location information can be removed, thus completing the preliminary screening of multiple geomagnetic data sequences and ensuring the validity of the geomagnetic data sequences.
[0175] S702: Perform data cleaning and format standardization on multiple original sequences to obtain multiple candidate sequences associated with preset road segments.
[0176] After identifying multiple raw sequences associated with a preset road segment, data cleaning and format standardization can be performed on these raw sequences to obtain multiple candidate sequences associated with the preset road segment. These multiple candidate sequences refer to the options used to determine the first geomagnetic data sequence for that preset road segment; that is, a geomagnetic data sequence that meets preset requirements can be selected from the multiple candidate sequences associated with the preset road segment as the first geomagnetic data sequence.
[0177] Data cleaning is used to filter multiple raw sequences associated with a preset road segment, removing geomagnetic data sequences with obvious errors. Format standardization converts the cleaned raw sequences from time series to distance series, and then converts each distance series into a geomagnetic data sequence of the same length. In other words, the geomagnetic data sequences in the cleaned raw sequences are time series, with time intervals between different geomagnetic data points (e.g., 2 seconds between any two adjacent geomagnetic data points). After determining the length of the preset road segment, the raw sequences can be converted from time series to distance series, with distance intervals between different geomagnetic data points (e.g., 5 meters between any two adjacent geomagnetic data points). After converting the cleaned raw sequences into distance series, interpolation can be used to convert each distance series into a geomagnetic data sequence of the same length. Each geomagnetic data sequence of the same length can then be used as a candidate sequence for association with the preset road segment.
[0178] In one possible implementation, the step S702 above, "performing data cleaning and format standardization processing on multiple raw data sequences to obtain multiple candidate sequences associated with a preset road segment," may include:
[0179] For each original sequence, the qualification of the original sequence is determined based on at least one of the following: the length of the original sequence, the speed at which the acquisition device corresponding to the original sequence enters the preset road segment, the length of the preset road segment recorded in the road network data, and the variance of each geomagnetic data in the original sequence.
[0180] If the original sequence is valid, it is formatted to obtain the corresponding candidate sequence; if the original sequence is invalid, it is discarded.
[0181] The length of the raw sequence refers to the amount of geomagnetic data contained in it. The speed of the data acquisition device corresponding to the raw sequence when it enters the preset road segment can be obtained via GPS. The length of the preset road segment recorded in the road network data refers to the actual accurate length of that preset road segment recorded in the road network data.
[0182] The variance of each geomagnetic data point in the original sequence is used to measure the degree of deviation between each geomagnetic data point and its mean. For example, the variance of the original sequence can be obtained by substituting each geomagnetic data point into the formula for calculating the squared difference.
[0183] For each original sequence, its qualification can be determined based on at least one of the following: the length of the original sequence, the speed at which the acquisition device corresponding to the original sequence enters the preset road segment, the length of the preset road segment recorded in the road network data, and the variance of each geomagnetic data in the original sequence.
[0184] As an example, the length of the preset road segment corresponding to the original sequence can be calculated based on the length of the original sequence, the time interval between each geomagnetic data in the original sequence, and the speed at which the acquisition device corresponding to the original sequence enters the preset road segment. The length of the preset road segment is then compared with the length of the preset road segment recorded in the road network data. If the length difference between the two is greater than the preset length threshold, the original sequence is considered unqualified. If the length difference between the two is not greater than the preset length threshold, the original sequence is considered qualified.
[0185] As another example, the speed at which the acquisition device corresponding to the original sequence collects data in the preset road segment can be calculated based on the length of the original sequence, the time interval between each geomagnetic data in the original sequence, and the length of the preset road segment where the road network data is recorded. If the speed is greater than the preset speed threshold, the original sequence is considered unqualified; if the speed is not greater than the preset speed threshold, the original sequence is considered qualified.
[0186] As another example, the validity of the original sequence can be determined based on the variance of each geomagnetic data in the original sequence. If the variance of the original sequence is greater than a preset variance threshold, the original sequence is considered unqualified. If the variance of the original sequence is not greater than the preset variance threshold, the original sequence is considered qualified.
[0187] If the original sequence is qualified, it can be formatted, that is, the qualified original sequence can be converted from a time series to a distance series. Further, for the distance series of each qualified original sequence, interpolation is used to convert each qualified original sequence into a geomagnetic data sequence of the same length. Thus, each geomagnetic data sequence of the same length can be used as multiple candidate sequences for association with the preset road segments. If the original sequence is unqualified, it can be discarded.
[0188] Therefore, by verifying whether the length of the preset road segments is uniform, whether the speed exceeds the limit, and the variance fluctuation of the original sequence, the original sequence can be used to determine whether the original sequence associated with the preset road segments is qualified. If qualified, the original sequence can be further processed for format standardization to determine the candidate sequence associated with the preset road segments, thereby ensuring the accuracy and consistency of the candidate sequence associated with the preset road segments. If unqualified, the original sequence is discarded to save computing resources.
[0189] S703:8.
[0190] After identifying multiple candidate sequences associated with a preset road segment, the first geomagnetic data sequence of the preset road segment can be selected from the multiple candidate sequences according to preset requirements.
[0191] In one possible implementation, "selecting the first geomagnetic data sequence of the preset road segment from the plurality of candidate sequences" in S703 above may include:
[0192] For each candidate sequence, the corresponding measurement parameters are determined based on the autocorrelation coefficient between the candidate sequence and other candidate sequences.
[0193] The candidate sequence whose corresponding measurement parameters meet the preset measurement conditions is selected as the first geomagnetic data sequence of the preset road segment.
[0194] The autocorrelation coefficient is used to describe the correlation between candidate sequences at different time points. It can be calculated using the autocorrelation coefficient calculation formula. It should be understood that the smaller the autocorrelation coefficient between two candidate sequences, the higher the similarity between the two candidate sequences.
[0195] For each candidate sequence, it can be substituted into the autocorrelation coefficient calculation formula along with every other candidate sequence in the entire set of candidate sequences. The autocorrelation coefficient between this candidate sequence and each of the other candidate sequences can then be calculated. After calculating the autocorrelation coefficients, the average of these coefficients can be used as a measure parameter for the candidate sequence. This measure parameter indicates the likelihood that the candidate sequence will be the first geomagnetic data sequence.
[0196] Taking a preset road segment with four candidate sequences as an example, the autocorrelation coefficients between the first candidate sequence and the other three candidate sequences can be calculated separately. This yields three autocorrelation coefficients for the first candidate sequence. These three autocorrelation coefficients are then averaged, and the average value is used as the measurement parameter for the first candidate sequence. This process is repeated to calculate the measurement parameters for each candidate sequence associated with the preset road segment.
[0197] After determining the measurement parameters corresponding to each candidate sequence associated with a preset road segment, the candidate sequence whose measurement parameters satisfy a preset measurement condition can be selected as the first geomagnetic data sequence for that preset road segment. The preset measurement condition refers to the judgment criteria used to determine the first geomagnetic data sequence. When the measurement parameters corresponding to a candidate sequence satisfy the preset measurement condition, the candidate sequence is considered acceptable as the first geomagnetic data sequence. For example, the preset measurement condition could be to select the candidate sequence corresponding to the smallest measurement parameter as the first geomagnetic data sequence. Using this preset measurement condition as an example, the candidate sequence corresponding to the smallest measurement parameter among the candidate sequences associated with the preset road segment can be selected as the first geomagnetic data sequence for that preset road segment.
[0198] As can be seen, the above method can be used to select the candidate sequence with the highest similarity to other candidate sequences from multiple candidate sequences based on the autocorrelation coefficient between each candidate sequence. That is, the most representative candidate sequence is selected from multiple candidate sequences as the first geomagnetic data sequence (i.e., the standard geomagnetic data sequence). This ensures that the selected first geomagnetic data sequence can accurately characterize the geomagnetic characteristics of the preset road segment.
[0199] As can be seen, the above method allows for the collection of geomagnetic data sequences from multiple acquisition devices during daily travel along a predetermined road segment. This serves as a basis for identifying multiple original sequences associated with that segment, reducing both labor costs and data collection time. This facilitates the rapid accumulation of large amounts of geomagnetic data, enriching the original sequences associated with the predetermined road segment for geomagnetic positioning. Furthermore, the collected geomagnetic data sequences can be filtered based on the actual location information of the predetermined road segment within the road network data, thereby improving the accuracy of the original sequences associated with the predetermined road segment. Subsequently, data cleaning and format standardization processes can be performed on the multiple original sequences to remove those that do not meet the filtering requirements. Geomagnetic data sequences of the same length after format standardization can then be used as candidate sequences for associating the predetermined road segment. Finally, the most accurate and representative geomagnetic data sequence for the predetermined road segment can be selected from these candidate sequences.
[0200] In one possible implementation, the method provided in this application embodiment may further include:
[0201] The first geomagnetic data sequence was matched with each candidate sequence for features, and the recall and precision were determined based on the feature matching results.
[0202] If the recall rate meets the preset recall requirement and the accuracy rate meets the preset accuracy requirement, then the preset road segment is determined to be suitable for geomagnetic positioning based on the first geomagnetic data sequence.
[0203] Since preset road segments may not be suitable for positioning based on geomagnetic data, these segments can be filtered. Specifically, following the geomagnetic positioning algorithm described in S201-S205, the first geomagnetic data sequence is geomagnetically matched with each candidate sequence. This means the first geomagnetic data sequence can be divided into several sub-geomagnetic data sequences, which serve as the reference sequence (i.e., the second geomagnetic data sequence) in steps S201-S205. The candidate sequences that undergo feature matching with these sub-sequences are used as the baseline sequence (i.e., the first geomagnetic data sequence) in steps S201-S205. Then, geomagnetic positioning is performed according to steps S201-S205, determining the geomagnetic matching result between the sub-geomagnetic data sequences and the candidate sequences in the first geomagnetic data sequence. This geomagnetic matching result refers to the positioning result obtained by geomagnetic positioning based on the sub-geomagnetic data sequences and candidate sequences in the first geomagnetic data sequence, according to the positioning method.
[0204] Based on the geomagnetic matching results, recall and precision can be determined. The recall rate indicates the probability that the location result can be determined based on the matching probability distribution. That is, after determining the matching probability distribution between the sub-geomagnetic data sequences and candidate sequences in the first geomagnetic data sequence, the entropy quantization value corresponding to the matching probability distribution can be calculated, and it can be determined whether it belongs to the preset entropy threshold range. If it does, the location result can be determined based on the matching probability distribution, and at this time, it can be considered a successful recall. Therefore, the probability of the above-mentioned successful recall event occurring during the geomagnetic matching process between the first geomagnetic data sequence and each candidate sequence can be determined as the recall rate.
[0205] Accuracy is used to indicate the accuracy of the index of each target geomagnetic data in its corresponding candidate sequence during geomagnetic positioning based on sub-geomagnetic data sequences and candidate sequences in the first geomagnetic data sequence. During geomagnetic positioning based on sub-geomagnetic data sequences and candidate sequences in the first geomagnetic data sequence, target geomagnetic data in the candidate sequence that meets preset matching conditions with the last geomagnetic data in the sub-geomagnetic data sequence can be identified. After identifying the target geomagnetic data between the candidate sequence and the sub-geomagnetic data sequence, the index of the target geomagnetic data in its respective candidate sequence can be determined. Then, the index of the target geomagnetic data in its respective candidate sequence can be compared with the index of the last geomagnetic data in the sub-geomagnetic data sequence in the first geomagnetic data sequence. Based on the comparison result between the two indices, the accuracy of the current positioning result can be determined. If the two indices are the same or the difference between the two indices is within a preset difference range, the positioning result is considered accurate. If the two indices are different or the difference between the two indices exceeds the preset difference range, the positioning result is considered inaccurate. Furthermore, the accuracy of the above-mentioned positioning results can be determined during the geomagnetic matching process between the first geomagnetic data sequence and each candidate sequence.
[0206] After determining the recall and precision, if the recall meets a preset recall requirement and the precision meets a preset precision requirement, then the preset road segment can be determined to be suitable for geomagnetic positioning based on the first geomagnetic data sequence. The preset recall requirement can be, for example, a recall rate greater than a preset recall rate threshold. The preset precision requirement can be, for example, a precision rate greater than a preset precision rate threshold. That is, if both the recall and precision are greater than the preset recall and precision thresholds, then the current preset road segment can be determined to be suitable for geomagnetic positioning based on the first geomagnetic data sequence; otherwise, it can be determined that the current preset road segment is not suitable for geomagnetic positioning based on the first geomagnetic data sequence.
[0207] Therefore, by using the above method, the geomagnetic matching results between the first geomagnetic data sequence and each candidate sequence are calculated. Furthermore, the recall and precision can be determined based on the geomagnetic matching results; that is, the recall and precision for geomagnetic positioning of a preset road segment based on the first geomagnetic data sequence can be determined based on the geomagnetic matching results. If the recall meets the preset recall requirement and the precision meets the preset precision requirement, then the current preset road segment can be determined to be suitable for geomagnetic positioning based on the first geomagnetic data sequence. This allows for the evaluation of whether the preset road segment is suitable for executing the positioning method from different perspectives, ensuring the executability of the positioning method for geomagnetic positioning of the preset road segment.
[0208] In one possible implementation, the method provided in this application embodiment may further include:
[0209] For each candidate sequence, a weighting factor is determined based on the length of the candidate sequence and the collection time.
[0210] When the number of candidate sequences associated with a preset road segment exceeds the preset number of sequences, the candidate sequences associated with the preset road segment are filtered according to the weight factor corresponding to each candidate sequence.
[0211] The length of a candidate sequence refers to the amount of geomagnetic data it contains. It should be noted that each candidate sequence is, by default, composed of geomagnetic data collected while traveling at a constant speed.
[0212] For each candidate sequence, a weight factor can be determined according to the length of the candidate sequence and its corresponding acquisition time using a preset weight factor mapping method. This weight factor is used to measure whether the candidate sequence needs to be filtered. That is, when the weight factor of a candidate sequence is less than a preset threshold, the candidate sequence is considered to need to be filtered; conversely, if the weight factor of the candidate sequence is not less than the preset threshold, the candidate sequence is considered not to need to be filtered.
[0213] For example, the preset weight factor mapping method can be as follows: when the length of the candidate sequence is within a preset length threshold range, the earlier the candidate sequence is collected, the smaller the weight factor of the candidate sequence; conversely, when the length of the candidate sequence is within the preset length threshold range, the later the candidate sequence is collected, the larger the weight factor of the candidate sequence. This application does not specifically limit the method for determining the weight factor corresponding to the candidate sequence.
[0214] When the number of candidate sequences associated with a preset road segment exceeds the preset number of sequences, the candidate sequences can be filtered based on their respective weight factors. For example, when the number of candidate sequences associated with a preset road segment exceeds the preset number of sequences, the candidate sequence with the lowest weight factor or the candidate sequence with a weight factor lower than a preset weight factor threshold can be selected as the candidate sequence to be filtered, thus removing it from the candidate sequences associated with the preset road segment. Alternatively, the weight factors of each candidate sequence can be sorted in descending order, and then the candidate sequence with the weight factor that appears after the preset order can be selected as the candidate sequence to be filtered, thus removing it from the candidate sequences associated with the preset road segment.
[0215] It should be noted that after filtering the candidate sequences associated with the preset road segment, the first geomagnetic data sequence corresponding to the preset road segment can be determined again based on the filtered candidate sequences, and then the positioning method can be executed based on the first geomagnetic data sequence.
[0216] Therefore, the above method allows setting corresponding weight factors for each candidate sequence. When the number of candidate sequences associated with a preset road segment exceeds the preset number of sequences, the candidate sequences to be filtered can be selected from the candidate sequences associated with the preset road segment based on their respective weight factors. It is evident that the above method can determine the importance of each candidate sequence based on weight factors, and then filter out candidate sequences with lower importance based on their importance, thus saving storage resources. Simultaneously, it can ensure the real-time performance of the standard geomagnetic data sequence corresponding to the preset road segment.
[0217] Finally, a general example explanation is provided using the positioning method; please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of the positioning method provided in this application embodiment. The diagram includes geomagnetic data feedback (i.e., determining the geomagnetic data sequence), geomagnetic fingerprint selection and updating (i.e., determining the standard geomagnetic data sequence for the geomagnetic positioning segment and updating the candidate sequence associated with the geomagnetic positioning segment), a geomagnetic positioning algorithm, and determining the positioning result. The geomagnetic data feedback mainly includes data input and intermediate result generation. Data input primarily includes geomagnetic data transmission, i.e., collecting the geomagnetic data sequence of a preset road segment through multiple acquisition devices. Furthermore, the location information of the preset road segment can also be collected through multiple acquisition devices. Taking a tunnel as an example, the location information of the tunnel and the exit location information can be determined through the GPS system of multiple acquisition devices. After determining the above location information and geomagnetic data sequence, the location information of the preset road segment and the geomagnetic data sequence can be associated.
[0218] The selection and updating of geomagnetic fingerprints can be mainly divided into the generation of the first geomagnetic data sequence for a preset road segment, weight allocation, and dynamic updating. The generation of the first geomagnetic data sequence for the preset road segment can first involve filtering out erroneous sequences from multiple original sequences associated with the preset road segment. For example, obviously erroneous geomagnetic data in the original sequences can be filtered based on the actual location information of the preset road segment recorded in the road network data to determine the valid original sequences. Then, data cleaning and format standardization processing can be performed on the multiple original sequences associated with the preset road segment to obtain multiple candidate sequences. Further, a corresponding weight factor can be determined for each candidate sequence, based on factors such as the length of the candidate sequence, acquisition speed, sequence completeness, and acquisition time. When the number of candidate sequences associated with the preset road segment exceeds the preset number of sequences, the candidate sequences associated with the preset road segment can be filtered according to their respective weight factors, thereby updating the candidate sequences associated with the preset road segment. Finally, the first geomagnetic data sequence for the preset road segment can be selected from these multiple new candidate sequences.
[0219] The geomagnetic positioning algorithm mainly includes subsequence matching (i.e., determining matching observation data), discrete Bayesian filtering, and matching point recall (i.e., determining target geomagnetic data). Subsequence matching primarily involves constructing a sequence segment corresponding to each item of second geomagnetic data in the second geomagnetic data sequence using a sliding window. Then, based on the sequence segment, the second feature vector of the second geomagnetic data can be determined, and the second feature vector of each item in the second geomagnetic data sequence is used to form the second data feature. Correspondingly, a sequence segment corresponding to each item of first geomagnetic data within a preset geomagnetic data range in the first geomagnetic data sequence can be constructed using a sliding window. Then, based on the sequence segment, the first feature vector of the first geomagnetic data can be determined, and the first feature vector of each item in the preset geomagnetic data range is used to form the first data feature. Afterwards, the feature distance between the first and second data features can be calculated using the Euclidean distance algorithm. Furthermore, based on the feature distance between the first and second data features, the matching observation data can be determined using the DTW algorithm.
[0220] Discrete Bayesian filters are primarily used to convert matched observation data into a matched probability distribution. Specifically, based on the prior probability distribution and a preset transition vector, a prior transition distribution can be determined. Furthermore, the discrete Bayesian algorithm can be used to calculate the posterior probability distribution based on the prior transition distribution and the matched observation data, and this posterior probability distribution can be used as the matched probability distribution. When the second geomagnetic data sequence is not the first second geomagnetic data sequence, the posterior probability distribution of the previous second geomagnetic data sequence can be used as the prior probability distribution of this second geomagnetic data sequence.
[0221] Match point recall mainly involves determining whether a match point falls within a preset entropy threshold range by using the entropy quantization value corresponding to the matching probability distribution. If it falls within the preset entropy threshold range, the target geomagnetic data in the first geomagnetic data sequence that meets the preset matching conditions with the last item in the time sequence, the second geomagnetic data, can be determined based on the matching probability distribution. For example, the first geomagnetic data corresponding to the highest matching probability in the matching probability distribution can be used as the target geomagnetic data. If the match point does not fall within the preset entropy threshold range, the target geomagnetic data determined based on the matching probability distribution is abandoned.
[0222] The determination of the positioning result can be mainly divided into data input and output matching results and location. Among them, the data input includes obtaining the first geomagnetic data sequence of the preset road segment in advance, obtaining the location information of the representative points of the preset road segment, and obtaining the index of the target geomagnetic data in the first geomagnetic data sequence. Then, based on the index of the target geomagnetic data in the first geomagnetic data sequence, the number of first geomagnetic data in the first geomagnetic data sequence, and the location information of the representative points, the positioning result of the device to be positioned can be determined, thereby completing the matching and recall of positioning results based on geomagnetic data.
[0223] Based on the positioning method provided in the preceding embodiments, this application also provides a positioning device. The following, in conjunction with... Figure 9 To explain, Figure 9 This is a schematic diagram of the positioning device 900 provided in an embodiment of this application. The device includes:
[0224] The acquisition module 901 is used to acquire a first geomagnetic data sequence of a preset road segment and a second geomagnetic data sequence collected by the device to be located for the preset road segment. The first geomagnetic data sequence includes multiple first geomagnetic data and the second geomagnetic data sequence includes multiple second geomagnetic data.
[0225] The feature determination module 902 is used to determine the first data feature of the first geomagnetic data sequence and the second data feature of the second geomagnetic data sequence. The first data feature includes a first feature vector of each first geomagnetic data item within a preset geomagnetic data range, and the second data feature includes a second feature vector of each second geomagnetic data item in the second geomagnetic data sequence.
[0226] The matching observation module 903 is used to determine the feature difference between the first data feature and the second data feature, and to determine matching observation data based on the feature difference. The matching observation data includes the matching cost corresponding to each of the various pairing methods between multiple first geomagnetic data and multiple second geomagnetic data within the preset geomagnetic data range.
[0227] The conversion module 904 is used to determine a matching probability distribution based on the matching observation data. The matching probability distribution includes the matching probability of each of the multiple first geomagnetic data in the first geomagnetic data sequence with the last second geomagnetic data in the second geomagnetic data sequence in terms of time sequence.
[0228] The result determination module 905 is used to determine, based on the matching probability distribution, target geomagnetic data that meets preset matching conditions with the last item of the second geomagnetic data in the time series from the plurality of first geomagnetic data; and to determine the positioning result of the device to be located according to the index of the target geomagnetic data in the first geomagnetic data sequence.
[0229] Optionally, the feature determination module 902 includes:
[0230] The first construction unit is used to construct a sequence segment corresponding to the first geomagnetic data for each first geomagnetic data within the preset geomagnetic data range, using the first geomagnetic data and first geomagnetic data in the first geomagnetic data sequence whose interval with the first geomagnetic data is less than a preset interval threshold; and to determine the first data feature vector of the first geomagnetic data based on the sequence segment corresponding to the first geomagnetic data.
[0231] A combination unit is used to combine the first feature vectors of multiple first geomagnetic data within the preset geomagnetic data range to form the first data feature.
[0232] The second construction unit is used to construct a sequence segment corresponding to the second geomagnetic data for each second geomagnetic data item in the second geomagnetic data sequence, using the second geomagnetic data and second geomagnetic data in the second geomagnetic data sequence whose interval with the second geomagnetic data is less than a preset interval threshold; and to determine the second feature vector of the second geomagnetic data based on the sequence segment corresponding to the second geomagnetic data.
[0233] The combination unit is used to combine the second feature vectors of each second geomagnetic data item in the second geomagnetic data sequence to form the second data feature.
[0234] Optionally, the first building unit includes:
[0235] The first calculation unit is used to calculate the derivative features of the sequence segment corresponding to the first geomagnetic data based on each of the first geomagnetic data in the sequence segment corresponding to the first geomagnetic data, and use them as the first feature vector of the first geomagnetic data.
[0236] The second building unit includes:
[0237] The second calculation unit is used to calculate the derivative features of the sequence segment corresponding to the second geomagnetic data based on each item of the second geomagnetic data in the sequence segment corresponding to the second geomagnetic data, and use it as the second feature vector of the second geomagnetic data.
[0238] Optionally, the second geomagnetic data sequence includes a first preset number of second geomagnetic data, and the second geomagnetic data sequence is updated as the second geomagnetic data collected by the device to be located is updated; the device further includes the following unit for determining the preset geomagnetic data range:
[0239] The first range determination unit is used to form the preset geomagnetic data range by using the first geomagnetic data of the first geomagnetic data sequence with the first sorted first geomagnetic data sequence and the second preset number when the second geomagnetic data sequence is the first second geomagnetic data sequence. The first second geomagnetic data sequence is composed of the first group of the first preset number of second geomagnetic data collected by the device to be located, and the second preset number is greater than the first preset number.
[0240] The second range determination unit is used to determine the preset geomagnetic data range in the first geomagnetic data sequence according to the matching probability distribution generated in the process of determining the positioning result based on the (i-1)th second geomagnetic data sequence when the second geomagnetic data sequence is the i-th second geomagnetic data sequence, where i is an integer greater than 1, and the i-th second geomagnetic data sequence is updated based on the (i-1)th second geomagnetic data sequence.
[0241] Optionally, the feature difference is a feature distance, which is a distance matrix with a size of m*n, where m is the number of second geomagnetic data in the second geomagnetic data sequence, and n is the number of first geomagnetic data within the preset geomagnetic data range. The element in the j-th row and k-th column of the distance matrix represents the distance between the second feature vector of the j-th second geomagnetic data in the second geomagnetic data sequence and the first feature vector of the k-th first geomagnetic data within the preset geomagnetic data range, where j is an integer greater than or equal to 1 and less than or equal to m, and k is an integer greater than or equal to 1 and less than or equal to n.
[0242] The matching observation module 903 includes:
[0243] The second calculation unit is used to calculate the cost matrix based on the distance matrix using a matching cost algorithm. The cost matrix has a size of m*n.
[0244] The matching observation data determination unit is used to take the element of the last row in the cost matrix as the matching observation data.
[0245] Optionally, the conversion module 904 includes:
[0246] The prior transition distribution determination unit is used to determine the prior transition distribution based on the prior probability distribution and the preset transition vector.
[0247] The third calculation unit is used to calculate the posterior probability distribution based on the prior transition distribution and the matched observation data using the discrete Bayesian algorithm, and use it as the matching probability distribution.
[0248] Wherein, when the second geomagnetic data sequence is the first second geomagnetic data sequence, the prior probability distribution is a preset probability distribution, and the first second geomagnetic data sequence is composed of the first set of a first preset number of second geomagnetic data collected by the device to be located; when the second geomagnetic data sequence is the i-th second geomagnetic data sequence, the prior probability distribution is the matching probability distribution generated in the process of determining the positioning result based on the (i-1)-th second geomagnetic data sequence, where i is an integer greater than 1, and the i-th second geomagnetic data sequence is updated based on the (i-1)-th second geomagnetic data sequence.
[0249] Optionally, the device further includes:
[0250] An interpolation processing unit is used to perform interpolation processing on the first geomagnetic data sequence to obtain at least one auxiliary first geomagnetic data sequence.
[0251] The first auxiliary data feature determination unit is used to determine the first auxiliary data feature corresponding to each of the auxiliary first geomagnetic data sequences; the first auxiliary data feature includes the first feature vector of each first geomagnetic data within a preset geomagnetic data range in the auxiliary first geomagnetic data sequence.
[0252] The feature distance determination unit is used to determine the feature difference between the second data feature and the first auxiliary data feature corresponding to the auxiliary first geomagnetic data sequence for each auxiliary first geomagnetic data sequence, and to determine the matching observation data corresponding to the auxiliary first geomagnetic data sequence based on the feature difference;
[0253] The first target matching observation data determination unit is used to select target matching observation data from the matching observation data corresponding to the first geomagnetic data sequence and the matching observation data corresponding to each of the auxiliary first geomagnetic data sequences; the target matching observation data will be used to determine the matching probability distribution.
[0254] Optionally, the first target matching observation data determination unit includes:
[0255] The representative cost parameter determination unit is used to determine the smallest matching cost parameter for each of the matched observation data, and use it as the representative cost parameter corresponding to the matched observation data.
[0256] The first target matching observation data determination unit is used to determine the matching observation data with the minimum representative cost parameter as the target matching observation data.
[0257] Optionally, the device further includes:
[0258] An entropy quantization value determination unit is used to determine the entropy quantization value corresponding to the matching probability distribution;
[0259] The matching geomagnetic data determination unit is configured to, if the entropy quantization value is within a preset entropy threshold range, perform the step of determining, based on the matching probability distribution, target geomagnetic data that satisfies a preset matching condition between the target geomagnetic data and the last item of the second geomagnetic data in the time series; if the entropy quantization value exceeds the preset entropy threshold range, abandon the step of determining, based on the matching probability distribution, target geomagnetic data that satisfies a preset matching condition between the target geomagnetic data and the last item of the second geomagnetic data in the time series.
[0260] Optionally, the result determination module 905 includes:
[0261] The first acquisition unit is used to acquire the location information of a representative point of the preset road segment; the representative point includes at least one of the start point and the end point of the preset road segment;
[0262] The positioning result determination unit is used to determine the positioning result of the device to be positioned based on the index of the target geomagnetic data in the first geomagnetic data sequence, the number of the first geomagnetic data in the first geomagnetic data sequence, and the location information of the representative point.
[0263] Optionally, the acquisition module 901 includes:
[0264] The second acquisition unit is used to acquire the first geomagnetic data sequence of the preset road segment if, based on the satellite positioning information of the device to be located, the distance between the device to be located and the preset road segment is less than a preset distance threshold.
[0265] or,
[0266] The third acquisition unit is used to acquire the first geomagnetic data sequence of the preset road segment if it is determined that the navigation route of the device to be located includes the preset road segment.
[0267] Optionally, the device further includes the following unit for determining a first geomagnetic data sequence for the preset road segment:
[0268] The fourth acquisition unit is used to acquire the geomagnetic data sequence of the preset road segment uploaded by multiple acquisition devices, as multiple original sequences associated with the preset road segment;
[0269] The candidate sequence determination unit is used to perform data cleaning and format standardization processing on the multiple original data sequences to obtain multiple candidate sequences associated with the preset road segment;
[0270] The first selection unit is used to select the first geomagnetic data sequence of the preset road segment from the plurality of candidate sequences.
[0271] Optionally, the candidate sequence determination unit includes:
[0272] The qualification determination unit is used to determine whether the original sequence is qualified for each original sequence based on at least one of the following: the length of the original sequence, the speed of the acquisition device corresponding to the original sequence when it enters the preset road segment, the length of the preset road segment recorded in the road network data, and the variance of each geomagnetic data in the original sequence.
[0273] The format specification processing unit is used to perform format specification processing on the original sequence if the original sequence is qualified, to obtain the corresponding candidate sequence; if the original sequence is unqualified, the original sequence is discarded.
[0274] Optionally, the first selection unit includes:
[0275] The measurement parameter determination unit is used to determine the measurement parameter corresponding to each candidate sequence based on the autocorrelation coefficient between the candidate sequence and other candidate sequences.
[0276] The second selection unit is used to select candidate sequences whose corresponding measurement parameters meet preset measurement conditions, as the first geomagnetic data sequence of the preset road segment.
[0277] Optionally, the device further includes:
[0278] A feature matching unit is used to perform feature matching between the first geomagnetic data sequence and each of the candidate sequences respectively, and determine the recall rate and precision based on the feature matching results.
[0279] A geomagnetic positioning segment determination unit is used to determine that the preset segment is suitable for geomagnetic positioning based on the first geomagnetic data sequence if the recall rate meets a preset recall requirement and the accuracy rate meets a preset accuracy requirement.
[0280] Optionally, the device further includes:
[0281] The weight factor determination unit is used to determine the weight factor corresponding to each candidate sequence based on the length of the candidate sequence and the acquisition time.
[0282] The filtering processing unit is used to filter the candidate sequences associated with the preset road segment according to the weight factor corresponding to each candidate sequence when the number of candidate sequences associated with the preset road segment exceeds the preset number of sequences.
[0283] This application also provides a computer device, which may specifically be a terminal device or a server. The terminal device and server provided in this application will be described below from the perspective of hardware implementation.
[0284] See Figure 10 , Figure 10 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. For example... Figure 10 As shown, for ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. The terminal can be any terminal device including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a computer as an example:
[0285] Figure 10 This is a block diagram illustrating a portion of the structure of a computer associated with the terminal provided in an embodiment of this application. (Reference) Figure 10 The computer includes: a radio frequency (RF) circuit 1210, a memory 1220, an input unit 1230 (including a touch panel 1231 and other input devices 1232), a display unit 1240 (including a display panel 1241), a sensor 1250, an audio circuit 1260 (connected to a speaker 1261 and a microphone 1262), a wireless fidelity (WiFi) module 1270, a processor 1280, and a power supply 1290, etc. Those skilled in the art will understand that... Figure 10 The computer architecture shown does not constitute a limitation on the computer and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0286] The memory 1220 can be used to store software programs and modules. The processor 1280 executes various computer functions and data processing by running the software programs and modules stored in the memory 1220. The memory 1220 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer (such as audio data, telephone directory, etc.). In addition, the memory 1220 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0287] The processor 1280 is the control center of the computer, connecting various parts of the computer through various interfaces and lines. It performs various computer functions and processes data by running or executing software programs and / or modules stored in the memory 1220, and by calling data stored in the memory 1220. Optionally, the processor 1280 may include one or more processing units; preferably, the processor 1280 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 1280.
[0288] In this embodiment of the application, the processor 1280 included in the terminal is used to execute the steps in the positioning method described in the foregoing embodiments.
[0289] See Figure 11 , Figure 11 This is a schematic diagram of the structure of a server 1300 provided in an embodiment of this application. The server 1300 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 1322 (e.g., one or more processors) and memory 1332, and one or more storage media 1330 (e.g., one or more mass storage devices) for storing application programs 1342 or data 1344. The memory 1332 and storage media 1330 can be temporary or persistent storage. The program stored in the storage media 1330 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 1322 may be configured to communicate with the storage media 1330 and execute the series of instruction operations stored in the storage media 1330 on the server 1300.
[0290] Server 1300 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input / output interfaces 1358, and / or one or more operating systems, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0291] The steps performed by the server in the above embodiments can be based on this Figure 11 The server structure shown is illustrated. The CPU 1322 is used to execute the steps in the positioning methods described in the foregoing embodiments.
[0292] This application also provides a computer-readable storage medium for storing a computer program that performs the steps in the positioning methods described in the foregoing embodiments.
[0293] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of the positioning methods described in the foregoing embodiments.
[0294] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0295] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0296] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0297] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0298] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0299] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0300] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0301] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A positioning method, characterized in that, The method includes: Acquire a first geomagnetic data sequence for a preset road segment, and acquire a second geomagnetic data sequence collected by the device to be located for the preset road segment. The first geomagnetic data sequence includes multiple first geomagnetic data, and the second geomagnetic data sequence includes multiple second geomagnetic data. Determine a first data feature of the first geomagnetic data sequence and a second data feature of the second geomagnetic data sequence. The first data feature includes a first feature vector of each first geomagnetic data item within a preset geomagnetic data range. The second data feature includes a second feature vector of each second geomagnetic data item in the second geomagnetic data sequence. Determine the feature difference between the first data feature and the second data feature, and determine matching observation data based on the feature difference. The matching observation data includes the matching cost corresponding to each of the various pairing methods between multiple first geomagnetic data and multiple second geomagnetic data within the preset geomagnetic data range. Based on the matching observation data, a matching probability distribution is determined, which includes the matching probability of each of the multiple first geomagnetic data in the first geomagnetic data sequence with the last second geomagnetic data in the second geomagnetic data sequence in terms of time sequence. Based on the matching probability distribution, target geomagnetic data that meets the preset matching conditions with the last item of the second geomagnetic data in the time series is determined from the plurality of first geomagnetic data; The positioning result of the device to be located is determined based on the index of the target geomagnetic data in the first geomagnetic data sequence.
2. The method according to claim 1, characterized in that, Determining the first data feature of the first geomagnetic data sequence and the second data feature of the second geomagnetic data sequence includes: For each first geomagnetic data item within the preset geomagnetic data range, a sequence segment corresponding to the first geomagnetic data is constructed using the first geomagnetic data and the first geomagnetic data in the first geomagnetic data sequence whose interval with the first geomagnetic data is less than a preset interval threshold; and a first feature vector of the first geomagnetic data is determined based on the sequence segment corresponding to the first geomagnetic data. The first data feature is formed by using the first feature vectors of each of the multiple first geomagnetic data within the preset geomagnetic data range; For each second geomagnetic data item in the second geomagnetic data sequence, a sequence segment corresponding to the second geomagnetic data is constructed using the second geomagnetic data and other second geomagnetic data items in the second geomagnetic data sequence whose interval with the second geomagnetic data is less than a preset interval threshold; and a second feature vector of the second geomagnetic data is determined based on the sequence segment corresponding to the second geomagnetic data. The second data feature is formed by using the second feature vector of each second geomagnetic data item in the second geomagnetic data sequence.
3. The method according to claim 2, characterized in that, Determining the first feature vector of the first geomagnetic data based on the sequence segment corresponding to the first geomagnetic data includes: Based on each of the first geomagnetic data in the sequence segment corresponding to the first geomagnetic data, the derivative features of the sequence segment corresponding to the first geomagnetic data are calculated and used as the first feature vector of the first geomagnetic data. The step of determining the second feature vector of the second geomagnetic data based on the sequence segment corresponding to the second geomagnetic data includes: Based on each of the second geomagnetic data items in the sequence segment corresponding to the second geomagnetic data, the derivative features of the sequence segment corresponding to the second geomagnetic data are calculated and used as the second feature vector of the second geomagnetic data.
4. The method according to any one of claims 1 to 3, characterized in that, The second geomagnetic data sequence includes a first preset number of second geomagnetic data points, and the second geomagnetic data sequence is updated as the second geomagnetic data collected by the device to be located is updated; the preset geomagnetic data range is determined in the following way: When the second geomagnetic data sequence is the first second geomagnetic data sequence, the preset geomagnetic data range is formed by using the first geomagnetic data that ranks first in the first geomagnetic data sequence and the second preset number of first geomagnetic data. The first second geomagnetic data sequence is composed of the first set of the first preset number of second geomagnetic data collected by the device to be located, and the second preset number is greater than the first preset number. When the second geomagnetic data sequence is the i-th second geomagnetic data sequence, the preset geomagnetic data range is determined in the first geomagnetic data sequence according to the matching probability distribution generated in the process of determining the positioning result based on the (i-1)-th second geomagnetic data sequence, where i is an integer greater than 1, and the i-th second geomagnetic data sequence is updated based on the (i-1)-th second geomagnetic data sequence.
5. The method according to any one of claims 1 to 4, characterized in that, The feature difference is the feature distance, which is a distance matrix with a size of m*n. Here, m is the number of second geomagnetic data in the second geomagnetic data sequence, and n is the number of first geomagnetic data within the preset geomagnetic data range. The element in the j-th row and k-th column of the distance matrix represents the distance between the second feature vector of the j-th second geomagnetic data in the second geomagnetic data sequence and the first feature vector of the k-th first geomagnetic data within the preset geomagnetic data range. Here, j is an integer greater than or equal to 1 and less than or equal to m, and k is an integer greater than or equal to 1 and less than or equal to n. The process of determining matching observation data based on the feature differences includes: Using a matching cost algorithm, a cost matrix is calculated based on the distance matrix, and the cost matrix has a size of m*n. The elements of the last row in the cost matrix are used as the matched observation data.
6. The method according to any one of claims 1 to 5, characterized in that, Determining the matching probability distribution based on the matching observation data includes: Determine the prior transition distribution based on the prior probability distribution and the preset transition vector; Using the discrete Bayesian algorithm, a posterior probability distribution is calculated based on the prior transition distribution and the matched observation data, which is then used as the matching probability distribution. Wherein, when the second geomagnetic data sequence is the first second geomagnetic data sequence, the prior probability distribution is a preset probability distribution, and the first second geomagnetic data sequence is composed of the first set of a first preset number of second geomagnetic data collected by the device to be located; when the second geomagnetic data sequence is the i-th second geomagnetic data sequence, the prior probability distribution is the matching probability distribution generated in the process of determining the positioning result based on the (i-1)-th second geomagnetic data sequence, where i is an integer greater than 1, and the i-th second geomagnetic data sequence is updated based on the (i-1)-th second geomagnetic data sequence.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Interpolate the first geomagnetic data sequence to obtain at least one auxiliary first geomagnetic data sequence; Determine a first auxiliary data feature for each of the auxiliary first geomagnetic data sequences; the first auxiliary data feature includes a first feature vector for each first geomagnetic data item within a preset geomagnetic data range in the auxiliary first geomagnetic data sequence; For each of the auxiliary first geomagnetic data sequences, the feature difference between the second data feature and the first auxiliary data feature of the auxiliary first geomagnetic data sequence is determined, and the matching observation data corresponding to the auxiliary first geomagnetic data sequence is determined based on the feature difference; Target matching observation data is selected from the matching observation data corresponding to the first geomagnetic data sequence and the matching observation data corresponding to each of the auxiliary first geomagnetic data sequences; the target matching observation data will be used to determine the matching probability distribution.
8. The method according to claim 7, characterized in that, The step of selecting target matching observation data from the matching observation data corresponding to the first geomagnetic data sequence and the matching observation data corresponding to each of the auxiliary first geomagnetic data sequences includes: For each of the matched observation data, the smallest matching cost parameter is determined as the representative cost parameter corresponding to the matched observation data; The matching observation data with the minimum representative cost parameter is determined and used as the target matching observation data.
9. The method according to any one of claims 1 to 8, characterized in that, Before determining, based on the matching probability distribution, the target geomagnetic data that satisfies a preset matching condition with the last item of the second geomagnetic data in the time series from the plurality of first geomagnetic data, the method further includes: Determine the entropy quantization value corresponding to the matching probability distribution; If the entropy quantization value is within a preset entropy threshold range, then the process of determining the target geomagnetic data that satisfies the preset matching condition between the multiple first geomagnetic data and the last second geomagnetic data in the time series based on the matching probability distribution is executed; if the entropy quantization value exceeds the preset entropy threshold range, then the process of determining the target geomagnetic data that satisfies the preset matching condition between the multiple first geomagnetic data and the last second geomagnetic data in the time series based on the matching probability distribution is abandoned.
10. The method according to any one of claims 1 to 9, characterized in that, The step of determining the positioning result of the device to be located based on the index of the target geomagnetic data in the first geomagnetic data sequence includes: Obtain the location information of representative points of the preset road segment; the representative points include at least one of the start and end points of the preset road segment; The positioning result of the device to be located is determined based on the index of the target geomagnetic data in the first geomagnetic data sequence, the number of the first geomagnetic data in the first geomagnetic data sequence, and the location information of the representative point.
11. The method according to any one of claims 1 to 10, characterized in that, The acquisition of the first geomagnetic data sequence of the preset road segment includes: Before the device to be located reaches the preset road segment, if it is determined, based on the satellite positioning information of the device to be located, that the distance between the device to be located and the preset road segment is less than a preset distance threshold, then the first geomagnetic data sequence of the preset road segment is obtained; or, If it is determined that the navigation route of the device to be located includes the preset road segment, then the first geomagnetic data sequence of the preset road segment is obtained.
12. The method according to any one of claims 1 to 11, characterized in that, The first geomagnetic data sequence of the preset road segment is determined in the following way: The geomagnetic data sequences of the preset road segment uploaded by multiple acquisition devices are obtained as multiple original sequences associated with the preset road segment; Data cleaning and format standardization are performed on the multiple original data sequences to obtain multiple candidate sequences associated with the preset road segments; Among the multiple candidate sequences, the first geomagnetic data sequence of the preset road segment is selected.
13. The method according to claim 12, characterized in that, The process of cleaning and format standardizing the multiple original data sequences yields multiple candidate sequences associated with the preset road segments, including: For each of the original sequences, the qualification of the original sequence is determined based on at least one of the following: the length of the original sequence, the speed at which the acquisition device corresponding to the original sequence enters the preset road segment, the length of the preset road segment recorded in the road network data, and the variance of each geomagnetic data in the original sequence. If the original sequence is qualified, the original sequence is processed for format standardization to obtain the corresponding candidate sequence; if the original sequence is unqualified, the original sequence is discarded.
14. The method according to claim 12 or 13, characterized in that, The step of selecting the first geomagnetic data sequence for the preset road segment from the plurality of candidate sequences includes: For each candidate sequence, a measurement parameter corresponding to the candidate sequence is determined based on the autocorrelation coefficient between the candidate sequence and other candidate sequences. The candidate sequence whose corresponding measurement parameters meet the preset measurement conditions is selected as the first geomagnetic data sequence of the preset road segment.
15. The method according to any one of claims 12 to 14, characterized in that, The method further includes: The first geomagnetic data sequence is matched with each of the candidate sequences, and the recall and precision are determined based on the feature matching results. If the recall rate meets the preset recall requirement and the accuracy rate meets the preset accuracy requirement, then the preset road segment is determined to be suitable for geomagnetic positioning based on the first geomagnetic data sequence.
16. The method according to any one of claims 12 to 15, characterized in that, The method further includes: For each candidate sequence, a weighting factor is determined based on the length of the candidate sequence and the acquisition time. When the number of candidate sequences associated with the preset road segment exceeds the preset number of sequences, the candidate sequences associated with the preset road segment are filtered according to the weight factor corresponding to each candidate sequence.
17. A positioning device, characterized in that, The device includes: The acquisition module is used to acquire a first geomagnetic data sequence of a preset road segment and a second geomagnetic data sequence collected by the device to be located for the preset road segment. The first geomagnetic data sequence includes multiple first geomagnetic data and the second geomagnetic data sequence includes multiple second geomagnetic data. The feature determination module is used to determine a first data feature of the first geomagnetic data sequence and a second data feature of the second geomagnetic data sequence. The first data feature includes a first feature vector of each first geomagnetic data item within a preset geomagnetic data range, and the second data feature includes a second feature vector of each second geomagnetic data item in the second geomagnetic data sequence. A matching observation module is used to determine the feature difference between the first data feature and the second data feature, and to determine matching observation data based on the feature difference. The matching observation data includes the matching cost corresponding to each of the various pairing methods between multiple first geomagnetic data and multiple second geomagnetic data within the preset geomagnetic data range. The conversion module is used to determine the matching probability distribution based on the matching observation data. The matching probability distribution includes the matching probability of each of the multiple first geomagnetic data in the first geomagnetic data sequence with the last second geomagnetic data in the second geomagnetic data sequence in terms of time sequence. The result determination module is used to determine, based on the matching probability distribution, target geomagnetic data that meets preset matching conditions with the last item of the second geomagnetic data in the time series from the plurality of first geomagnetic data; and to determine the positioning result of the device to be located according to the index of the target geomagnetic data in the first geomagnetic data sequence.
18. A computer device, characterized in that, The device includes a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the positioning method according to any one of claims 1 to 16 according to the computer program.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when executed by an electronic device, implements the positioning method according to any one of claims 1 to 16.
20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the positioning method according to any one of claims 1 to 16.