A port-based truck positioning data correction method and system
By initializing and formatting truck positioning data, and combining this with port characteristics for detection and correction, the problem of inaccurate positioning data in port container operations was solved, improving the stability and accuracy of truck positioning and enhancing port operation efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN SIXIN INTERNET OF THINGS TECH CO LTD
- Filing Date
- 2025-07-24
- Publication Date
- 2026-07-31
AI Technical Summary
In port container operations, the positioning data of container trucks is affected by environmental interference, resulting in inaccurate positioning accuracy, problems such as brief signal loss, position deviation and lateral jitter, and existing technologies lack targeted solutions.
By initializing basic data, receiving and formatting truck positioning data, performing coordinate validity, position and speed detection, and classifying and correcting the results, including setting speed thresholds and area judgment, using ray casting to determine position, and correcting truck positioning data.
It improves the stability and accuracy of truck positioning data, reduces the impact of positioning drift on remote control operations, and enhances port operation efficiency.
Smart Images

Figure CN120928399B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of port container operation technology, and in particular to a method and system for correcting the positioning data of container trucks based on ports. Background Technology
[0002] Container operations at ports are a crucial link in modern logistics, involving the loading, unloading, transportation, and storage of containers by trucks. In the container yard, yard cranes are responsible for lifting and placing containers from trucks; at the quayside, quay cranes are responsible for lifting and placing containers from ships and trucks. Among these operations, the accuracy of positioning data is paramount. Given that positioning data is obtained at a frequency typically on the order of seconds, with short time differences between locations and minimal variability, and with the increasing prevalence of semi-automated, remote-controlled, and automated operations in ports, positioning data remains a critical element. Accurate and stable positioning data allows yard crane and quay crane operators to precisely determine the location of trucks, reducing the need for calibration of other sensors and effectively improving operational efficiency.
[0003] Currently, BeiDou / GPS positioning accuracy can reach the centimeter level, but this accuracy is primarily achieved in open environments with normal satellite reception. However, container operations in port yards and along the shore have stringent accuracy requirements. The port environment is highly susceptible to interference, including signal reflections from the metal structures of yard cranes and gantry cranes, specular reflections from the sea surface creating multipath effects, and signal blockages from numerous gantry cranes. These numerous interference factors affect positioning accuracy. Even with differential reference stations, trucks may still experience brief signal loss, positional shifts, and jitter while driving or operating in port yards and along the shore. Existing correction technologies primarily address general drift issues, with limited solutions for specific business scenarios. Summary of the Invention
[0004] In view of this, the purpose of this invention is to propose a port-based method for correcting container truck positioning data. This method combines basic data and positioning data during the container truck's operation to detect and correct abnormal positioning data, thereby ensuring that the container truck maintains consistent position and status during its corresponding work.
[0005] To achieve the above-mentioned technical objectives, the technical solution adopted by this invention is as follows:
[0006] This invention provides a method for correcting container truck positioning data based on ports, comprising the following steps:
[0007] Step 1: Initialize basic data to provide a data reference for detection and correction processing;
[0008] Step 2: Receive truck positioning data and format the truck positioning data uniformly;
[0009] Step 3: Perform coordinate validity detection, coordinate position detection, and speed detection on the truck positioning data;
[0010] Step 4: Classify and correct abnormal truck positioning data based on the detection results;
[0011] Step 5: Save the latest multiple normal or corrected truck positioning data.
[0012] Furthermore, the basic data in step 1 includes: the yard operation area, the shore operation area, the water area near the shore, the center line of the yard and shore road, and historical positioning data.
[0013] Furthermore, step 2 specifically includes:
[0014] Step 21: Receive truck location data from the message queue using topic subscription;
[0015] Step 22: Receive the truck positioning data from the device via the TCP-based Socket communication protocol;
[0016] Step 23: Receive truck positioning data from a third party using a TCP-based Socket communication protocol;
[0017] Step 24: Format the received truck positioning data into a unified JSON format.
[0018] Furthermore, the coordinate validity detection in step 3 includes:
[0019] Step 31: Check the integrity of the truck positioning data and verify whether the truck positioning data conforms to the NMEA0183 protocol format. If it does, the truck positioning data is complete; if not, the truck positioning data is incomplete or invalid.
[0020] Step 32: Verify the check digit, calculate the data check code and compare it with the original check code. If the comparison result is consistent, the verification passes; if the comparison result is inconsistent, the verification fails and the truck positioning data is invalid.
[0021] Step 33: Verify the rationality of the truck positioning data, including the rationality of the time, the rationality of the number of satellites, and the validity of the positioning status value; determine whether the time, the number of satellites, and the positioning status value are within a reasonable range. If so, the verification passes; if not, the verification fails, and the truck positioning data is invalid. There is no sequential order between Step 31, Step 32, and Step 33.
[0022] The coordinate position detection includes:
[0023] Step 34: Use the ray method to determine whether the location of the gantry crane positioning data is in the yard operation area, the shore operation area, the waters near the shore area, or other areas;
[0024] The speed detection includes:
[0025] Step 35: Convert the unit of the vehicle speed to kilometers per hour;
[0026] Step 36: Detect the magnitude of the current vehicle speed.
[0027] Further, the specific steps of Step 34 include:
[0028] Step 341: Set the gantry crane positioning data as the point P to be determined, set the yard operation area, the shore operation area, and the waters near the shore area as the polygon vertex set points, initialize the index j = points.Count - 1, representing the index of the last vertex; set the initial state inPoly = false, indicating that the point in the initial state is outside the polygon;
[0029] Step 342: Traverse each side AB of the polygon starting from the index i = 0, where A = points[i] and B = points[j];
[0030] Step 343: Determine whether P.X is between A.X and B.X, that is, satisfy A.X ≤ P.X < B.X or B.X ≤ P.X < A.X, where P.X represents the X coordinate value of point P in the two-dimensional space rectangular coordinate system, A.X represents the X coordinate value of point A in the two-dimensional space rectangular coordinate system, and B.X represents the X coordinate value of point B in the two-dimensional space rectangular coordinate system; if not satisfied, skip the current side processing and execute Step 346; if satisfied, enter Step 344;
[0031] Step 344: Calculate the intersection point Y_intersect of the side AB and the horizontal ray:
[0032] Y_intersect = A.Y + (P.X - A.X) / (B.X - A.X) × (B.Y - A.Y), where A.Y represents the Y coordinate value of point A in the two-dimensional space rectangular coordinate system, and B.Y represents the Y coordinate value of point B in the two-dimensional space rectangular coordinate system;
[0033] Step 345: Compare the magnitudes of P.Y and Y_intersect, where P.Y represents the Y coordinate value of point P in the two-dimensional space rectangular coordinate system. When P.Y > Y_intersect, flip the value of the inPoly state;
[0034] Step 346: Update the index j = i, increment i by 1, and repeat steps 342 to 346 until all edges are traversed while i < points.Count;
[0035] Step 347: Determine the positional relationship between point P and the polygon based on the final inPoly value:
[0036] When inPoly is true, it is determined that point P is inside the polygon;
[0037] When inPoly is false, it is determined that point P is outside the polygon.
[0038] Furthermore, step 4 specifically includes:
[0039] Step 41: Set the first speed threshold, the second speed threshold, and the third speed threshold, where the first speed threshold < the second speed threshold < the third speed threshold; when the gantry crane positioning data is in the yard operation area and the shore operation area, compare the vehicle speed with the preset first speed threshold, the second speed threshold, and the third speed threshold: when the vehicle speed ≤ the first speed threshold, perform speed processing, position processing, and direction processing; when the first speed threshold < the vehicle speed ≤ the second speed threshold, perform direction processing; when the second speed threshold < the vehicle speed ≤ the third speed threshold, keep the gantry crane positioning data unchanged; when the vehicle speed > the third speed threshold, perform speed processing; specifically including:
[0040] a1: If the vehicle speed ≤ the first speed threshold, then perform speed processing, position processing, and direction processing; for speed processing, set the vehicle speed to 0 km / h; for position processing, based on historical positioning data, determine whether there is a previous historical point. If so, correct the gantry crane positioning data to the position of the previous historical point. If not, correct the gantry crane positioning data to the foot of the perpendicular to the nearest road centerline. If the foot of the perpendicular exceeds the road centerline, correct it to the nearest endpoint of the road centerline; for direction processing, correct the vehicle direction according to the angle between the vehicle direction and the road centerline direction;
[0041] a2: If the first speed threshold < the vehicle speed ≤ the second speed threshold, then perform direction processing, that is, correct the vehicle direction according to the angle between the vehicle direction and the road centerline direction;
[0042] a3: If the second speed threshold < the vehicle speed ≤ the third speed threshold, it means that the gantry crane positioning data is a normal positioning point, and keep the gantry crane positioning data unchanged;
[0043] a4: If the vehicle speed > the third speed threshold, then perform speed processing, that is, set the vehicle speed to the third speed threshold;
[0044] a5. Obtain the normal or corrected truck positioning data and save it to the historical positioning data list;
[0045] Step 42: When the truck positioning data is in the water area near the shore, compare the vehicle speed with the preset first speed threshold and third speed threshold: When the vehicle speed > the third speed threshold, limit the speed to the third speed threshold; if there is a previous historical point and the vehicle speed ≤ the first speed threshold, perform speed processing, position processing, and direction processing; if the vehicle speed > the first speed threshold and the distance between the current position and the nearest road centerline is within the set range, perform direction processing and position processing; if the vehicle speed > the first speed threshold and the distance between the current position and the nearest road centerline is not within the set range, discard the current truck positioning data; specifically including:
[0046] b1. If the vehicle speed is greater than the third speed threshold, then set the vehicle speed to the third speed threshold.
[0047] b2. Determine whether there is a previous historical point based on historical positioning data. If yes, proceed to step b3; otherwise, perform direction and position processing. For direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. For speed processing, correct the truck positioning data to the foot of the perpendicular line to the nearest road centerline. If the foot of the perpendicular line exceeds the road centerline, correct it to the nearest endpoint of the road centerline.
[0048] b3. Determine whether the vehicle speed is less than or equal to the first speed threshold. If yes, perform speed processing, position processing, and direction processing. For speed processing, set the vehicle speed to 0 km / h. For position processing, correct the truck positioning data to the position of the previous historical point. For direction processing, correct the vehicle direction according to the angle between the vehicle direction and the road centerline direction. If no, proceed to step b4.
[0049] b4. Determine whether the distance between the truck positioning data and the nearest road centerline is within the set range. If so, perform direction and position processing. For direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. For speed processing, correct the truck positioning data to the foot of the perpendicular line to the nearest road centerline. If the foot of the perpendicular line exceeds the road centerline, correct it to the nearest endpoint of the road centerline. If not, discard the current truck positioning data.
[0050] b5. Obtain the corrected truck positioning data and save it to the historical positioning data list;
[0051] Step 43: When the truck positioning data is in other areas, compare the vehicle speed with the preset first speed threshold and third speed threshold: when the vehicle speed ≤ the first speed threshold, perform position processing and speed processing; when the vehicle speed > the third speed threshold, perform speed processing; when the first speed threshold < the vehicle speed ≤ the third speed threshold, keep the truck positioning data unchanged; specifically including:
[0052] c1. If the vehicle speed is less than or equal to the first speed threshold, the truck positioning data will be corrected to the position of the previous historical point based on the historical positioning data, and the vehicle speed will be set to 0 km / h.
[0053] c2. If the vehicle speed is greater than the third speed threshold, then set the vehicle speed to the third speed threshold.
[0054] c3. If the first speed threshold < vehicle speed ≤ third speed threshold, it means that the truck positioning data is a normal positioning point, and the truck positioning data should be kept unchanged.
[0055] c4. Obtain the normal or corrected truck positioning data and save it to the historical positioning data list.
[0056] Furthermore, the step of correcting the vehicle direction based on the angle between the vehicle's direction and the road centerline direction specifically includes:
[0057] Calculate the angle between the vehicle's direction and the positive direction of the road centerline;
[0058] If the included angle is ≤90° or ≥270°, the vehicle's direction should be corrected to the positive direction of the road centerline;
[0059] If 90° < included angle < 270°, then the vehicle's direction should be corrected to the opposite direction of the road centerline.
[0060] Furthermore, correcting the truck positioning data to the foot of the perpendicular line to the nearest road centerline specifically includes:
[0061] Obtain the coordinates of the start and end points of the road centerline;
[0062] Calculate the projection scale factor u from the positioning point corresponding to the truck's positioning data to the road centerline;
[0063] The position of the perpendicular foot is determined according to the projection scale factor u: when u = 0, the perpendicular foot coincides with the starting point; when u = 1, the perpendicular foot coincides with the ending point; when u < 0 or u > 1, the perpendicular foot is set as the nearest endpoint of the road centerline.
[0064] Furthermore, step 5 also includes: clearing historical positioning data when there is no new truck positioning data within a set time.
[0065] Step 5 is followed by:
[0066] Step 6: Output the processed truck positioning data to a message queue, WebSocket, or REST interface.
[0067] This invention also provides a port-based truck positioning data correction system, comprising:
[0068] The basic data initialization terminal is used to initialize basic data and provide data references for detection and correction processing.
[0069] The positioning data receiving end is used to receive the positioning data of the container trucks and format the positioning data of the container trucks in a unified manner;
[0070] The data detection end is used to perform coordinate validity detection, coordinate position detection, and speed detection on the positioning data of the container truck.
[0071] The data correction end is used to classify and correct abnormal truck positioning data based on the detection results;
[0072] The historical data storage terminal is used to store the latest multiple normal or corrected truck positioning data.
[0073] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0074] The key point of this invention lies in solving the problem of truck positioning data drift in port container operations. By considering the characteristics of container truck operations in ports, the status of trucks in yards and quayside operating areas, and influencing factors, targeted corrections and adjustments are made. This significantly improves the stability and accuracy of positioning data for overall monitoring personnel, remote control personnel, and command personnel. Users applying the corrected positioning data experience less confusion due to trailer positioning data issues; gantry crane operators experience less impact on the accuracy of remote control operations due to positioning drift; and the large-screen visualization prevents trucks from erratically veering and affecting the command personnel's overall control.
[0075] The features of this invention are:
[0076] 1. In conjunction with port container operations, perform positioning data correction processing to better meet the port's requirements for positioning data accuracy and visualization;
[0077] 2. The algorithm is simple and fast. The core correction algorithm of this invention does not use third-party plugins. This includes point-to-line proximity determination, inclusion query, distance calculation, and perpendicularity calculation of points and line segments, all implemented in the simplest way possible. Due to the second-level requirements for port truck positioning data (i.e., the requirement that the transmission interval of positioning data from one device is one second), and the need for algorithms to quickly process each piece of positioning data from hundreds or thousands of trucks to reduce latency, the algorithm is essential.
[0078] 3. Supports integration across different applications. This invention is a middleware service with a closed-loop operation from input to output, which also means that this invention can be integrated into different port application environments. Attached Figure Description
[0079] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0080] Figure 1 This is a flowchart illustrating the execution of a port-based truck positioning data correction method provided in an embodiment of the present invention.
[0081] Figure 2 This is a process diagram of receiving truck positioning data provided in an embodiment of the present invention.
[0082] Figure 3 This is a process diagram of detecting truck positioning data provided in an embodiment of the present invention.
[0083] Figure 4 This is a flowchart of the processing in the yard operation area and the shore operation area provided in the embodiments of the present invention.
[0084] Figure 5 This is a flowchart of the processing in the water area near the shore provided in an embodiment of the present invention.
[0085] Figure 6 This is a flowchart of the process for correcting vehicle direction provided in an embodiment of the present invention.
[0086] Figure 7 This is a structural block diagram of a port-based truck positioning data correction system provided in an embodiment of the present invention. Detailed Implementation
[0087] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0088] Please see Figure 1 The present invention provides a method for correcting container truck positioning data based on a port, comprising the following steps:
[0089] Step 1: Initialize basic data. This mainly involves initializing basic data into memory to provide data reference for detection and correction processing.
[0090] In this embodiment, the basic data includes: the yard operation area, the shore operation area, the water area near the shore, the center line of the yard and the shore road, and historical positioning data.
[0091] The purpose of the yard operation area and the shore operation area is to determine whether the input positioning data is within the operation area, so as to carry out special handling of positioning data anomalies in the operation area.
[0092] When trucks are operating near the shore, the slow speed or stop of the vehicles, the mirror effect of the ocean, and the steel of the gantry crane have a significant impact on the BeiDou / GPS positioning, which can easily cause problems with the received positioning data, causing it to deviate into the water. The correction of this type of positioning data is different from the processing of the operation area and other areas.
[0093] The road centerline is determined by matching and correcting adjacent roads based on the status of the container trucks in the storage yard.
[0094] Historical positioning data provides a reference for abnormal positioning data, helping to correct the current position and orientation of the truck.
[0095] Step 2: Receive truck positioning data and format the truck positioning data uniformly;
[0096] In this embodiment, step 2 specifically includes:
[0097] Step 21: Receive truck location data from the message queue using topic subscription;
[0098] Step 22: Receive the truck positioning data from the device via the TCP-based Socket communication protocol;
[0099] Step 23: Receive truck positioning data from a third party using a TCP-based Socket communication protocol;
[0100] Step 24: Format the received truck positioning data into a unified JSON format. The JSON structure mainly includes the following fields: device number, license plate number, positioning status, latitude and longitude, latitude and longitude direction, speed, direction, magnetic declination, magnetic declination direction, acquisition time, positioning mode, number of satellites, altitude, and other information. Among them, the device number and license plate number are bound to the truck for easy integration with business applications. The other data is used to transmit other agreed-upon information, as well as the original data information before correction. Figure 2 As shown.
[0101] Step 3: Perform coordinate validity checks, coordinate position checks, and speed checks on the truck positioning data; for example... Figure 3 As shown;
[0102] In this embodiment, the coordinate validity detection in step 3 mainly comes from the original positioning data of the device, and the coordinate validity is detected and verified from the following aspects:
[0103] Step 31: Check the integrity of the truck positioning data. Verify whether the truck positioning data conforms to the NMEA0183 protocol format. If it does, the truck positioning data is complete; otherwise, the truck positioning data is incomplete or invalid. For example, check the start and end characters. The truck positioning data from the equipment is mainly in BDRMC / GPRMC (BeiDou / GPS General Positioning Information) and BDGGA / GPGGA (BeiDou / Global Positioning System Fixed Data) formats. BDRMC / GPRMC and BDGGA / GPGGA are statements under the NMEA0183 protocol and must conform to a fixed format, with fields separated by commas and ending with "*check mark". If missing, the data is incomplete.
[0104] Step 32: Verify the check digit, calculate the data check code and compare it with the original check code. If the comparison result is consistent, the verification passes; if the comparison result is inconsistent, the verification fails and the truck positioning data is invalid. For example: take all characters after $ and before *, XOR the ASCII code of each character in the check data in sequence, and compare the calculation result with the hexadecimal number after * in the statement. If they are consistent, the verification passes; otherwise, the data is invalid.
[0105] Step 33: Verify the rationality of the truck positioning data, including time rationality, satellite number rationality, and positioning status value validity; determine whether the time, satellite number, and positioning status value are within a reasonable range. If so, the verification passes; if not, the verification fails and the truck positioning data is invalid. The time rationality mainly needs to conform to the actual time logic, including year, month, day, hour, minute, and second, and needs to be within the time range at the time of collection. For the satellite number rationality, it needs to be within the reasonable range of 1 to 12. No satellite number or more than 12 satellites are judged as abnormal. For the positioning status value validity, the second field in GPRMC is the positioning status. The value A represents valid, and the value V represents invalid. Only when the value is A can it be regarded as valid positioning data. The sixth field in GPGGA is the positioning status. The value 0 represents invalid, 1 represents GPS valid, and 2 represents differential GPS valid. Only when the value is 1 or 2 is it valid.
[0106] There is no sequential order among Step 31, Step 32, and Step 33.
[0107] After the validity of the coordinates is confirmed, the position of the coordinates will be detected. The position accuracy requirements in different regions are different, and the processing methods required are also different. The positioning position is mainly judged in three regions, including the yard and shore operation area, the water area near the shore, and other areas. The coordinate position detection includes:
[0108] Step 34: Use the ray method to determine whether the position where the truck positioning data is located is within the yard operation area, the shore operation area, the water area near the shore, or other areas.
[0109] In this embodiment, Step 34 specifically includes:
[0110] Step 341: Set the truck positioning data as the point P to be determined, set the yard operation area, the shore operation area, and the water area near the shore as the polygon vertex set points, and initialize the index j = points.Count - 1, representing the index of the last vertex; set the initial state inPoly = false, indicating that the point in the initial state is outside the polygon.
[0111] Step 342: Start traversing each side AB of the polygon from the index i = 0, where A = points[i] and B = points[j].
[0112] Step 343: Determine whether P.X is between A.X and B.X, that is, satisfy A.X ≤ P.X < B.X or B.X ≤ P.X < A.X, where P.X represents the X coordinate value of point P in the two-dimensional space rectangular coordinate system, A.X represents the X coordinate value of point A in the two-dimensional space rectangular coordinate system, and B.X represents the X coordinate value of point B in the two-dimensional space rectangular coordinate system. If not satisfied, skip the current side processing and execute Step 346; if satisfied, enter Step 344.
[0113] Step 344: Calculate the intersection point Y_intersect of side AB and the horizontal ray:
[0114] Y_intersect = A.Y + (P.X - A.X) / (B.X - A.X) × (B.Y - A.Y), where A.Y represents the Y coordinate value of point A in the two-dimensional Cartesian coordinate system, and B.Y represents the Y coordinate value of point B in the two-dimensional Cartesian coordinate system;
[0115] Step 345: Compare the magnitudes of P.Y and Y_intersect, where P.Y represents the Y coordinate value of point P in the two-dimensional Cartesian coordinate system. When P.Y > Y_intersect, that is, point P is below side AB, indicating that the ray based on point P passes through this side, then flip the inPoly status value;
[0116] Step 346: Update the index j = i, increment i by 1, i < points.Count, and repeat steps 342 to 346 until all sides are traversed;
[0117] Step 347: Determine the positional relationship between point P and the polygon based on the final inPoly value:
[0118] When inPoly is true, it indicates passing through the surface an odd number of times, and it is determined that point P is inside the polygon;
[0119] When inPoly is false, it indicates passing through an even number of times or not passing through, and it is determined that point P is outside the polygon.
[0120] The speed detection mainly focuses on the processing of extreme speed values. When the speed value is small, for example, when < 1 km / h, the positioning data points will jitter within a certain range; and sometimes there will be a speed value significantly greater than the current vehicle speed; processing is required, mainly by setting thresholds for determination, because there are speed limit requirements for vehicles driving in the port area, and container trucks will not have extremely high driving speeds during driving. The speed detection specifically includes:
[0121] Step 35: Convert the unit of the vehicle speed to kilometers per hour; for example: for GPRMC data, the speed unit needs to be converted from nautical miles per hour to kilometers per hour;
[0122] Step 36: Detect the magnitude of the current vehicle speed.
[0123] Step 4: Classify and correct the abnormal container truck positioning data according to the detection results, and directly discard the detected invalid positioning data; and the container truck positioning data in different regions is also processed in different ways;
[0124] In this embodiment, step 4 specifically includes:
[0125] Step 41: Set a first speed threshold, a second speed threshold, and a third speed threshold, wherein the first speed threshold < the second speed threshold < the third speed threshold. The first speed threshold is 0.2 km / h, the second speed threshold is 2 km / h, and the third speed threshold is the maximum speed limit for container trucks in the port. The value can be adjusted according to user needs.
[0126] When the truck's positioning data is within the yard or shore operation area—that is, when the truck enters the yard or shore operation area and its speed gradually decreases—the truck needs to be parked or operated according to the lane. In this case, the correction process mainly handles the following situations, comparing the vehicle speed with preset first, second, and third speed thresholds: When the vehicle speed ≤ the first speed threshold, speed processing, position processing, and direction processing are performed; when the first speed threshold < vehicle speed ≤ the second speed threshold, direction processing is performed; when the second speed threshold < vehicle speed ≤ the third speed threshold, the truck positioning data remains unchanged; when the vehicle speed > the third speed threshold, speed processing is performed. Specifically, this includes:
[0127] a1. If the vehicle speed is less than or equal to the first speed threshold (0.2 km / h), the vehicle can be considered to have basically stopped. However, the speed value of the vehicle's positioning data will fluctuate slightly and will not be exactly 0 km / h. At this point, the vehicle's position becomes unstable and will shake within the actual parking position range. Based on this situation, speed processing, position processing, and direction processing are required. For speed processing, the vehicle speed is set to 0 km / h. For position processing, based on historical positioning data, it is determined whether there is a previous historical point. If so, the truck positioning data is corrected to the position of the previous historical point. If not, the truck positioning data is corrected to the foot of the perpendicular to the nearest road centerline. If the foot of the perpendicular exceeds the road centerline, it is corrected to the nearest endpoint of the road centerline. If the road in the yard is one-way, it is directly corrected to the angle value parallel to the one-way road. For direction processing, the vehicle direction is corrected according to the angle between the vehicle direction and the road centerline direction.
[0128] a2. If the first speed threshold (0.2km / h) < vehicle speed ≤ second speed threshold (2km / h), it means the speed has decreased. The main task is to correct the vehicle's direction. In this case, the direction is adjusted, that is, the vehicle's direction is corrected according to the angle between the vehicle's direction and the direction of the road centerline.
[0129] a3. If the second speed threshold (2km / h) < vehicle speed ≤ third speed threshold (maximum speed limit), it means that the truck positioning data is a normal positioning point, and the truck positioning data should remain unchanged.
[0130] a4. If the vehicle speed is greater than the third speed threshold (maximum speed limit), then speed processing is performed, that is, the vehicle speed is set to the third speed threshold. Since it is within the work area, the position coordinates and direction are not processed at this time.
[0131] a5. Obtain the normal or corrected truck positioning data and save it to the historical positioning data list; the processing flow in the work area is as follows: Figure 4 As shown;
[0132] Step 42: When the truck positioning data is in the water area near the shore, meaning the positioning point data has entered the water or sea, this data is definitely incorrect and needs to be corrected. The vehicle speed is compared with the preset first and third speed thresholds: if the vehicle speed > the third speed threshold, the speed is limited to the third speed threshold; if a previous historical point exists and the vehicle speed ≤ the first speed threshold, speed processing, position processing, and direction processing are performed; if the vehicle speed > the first speed threshold and the distance between the current position and the nearest road centerline is within the set range, direction processing and position processing are performed; if the vehicle speed > the first speed threshold and the distance between the current position and the nearest road centerline is not within the set range, the current truck positioning data is discarded. Specifically, this includes:
[0133] b1. If the vehicle speed is greater than the third speed threshold, then set the vehicle speed to the third speed threshold.
[0134] b2. Determine whether there is a previous historical point based on historical positioning data. If yes, proceed to step b3; otherwise, perform direction and position processing. For direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. For speed processing, correct the truck positioning data to the foot of the perpendicular line to the nearest road centerline. If the foot of the perpendicular line exceeds the road centerline, correct it to the nearest endpoint of the road centerline.
[0135] b3. Determine if the vehicle speed is less than or equal to the first speed threshold (0.2 km / h). If yes (vehicle speed ≤ 0.2 km / h), perform speed processing, position processing, and direction processing. For speed processing, set the vehicle speed to 0 km / h; for position processing, correct the truck positioning data to the position of the previous historical point; for direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. If no (vehicle speed > 0.2 km / h), proceed to step b4.
[0136] b4. Determine if the distance between the truck positioning data and the nearest road centerline is within a set range (e.g., a set range of 3 meters, the specific value can be set according to user needs). If so, perform direction and position processing. For direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. For speed processing, correct the truck positioning data to the foot of the perpendicular to the nearest road centerline. If the foot of the perpendicular exceeds the road centerline, correct it to the nearest endpoint of the road centerline. If not, discard the current truck positioning data, that is, do not output it or save it to the historical positioning data list.
[0137] b5. Obtain the corrected truck positioning data and save it to the historical positioning data list. Based on this processing, it can be seen that vehicles in the water area near the shore, regardless of speed, generally travel along the center line of the road. The processing procedure in the water area near the shore is as follows: Figure 5 As shown.
[0138] Step 43: When the truck positioning data is in other areas (referring to non-operational areas and non-water areas), the interference factors are reduced, and the accuracy requirements for the positioning data are not as high. The main focus is on speed, comparing the vehicle speed with preset first and third speed thresholds: when the vehicle speed ≤ the first speed threshold, position processing and speed processing are performed; when the vehicle speed > the third speed threshold, speed processing is performed; when the first speed threshold < the vehicle speed ≤ the third speed threshold, the truck positioning data remains unchanged. Specifically, this includes:
[0139] c1. If the vehicle speed is less than or equal to the first speed threshold (0.2 km / h), the truck positioning data will be corrected to the position of the previous historical point based on the historical positioning data, and the vehicle speed will be set to 0 km / h. If the vehicle has just started and there is no record in the historical positioning data list, the current position coordinates and direction will be used directly.
[0140] c2. If the vehicle speed is greater than the third speed threshold (maximum speed limit), then set the vehicle speed to the third speed threshold.
[0141] c3. If the first speed threshold (0.2km / h) < vehicle speed ≤ third speed threshold (maximum speed limit), it means that the truck positioning data is a normal positioning point, and the truck positioning data should remain unchanged.
[0142] c4. Obtain the normal or corrected truck positioning data and save it to the historical positioning data list.
[0143] In this embodiment, the step of correcting the vehicle direction based on the angle between the vehicle's direction and the road centerline direction is as follows: Figure 6 As shown, it specifically includes:
[0144] Calculate the angle between the vehicle's direction and the positive direction of the road centerline, where the angle is between 0 and 360 degrees; assume the positive direction of the road centerline is 0 degrees and the negative direction is 180 degrees.
[0145] If the included angle is ≤90° or ≥270°, then the vehicle's direction should be corrected to the positive direction of the road centerline (meaning the front of the vehicle is close to the positive direction of the road).
[0146] If 90° < included angle < 270°, then the vehicle's direction should be corrected to the opposite direction of the road centerline (meaning the front of the vehicle is close to the opposite direction of the road).
[0147] In this embodiment, correcting the truck positioning data to the foot of the perpendicular line to the nearest road centerline specifically includes:
[0148] Obtain the coordinates of the start and end points of the road centerline;
[0149] Calculate the projection scale factor u from the positioning point corresponding to the truck's positioning data to the road centerline;
[0150] The position of the perpendicular foot is determined according to the projection scale factor u: when u = 0, the perpendicular foot coincides with the starting point; when u = 1, the perpendicular foot coincides with the ending point; when u < 0 or u > 1, the perpendicular foot is set as the nearest endpoint of the road centerline.
[0151] The logic for calculating the foot of the perpendicular from a point to a line is as follows:
[0152] a. Find the foot of the perpendicular from the point to the line (x, y), which is the projection point of the shortest distance from the point to the line. Let the point be p, and the line be composed of two points: begin and end.
[0153] b. Using the projection formula from a point to a line, first define two points of the line, begin(x1,y1) and end(x2,y2), and find its direction vector as: d=(dx,dy)=(x2-x1,y2-y1);
[0154] c. Next, find the foot of the perpendicular (x, y) from point pt(x0, y0) to the line. Calculate this using vector projection: u = [(x0, y0)] - x1)*dx+(y0-y1)*dy] / ((dx*dx)+(dy*dy));
[0155] d. Find the coordinates of the foot of the perpendicular: x = x1 + u*dx; y = x2 + u*dy; where: u is the projection scale factor; u = 0: the foot of the perpendicular is the beginning point; u = 1: the foot of the perpendicular is the end point; u < 0 or u > 1: the foot of the perpendicular is on the extension of the line.
[0156] The logic for correcting the positioning point when landing in a water area is as follows:
[0157] a. Let point P be the location point where the location lands in the water area; let road lines be listed as roadLines; let historyPoints be the historical location data list; and let lastP = .
[0158] historyPoints[historyPoints.length-1];
[0159] b. If the positioning point speed (vehicle speed) P. speed <= 0.2km / h, then set P. latitude and longitude = lastP. latitude and longitude; P. direction = lastP. direction; P. speed = 0;
[0160] c. If the positioning point speed (vehicle speed) P. speed > 0.2 km / h, an additional judgment is made: if P. speed > the maximum speed threshold, then P. speed = the maximum speed limit. At this time, by using the method of "calculating the foot of the perpendicular from a point to a line", the foot of the perpendicular from point P to the center line of each road (footP) is calculated. If the foot of the perpendicular exceeds the line, the foot of the perpendicular (footP) is set to the nearest endpoint. Then the distance from point P to the foot of the perpendicular is calculated. The one with the smallest distance is the closest to point P.
[0161] d. The distance between point P and the perpendicular foot: if the distance is >3 meters, discard it directly; if the distance is <=3 meters, set P.latitude and longitude = footP.latitude and longitude; in terms of direction processing, use the method of "setting the positive or negative direction of the vehicle's front approaching the center line of the road" to set the direction of point P;
[0162] e. The original location point information will be stored in other information fields in JSON format for later backtracking and querying.
[0163] Step 5: Save the latest multiple normal or corrected truck positioning data. If no new truck positioning data is received within a set time (e.g., 180 seconds, the value can be adjusted according to user needs), clear the historical positioning data; it will no longer be used as a reference for the above processing. This prevents the reasonableness of using the data as a processing reference from being lost for a long period without receiving positioning information. After new positioning data is received subsequently, a new historical positioning data list for the truck will be formed.
[0164] Step 6: Output the processed truck positioning data to a message queue, WebSocket, or REST interface to form a closed-loop process from input, detection, correction, and finally output and application.
[0165] like Figure 7 As shown, the present invention also provides a port-based truck positioning data correction system, comprising:
[0166] The basic data initialization terminal is used to initialize basic data and provide data references for detection and correction processing.
[0167] The positioning data receiving end is used to receive the positioning data of the container trucks and format the positioning data of the container trucks in a unified manner;
[0168] The data detection end is used to perform coordinate validity detection, coordinate position detection, and speed detection on the positioning data of the container truck.
[0169] The data correction end is used to classify and correct abnormal truck positioning data based on the detection results;
[0170] The historical data storage terminal is used to save the latest multiple normal or corrected truck positioning data. The historical positioning data is cleared when there is no new truck positioning data within a set time.
[0171] The positioning data output end is used to output the processed truck positioning data to a message queue, WebSocket, or REST interface.
[0172] The data detection end, data correction end, and historical data storage end constitute the main steps of the positioning data processing for container trucks in port container operations, providing suitable and accurate positioning data for the positioning data output end.
[0173] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for correcting container truck positioning data based on ports, characterized in that, Includes the following steps: Step 1: Initialize basic data to provide data reference for detection and correction processing; the basic data includes: yard operation area, shore operation area, water area near the shore, centerline of yard and shore road and historical positioning data; Step 2: Receive truck positioning data and format the truck positioning data uniformly; Step 3: Perform coordinate validity detection, coordinate position detection, and speed detection on the truck positioning data; Step 4: Based on the detection results, classify and correct abnormal truck positioning data; specifically including: Step 41: Set a first speed threshold, a second speed threshold, and a third speed threshold, where the first speed threshold < the second speed threshold < the third speed threshold; When the truck positioning data is in the yard operation area and the shore operation area, compare the vehicle speed with the preset first speed threshold, second speed threshold, and third speed threshold: When the vehicle speed ≤ the first speed threshold, perform speed processing, position processing, and direction processing; when the first speed threshold < the vehicle speed ≤ the second speed threshold, perform direction processing; when the second speed threshold < the vehicle speed ≤ the third speed threshold, keep the truck positioning data unchanged; when the vehicle speed > the third speed threshold, perform speed processing; specifically including: a1. If the vehicle speed is less than or equal to the first speed threshold, then speed processing, position processing, and direction processing are performed. For speed processing, the vehicle speed is set to 0 km / h. For position processing, based on historical positioning data, it is determined whether there is a previous historical point. If so, the truck positioning data is corrected to the position of the previous historical point. If not, the truck positioning data is corrected to the foot of the perpendicular to the nearest road centerline. If the foot of the perpendicular exceeds the road centerline, it is corrected to the nearest endpoint of the road centerline. For direction processing, the vehicle direction is corrected according to the angle between the vehicle direction and the road centerline direction. a2. If the first speed threshold < vehicle speed ≤ second speed threshold, then directional processing is performed, that is, the vehicle direction is corrected according to the angle between the vehicle direction and the road centerline direction. a3. If the second speed threshold < vehicle speed ≤ third speed threshold, it means that the truck positioning data is a normal positioning point, and the truck positioning data should be kept unchanged. a4. If the vehicle speed is greater than the third speed threshold, then speed processing is performed, that is, the vehicle speed is set to the third speed threshold. a5. Obtain the normal or corrected truck positioning data and save it to the historical positioning data list; Step 42: When the truck positioning data is in the water area near the shore, compare the vehicle speed with the preset first speed threshold and third speed threshold: When the vehicle speed > the third speed threshold, limit the speed to the third speed threshold; if there is a previous historical point and the vehicle speed ≤ the first speed threshold, perform speed processing, position processing, and direction processing; if the vehicle speed > the first speed threshold and the distance between the current position and the nearest road centerline is within the set range, perform direction processing and position processing; if the vehicle speed > the first speed threshold and the distance between the current position and the nearest road centerline is not within the set range, discard the current truck positioning data; specifically including: b1. If the vehicle speed is greater than the third speed threshold, then set the vehicle speed to the third speed threshold. b2. Determine whether there is a previous historical point based on historical positioning data. If yes, proceed to step b3; otherwise, perform direction and position processing. For direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. For speed processing, correct the truck positioning data to the foot of the perpendicular line to the nearest road centerline. If the foot of the perpendicular line exceeds the road centerline, correct it to the nearest endpoint of the road centerline. b3. Determine whether the vehicle speed is less than or equal to the first speed threshold. If so, perform speed processing, position processing, and direction processing. For speed processing, set the vehicle speed to 0 km / h. For position processing, correct the truck positioning data to the position of the previous historical point. For direction processing, correct the vehicle direction according to the angle between the vehicle direction and the road centerline direction. If not, proceed to step b4. b4. Determine whether the distance between the truck positioning data and the nearest road centerline is within the set range. If so, perform direction and position processing. For direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. For speed processing, correct the truck positioning data to the foot of the perpendicular line to the nearest road centerline. If the foot of the perpendicular line exceeds the road centerline, correct it to the nearest endpoint of the road centerline. If not, discard the current truck positioning data. b5. Obtain the corrected truck positioning data and save it to the historical positioning data list; Step 43: When the truck positioning data is in other areas, compare the vehicle speed with the preset first speed threshold and third speed threshold: when the vehicle speed ≤ the first speed threshold, perform position processing and speed processing; when the vehicle speed > the third speed threshold, perform speed processing; when the first speed threshold < the vehicle speed ≤ the third speed threshold, keep the truck positioning data unchanged; specifically including: c1. If the vehicle speed is less than or equal to the first speed threshold, the truck positioning data will be corrected to the position of the previous historical point based on the historical positioning data, and the vehicle speed will be set to 0 km / h. c2. If the vehicle speed is greater than the third speed threshold, then set the vehicle speed to the third speed threshold. c3. If the first speed threshold < vehicle speed ≤ third speed threshold, it means that the truck positioning data is a normal positioning point, and the truck positioning data should be kept unchanged. c4. Obtain the normal or corrected truck positioning data and save it to the historical positioning data list; Step 5: Save the latest multiple normal or corrected truck positioning data.
2. The port-based tractor positioning data correction method of claim 1, wherein, Step 2 specifically includes: Step 21: Receive truck location data from the message queue using topic subscription; Step 22: Receive the truck positioning data from the device via the TCP-based Socket communication protocol; Step 23: Receive truck positioning data from a third party using a TCP-based Socket communication protocol; Step 24: Format the received truck positioning data into a unified JSON format.
3. The method for correcting container truck positioning data based on a port as described in claim 1, characterized in that, The coordinate validity check in step 3 includes: Step 31: Check the integrity of the truck positioning data to verify whether the truck positioning data conforms to the NMEA0183 protocol format. If so, it indicates that the truck positioning data is complete; if not, it indicates that the truck positioning data is incomplete and the truck positioning data is invalid. Step 32: Verify the check digit. Calculate the data check code and compare it with the original check digit. If the comparison result is consistent, the verification passes; if the comparison result is inconsistent, the verification fails and the truck positioning data is invalid. Step 33: Verify the reasonableness of the truck positioning data, including time reasonableness, satellite number reasonableness, and positioning status value validity. Determine whether the time, satellite number, and positioning status value are within a reasonable range. If so, the verification passes; if not, the verification fails and the truck positioning data is invalid. There is no sequential order among Step 31, Step 32, and Step 33. The coordinate position detection includes: Step 34: Use the ray method to determine whether the position where the truck positioning data is located is within the yard operation area, shore operation area, waters near the shore area, or other areas. The speed detection includes: Step 35: Convert the unit of the vehicle speed to kilometers per hour. Step 36: Detect the magnitude of the current vehicle speed.
4. The port-based tractor positioning data correction method of claim 3, wherein, The specific content of Step 34 includes: Step 341: Set the truck positioning data as the point P to be determined, set the yard operation area, shore operation area, and waters near the shore area as the polygon vertex set points, and initialize the index j = points.Count - 1, indicating the index of the last vertex; set the initial state inPoly = false, indicating that the point in the initial state is outside the polygon. Step 342: Traverse each side AB of the polygon starting from the index i = 0, where A = points[i] and B = points[j]. Step 343: Determine whether P.X is between A.X and B.X, that is, satisfy A.X ≤ P.X < B.X or B.X ≤ P.X < A.X, where P.X represents the X coordinate value of point P in the two-dimensional space rectangular coordinate system, A.X represents the X coordinate value of point A in the two-dimensional space rectangular coordinate system, and B.X represents the X coordinate value of point B in the two-dimensional space rectangular coordinate system. If not satisfied, skip the current side processing and execute Step 346; if satisfied, enter Step 344. Step 344: Calculate the intersection point Y_intersect of side AB and the horizontal ray: Y_intersect = A.Y + (P.X - A.X) / (B.X - A.X) × (B.Y - A.Y), where A.Y represents the Y coordinate value of point A in the two-dimensional space rectangular coordinate system, and B.Y represents the Y coordinate value of point B in the two-dimensional space rectangular coordinate system. Step 345: Compare the magnitudes of P.Y and Y_intersect, where P.Y represents the Y coordinate value of point P in the two-dimensional space rectangular coordinate system. When P.Y > Y_intersect, flip the state value of inPoly. Step 346: Update the index j = i, increment i by 1, if i < points.Count, repeat Steps 342 to 346 until all edges are traversed; Step 347: Determine the positional relationship between point P and the polygon based on the final inPoly value: When inPoly is true, it is determined that point P is inside the polygon; When inPoly is false, it is determined that point P is outside the polygon.
5. The port-based tractor positioning data correction method of claim 1, wherein, The correction of the vehicle direction according to the angle between the vehicle direction and the road centerline direction specifically includes: Calculate the angle between the vehicle direction and the positive direction of the road centerline; If the angle ≤ 90° or ≥ 270°, correct the vehicle direction to the positive direction of the road centerline; If 90° < angle < 270°, correct the vehicle direction to the opposite direction of the road centerline.
6. The port-based tractor positioning data correction method of claim 1, wherein, The correction of the container truck positioning data to the foot of the perpendicular closest to the road centerline specifically includes: Obtain the starting and ending coordinates of the road centerline; Calculate the projection scale factor u of the positioning point corresponding to the container truck positioning data onto the road centerline; Determine the position of the foot of the perpendicular according to the projection scale factor u: when u = 0, the foot of the perpendicular coincides with the starting point; when u = 1, the foot of the perpendicular coincides with the ending point; when u < 0 or u > 1, set the foot of the perpendicular as the closest endpoint of the road centerline.
7. The port-based tractor positioning data correction method of claim 1, wherein, After Step 5, it further includes: clearing the historical positioning data when there is no new container truck positioning data within a set time; After Step 5, it further includes: Step 6: Output the processed container truck positioning data to a message queue, WebSocket or Rest interface.
8. A port-based truck positioning data correction system, characterized in that, It includes: A basic data initialization end, used to initialize basic data and provide a data reference for detection and correction processing; The basic data includes: the yard operation area, the shore operation area, the water area near the shore, the yard and the shore road centerline, and historical positioning data; A positioning data receiving end, used to receive container truck positioning data and uniformly format the container truck positioning data; A data detection end, used to perform coordinate validity detection, coordinate position detection and speed detection on the container truck positioning data; A data correction end, used to perform classification and correction processing on abnormal container truck positioning data according to the detection results; specifically includes: Set a first speed threshold, a second speed threshold and a third speed threshold, and the first speed threshold < the second speed threshold < the third speed threshold; when the container truck positioning data is in the yard operation area and the shore operation area, compare the vehicle speed with the preset first speed threshold, second speed threshold and third speed threshold: when the vehicle speed ≤ the first speed threshold, perform speed processing, position processing and direction processing; when the first speed threshold < vehicle speed ≤ the second speed threshold, perform direction processing; when the second speed threshold < vehicle speed ≤ the third speed threshold, keep the container truck positioning data unchanged; when the vehicle speed > the third speed threshold, perform speed processing; specifically includes: a1. If the vehicle speed is less than or equal to the first speed threshold, then speed processing, position processing, and direction processing are performed. For speed processing, the vehicle speed is set to 0 km / h. For position processing, based on historical positioning data, it is determined whether there is a previous historical point. If so, the truck positioning data is corrected to the position of the previous historical point. If not, the truck positioning data is corrected to the foot of the perpendicular to the nearest road centerline. If the foot of the perpendicular exceeds the road centerline, it is corrected to the nearest endpoint of the road centerline. For direction processing, the vehicle direction is corrected according to the angle between the vehicle direction and the road centerline direction. a2. If the first speed threshold < vehicle speed ≤ second speed threshold, then directional processing is performed, that is, the vehicle direction is corrected according to the angle between the vehicle direction and the road centerline direction. a3. If the second speed threshold < vehicle speed ≤ third speed threshold, it means that the truck positioning data is a normal positioning point, and the truck positioning data should be kept unchanged. a4. If the vehicle speed is greater than the third speed threshold, then speed processing is performed, that is, the vehicle speed is set to the third speed threshold. a5. Obtain the normal or corrected truck positioning data and save it to the historical positioning data list; When the truck's positioning data is in a water area near the shore, the vehicle speed is compared with preset first and third speed thresholds: if the vehicle speed > the third speed threshold, the speed is limited to the third speed threshold; if a previous historical point exists and the vehicle speed ≤ the first speed threshold, speed processing, position processing, and direction processing are performed; if the vehicle speed > the first speed threshold and the distance between the current position and the nearest road centerline is within a set range, direction processing and position processing are performed; if the vehicle speed > the first speed threshold and the distance between the current position and the nearest road centerline is not within a set range, the current truck positioning data is discarded; specifically including: b1. If the vehicle speed is greater than the third speed threshold, then set the vehicle speed to the third speed threshold. b2. Determine whether there is a previous historical point based on historical positioning data. If yes, proceed to step b3; otherwise, perform direction and position processing. For direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. For speed processing, correct the truck positioning data to the foot of the perpendicular line to the nearest road centerline. If the foot of the perpendicular line exceeds the road centerline, correct it to the nearest endpoint of the road centerline. b3. Determine whether the vehicle speed is less than or equal to the first speed threshold. If so, perform speed processing, position processing, and direction processing. For speed processing, set the vehicle speed to 0 km / h. For position processing, correct the truck positioning data to the position of the previous historical point. For direction processing, correct the vehicle direction according to the angle between the vehicle direction and the road centerline direction. If not, proceed to step b4. b4. Determine whether the distance between the truck positioning data and the nearest road centerline is within the set range. If so, perform direction and position processing. For direction processing, correct the vehicle direction based on the angle between the vehicle direction and the road centerline direction. For speed processing, correct the truck positioning data to the foot of the perpendicular line to the nearest road centerline. If the foot of the perpendicular line exceeds the road centerline, correct it to the nearest endpoint of the road centerline. If not, discard the current truck positioning data. b5. Obtain the corrected truck positioning data and save it to the historical positioning data list; When the truck's positioning data is in other areas, the vehicle speed is compared with preset first and third speed thresholds: when the vehicle speed is less than or equal to the first speed threshold, position and speed processing are performed; when the vehicle speed is greater than the third speed threshold, speed processing is performed; when the first speed threshold is less than or equal to the third speed threshold, the truck's positioning data remains unchanged. Specifically, this includes: c1. If the vehicle speed is less than or equal to the first speed threshold, the truck positioning data will be corrected to the position of the previous historical point based on the historical positioning data, and the vehicle speed will be set to 0 km / h. c2. If the vehicle speed is greater than the third speed threshold, then set the vehicle speed to the third speed threshold. c3. If the first speed threshold < vehicle speed ≤ third speed threshold, it means that the truck positioning data is a normal positioning point, and the truck positioning data should be kept unchanged. c4. Obtain the normal or corrected truck positioning data and save it to the historical positioning data list; The historical data storage terminal is used to store the latest multiple normal or corrected truck positioning data.