An algorithm to prevent position detection jitter
By using algorithms for vehicle body area division and location type determination, the problem of position jitter caused by interference with wireless positioning technology has been solved, thus achieving stability in vehicle unlocking and locking and improving user experience.
Patent Information
- Application Number
- CN202210054567.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-18
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-01-18
AI Technical Summary
Existing wireless positioning technologies such as Bluetooth, UWB, and RFID are susceptible to external interference, which can cause location detection jitter, leading to instability in vehicle unlocking and locking, resulting in a poor user experience.
By setting the center point of the rectangular area PS projected onto the vehicle body as the origin of the coordinate system, the vehicle body area is divided into the front, rear, left front door, left rear door, right front door, and right rear door. The PE area is then divided around the area PS to determine the position type of the car key. The judgment formulas for the detection area and the critical area are used to prevent position jitter.
It effectively prevents positional changes caused by interference, improves the stability of vehicle unlocking and locking, and enhances the user experience.
Smart Images

Figure CN114567850B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle technology, specifically to an algorithm for preventing position detection jitter. Background Technology
[0002] Nowadays, we rely more and more on cars for transportation, and car keys are becoming increasingly intelligent. Many car keys use wireless technologies such as Bluetooth, RFID, and UWB for automatic location sensing, thus enabling intelligent unlocking and locking.
[0003] However, these wireless technologies all have a drawback: they are susceptible to external interference, causing significant fluctuations in the distance calculated using RSSI values or time-of-flight, which in turn leads to large jitters in the position calculated by multi-point detection. For example, if the driver is in the critical area of the unlock line, due to the jitter in the detection position, the vehicle may unlock and then be locked again, requiring the vehicle to be unlocked again, resulting in a very poor customer experience. Summary of the Invention
[0004] The purpose of this invention is to provide an algorithm to prevent location detection jitter, which can avoid the location jitter problem caused by interference or occasional communication failures of individual base stations in wireless positioning technologies such as Bluetooth, UWB, and RFID. To achieve the above objective, the following technical solution is used.
[0005] This invention provides an algorithm to prevent position detection jitter, comprising the following steps:
[0006] S1: Set the center point (x0, y0) of the rectangular area PS of the vehicle body projection as the origin of the coordinate system, take the direction from the front of the vehicle to the rear of the vehicle as the longitudinal X-axis, and the direction from the right side of the vehicle body to the left side as the transverse Y-axis. The area outside the area PS is the area PE. The area PE is divided into sub-areas, including the front of the vehicle, the rear of the vehicle, the left front door, the left rear door, the right front door, and the right rear door area.
[0007] S2: Divide each sub-region into a detection region and a critical region;
[0008] S3: Determine if the current key detection position is within region PS. If it is, the key position type remains unchanged, using the previous position type. Then, determine if the key has entered the PS detection region. If so, the position type is set to PS; otherwise, check if the current key detection position is within region PE. If it is within PE, determine if the key is in any of the sub-region detection positions. If so, determine if it has entered the sub-region detection area. If so, change the key position type to the sub-region position type. If not within PE, set the key position to an unknown region, and set type to unknown.
[0009] S1 further includes:
[0010] The region PS has a length of L and a width of w;
[0011] When dividing the region PE, the four vertices of the region PS are extended outwards and connected to the four vertices of the region PE, dividing the region PE into the front, rear, left and right regions; the angle between the extension line and the longitudinal centerline of the vehicle body region is 45°; the left region is divided into the left front door and left rear door regions, and the right region is divided into the right front door and right rear door regions.
[0012] The regions PE and PS have the same shape and are in a preset size ratio. The distance between each corresponding side of each region PS and its corresponding region PE is r. The inner part of the region PS is a dashed region PS used as the detection area.
[0013] Each sub-region and its corresponding detection region have the same shape and are in a preset size ratio; the distance between each detection region and each corresponding edge of its corresponding sub-region is d; the critical region is a ring shape with a width of d.
[0014] Furthermore, the coordinate range of the sub-region is defined as follows:
[0015] The x-coordinate of the vehicle's front end is x_head = x0–L / 2;
[0016] The x-coordinate of the rear of the vehicle is x_tail = x0 + L / 2;
[0017] The y-coordinate of the left side of the car is y_left = y0 + w / 2;
[0018] The y-coordinate of the right side of the car is y_right = y0 – w / 2.
[0019] S3 further includes:
[0020] The formula to determine whether the current car key is in region PS is:
[0021] x >= x_head && x <= x_tail, y>= y_right && y << y_left;
[0022] If it is in the region PS, then the previous location type will be used;
[0023] When the key enters the dashed PS detection area, i.e., x >= x_head + d && x <= x_tail –d , y>= y_right + d && y << y_left –d , then update the position type type = PS.
[0024] S3 further includes: if the current car key is not in area PS, then determining whether the current car key is located anywhere in area PE, and sequentially determining the positions of the front, rear, left front door, left rear door, right front door, and right rear door in the sub-area, including:
[0025] S301: Obtain the current location of the car key in any of the sub-regions;
[0026] S302: Determine the previous key location type. If the location type is not in the sub-region location, i.e., the location type is type = unknown, then change it to the current key location type = sub-region location; if the previous location type is not unknown, then go to S303.
[0027] S303: Determine whether the key has entered the sub-region detection area. If the current key's x, y position type satisfies the formula condition of the sub-region detection area, then change the current key position type to type = sub-region position, and add the type to the position type array. Determine whether the number of the newly added key position type type in the position type array is half of the maximum number of data stored in the array. If so, then use the current key position as the new type position; otherwise, it is determined that the current key position has been disturbed and caused a position jump, and it continues to remain in the original type position.
[0028] The determination of the location of the sub-region includes:
[0029] The formula for determining the rear area of the vehicle is:
[0030] x > x_tail && x < x_tail + r && y + x > y_right + x_tail && y – x <y_left – x_tail。
[0031] The formula for determining the front area of the vehicle is:
[0032] x > x_head - r && x < x_head && y - x > y_right - x_head && y + x <y_left + x_head。
[0033] The formula for determining the left front door area is:
[0034] y > y_left && y < y_left + r && x + y > x_head + y_left && x < x0 .
[0035] The formula for determining the left rear door area is:
[0036] y > y_left && y < y_left r && x > x0 && x - y < x_tail - y_left.
[0037] The formula for determining the right front door area is:
[0038] y < y_right && y > y_right - r && x - y > x_head - y_right && x < x0.
[0039] The formula for determining the right rear door area is:
[0040] y < y_right && y > y_right - r && x > x0 && x + y < x_tail + y_right.
[0041] The determination of the sub-region detection area includes:
[0042] The formula for determining whether the key has entered the rear detection area is:
[0043] x > x_tail + d && x < x_tail + r - d && y + x > y_right + x_tail + d&& y – x < y_left – x_tail –d.
[0044] The formula for determining whether the key has entered the front detection area of the vehicle is as follows:
[0045] x > x_head - r + d && x < x_head - d && y - x > y_right - x_head + d&& y +x < y_left + x_head –d.
[0046] The formula for determining whether the key has entered the detection area of the left front door is:
[0047] y > y_left + d && y < y_left + r –d && x + y > x_head + y_left + d &&x < x0 - d.
[0048] The formula for determining whether the key has entered the left rear door detection area is:
[0049] y > y_left + d && y < y_left r – d && x > x0 + d && x - y < x_tail -y_left - d.
[0050] The formula for determining whether the key has entered the detection area of the right front door is:
[0051] y < y_right - d && y > y_right - r + d && x - y > x_head - y_right +d && x < x0 - d.
[0052] The formula for determining whether the key has entered the right rear door detection area is:
[0053] y < y_right - d && y > y_right - r + d && x > x0 + d && x + y < x_tail + y_right - d.
[0054] The key location type array stores 10 historical location type records and updates the data in real time at a preset frequency; each time a new key location type is added to the key location type array, the first key location type added is removed.
[0055] The algorithm for preventing position detection jitter described in this invention divides the vehicle body into front, rear, left front door, left rear door, right front door, and right rear door regions, with the center point of the rectangular area PS projected by the vehicle body as the origin of the coordinate system. Each sub-region is further divided into a detection region PS and a critical region PL. The current key detection position is determined. If the key is in the critical region PL, the key position type remains unchanged, using the previous position type. If the key is in the detection region, the key position type is changed, thereby preventing position jumps caused by interference that could lead to misjudgment of the key position. Attached Figure Description
[0056] Figure 1 This is a schematic diagram showing the division of the vehicle body into regions with the vehicle coordinate origin as the origin. Detailed Implementation
[0057] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments carried out by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] This invention provides an algorithm for preventing position detection jitter, comprising the following steps:
[0059] S1: Set the center point (x0, y0) of the rectangular area PS of the vehicle body projection as the origin of the coordinate system, take the direction from the front of the vehicle to the rear of the vehicle as the longitudinal X-axis, and the direction from the right side of the vehicle body to the left side as the transverse Y-axis. The area outside the area PS is the area PE. The area PE is divided into sub-areas, including the front of the vehicle, the rear of the vehicle, the left front door, the left rear door, the right front door, and the right rear door area.
[0060] S2: Divide each sub-region into a detection region and a critical region;
[0061] S3: Determine if the current key detection position is within region PS. If it is, the key position type remains unchanged, using the previous position type. Then, determine if the key has entered the PS detection region. If so, the position type is set to PS; otherwise, check if the current key detection position is within region PE. If it is within PE, determine if the key is in any of the sub-region detection positions. If so, determine if it has entered the sub-region detection area. If so, change the key position type to the sub-region position type. If not within PE, set the key position to an unknown region, and set type to unknown.
[0062] Among them, such as Figure 1 As shown, the length of region PS is L and the width is w; when dividing region PE, the four vertices of region PS are extended outward to connect to the four vertices of region PE, dividing region PE into front, rear, left and right regions; the angle between the extension line and the longitudinal centerline of the vehicle body is 45°; the left region is divided into left front door and left rear door regions, and the right region is divided into right front door and right rear door regions.
[0063] The regions PE and PS have the same shape and are in a preset size ratio. The distance between each corresponding side of each region PS and its corresponding region PE is r. The inner part of the region PS is a dashed region PS used as the detection area.
[0064] Each sub-region and its corresponding detection region have the same shape and are in a preset size ratio; the distance between each detection region and each corresponding edge of its corresponding sub-region is d; the critical region is a ring shape with a width of d.
[0065] The coordinate range of the sub-region is defined as follows:
[0066] The x-coordinate of the vehicle's front end is x_head = x0–L / 2;
[0067] The x-coordinate of the rear of the vehicle is x_tail = x0 + L / 2;
[0068] The y-coordinate of the left side of the car is y_left = y0 + w / 2;
[0069] The y-coordinate of the right side of the car is y_right = y0 – w / 2.
[0070] S3 further includes: determining whether the current car key is in region PS, the determination formula is:
[0071] x >= x_head && x <= x_tail, y>= y_right && y << y_left;
[0072] If it is in the region PS, then the previous location type will be used;
[0073] When the key enters the dashed PS detection area, i.e., x >= x_head + d && x <= x_tail –d , y>= y_right + d && y << y_left –d , then update the position type type = PS.
[0074] S3 further includes: if the current car key is not in area PS, then determining whether the current car key is located anywhere in area PE, and sequentially determining the positions of the front, rear, left front door, left rear door, right front door, and right rear door in the sub-area, including:
[0075] S301: Obtain the current location of the car key in any of the sub-regions;
[0076] S302: Determine the previous key location type. If the location type is not in the sub-region location, i.e., the location type is type = unknown, then change it to the current key location type = sub-region location; if the previous location type is not unknown, then go to S303.
[0077] S303: Determine whether the key has entered the sub-region detection area. If the current key's x, y position type satisfies the formula condition of the sub-region detection area, then change the current key position type to type = sub-region position, and add the type to the position type array. Determine whether the number of the newly added key position type type in the position type array is half of the maximum number of data stored in the array. If so, then use the current key position as the new type position; otherwise, it is determined that the current key position has been disturbed and caused a position jump, and it continues to remain in the original type position.
[0078] The determination of the location of the sub-region includes:
[0079] The formula for determining the rear area of the vehicle is:
[0080] x > x_tail && x < x_tail + r && y + x > y_right + x_tail && y – x <y_left – x_tail。
[0081] The formula for determining the front area of the vehicle is:
[0082] x > x_head - r && x < x_head && y - x > y_right - x_head && y + x <y_left + x_head;
[0083] The formula for determining the left front door area is:
[0084] y > y_left && y < y_left + r && x + y > x_head + y_left && x < x0 .
[0085] The formula for determining the left rear door area is:
[0086] y > y_left && y < y_left r && x > x0 && x - y < x_tail - y_left.
[0087] The formula for determining the right front door area is:
[0088] y < y_right && y > y_right - r && x - y > x_head - y_right && x < x0.
[0089] The formula for determining the right rear door area is:
[0090] y < y_right && y > y_right - r && x > x0 && x + y < x_tail + y_right.
[0091] The determination of the sub-region detection area includes the following:
[0092] The formula for determining whether the key has entered the rear detection area is:
[0093] x > x_tail + d && x < x_tail + r - d && y + x > y_right + x_tail + d&& y – x < y_left – x_tail –d.
[0094] The formula for determining whether the key has entered the front detection area of the vehicle is as follows:
[0095] x > x_head - r + d && x < x_head - d && y - x > y_right - x_head + d&& y +x < y_left + x_head –d.
[0096] The formula for determining whether the key has entered the detection area of the left front door is:
[0097] y > y_left + d && y < y_left + r –d && x + y > x_head + y_left + d &&x < x0 - d.
[0098] The formula for determining whether the key has entered the left rear door detection area is:
[0099] y > y_left + d && y < y_left r – d && x > x0 + d && x - y < x_tail -y_left - d.
[0100] The formula for determining whether the key has entered the detection area of the right front door is:
[0101] y < y_right - d && y > y_right - r + d && x - y > x_head - y_right +d && x < x0 - d.
[0102] The formula for determining whether the key has entered the right rear door detection area is:
[0103] y < y_right - d && y > y_right - r + d && x > x0 + d && x + y < x_tail + y_right - d.
[0104] The key location type array stores 10 historical location type records and updates the data in real time at a preset frequency; each time a new key location type is added to the key location type array, the first key location type added is removed.
[0105] The key location type array stores 10 historical location type records and updates the data in real time at a preset frequency.
[0106] Each time a new key position type is added to the key position type array, the first key position type added is removed.
[0107] As another preferred option, such as Figure 1As shown, the dashed lines in each of the following sub-regions—front, rear, left front door, left rear door, right front door, and right rear door—serve as the detection area. The area enclosed by the dashed lines and the solid lines of the sub-regions is designated as the critical region. When a car key is detected moving from outside region PE to inside region PE, and before the key enters the dashed line range of any sub-region, the key position type (type) remains the same as the previous position type. This continues until the key position is detected entering the dashed line range of any sub-region. For example, entering the rear coordinate range: x > x_tail + d && x < x_tail + r - d && y + x > y_right + x_tail + d && y – x < y_left – x_tail –d, then the key has entered the detection region of the rear region. In this case, the key position type (type) is changed to rear region PE and added to the key position type array. Continue to determine whether the number of positions belonging to the rear area location type in the array is half of the maximum number of data stored in the array. If the maximum number of data stored in the array is 10, that is, the number of positions belonging to the rear area location type exceeds 5, then the current key position is taken as the new type position. If the data deviation is detected due to a position jump, then the number of detected positions belonging to the rear area location type does not exceed 5. If there is only 1, it means that there is another location type in the current array that exceeds 5. If the other location type is the body location type, it means that the current car key is retained as the original location type, that is, the car key location type is the interior PS, and only a few jump points are the rear type. In this case, it is determined that the current key position is affected by interference and the position jump is caused, and it continues to be retained in the original type position.
[0108] This invention discloses an algorithm to prevent position detection jitter. The algorithm sets the center point of the rectangular area PS projected onto the vehicle body as the origin, uses the direction from the front to the rear of the vehicle as the longitudinal X-axis, and the direction from the right side of the vehicle body to the left as the lateral Y-axis. An area PE is defined outside the area PS. The area PE is further divided into sub-regions, each sub-region consisting of a detection area and a critical area. The algorithm determines whether the current key's detection position is within the area PS. If it is, the key position type remains unchanged, using the previous position type, and the algorithm continues to determine if it has entered the PS detection area. If so, the position type is changed to the PS area. Otherwise, the algorithm checks whether the current key's detection position is within the area PE. If it is within the PE area, the algorithm continues to determine whether the current key is within any of the sub-region detection positions. If it is, the algorithm continues to determine if it has entered the sub-region detection area. If so, the key position type is changed to the sub-region position type. If it is not within the PE area, the key position is set to an unknown area, and type = unknown. Then, based on whether the current position type is greater than half the number of elements in the position type array, it is determined whether to update the current position type, thereby preventing position jumps caused by interference from leading to misjudgment of the key position.
[0109] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. An algorithm for preventing position detection jitter, characterized in that, Includes the following steps: S1: Set the center point (x0, y0) of the rectangular area PS of the vehicle body projection as the origin of the coordinate system, with the direction from the front to the rear of the vehicle as the longitudinal X-axis and the direction from the right side of the vehicle body to the left side as the transverse Y-axis; the area PE is defined around the area PS. When dividing the area PE, extend the four vertices of the area PS outwards and connect them to the four vertices of the area PE, dividing the area PE into the front, rear, left, and right areas; the angle between the extended lines and the longitudinal centerline of the vehicle body area is 45°; the area PE is further divided into sub-areas, including the front, rear, left front door, left rear door, right front door, and right rear door areas; the left side area is divided into the left front door and left rear door areas, and the right side area is divided into the right front door and right rear door areas; S2: Divide each sub-region into a detection region and a critical region; S3: Determine if the current key detection position is within the area PS. If it is, the key position type remains unchanged and the previous position type is used. Next, determine whether the key has entered the PS detection area; if so, the location type is set to PS. Otherwise, check if the current car key is detected in the PE area. If it is in the PE area, continue to determine if the current car key is in any of the sub-area detection positions. If it is, continue to determine if it has entered the detection area of the sub-area. If it is, change the key position type to sub-area position type. If it is not in the PE area, set the key position to unknown area, type=unknown. The step S3 further includes: If the current car key is not in area PS, then determine whether the current car key is located anywhere in area PE, and sequentially determine the position of the front of the car, rear of the car, left front door, left rear door, right front door, and right rear door in the sub-area, including: S301: Obtain the current location of the car key in any of the sub-regions; S302: Determine the previous key location type. If the location type is not in the sub-region location, i.e., the location type is type=unknown, then change it to the current key location type=sub-region location; if the previous location type is not unknown, then go to S303. S303: Determine whether the key has entered the sub-region detection area. If the current key's x, y position type satisfies the formula condition of the sub-region detection area, then change the current key position type to type=sub-region position and add the type to the position type array. Determine whether the number of the newly added key position type type in the position type array is half of the maximum number of data stored in the array. If so, then use the current key position as the new type position; otherwise, it is determined that the current key position has been disturbed and caused a position jump, and it continues to remain in the original type position.
2. The algorithm for preventing position detection jitter according to claim 1, characterized in that, S1 further includes: The region PS has a length of L and a width of w.
3. The algorithm for preventing position detection jitter according to claim 2, characterized in that, The regions PE and PS have the same shape and are in a preset proportional size. The distance between each corresponding side of each region PS and its corresponding region PE is r; the inner part of the region PS is a dashed-line region PS as the detection region.
4. The algorithm for preventing position detection jitter according to claim 3, characterized in that, It further includes: Each sub-region and its corresponding detection region have the same shape and are in a preset proportional size; the distance between each corresponding side of each detection region and its corresponding sub-region is d; the critical region is in the shape of a ring with a width of d.
5. The algorithm for preventing position detection jitter according to claim 4, characterized in that, It further includes: Define the coordinate range of the sub-region as: The x-coordinate of the vehicle head x_head = x0 – L / 2; The x-coordinate of the vehicle tail x_tail = x0 + L / 2; The y-coordinate of the left side of the vehicle y_left = y0 + w / 2; The y-coordinate of the right side of the vehicle y_right = y0 – w / 2.
6. The algorithm for preventing position detection jitter according to claim 5, characterized in that, The S3 further includes: Judge whether the current car key is in the region PS. The judgment formula is: x >= x_head && x <= x_tail, y >= y_right && y << y_left; If it is in the region PS, the previous position type is continued; when the key enters the dashed-line PS detection region, that is, x >= x_head + d && x <= x_tail – d, y >= y_right + d && y << y_left – d, then update the position type type = PS.
7. The algorithm for preventing position detection jitter according to claim 6, characterized in that, The judgment of the sub-region position includes: The judgment formula for the vehicle tail region is: x > x_tail && x < x_tail + r && y + x > y_right + x_tail && y – x < y_left – x_tail; The judgment formula for the vehicle head region is: x > x_head - r && x < x_head && y - x > y_right - x_head && y + x < y_left + x_head; The judgment formula for the left front door region is: y > y_left && y < y_left + r && x + y > x_head + y_left && x < x0; The judgment formula for the left rear door region is: y > y_left && y < y_left + r && x > x0 && x - y < x_tail - y_left; The judgment formula for the right front door region is: y < y_right && y > y_right - r && x - y > x_head - y_right && x < x0; The judgment formula for the right rear door region is: y < y_right && y > y_right - r && x > x0 && x + y < x_tail + y_right.
8. The algorithm for preventing position detection jitter according to claim 7, characterized in that, The judgment of the sub-region detection region includes: Judge whether the key enters the vehicle tail detection region. The judgment formula is: x > x_tail + d && x < x_tail + r - d && y + x > y_right + x_tail + d && y – x < y_left – x_tail – d; Judge whether the key enters the vehicle head detection region. The judgment formula is: x>x_head-r+d&&x<x_head-d&&y-x> y_right-x_head+d&&y+x <y_left+x_head–d; The formula for determining whether the key has entered the detection area of the left front door is: y>y_left+d&&y<y_left+r–d&&x+y> x_head+y_left+d&&x <x0-d; The formula for determining whether the key has entered the left rear door detection area is: y>y_left+d&&y<y_left+r–d&&x> x0+d&&x-y <x_tail-y_left-d; The formula for determining whether the key has entered the detection area of the right front door is: y<y_right-d&&y> y_right–r+d&&x-y>x_head-y_right+d&&x <x0-d; The formula for determining whether the key has entered the right rear door detection area is: y<y_right-d&&y> y_right-r+d&&x>x0+d&&x+y <x_tail+y_right-d。 9. The algorithm for preventing position detection jitter according to claim 8, characterized in that, The key location type array stores 10 historical location type records and updates the data in real time at a preset frequency; each time a new key location type is added to the key location type array, the first key location type added is removed.
Citation Information
Patent Citations
Positioning method and system
CN112147570A
Key positioning device for vehicle, vehicle with same and method
CN112468955A