Digital car key positioning method and device, positioning system and terminal equipment
By optimizing the digital car key positioning algorithm through extended Kalman filtering and sliding window processing, the problems of insufficient positioning accuracy caused by the small number of anchor points and signal obstruction are solved, achieving high-precision and stable positioning results.
Patent Information
- Application Number
- CN202510632423.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2026-11-17
AI Technical Summary
In digital car key positioning, the limited number of anchor points and signal obstruction result in insufficient positioning accuracy, making it difficult for existing technologies to achieve high-precision positioning.
By counting the number of effective anchor points, the extended Kalman filter algorithm is used for state estimation and measurement updates. Combined with sliding window processing and linearization of the nonlinear ranging model, the positioning results are optimized.
In situations where the number of anchor points is small or the signal is blocked, the positioning accuracy and robustness of the digital car key are improved, ensuring the continuity and stability of the positioning results.
Smart Images

Figure CN123124084A_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, positioning technology, and particularly to a digital car key positioning method and device, positioning system and terminal equipment. Background Technology
[0002] In the field of digital car keys, due to the need to consider factors such as the vehicle's structure and cost when determining the number and distribution of anchor points, typically 4-5 anchor points are placed around the vehicle body and inside the vehicle. Figure 1 As shown, the locations of four anchor points are illustrated. This means that the digital car key can easily fall into the signal blind spots of some of these anchor points. In reality, only 2-3 anchor points, or even just one, are often usable for positioning, and even then, the signal is likely to be non-line-of-sight. Achieving high-precision positioning with a limited number of anchor points and obstructed signals remains a challenging technical problem to be solved. Summary of the Invention
[0003] This application provides a digital car key positioning method, device, positioning system, and terminal equipment, which can accurately model the target positioning problem, thereby achieving high-precision positioning.
[0004] This invention provides a digital car key location method, including:
[0005] In a positioning cycle, the number of valid anchor points in the current positioning cycle is counted. When the number of valid anchor points is less than the preset anchor point number threshold, the state estimation result of the previous positioning cycle is output as the positioning result of the digital car key in the current positioning cycle, and the process ends. When the number of valid anchor points is not less than the anchor point number threshold, the process proceeds to the next step.
[0006] For each valid anchor point, the distance measurement value is processed by a pre-set sliding window to generate a smooth distance measurement measurement corresponding to each anchor point.
[0007] Based on the pre-established state transition model and process noise covariance matrix, the extended Kalman filter is used to predict the state estimate of the previous positioning cycle to obtain the predicted state of the current positioning cycle.
[0008] Based on the geometric relationship between the location of the effective anchor point and the predicted state, a nonlinear ranging observation model is constructed and linearized to obtain the Jacobian matrix of the observation model.
[0009] The Jacobian matrix of the constructed observation model and the smoothed ranging observations generated for each anchor point are used as inputs to the extended Kalman filter for measurement updates, and the updated state estimation results are used as the positioning results of the digital car key for the current positioning cycle.
[0010] Optionally, the length and step size of the sliding window can be set according to actual needs. For example, the length of the sliding window can be set to 2 to 10 historical ranging values, while the step size can be set to 1 to 3.
[0011] Optionally, the effective anchor points include: anchor points that have successfully reported the ranging value of the current positioning cycle.
[0012] Optionally, the preset anchor point threshold is 3.
[0013] Optionally, before predicting the state estimate of the previous positioning cycle using extended Kalman filtering, the method further includes:
[0014] Initialize the state estimation vector and state estimation covariance matrix of the digital car key, and establish a state transition model and its process noise covariance matrix based on the assumption of constant velocity motion.
[0015] Optionally, the predicted state includes a predicted state vector and a state estimation covariance matrix;
[0016] The method of using extended Kalman filtering to predict the state estimate of the previous positioning cycle includes:
[0017] Based on the state transition model, the state estimation vector of the previous positioning cycle is used, combined with the state transition matrix, to predict the predicted state vector of the current positioning cycle.
[0018] Based on the state transition matrix, the state estimation covariance matrix of the previous positioning cycle, and the process noise covariance matrix, the state estimation covariance matrix of the current positioning cycle is predicted.
[0019] Optionally, under the current prediction state, the Jacobian matrix is obtained by performing Taylor first-order linearization on the constructed nonlinear ranging observation model.
[0020] Optionally, the number of rows in the Jacobian matrix is equal to the number of effective anchors, or the number of rows in the Jacobian matrix is equal to the product of the number of effective anchors and the observation dimension.
[0021] Optionally, the step of using the Jacobian matrix of the constructed observation model and the generated smoothed ranging observations for each anchor point as input to the extended Kalman filter for measurement updates includes:
[0022] Based on the Jacobian matrix, the smoothed distance measurement observation corresponding to each anchor point is compared with the theoretical distance measurement value, and the observation residual is calculated.
[0023] Based on the obtained observation residuals, the Jacobian matrix, and the state estimation covariance matrix in the predicted state, the Kalman gain is calculated to determine the weight of the measurement information in the state update.
[0024] The predicted state is corrected using the calculated Kalman gain to obtain the optimal state estimate for the current positioning cycle and update its state estimate covariance matrix.
[0025] The two-dimensional position coordinates of the digital car key in the current positioning cycle are extracted from the corrected state estimation vector, and this position is used as the digital key positioning result for this positioning cycle.
[0026] Optionally, the observation noise covariance matrix is set with the observation noise covariance of the farthest effective anchor point as a first value, and the observation noise covariance of the remaining effective anchor points as a second value; wherein the first value is greater than the second value.
[0027] This application also provides a digital car key positioning method, including:
[0028] Obtain the distance values between all anchor points on the vehicle and the digital car key during the current positioning period;
[0029] If the number of valid anchor points that provide ranging values is less than a preset anchor point threshold, the positioning result of the previous positioning cycle is directly output as the positioning result of the digital car key in the current positioning cycle. If the number of valid anchor points that provide ranging values is not less than the anchor point threshold, state prediction is performed based on a constant velocity motion model. After constructing and linearizing the ranging observation model, the state is updated using an extended Kalman filter in conjunction with the dynamically set observation noise covariance. The resulting positioning result is used as the positioning result of the digital car key in the current positioning cycle.
[0030] Optionally, the effective anchor points include: anchor points that have successfully reported the ranging value of the current positioning cycle;
[0031] The preset threshold for the number of anchor points is 3.
[0032] Optionally, the state estimation using the extended Kalman filter algorithm includes:
[0033] A state transition model is constructed based on the constant velocity motion assumption, and a nonlinear ranging observation model is constructed based on the geometric relationship between the effective anchor point and the digital car key position. Under the current prediction state, the ranging observation model is linearized to obtain the Jacobian matrix of the ranging observation model. Combining the dynamically set observation noise covariance, the extended Kalman filter is used to predict and update the target state, and the digital car key positioning result of the current positioning cycle is output.
[0034] This application also provides a digital car key positioning method, which may include: obtaining the distance values between all anchor points on the vehicle and the digital car key in the current positioning cycle; if the number of valid anchor points with obtained distance values is less than a preset anchor point number threshold, directly outputting the positioning result of the previous positioning cycle as the positioning result of the digital car key in the current positioning cycle; if the number of valid anchor points with obtained distance values is not less than the anchor point number threshold, using the positioning result obtained based on the distance values corresponding to the valid anchor points as the positioning result of the digital car key in the current positioning cycle. This embodiment, by judging the valid anchor points, can quickly complete the judgment and update of the positioning result, especially in scenarios such as a small number of valid anchor points, obstructed anchor point signals, and unstable anchor point distance values, ensuring that a relatively accurate positioning result can be obtained in each positioning cycle.
[0035] Optionally, an extended Kalman filter algorithm can be used to obtain the positioning result based on the distance measurement value corresponding to the effective anchor point.
[0036] Optionally, the effective anchor points include: anchor points that successfully report the ranging value of the current positioning cycle; the preset anchor point number threshold is greater than or equal to 3; and / or, based on the ranging value corresponding to the effective anchor points, state prediction is performed through a constant velocity motion model, a ranging observation model is constructed and linearized, and then, combined with the dynamically set observation noise covariance, an extended Kalman filter is used to complete the state update to obtain the positioning result.
[0037] This application embodiment further provides a digital car key positioning method, including:
[0038] Based on the original distance measurement data of each anchor point, valid anchor points that meet the preset conditions are selected.
[0039] The raw distance measurement data of each valid anchor point is smoothed to obtain smoothed measurement data.
[0040] The weights of each valid anchor point are dynamically assigned based on the distance between the valid anchor point and the digital car key, so as to dynamically set the observation noise covariance matrix.
[0041] Based on the geometric relationship between the effective anchor point and the digital car key position, a nonlinear ranging observation model is constructed, and the constructed ranging observation model is linearized in the prediction state to obtain the Jacobian matrix of the ranging observation model.
[0042] The linearized Jacobian matrix, the smoothed ranging observations, and the dynamically set observation noise covariance are used as inputs to the extended Kalman filter to perform state updates and output the spatial positioning result of the digital key in the current positioning cycle.
[0043] Optionally, based on the distance measurement results between the digital car key and each of the effective anchor points, and in conjunction with the measurement accuracy index, a corresponding weight is assigned to each of the effective anchor points.
[0044] This application also provides a computer-readable storage medium storing computer-executable instructions for executing the digital car key positioning method described in any of the above embodiments.
[0045] This application also provides a digital car key positioning device, including a selection module, a preprocessing module, a first processing module, a second processing module, a linearization processing module, and an update module; wherein,
[0046] The selection module is used to count the number of valid anchor points in a positioning cycle. When the number of valid anchor points is less than a preset anchor point number threshold, it enters the first processing module; when the number of valid anchor points is not less than the anchor point number threshold, it enters the preprocessing module.
[0047] The preprocessing module is used to perform sliding window processing on the distance measurement value according to a pre-set sliding window for each valid anchor point, so as to generate the smooth distance measurement observation corresponding to each anchor point.
[0048] The first processing module is used to output the state estimation result of the previous positioning cycle as the positioning result of the digital car key in the current positioning cycle.
[0049] The second processing module is used to predict the state estimate of the previous positioning cycle based on the pre-established state transition model and process noise covariance matrix, using extended Kalman filtering, to obtain the predicted state of the current positioning cycle.
[0050] The linearization module is used to construct a nonlinear ranging observation model and linearize it based on the geometric relationship between the position of the effective anchor point and the predicted state, so as to obtain the Jacobian matrix of the observation model.
[0051] The update module is used to update the measurement by taking the Jacobian matrix of the constructed observation model and the smoothed ranging observation of each anchor point as input to the extended Kalman filter, and using the updated state estimation result as the positioning result of the digital car key in the current positioning cycle.
[0052] Optionally, it also includes an initialization module for: initializing the state estimation vector and state estimation covariance matrix of the digital car key, and establishing a state transition model and its process noise covariance matrix based on the assumption of constant velocity motion.
[0053] Optionally, the second processing module is used for:
[0054] Based on the state transition model, the predicted state vector of the current epoch is predicted using the state estimation vector of the previous epoch and the state transition matrix; the state estimation covariance matrix of the current epoch is predicted based on the state transition matrix, the state estimation covariance matrix of the previous epoch, and the process noise covariance matrix.
[0055] Optionally, the linearization processing module is used to:
[0056] Based on the geometric relationship between the position of the effective anchor point and the predicted state, a nonlinear ranging observation model is constructed; under the current predicted state, the Jacobian matrix is obtained by performing Taylor first-order linearization on the constructed nonlinear ranging observation model.
[0057] Optionally, the update module is used to:
[0058] Based on the Jacobian matrix, the smoothed ranging observations corresponding to each anchor point are compared with the theoretical ranging values to calculate the observation residuals. Based on the obtained observation residuals, the Jacobian matrix, and the state estimation covariance matrix in the predicted state, the Kalman gain is calculated to determine the weight of the measurement information in the state update. The calculated Kalman gain is used to correct the predicted state, obtaining the optimal state estimate for the current epoch and updating its state estimation covariance matrix. The two-dimensional position coordinates of the digital car key in the current epoch are extracted from the corrected state estimation vector, and this position is used as the digital key positioning result for this epoch.
[0059] This application embodiment further provides a terminal device, including a memory and a processor, wherein the memory stores the following instructions executable by the processor: for performing the steps of the digital car key positioning method described in any of the above claims; and / or, the terminal device includes the digital car key positioning device described in any of the above claims.
[0060] This application embodiment provides another positioning system, including a first terminal device and a second terminal device, wherein the second terminal device is provided with at least three anchor points that match the positioning of the first terminal device;
[0061] Specifically, based on the preprocessing results of the current and historical ranging values of the anchor points, the extended Kalman filter model is used to estimate the positioning of the first terminal device.
[0062] Optionally, the preprocessing results of the current and historical ranging values of the anchor point include:
[0063] For each anchor point, the measured values of a preset number of the nearest anchor points are averaged, or the median is calculated, or the median value is taken. The preprocessed results for each anchor point are then used as input to the extended Kalman filter model; or,
[0064] A sliding window process is applied to the current and historical distance measurements of each anchor point. After selecting a minimum (smaller) preset number of measurements, the selected measurements are averaged, the median is calculated, and the median value is calculated. The preprocessed results of each anchor point are then used as the input to the extended Kalman filter model.
[0065] Optionally, the extended Kalman filter model includes:
[0066] The state vector definition module is used to construct the state vector of the second terminal device, which includes position and velocity components;
[0067] A state transition model is used to predict the state of the second terminal device in the current positioning cycle;
[0068] The process noise covariance matrix is used to model uncertainties in state prediction.
[0069] A ranging observation model is used to describe the nonlinear mapping relationship between the state of the second terminal device and the observations of each anchor point;
[0070] The linearization module is used to linearize the nonlinear ranging observation model and generate the Jacobian matrix for the current positioning cycle.
[0071] The observation noise covariance matrix is used to set the weights of the observations at each anchor point.
[0072] The state prediction module is used to output the predicted state vector and the corresponding state estimation covariance matrix;
[0073] The measurement update module is used to correct the predicted state based on the current observation residuals and Kalman gain, and obtain the state estimation result for the current positioning cycle.
[0074] Optionally, the second terminal device is a vehicle, an air conditioner, or a television;
[0075] The first terminal device is a digital car key, remote control, or mobile phone that is matched with the second terminal device.
[0076] This application embodiment also provides a terminal device, which is the first terminal device or the second terminal device in the positioning system described in any of the above claims.
[0077] The digital car key positioning method and apparatus provided in this application achieve better positioning results by accurately modeling the target positioning problem and based on extended Kalman filtering. In particular, it improves the positioning accuracy of digital car keys when the number of anchor points is small and the signal is blocked.
[0078] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description, claims, and drawings. Attached Figure Description
[0079] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0080] Figure 1 This is a schematic diagram of the digital car key positioning system architecture in the embodiments of this application;
[0081] Figure 2 This is a flowchart illustrating the digital car key positioning method in the embodiments of this application;
[0082] Figure 3 This is a schematic diagram of the composition of the digital car key positioning device in the embodiments of this application. Detailed Implementation
[0083] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be arbitrarily combined with each other.
[0084] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings, which illustrate embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of this application will be thorough and complete.
[0085] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0086] It is understood that the terms "first" and "second" used in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0087] It is understood that the term "connection" in the following embodiments should be understood as "electrical connection," "communication connection," etc., if the connected circuits, modules, units, etc., have electrical signal or data transmission with each other.
[0088] When used herein, the singular forms of “a,” “an,” and “the” may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising / including” or “having,” etc., specify the presence of the stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not preclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. Meanwhile, the term “and / or” as used in this specification includes any and all combinations of the associated listed items.
[0089] The steps illustrated in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in a different order than that presented here.
[0090] Figure 2 This is a flowchart illustrating the digital car key positioning method in an embodiment of this application, as shown below. Figure 1 As shown, it may include:
[0091] Step 200: In a positioning cycle, count the number of valid anchor points in the current positioning cycle. When the number of valid anchor points is less than the preset anchor point number threshold, output the state estimation result of the previous positioning cycle as the positioning result of the digital car key in the current positioning cycle and end this process; when the number of valid anchor points is not less than the anchor point number threshold, proceed to step 201.
[0092] In this embodiment, a positioning cycle is a time unit in which a system collects and processes all data from a signal transceiver (such as an anchor point) and outputs a positioning result once. In one embodiment, the distance between the anchor point and the digital car key can be obtained based on Channel Impulse Response (CIR) information.
[0093] In this embodiment, the anchor point refers to a wireless base station device with a known location and the ability to provide ranging to the target device (digital car key). This anchor point can be a fixed UWB transmitter / receiver module, a Bluetooth base station with ranging functionality, a Wi-Fi hotspot, or a new protocol device supporting ranging and positioning, such as a SparkLink node or other wireless devices. In this embodiment, the digital car key positioning system uses multiple anchor points to perform spatial ranging on the target device to achieve two-dimensional or three-dimensional position estimation. Figure 1As shown, four anchor points are used as an example. In some embodiments, a fifth anchor point can be added to supplement signal coverage blind spots. The anchor point can be placed in locations including but not limited to: the central position of the vehicle's top interior (such as inside the ceiling lighting module) to facilitate coverage of the entire vehicle interior; the center of the vehicle's dashboard, which is particularly suitable for precise positioning scenarios inside the vehicle; the inside of the door armrest or the center console armrest area, which helps to increase the number of measurable anchor points when the target is near the door or sitting inside the vehicle.
[0094] In step 200, for each positioning cycle, the data reporting status of each anchor point is statistically analyzed to determine which anchor points successfully reported the ranging value for the current positioning cycle. These anchor points are then considered valid anchor points. In one exemplary instance, as long as an anchor point provides ranging data within a valid format and numerical range in the current positioning cycle, regardless of its accuracy, it is considered a valid anchor point and participates in subsequent positioning calculations.
[0095] In one embodiment, the preset anchor point number threshold can be 3.
[0096] After calculating the number of valid anchor points in the current positioning cycle, this number is compared with a pre-set anchor point threshold. In one embodiment, taking an anchor point threshold of 3 as an example, when the number of valid anchor points is less than 3, it is determined that the current ranging information is insufficient to support valid state correction. At this time, to avoid misleading state updates, the subsequent Extended Kalman Filter (EKF) measurement update process is skipped, i.e., the target state is not updated. The state estimation result of the previous positioning cycle is directly used as the positioning result of the digital car key in the current positioning cycle, and the entire positioning process terminates here without performing subsequent prediction and update operations. When the number of valid anchor points is not less than (greater than or equal to) 3, it is determined that the current observation conditions meet the minimum positioning requirements, and the subsequent positioning calculation process is initiated, including time prediction based on the state transition model, measurement update, and other steps.
[0097] In one embodiment, when the number of valid anchor points is less than three (i.e., only two or fewer anchor points are detected as valid reports), the signal quality is considered poor at this time, and it is assumed that this will cause a reverse update to the EKF. Therefore, it is not put into the extended Kalman filter for state estimation and update; that is, subsequent extended Kalman filter updates are paused, and the state estimation result of the previous moment is directly used. This effectively avoids the problem of increased positioning error due to signal quality deterioration. In this embodiment, the state estimation result of the previous moment is directly frozen, avoiding the introduction of erroneous estimation when the number of anchor points is severely insufficient or the signal quality deteriorates, maintaining the state estimation result of the previous cycle, and ensuring positioning continuity.
[0098] By using the judgment mechanism based on the number of valid anchor points in step 200, the instability of the positioning results is actively suppressed when the availability of anchor points is limited. This ensures that the state is updated only when the credibility of the observation information is sufficient, thereby improving the robustness and accuracy stability of the entire digital car key positioning system.
[0099] Step 201: For each valid anchor point, perform sliding window processing on the distance measurement value according to the pre-set sliding window to generate the smooth distance measurement observation corresponding to each anchor point.
[0100] In one exemplary instance, due to the problem of numerous abnormal measurement values in ranging, after receiving ranging values from valid anchor points in each positioning cycle, the ranging values obtained by each valid anchor point in the current positioning cycle and several historical positioning cycles are processed using a preset sliding window. In one embodiment, a preset sliding window of length, such as 10, can be maintained for each valid anchor point, recording the ranging values of that valid anchor point in the most recent 10 positioning cycles (i.e., the current positioning cycle (k-1) and the previous 9 positioning cycles (k-9)). The 10 ranging values in the window are sorted in order of size, and the smallest preset number, such as 4, is selected. These 4 ranging values are then averaged to generate a smoothed ranging observation for that valid anchor point in the current positioning cycle. In this step, the smoothed ranging observations of multiple valid anchor points constitute the observation vector of the current positioning cycle, which is then used for measurement updates by the subsequent Extended Kalman Filter (EKF).
[0101] In one type of system, the length and step size of the sliding window can be set based on actual needs. For example, the length of the sliding window can be set to 2 to 10 historical distance values, while the step size can be set to 1 to 3.
[0102] Step 202: Based on the pre-established state transition model and process noise covariance matrix, use extended Kalman filtering to predict the state estimate of the previous positioning cycle to obtain the predicted state of the current positioning cycle.
[0103] In one embodiment, firstly, the target state vector is defined as shown in Equation (1), and the process model is shown in Equation (2):
[0104]
[0105] Formula (1) represents the position and velocity state of the object to be located, i.e., the digital car key, on a two-dimensional plane, where x k y k This indicates the current location coordinates of the digital car key; v x,k v y,kThis represents the velocity components of the digital car key in the x and y directions. It should be noted that, given the typical use case of digital car keys, where the vehicle is usually a pedestrian with gentle changes in motion and low acceleration, the modeling structure can be simplified based on Newtonian motion modeling when constructing the target state vector. Acceleration components can be ignored, retaining only position and velocity as state variables. This simplification not only reduces computational complexity but also helps improve filtering stability in low-speed dynamic scenes.
[0106] x k =Fx k-1 +ω k-1 (2)
[0107] Equation (2) shows a process model used to describe how the system state changes over time. In Equation (2), x k The x represents the state vector (such as position, velocity, etc.) at the current time k; k-1 F represents the state vector at the previous time step; F is the state transition matrix, used to describe the state transition from x... k-1 To x k Deterministic changes; Fx k-1 That is, the state transition model; ω k-1 This represents process noise (i.e., random errors caused by imperfect modeling or external disturbances).
[0108] In a digital car key positioning scenario, assuming the target moves at a constant speed during the positioning cycle, then the position at the next moment = current position + speed × time interval. The state transition matrix F is a coefficient matrix in the process model, used to transition the old state x... k-1 Transform to the new predicted state x k The state transition matrix F under constant velocity is shown in equation (3):
[0109]
[0110] In formula (3), Δt represents the time interval; the first row represents the new position x. k =x k-1 +v x,k-1 ·Δt; the second line indicates: the new position y k =y k-1 +v y,k-1 •Δt; Lines 3 and 4 indicate that the velocity remains constant: v x,k =v x,k-1 v y,k =v y,k-1 .
[0111] The process noise ω in formula (2) k-1 Its matrix, namely the process noise covariance matrix Q, is shown in formula (4):
[0112]
[0113] In formula (4), σ is the process noise intensity hyperparameter, which can be set based on experience or system performance.
[0114] While predicting the state vector, the extended Kalman filter also simultaneously calculates the state estimation covariance matrix P for the current positioning cycle. k|k-1 , used to represent the uncertainty of the predicted state. The state estimation covariance matrix is shown in Equation (5):
[0115] P k|k-1 =F·P k-1|k-1 ·F T +Q (5)
[0116] In formula (5), P k-1|k-1 F is the state estimation covariance matrix of the previous positioning cycle. T Let Q be the transpose of the state transition matrix, and let Q be the process noise covariance matrix. The state estimation covariance matrix prediction result P obtained from equation (5) is... k|k-1 This will be used in subsequent step 204 to calculate the Kalman gain (as shown in Equation (9)) to control the degree of influence of the observations on the state correction.
[0117] In one exemplary instance, the predicted state in step 202 includes a predicted state vector and a state estimation covariance matrix, and step 202 includes:
[0118] According to the state transition model shown in formula (2), the state estimation vector of the previous positioning period k-1 is used. By combining the state transition matrix F, the predicted state vector for the current positioning period k is predicted, and the prediction result is obtained: The predicted state vector This indicates the target's expected position and velocity status in the current positioning cycle without considering new measurement data.
[0119] Based on formula (5), the state estimation covariance matrix P k|k-1 The prediction is updated, and the predicted state estimate covariance matrix P is... k|k-1 It will be used in subsequent step 204 to calculate the Kalman gain and participate in the state update process.
[0120] The two prediction branches in step 202 not only obtain the initial state estimate for the current positioning cycle, but also quantify the confidence of the estimate, preparing for subsequent measurement updates.
[0121] In one exemplary instance, step 202 may also include:
[0122] Initialize the state estimation vector and state estimation covariance matrix of the digital car key, and establish a state transition model and its process noise covariance matrix based on the assumption of constant velocity motion, which are used for prediction by extended Kalman filtering.
[0123] In one exemplary instance, the target state vector is initialized as follows: Where x0 and y0 represent the initial two-dimensional position coordinates of the target; v x,0 v y,0 This represents the initial velocity component. In one embodiment, the system can set the initial position of the target as the geometric center of all valid anchor point coordinates, i.e.: Where m represents the number of valid anchor points participating in the positioning, x i (a) ,y i (a) This represents the fixed spatial coordinates of the i-th valid anchor point. The initial velocity is set to 0 by default (i.e., the target is stationary) to avoid introducing motion trend bias into the system when there is no observation information.
[0124] In one exemplary instance, the initial state estimation covariance matrix is: Where, σ p 2 σ represents the uncertainty of the initial position (e.g., 1000); v 2 The uncertainty of the initial velocity (e.g., 1000) reflects the system's uncertainty about whether the target is moving.
[0125] Taking an example where there are i=4 valid anchor points, This is equivalent to setting the initial position of the target to the center of the set of valid anchor points for searching friends during initialization, and setting the velocity to 0. State estimation covariance matrix The original color of the diagonal line represents the initial uncertainty of the state estimate. A larger initial value, such as 1000, indicates a higher level of uncertainty in the initial state.
[0126] Step 203: Based on the geometric relationship between the position of the effective anchor point and the predicted state, construct a nonlinear ranging observation model and linearize it to obtain the Jacobian matrix of the observation model.
[0127] Before updating the state measurement using extended Kalman filtering, a ranging observation model for the current positioning cycle is first constructed. This model describes how the system state (i.e., the target's current position) is mapped to the ranging measurements observed by the anchor points. Since the digital key positioning system is based on a spatial geometric ranging method, the ranging value of each valid anchor point is actually the Euclidean distance between the target's current position and the known position of that anchor point. Therefore, a nonlinear ranging observation model can be constructed based on this ranging relationship.
[0128] In one exemplary instance, suppose the spatial coordinates of the i-th valid anchor point are (x... i (a) ,y i (a) The target position in the current predicted state is (x). k ,y k The geometric relationship between the position of the effective anchor point and the predicted state (i.e., the Euclidean distance (radial distance) between the target device and the i-th anchor point) can be expressed by formula (6) as follows:
[0129]
[0130] Formula (6) represents the expected distance of the i-th anchor point to the target in the current positioning cycle. By combining the distance models of all valid anchor points, an observation function vector can be formed, as shown in Formula (7):
[0131] z k =h(x k )+v k (7)
[0132] In formula (7), z k The observation vector is composed of the actual distance measurements (smoothed by a sliding window) from all valid anchor points; h(x k ) represents the observation function, which consists of the distance function between the target position and the anchor point coordinates; v k Let the observed noise be represented by a zero-mean Gaussian distribution with a covariance of R. k .
[0133] In the extended Kalman filter framework, h(x) k Since the observation function h(x) is a nonlinear function, it needs to be linearized using a first-order Taylor transformation under the current prediction state during actual calculation. To achieve updates within a linear system framework, this embodiment performs a first-order Taylor expansion on the nonlinear function at the current prediction state, linearizing it to obtain the Jacobian matrix of the observation model, i.e., calculating the observation function h(x). k Regarding the state vector x k The first derivative yields the Jacobian matrix, specifically including:
[0134] First, for each anchor point i, obtain information about the state vector x. k =[x,y,v x ,v y ] T The Jacobian line is shown in formula (8):
[0135]
[0136] In formula (8),
[0137] Then, the Jacobian rows of multiple valid anchor points are arranged row by row to form the Jacobian matrix H. k It is used in EKF to calculate Kalman gain and measurement updates.
[0138] Taking an example where there are i=4 effective anchor points, the measurement vector Among them, z i,k This is the radial distance measurement obtained from the i-th anchor point. The measurement function at this point is: Among them, (x i (a) ,y i (a) (x) are the known coordinates of the i-th anchor point. k ,y k () represents the coordinates of the digital car key to be estimated. In this embodiment, the observation noise v k The covariance R is: Where, σ i 2 It is the variance of the measurement error at the i-th anchor point. The nonlinear function h(x) k It can be used to calculate predicted measurements based on predicted states, but it cannot be directly used in covariance calculations. In EKF, this is achieved by applying the nonlinear function h(x)... k Perform a Taylor expansion, omitting higher-order terms and retaining only the first-order terms, to linearize the nonlinear function, thus obtaining its Jacobian matrix H: in,
[0139] In one exemplary instance, to address the scenario where only three anchor points successfully report ranging values during actual use, the extended Kalman filter undergoes dynamic adaptation optimization. Specifically, when constructing the observation equation, the system can dynamically adjust the dimension of the observation vector and its corresponding observation model based on the actual number of valid ranging anchor points received in the current positioning cycle, i.e., dynamically reducing the measurement function h(x k ) and its Jacobian matrix H kThe number of rows (i.e., the number of rows = the number of effective anchor points) allows the extended Kalman filter to adapt to changes in the ranging dimension and continue iterative execution. This means that, on the one hand, during the initial startup phase, the positioning process can begin immediately when at least three anchor points have successfully reported ranging values, without waiting for all four or more anchor points to report, thus significantly improving the initial positioning response speed of the system. On the other hand, during operation, if only three anchor points report ranging results in certain positioning cycles due to occlusion, interference, or other reasons, state updates can still continue, preventing the positioning process from being interrupted due to insufficient anchor points. This improves the update frequency and positioning continuity of the system in special or corner cases, reducing jump phenomena. This approach effectively improves the real-time performance and robustness of the system, making it particularly suitable for scenarios such as digital car keys where anchor points are limited and the environment changes dynamically.
[0140] Step 204: Use the Jacobian matrix of the constructed observation model and the smoothed distance measurement of each anchor point as input to the extended Kalman filter to update the measurement, and use the updated state estimation result as the positioning result of the digital car key in the current positioning cycle.
[0141] After completing the state-time prediction and constructing the ranging observation model, the extended Kalman filter measurement update stage will begin. In step 204, the predicted state is corrected by combining the actual ranging data from the current effective anchor points, resulting in a state estimation result closer to the target's true location, thus yielding the final positioning result for the current positioning cycle.
[0142] In one exemplary instance, step 204 may include:
[0143] Based on the Jacobian matrix H of the constructed nonlinear observation function h, the smoothed ranging observations obtained from each effective anchor point in the current positioning cycle are compared with the theoretical ranging values, and the observation residuals are calculated.
[0144] Based on the obtained observation residuals, Jacobian matrix H, and state estimation covariance matrix in the predicted state, the Kalman gain is calculated to determine the weight of measurement information in state update.
[0145] The calculated Kalman gain is used to correct the predicted state, obtain the optimal state estimate for the current positioning cycle, and update its state estimate covariance matrix.
[0146] The first two components, namely the two-dimensional position coordinates of the digital car key in the current positioning cycle, are extracted from the corrected state estimation vector, and this position is used as the positioning result of the digital key in this positioning cycle.
[0147] In one exemplary instance, the Kalman gain can be calculated according to formula (8):
[0148]
[0149] In formula (9), P k|k-1 H represents the state estimation covariance matrix obtained in step 202, reflecting the uncertainty of the current state prediction; k R represents the Jacobian matrix of the current observation model, showing the sensitivity of the observation function to the state variables; k R represents the observation noise covariance matrix, reflecting the uncertainty of the ranging observations. In the embodiments of this application, R k The distance measurement quality of each anchor point can be dynamically set. For example, a larger noise variance can be assigned to distant anchor points to reduce their weight on the final estimation result. The Kalman gain shown in formula (9) actually plays a role in making a dynamic trade-off between trust prediction and trust observation.
[0150] In one exemplary instance, the predicted state can be corrected using the calculated Kalman gain as shown in Equation (9):
[0151]
[0152] In formula (10), This indicates the predicted state in step 202; It is the observation residual; K k y k This represents the amount by which the distance observations correct for the state prediction; This represents the final state estimate for the current positioning cycle, comprising both position and velocity components. In this embodiment, this update process fuses the prediction with actual observation information, thereby correcting biases caused by incomplete models or changes in the motion process.
[0153] In one exemplary instance, in order to synchronously update the judgment on the uncertainty of the state estimation, it is also necessary to update the state estimation covariance matrix, as shown in Equation (11):
[0154] P k|k =(IK k H k )P k|k-1 (11)
[0155] In formula (11), I represents the identity matrix. By updating the state estimation covariance matrix, the variance of the state estimation is reduced accordingly (i.e., the system's confidence in the current state is improved), while providing a reliable prior covariance input for the prediction step of the next positioning cycle.
[0156] After completing the state update in step 204, the final state estimation vector is obtained. Extract the first two components, namely the two-dimensional position coordinates (x, y) of the target in the current positioning cycle. k ,y k The system outputs this location as the digital key location result for the current positioning cycle. This location result can be used in a range of spatial relationship-based application scenarios, including but not limited to: determining whether a target is close to the vehicle, whether automatic unlocking conditions are met, and whether vehicle start-up is permitted.
[0157] In one exemplary instance, to address the problem that at least one of the four anchor points is obscured by a vehicle at different locations, resulting in a large measurement error at at least one anchor point, the observation noise covariance matrix R... k The observation noise covariance of the farthest valid anchor point is set to a large value (first value), and the observation noise variance of the remaining anchor points is set to the same small value (second value).
[0158] To improve the fault tolerance of the positioning system to unreliable ranging data, this embodiment further introduces an anchor point distance-sensitive weight adjustment mechanism in the setting of the observation noise covariance matrix. This mechanism is particularly suitable for cases where the number of effective anchor points is 4, and may include:
[0159] Based on the geometric relationship between the position of the effective anchor point and the predicted state calculated in step 203, i.e. the Euclidean distance between the target device and the i-th anchor point, the anchor point farthest from the target device is identified and recorded as the farthest anchor point.
[0160] In the observation noise covariance matrix R k In the settings, a large noise variance value is assigned to the ranging measurement corresponding to the farthest anchor point, for example... The remaining three anchor points are assigned a uniform, smaller noise variance, for example... Of all the valid anchor points, only one is... The remaining effective anchor points are Through the above processing, during the measurement update process, for the distance measurement determined to be the farthest anchor point, its observation noise covariance is set to a larger value to reduce its weight, while the remaining anchor points use a uniformly smaller observation noise covariance; if the number of effective anchor points is 4, the anchor point with the farthest distance measurement is identified and a larger observation noise variance is assigned to it, while the remaining anchor points use a uniformly smaller noise variance.
[0161] The digital car key positioning method provided in this application provides an accurate model of the target positioning problem and achieves better positioning results based on extended Kalman filtering. In particular, it improves the positioning accuracy of digital car keys under special circumstances such as a small number of anchor points and signal obstruction.
[0162] In practical UWB ranging, anchor points at greater distances are more susceptible to interference from multipath propagation, non-line-of-sight, and occlusion, leading to increased ranging errors. Therefore, the anchor point distance-sensitive weight adjustment mechanism provided in this application reduces the influence of measured values on state correction during filter updates, avoiding the introduction of systematic errors or abrupt changes. This not only improves the filter's adaptability to variations in ranging errors but also significantly enhances the system's stability and anomaly resistance while maintaining positioning sensitivity.
[0163] This application also provides a digital car key positioning method, which combines sliding window filtering, dynamic measurement modeling, and EKF to effectively suppress ranging noise, handle anchor point occlusion, and improve positioning accuracy and stability. It includes:
[0164] First, based on the original distance measurement data of each anchor point, valid anchor points that meet preset conditions are selected, while abnormal or unusable anchor points are removed. For example, preset conditions can be based on whether the distance measurement value was successfully reported, whether it is within the maximum effective distance measurement range, or whether the current distance measurement value falls within a reasonable threshold range.
[0165] Next, the raw distance measurement data for each valid anchor point is smoothed to obtain smoothed measurement data. For example, smoothing can be achieved using methods such as sliding window averaging filtering to eliminate instantaneous fluctuations and suppress outliers, thereby improving the stability and usability of the measurement.
[0166] Then, weights are dynamically assigned to each valid anchor point based on the distance between the valid anchor point and the digital car key, thereby dynamically setting the observation noise covariance matrix. In one embodiment, weights can be assigned to each valid anchor point based on the distance measurement results between the digital car key and each valid anchor point, combined with measurement accuracy indicators (such as observation noise covariance). In another embodiment, these weights can be reflected in the observation noise covariance matrix R. k In the settings, a larger observation noise covariance is assigned to the effective anchor points that are farthest away or have larger errors, in order to reduce their impact on the positioning results.
[0167] Subsequently, based on the geometric relationship between the effective anchor point and the digital car key position, a nonlinear ranging observation model is constructed, and the constructed ranging observation model is linearized to the first order at the prediction state to obtain the Jacobian matrix of the ranging observation model.
[0168] Finally, the linearized Jacobian matrix, the smoothed ranging observations, and the dynamically set observation noise covariance are used as inputs to the extended Kalman filter to perform a state update and output the spatial positioning result of the digital key in the current positioning cycle.
[0169] In this embodiment, a dynamic weighting mechanism driven by observation data quality is combined with the linearization processing of the nonlinear ranging model. This fully leverages the accuracy and robustness advantages of the extended Kalman filter in complex environments such as low anchor points and weak line-of-sight, significantly improving the positioning performance of the digital key system.
[0170] This application also provides a digital car key positioning method, which may include:
[0171] Obtain the distance values between all anchor points on the vehicle and the digital car key during the current positioning period;
[0172] If the number of valid anchor points that provide ranging values is less than a preset anchor point threshold, the positioning result of the previous positioning cycle is directly output as the positioning result of the digital car key in the current positioning cycle. If the number of valid anchor points that provide ranging values is not less than the anchor point threshold, state prediction is performed based on a constant velocity motion model. After constructing and linearizing the ranging observation model, the state is updated using an extended Kalman filter in conjunction with the dynamically set observation noise covariance. The resulting positioning result is used as the positioning result of the digital car key in the current positioning cycle.
[0173] In one exemplary instance, the distance measurement value can first undergo smoothing processing such as sliding window averaging to suppress instantaneous noise and outliers, thereby improving observation stability. Valid anchor points can be filtered based on preset conditions such as whether the distance measurement value has been reported, whether it is within the maximum effective distance measurement range, or whether the current distance measurement value falls within a reasonable threshold range.
[0174] In one exemplary instance, if the number of valid anchor points is less than a pre-set anchor point threshold (e.g., only 1-2 anchor points), the state update is skipped, and the positioning state of the previous positioning cycle is maintained. That is, the state estimation result of the previous positioning cycle is used as the positioning result of the digital car key in the current positioning cycle to improve system stability.
[0175] In one exemplary instance, when the number of effective anchor points reaches a preset threshold (e.g., 3 or more), the extended Kalman filter algorithm is used for state estimation. This may include: constructing a state transition model based on the assumption of constant velocity motion, and constructing a nonlinear ranging observation model based on the geometric relationship between the effective anchor points and the target (digital car key) position. Under the current predicted state, the ranging observation model is linearized to obtain the Jacobian matrix of the ranging observation model. Combined with dynamically set observation noise covariance, the extended Kalman filter is used to predict and update the target state, outputting the digital car key positioning result for the current positioning cycle. The ranging observation model constructed based on the geometric relationship between the effective anchor points and the digital car key is nonlinear. In this embodiment, in each positioning cycle, a first-order linearization process is performed based on the predicted state to obtain the Jacobian matrix, which serves as the input for the Kalman filter. Simultaneously, the observation noise covariance is dynamically set according to the ranging quality of each anchor point to control the impact of unreliable ranging on the positioning result, thereby enhancing robustness and positioning accuracy in complex environments.
[0176] This application also provides a computer-readable storage medium storing computer-readable instructions that, when executed by a processor, cause the processor to perform the digital car key positioning method as described in any of the preceding claims.
[0177] This application provides another digital car key positioning method, aiming to establish a stable and accurate relative positioning capability between the vehicle and the digital car key, particularly suitable for environments with fluctuating anchor point numbers or unstable ranging quality. This embodiment may include:
[0178] Obtain the distance values between all anchor points on the vehicle and the digital car key during the current positioning period;
[0179] If the number of valid anchor points that have obtained ranging values is less than the preset anchor point number threshold, the positioning result of the previous positioning cycle is directly output as the positioning result of the digital car key in the current positioning cycle; if the number of valid anchor points that have obtained ranging values is not less than the anchor point number threshold, the positioning result obtained based on the ranging value corresponding to the valid anchor point is used as the positioning result of the digital car key in the current positioning cycle.
[0180] The digital car key positioning method provided in this embodiment can quickly complete the judgment and update of positioning results by judging the effective anchor points. Especially in scenarios such as a small number of effective anchor points, anchor point signals being blocked, and anchor point ranging values being unstable, it can ensure that relatively accurate positioning results can be obtained in each positioning cycle.
[0181] In one exemplary instance, during the current positioning cycle, firstly, the distance measurements between all anchor points deployed on the vehicle and the digital vehicle key are acquired. Then, the validity of the acquired distance data is determined. Valid anchor points may include those that successfully reported distance data for the current cycle, whose distance values are within a set range, and whose signal quality meets requirements. Anchor points that meet the set conditions are marked as valid anchor points for subsequent positioning calculations.
[0182] In one exemplary instance, during the positioning calculation process, an extended Kalman filter algorithm can be used to obtain the positioning result based on the distance measurement value corresponding to the effective anchor point.
[0183] In one exemplary instance, state prediction can be performed based on the ranging value corresponding to the effective anchor point using a constant velocity motion model. After constructing and linearizing the ranging observation model, an extended Kalman filter is used to update the state and obtain the positioning result, incorporating dynamically set observation noise covariance. In one embodiment, the process may include: constructing a state transition model based on the constant velocity motion assumption, and constructing a nonlinear ranging observation model based on the geometric relationship between the effective anchor point and the target (digital car key) position. Under the current predicted state, the ranging observation model is linearized to obtain the Jacobian matrix of the ranging observation model. The target state is then predicted and updated using an extended Kalman filter, incorporating the dynamically set observation noise covariance, to output the digital car key positioning result for the current positioning cycle. The ranging observation model constructed based on the geometric relationship between the effective anchor point and the digital car key is nonlinear. In this embodiment, a first-order linearization process is performed based on the predicted state in each positioning cycle to obtain the Jacobian matrix, which serves as the input to the Kalman filter. Meanwhile, the observation noise covariance is dynamically set according to the ranging quality of each anchor point to control the impact of unreliable ranging on the positioning results, thereby enhancing robustness and positioning accuracy in complex environments.
[0184] It is worth mentioning that a dynamically set observation noise covariance matrix is introduced during the observation update phase. The system can model and adjust the ranging observation noise based on environmental factors such as signal quality and obstruction conditions at each anchor point, making the filter more sensitive to uncertainties in complex environments. Finally, the predicted state is corrected through Kalman gain to obtain the positioning estimate for the current period, which is then output as the positioning result for the digital car key.
[0185] In one exemplary instance, valid anchor points include: anchor points that have successfully reported the ranging value for the current positioning cycle.
[0186] In one exemplary instance, the pre-set anchor point threshold can be set to be greater than or equal to 3.
[0187] In this embodiment, branching processing is performed based on the number of valid anchor points: if the number of valid anchor points in the current cycle is less than a preset anchor point threshold (e.g., 3), it is considered that the positioning conditions for this cycle are insufficient, and the system will directly reuse the positioning result of the previous positioning cycle as the output of the current cycle, thereby avoiding mispositioning problems caused by missing anchor points or abnormal ranging. If the number of valid anchor points is not less than the anchor point threshold, the positioning calculation process is entered, and a new positioning result is output based on the ranging value of the current valid anchor points.
[0188] This embodiment not only achieves efficient and real-time positioning result output, but also operates stably even when the number of anchor points is insufficient or the ranging data is abnormal. It has good practicality and anti-interference capabilities, and is particularly suitable for application scenarios such as vehicle gate control systems, personalized proximity recognition and intelligent interaction.
[0189] Figure 3 This is a schematic diagram of the composition of the digital car key positioning device in the embodiments of this application, as shown below. Figure 3 As shown, it may include: a selection module, a preprocessing module, a first processing module, a second processing module, a linearization processing module, and an update module; wherein,
[0190] In the selection module, within a positioning cycle, the number of valid anchor points in the current positioning cycle is counted. When the number of valid anchor points is less than a preset anchor point number threshold, the process proceeds to the first processing module; when the number of valid anchor points is not less than the anchor point number threshold, the process proceeds to the preprocessing module.
[0191] The preprocessing module is used to perform sliding window processing on the distance measurement value according to a pre-set sliding window for each valid anchor point, so as to generate the smooth distance measurement observation corresponding to each anchor point.
[0192] The first processing module is used to output the state estimation result of the previous positioning cycle as the positioning result of the digital car key in the current positioning cycle.
[0193] The second processing module is used to predict the state estimate of the previous positioning cycle based on the pre-established state transition model and process noise covariance matrix, using extended Kalman filtering, to obtain the predicted state of the current positioning cycle.
[0194] The linearization module is used to construct a nonlinear ranging observation model and linearize it based on the geometric relationship between the position of the effective anchor point and the predicted state, so as to obtain the Jacobian matrix of the observation model.
[0195] The update module is used to update the measurement by taking the Jacobian matrix of the constructed observation model and the smoothed ranging observation of each anchor point as input to the extended Kalman filter, and using the updated state estimation result as the positioning result of the digital car key in the current positioning cycle.
[0196] The digital car key positioning device provided in this application provides an accurate model of the target positioning problem and achieves better positioning results based on extended Kalman filtering. In particular, it improves the positioning accuracy of digital car keys under special circumstances such as a small number of anchor points and signal obstruction.
[0197] In one exemplary instance, the pre-set threshold for the number of anchor points can be 3. Based on the mechanism for determining the number of valid anchor points, the instability of the positioning results is actively suppressed when the availability of anchor points is limited. This ensures that the state is updated only when the reliability of the observation information is sufficient, thereby improving the robustness and accuracy stability of the entire digital car key positioning system.
[0198] In one exemplary instance, the predicted state includes a predicted state vector and a state estimation covariance matrix; the second processing module can be used to:
[0199] Based on the state transition model, the state estimation vector of the previous positioning cycle is used in conjunction with the state transition matrix to predict the predicted state vector of the current positioning cycle. This predicted state vector represents the expected position and speed state of the digital car key in the current positioning cycle without considering new measurement data. The state estimation covariance matrix is then updated based on formula (5), i.e., based on the state transition matrix, the state estimation covariance matrix of the previous positioning cycle, and the process noise covariance matrix, the state estimation covariance matrix of the current positioning cycle is predicted. Through the two prediction branches in the second processing module, not only is the initial state estimation value of the current positioning cycle obtained, but the reliability of the estimation is also quantified, preparing for subsequent measurement updates.
[0200] In one exemplary instance, an initialization module may also be included to initialize the state estimation vector and state estimation covariance matrix of the digital car key, and to establish a state transition model and its process noise covariance matrix based on the assumption of constant velocity motion, for use in expanding the prediction of the Kalman filter.
[0201] In one exemplary instance, the linearization processing module can be used to:
[0202] Based on the geometric relationship between the position of the effective anchor point and the predicted state, a nonlinear ranging observation model is constructed. At the current predicted state, the constructed nonlinear ranging observation model is subjected to a first-order Taylor expansion and linearized to obtain the Jacobian matrix of the observation model.
[0203] In one exemplary instance, the linearization module performs a first-order Taylor expansion on the constructed nonlinear ranging observation model, linearizing it to obtain the Jacobian matrix of the observation model, including:
[0204] For each anchor point i, obtain the Jacobian row of the state vector;
[0205] Arrange the Jacobian rows of multiple effective anchor points in rows to form a Jacobian matrix, which is used in EKF to calculate Kalman gain and measurement update.
[0206] In one embodiment, when the number of effective anchor points is 3, the number of rows in the Jacobian matrix is dynamically adjusted according to the actual number of effective anchor points received in the current positioning cycle, so that the number of rows in the Jacobian matrix is equal to the number of effective anchor points.
[0207] In one exemplary instance, the update module can be used to:
[0208] Based on the Jacobian matrix of the constructed nonlinear observation function h, the smoothed distance measurement observation corresponding to each anchor point is compared with the theoretical distance measurement value, and the observation residual is calculated.
[0209] Based on the obtained observation residuals, Jacobian matrix, and state estimation covariance matrix in the predicted state, the Kalman gain is calculated to determine the weight of measurement information in state update.
[0210] The calculated Kalman gain is used to correct the predicted state, obtain the optimal state estimate for the current positioning cycle, and update its state estimate covariance matrix.
[0211] The first two components, namely the two-dimensional position coordinates of the digital car key in the current positioning cycle, are extracted from the corrected state estimation vector, and this position is used as the positioning result of the digital key in this positioning cycle.
[0212] In one embodiment, to address the problem that at least one of the four anchor points is obscured by the vehicle at different locations, resulting in a large measurement error for at least one anchor point, the observation noise covariance matrix R... k Set the observation noise covariance of the farthest anchor point to a large value, and the observation noise variance of the remaining anchor points to the same small value.
[0213] In this embodiment, the target localization problem is accurately modeled, and a better localization effect is achieved based on extended Kalman filtering. In some embodiments, through an anchor point distance-sensitive weight adjustment mechanism, the influence weight of the measurement value on state correction is reduced during filter updates, avoiding the introduction of systematic errors or abrupt changes. This not only improves the filter's adaptability to changes in ranging errors but also significantly enhances the system's stability and anti-anomaly capability while maintaining localization sensitivity.
[0214] This application embodiment also provides a terminal device, which includes: a memory and a processor; wherein the memory stores the following instructions executable by the processor: for performing the steps of the digital car key positioning method described in any of the above claims; and / or, the terminal device includes the digital car key positioning device described in any of the above claims.
[0215] This application embodiment also provides a positioning system, including a first terminal device and a second terminal device, wherein the second terminal device is provided with at least three anchor points that match the positioning of the first terminal device;
[0216] Among them, based on the preprocessing results of the current and historical ranging values of the anchor points, the extended Kalman filter model is used to estimate the positioning of the first terminal device.
[0217] In one exemplary instance, the second terminal device is a fixedly deployed device, such as a vehicle, a smart home device (such as a television or air conditioner), or other device that supports spatial positioning. The second terminal device is equipped with at least three anchor points that match the first terminal device for acquiring ranging data.
[0218] In one exemplary instance, the first terminal device is the device to be located, which is a device such as a digital car key, remote control, or a mobile smart terminal that is matched with the second terminal device.
[0219] In one exemplary instance, the preprocessed results of the current and historical ranging values of the anchor point can be obtained as follows:
[0220] For each anchor point, the measured values from the nearest preset number of positioning cycles are preprocessed by averaging, medianing, or taking the median, and the preprocessed results for each anchor point are used as input to the extended Kalman filter model; or,
[0221] A sliding window process is applied to the current and historical ranging values of each anchor point, and a preset number of measurements less than a preset threshold (such as minimum or small) are selected. The selected measurements are then preprocessed by averaging, medianing, or taking the median. The preprocessed results of each anchor point are then used as the input to the extended Kalman filter model.
[0222] In one embodiment, to suppress transient outliers in the ranging data, a sliding window mechanism can be set for each valid anchor point to smooth its ranging values over the most recent positioning cycles. For example, the sliding window length can be set to 3-5 positioning cycles, and the smallest 2-3 ranging values can be selected and averaged to obtain the smoothed ranging observation for the current positioning cycle. As shown in Table 1, the ranging values of anchor points A to D in 6 consecutive positioning cycles (STEP1-STEP6) are listed, where NA indicates that the anchor point failed to report a ranging value or the data was invalid in the corresponding positioning cycle.
[0223] Anchor point STEP1 STEP2 STEP3 STEP4 STEP5 STEP6 A a1 a2 a3 a4 a5 a6 B b1 b2 NA b4 b5 b6 C c1 c2 NA c4 c5 c6 D NA NA NA NA d5 d6
[0224] Table 1
[0225] As shown in Table 1, in one embodiment, for anchor point A, assuming it is currently in STEP6 cycle, the corresponding sliding window is from STEP2 to STEP6, and the ranging values include: a2, a3, a4, a5, and a6 (a total of 5). If the minimum of the three smallest values is selected for averaging, then the smoothed observation is the sum of these three smallest ranging values divided by 3. Through the sliding window minimum value selection mechanism, stable and reliable observations are prioritized for use in positioning calculations, effectively suppressing the impact of occasional outliers on state estimation, thereby improving the positioning accuracy and overall robustness of the digital car key system.
[0226] As shown in Table 1, in one embodiment, for anchor point B, assuming it is currently in STEP 6 cycle, its sliding window includes 5 cycles from STEP 2 to STEP 6, where no measurements (NA) were reported in STEP 3, and the effective ranging values include: b2, b4, b5, and b6 (a total of 4). If a median-based strategy is adopted, and the three smallest ranging values are selected, then after sorting these three smallest measurements, the middle value is the median. This method, while preserving the main observation trend, further reduces the impact of individual outliers on the final result.
[0227] As shown in Table 1, in one embodiment, for anchor point C, it is also assumed that the current period is STEP6. The sliding window includes ranging data from STEP2 to STEP6, where STEP3 is NA, and the effective ranging values include c2, c4, c5, and c6. If a median-based strategy is adopted, then after sorting these four effective ranging values in ascending order, the average of the second and third ranging values is taken as the median. This median is used as the smoothed ranging observation of anchor point C in the current positioning period. Median processing can effectively balance the upper and lower deviations when the number of ranging values is even, further enhancing the stability of the filtering results.
[0228] As shown in Table 1, in one embodiment, for anchor point D, it is also assumed that the current period is STEP6. Anchor point D only reported the ranging value in STEP5 and STEP6. If the minimum number of valid observations is set to 2, and anchor point D just meets this requirement, its smoothed observation can be calculated as (d5+d6) / 2. If it is set that there must be at least 3 valid values, then anchor point D can be marked as an invalid anchor point and will not participate in the subsequent positioning calculation process in the current positioning period.
[0229] In one exemplary instance, the extended Kalman filter model is used to implement state estimation and updating of a digital car key. Its model structure may include: a state vector definition module, a state transition model, a process noise covariance matrix, a ranging observation model, a linearization module, an observation noise covariance matrix, a state prediction module, and a measurement update module.
[0230] The state vector definition module is used to define the state variables of the object to be estimated, such as constructing the state vector of a second terminal device that includes position and velocity components.
[0231] The state transition model is used to predict the state of the second terminal device in the current positioning cycle. The state transition model supports motion modeling with constant speed or low acceleration assumptions and predicts the trend of system state changes over time.
[0232] The process noise covariance matrix is used to model uncertainties in state prediction, such as to characterize model errors, i.e., to describe uncertainties introduced by modeling errors or external disturbances.
[0233] The ranging observation model is used to describe the nonlinear mapping relationship between the state of the second terminal device and the observations at each anchor point;
[0234] The linearization module is used to linearize the nonlinear ranging observation model and generate the Jacobian matrix for the current positioning cycle.
[0235] The observation noise covariance matrix is used to set the weight of the observation values of each anchor point. For example, it is used to characterize the uncertainty of the distance measurement values of each effective anchor point. It can be set statically or adjusted dynamically. For example, a larger variance can be set for anchor points at a distance to reduce their weight.
[0236] The state prediction module is used to output the predicted state vector and the corresponding state estimation covariance matrix. For example, it combines the state of the previous positioning cycle and the state transition model to predict the state vector and covariance matrix of the current positioning cycle.
[0237] The measurement update module is used to correct the predicted state based on the current observation residuals and Kalman gain to obtain the state estimate result for the current positioning cycle. For example, based on the current observations and the predicted state, the observation residuals are calculated, the Kalman gain is updated, and the predicted state is corrected to obtain the optimal state estimate for the current positioning cycle.
[0238] This application embodiment also provides a terminal device, which is either the first terminal device or the second terminal device in the positioning system described in any of the above claims.
[0239] Although the embodiments disclosed in this application are as described above, the content described is merely for the purpose of understanding this application and is not intended to limit this application. Any person skilled in the art to which this application pertains may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application; however, the scope of patent protection of this application shall still be determined by the scope defined in the appended claims.
Claims
1. A method for locating a digital car key, characterized in that, include: In a positioning cycle, the number of valid anchor points in the current positioning cycle is counted. When the number of valid anchor points is less than the preset anchor point number threshold, the state estimation result of the previous positioning cycle is output as the positioning result of the digital car key in the current positioning cycle, and the process ends. When the number of valid anchor points is not less than the anchor point number threshold, the process proceeds to the next step. For each valid anchor point, the distance measurement value is processed by a pre-set sliding window to generate a smooth distance measurement measurement corresponding to each anchor point. Based on the pre-established state transition model and process noise covariance matrix, the extended Kalman filter is used to predict the state estimate of the previous positioning cycle to obtain the predicted state of the current positioning cycle. Based on the geometric relationship between the location of the effective anchor point and the predicted state, a nonlinear ranging observation model is constructed and linearized to obtain the Jacobian matrix of the observation model. The Jacobian matrix of the constructed observation model and the smoothed ranging observations generated for each anchor point are used as inputs to the extended Kalman filter for measurement updates, and the updated state estimation results are used as the positioning results of the digital car key for the current positioning cycle.
2. The digital car key positioning method according to claim 1, wherein, The effective anchor points include: anchor points that have successfully reported the distance measurement value for the current positioning cycle.
3. The digital car key positioning method according to claim 2, wherein, The preset threshold for the number of anchor points is 3.
4. The digital car key positioning method according to claim 1, before predicting the state estimate of the previous positioning cycle using extended Kalman filtering, further comprising: Initialize the state estimation vector and state estimation covariance matrix of the digital car key, and establish a state transition model and its process noise covariance matrix based on the assumption of constant velocity motion.
5. The digital car key positioning method according to claim 4, wherein, The predicted state includes a predicted state vector and a state estimation covariance matrix; The method of using extended Kalman filtering to predict the state estimate of the previous positioning cycle includes: Based on the state transition model, the state estimation vector of the previous positioning cycle is used, combined with the state transition matrix, to predict the predicted state vector of the current positioning cycle. Based on the state transition matrix, the state estimation covariance matrix of the previous positioning cycle, and the process noise covariance matrix, the state estimation covariance matrix of the current positioning cycle is predicted.
6. The digital car key positioning method according to claim 1, wherein, Under the current prediction state, the Jacobian matrix is obtained by performing Taylor first-order linearization on the constructed nonlinear ranging observation model.
7. The digital car key positioning method according to claim 6, wherein, The number of rows in the Jacobian matrix is equal to the number of effective anchors.
8. The digital car key positioning method according to claim 1, wherein, The step of updating measurements by using the Jacobian matrix of the constructed observation model and the generated smoothed distance measurements for each anchor point as input to the extended Kalman filter includes: Based on the Jacobian matrix, the smoothed distance measurement observation corresponding to each anchor point is compared with the theoretical distance measurement value, and the observation residual is calculated. Based on the obtained observation residuals, the Jacobian matrix, and the state estimation covariance matrix in the predicted state, the Kalman gain is calculated to determine the weight of the measurement information in the state update. The predicted state is corrected using the calculated Kalman gain to obtain the optimal state estimate for the current positioning cycle and update its state estimate covariance matrix. The two-dimensional position coordinates of the digital car key in the current positioning cycle are extracted from the corrected state estimation vector, and this position is used as the digital key positioning result for this positioning cycle.
9. The digital car key positioning method according to claim 8, wherein, The observation noise covariance matrix is set with the observation noise covariance of the farthest effective anchor point as the first value and the observation noise covariance of the remaining effective anchor points as the second value; wherein the first value is greater than the second value.
10. A method for locating a digital car key, characterized in that, include: Obtain the distance values between all anchor points on the vehicle and the digital car key during the current positioning period; If the number of valid anchor points that have obtained ranging values is less than the preset anchor point number threshold, the positioning result of the previous positioning cycle is directly output as the positioning result of the digital car key in the current positioning cycle; if the number of valid anchor points that have obtained ranging values is not less than the anchor point number threshold, the positioning result obtained based on the ranging value corresponding to the valid anchor point is used as the positioning result of the digital car key in the current positioning cycle.
11. The digital car key positioning method according to claim 10, wherein, The extended Kalman filter algorithm is used to obtain the positioning result based on the distance measurement value corresponding to the effective anchor point.
12. The digital car key positioning method according to claim 10, wherein, The effective anchor points include: anchor points that have successfully reported the ranging value of the current positioning cycle; anchor points whose preset anchor point number threshold is greater than or equal to 3; and / or Based on the distance measurement value corresponding to the effective anchor point, the state is predicted by a constant velocity motion model. After constructing and linearizing the distance measurement observation model, the state is updated by combining the dynamically set observation noise covariance and using an extended Kalman filter to obtain the positioning result.
13. A method for locating a digital car key, characterized in that, include: Based on the original distance measurement data of each anchor point, valid anchor points that meet the preset conditions are selected. The raw distance measurement data of each valid anchor point is smoothed to obtain smoothed measurement data. The weights of each valid anchor point are dynamically assigned based on the distance between the valid anchor point and the digital car key, so as to dynamically set the observation noise covariance matrix. Based on the geometric relationship between the effective anchor point and the digital car key position, a nonlinear ranging observation model is constructed, and the constructed ranging observation model is linearized in the prediction state to obtain the Jacobian matrix of the ranging observation model. The linearized Jacobian matrix, the smoothed ranging observations, and the dynamically set observation noise covariance are used as inputs to the extended Kalman filter to perform state updates and output the spatial positioning result of the digital key in the current positioning cycle.
14. The digital car key positioning method according to claim 13, wherein, Based on the distance measurement results between the digital car key and each of the effective anchor points, and combined with the measurement accuracy index, a corresponding weight is assigned to each of the effective anchor points.
15. A computer-readable storage medium storing computer-executable instructions for performing the digital car key positioning method according to any one of claims 1-9, 10-12, or 13-14.
16. A digital car key positioning device, characterized in that, It includes a selection module, a preprocessing module, a first processing module, a second processing module, a linearization processing module, and an update module; among which, The selection module is used to count the number of valid anchor points in a positioning cycle. When the number of valid anchor points is less than a preset anchor point number threshold, it enters the first processing module; when the number of valid anchor points is not less than the anchor point number threshold, it enters the preprocessing module. The preprocessing module is used to process the distance measurement value according to a pre-set sliding window for each valid anchor point, so as to generate the smooth distance measurement observation corresponding to each anchor point. The first processing module is used to output the state estimation result of the previous positioning cycle as the positioning result of the digital car key in the current positioning cycle. The second processing module is used to predict the state estimate of the previous positioning cycle based on the pre-established state transition model and process noise covariance matrix, using extended Kalman filtering, to obtain the predicted state of the current positioning cycle. The linearization module is used to construct a nonlinear ranging observation model and linearize it based on the geometric relationship between the position of the effective anchor point and the predicted state, so as to obtain the Jacobian matrix of the observation model. The update module is used to update the measurement by taking the Jacobian matrix of the constructed observation model and the smoothed ranging observation of each anchor point as input to the extended Kalman filter, and using the updated state estimation result as the positioning result of the digital car key in the current positioning cycle.
17. A terminal device, comprising a memory and a processor, wherein, The memory stores the following instructions executable by a processor: for performing the steps of the digital car key positioning method according to any one of claims 1-9, 10-12, or 13-14; and / or, the terminal device includes the digital car key positioning device as described in claim 16.
18. A positioning system, characterized in that, It includes a first terminal device and a second terminal device, wherein the second terminal device is provided with at least three anchor points that match the positioning of the first terminal device; Specifically, based on the preprocessing results of the current and historical ranging values of the anchor points, the extended Kalman filter model is used to estimate the positioning of the first terminal device.
19. The positioning system according to claim 18, wherein, The preprocessing results of the current and historical ranging values of the anchor points include: For each anchor point, the measured values of a preset number of the nearest anchor points are averaged, or the median is calculated, or the median value is taken. The preprocessed results for each anchor point are then used as input to the extended Kalman filter model; or, A sliding window process is applied to the current and historical distance measurements of each anchor point. After selecting a minimum (smaller) preset number of measurements, the selected measurements are averaged, the median is calculated, and the median value is calculated. The preprocessed results of each anchor point are then used as the input to the extended Kalman filter model.
20. The positioning system according to claim 18, wherein, The extended Kalman filter model includes: The state vector definition module is used to construct the state vector of the second terminal device, which includes position and velocity components; A state transition model is used to predict the state of the second terminal device in the current positioning cycle; The process noise covariance matrix is used to model uncertainties in state prediction. A ranging observation model is used to describe the nonlinear mapping relationship between the state of the second terminal device and the observations of each anchor point; The linearization module is used to linearize the nonlinear ranging observation model and generate the Jacobian matrix for the current positioning cycle. The observation noise covariance matrix is used to set the weights of the observations at each anchor point. The state prediction module is used to output the predicted state vector and the corresponding state estimation covariance matrix; The measurement update module is used to correct the predicted state based on the current observation residuals and Kalman gain, and obtain the state estimation result for the current positioning cycle.
21. The positioning system according to any one of claims 18-20, wherein, The second terminal device is a vehicle, air conditioner, or television; The first terminal device is a digital car key, remote control, or mobile phone that is matched with the second terminal device.
22. A terminal device, characterized in that, The terminal device is either the first terminal device or the second terminal device in the positioning system according to any one of claims 18-21.
