Dangerous chemical vehicle electronic fence range judgment method
Through improved light projection algorithms and machine learning technology, the problem of traditional electronic fence technology being unable to determine whether hazardous chemical vehicles have crossed the boundary in irregular polygonal areas has been solved, and predictive deviation warnings have been achieved, improving the safety and security of hazardous chemical transportation. control ability.
Patent Information
- Application Number
- CN202410654926.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-05-24
AI Technical Summary
Traditional electronic fence technology cannot effectively judge the crossing of hazardous chemicals vehicles in complex irregular polygonal electronic fence areas, and lacks predictive deviation warning analysis, making it unable to meet the safety needs of hazardous chemicals transportation.
Using improved ray casting algorithm and machine learning technology, the location of hazardous chemicals vehicles is monitored in real time, and the longitude and latitude coordinates are obtained through positioning equipment. Combined with the vehicle's common routes and historical records, the support vector machine algorithm is used to predict the risk of trajectory deviation and achieve predictive deviation warning.
Accurately determine the vehicle position within the irregular polygon electronic fence area, improve the flexibility of judgment, issue timely alarms, reduce the probability of accidents, and enhance safety and control capabilities.
Smart Images

Figure CN118628004A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of logistics and transportation, and in particular to a method for determining the range of an electronic fence for a hazardous chemical vehicle. Background Art
[0002] With the rapid development of the hazardous chemicals transportation industry, the number of hazardous chemicals transportation vehicles on the roads is increasing. However, hazardous chemicals transportation is a high-risk industry, and strict safety measures need to be taken to ensure the safety of vehicles and personnel. Electronic fences are a common safety measure that can limit vehicles to travel within a specific range and reduce the chance of accidents.
[0003] Traditional electronic fence technology has some limitations, such as fixed range, fixed fence area shape, low accuracy, and inability to provide predictive deviation warnings based on the vehicle's usual routes. It cannot meet the actual needs of hazardous chemical vehicle transportation.
[0004] After searching, the Chinese patent application number is 2023114072324, and the application publication date is October 26, 2023, which discloses a method and device for judging the range of the electronic fence of the express delivery outlet. The method includes: obtaining source data with an electronic fence for judging the express delivery outlet; deduplicating the source data to obtain pre-processed data; using the convex hull algorithm principle to judge whether the electronic fence range formed by each position point in the pre-processed data is accurate, and obtaining a judgment result; according to the judgment result, determining the target data for accurately demarcating the electronic fence range of the express delivery outlet, the target data includes at least one electronic fence data; saving the target data, and the target data is used to demarcate the electronic fence range of the express delivery outlet to be judged. Although this method can be used to construct the range of the electronic fence, it cannot judge whether the target position is inside the electronic fence area, and its applicability is poor and its function is relatively limited.
[0005] The Chinese patent application number is 201811617347.5, and the application publication date is December 28, 2018. It discloses a method for judging the entry and exit of a bus based on the electronic fence of a bus stop. The method includes: collecting the coordinates of the first and last points on the side where the bus stop is located with an accuracy of centimeters and setting the width of the road; performing a Gaussian transformation to transform the latitude and longitude coordinates of the electronic fence and the bus position point into plane rectangular coordinates, and calculating the coordinates of the four vertices of the rectangular electronic fence, which are divided into the entry edge and the exit edge perpendicular to the road direction according to the entry intersection and exit intersection; judging whether the current position point of the bus and the position point of the last second are included in the electronic fence rectangle, and then judging whether the bus enters, exits or stops at the bus stop. Although this method can be used to judge whether the target position is located within the electronic fence, its scope of application is not wide. First, the electronic fence must be a rectangular area. Secondly, the position of the electronic fence is relatively fixed to the bus platform area, which is not flexible. In addition, no predictive deviation warning analysis is performed on the bus vehicle's driving route, and there is a lack of safety warning prompts.
[0006] Both of the above methods have realized the construction of the electronic fence area, but only partially realized whether the target position is located inside the electronic fence area. It is difficult to apply in the face of the reality of complex irregular polygonal electronic fence area crossing judgment, and it is impossible to make an accurate judgment. In addition, neither method analyzes the common driving routes and crossing warning records of the target point, and conducts predictive deviation warning analysis. Summary of the invention
[0007] In order to solve these problems, the present invention proposes a method for determining the range of an electronic fence for the location of a hazardous chemical vehicle. The method uses advanced positioning technology to monitor and track the location of the hazardous chemical vehicle. According to the actual situation of the hazardous chemical vehicle itself and the commonly used transportation routes, and using electronic fence technology, the vehicle's driving can be controlled, and the vehicle's movement trajectory can be tracked, checked and predicted at all times to issue alarms and take measures in a timely manner to ensure that the vehicle does not cross the electronic fence, thereby solving the problems raised in the background technology.
[0008] The specific technical solutions are as follows:
[0009] The present invention provides a method for determining the range of an electronic fence for a hazardous chemical vehicle, the method comprising:
[0010] S1, obtaining the longitude and latitude coordinate source data of each vertex of the polygonal electronic fence area to be judged, and performing vertex data deduplication processing, and sequentially connecting and constructing the polygonal electronic fence area according to the longitude and latitude positions of each vertex;
[0011] S2, performing standardized preprocessing on the source data obtained in S1, and then persistently storing the preprocessed electronic fence area data in the database;
[0012] S3. Obtain the longitude and latitude coordinates of the hazardous chemicals vehicle in real time through the positioning equipment installed on the hazardous chemicals vehicle;
[0013] S4. Find one or more polygonal electronic fence information associated with the hazardous chemical vehicle according to the license plate number of the hazardous chemical vehicle, and find out the longitude and latitude coordinate information of each vertex of the polygonal electronic fence area, so as to provide judgment data for subsequent judgment of whether the position of the hazardous chemical vehicle is within the electronic fence area;
[0014] S5. Using an improved ray casting algorithm to determine whether the location of the hazardous chemicals vehicle is within the associated polygonal electronic fence area;
[0015] S6. Perform data analysis based on the common routes and historical records of hazardous chemicals vehicles exceeding the electronic fence provided by the vehicle positioning system, and use machine learning algorithms to predict whether the hazardous chemicals vehicle's running trajectory will deviate from the electronic fence, thereby achieving predictive deviation warning.
[0016] Preferably, in S5, the specific steps of the improved ray casting algorithm include:
[0017] S5.1. Assume that the current position of the vehicle is (x, y), the polygonal electronic fence has n edges, and the endpoints of each edge are (x1, y1) and (x2, y2). A ray is emitted from the target point of the vehicle position to intersect with the polygonal electronic fence area;
[0018] S5.2. Initialize the number of intersection points count = 0. For each edge of the polygonal electronic fence area, obtain the two endpoints of the edge (x1, y1) and (x2, y2), and determine whether the ray intersects with the edge:
[0019] If the starting point (x, y) of the ray is between the two endpoints of the edge, or the edge is parallel to the ray, they do not intersect and continue to the next edge; otherwise, use equations (1) and (2) to calculate whether the ray intersects the fence boundary:
[0020] intersect x =x∈[x1,x2] (1)
[0021] intersect y =x∈[y1,y2] (2)
[0022] S5.3. If the x-coordinate and y-coordinate of the intersection point meet the above conditions, it is considered to be an intersection, and the intersection point count count is increased by count=count+1;
[0023] S5.4. Determine the parity of the number of intersection points count:
[0024] If count is an odd number, it means the vehicle is inside the polygonal electronic fence;
[0025] If count is an even number, it means the vehicle is outside the polygonal electronic fence;
[0026] S5.5. Based on the special target point, set the arc margin for movement. When the target point is at the fence boundary, fence vertex, projection line intersecting the fence vertex, or ray coinciding with the fence boundary, set the boundary distance to b. Draw a circle with b as radius for each vertex of the fence boundary involved. Extend the projection line to intersect the arc of the circle. The original vertex remains unchanged. The connecting lines of other boundaries are extended to the intersection point and set to p. Draw rays from the original vertex to re-judge the number of intersection points. Set the coordinates of the original vertex to (x0, y0), the angle between the projection line and the horizontal axis to θ, and the x and y in the coordinates of point p (x, y) are:
[0027] x=x0+b·cos(f(θ)+2πn)
[0028] y=y0+b·sin(f(θ)+2πn)
[0029] The above algorithm determines whether the vehicle is within the polygonal electronic fence by adding arc margin ray intersections, and determines the position according to the parity of the number of intersections.
[0030] Preferably, in S6, according to the scheduled route of the vehicle, a linear interpolation method is used to predict the position of the vehicle at a certain time point, so as to obtain a predicted vehicle running trajectory, which specifically includes:
[0031] Assume that the vehicle travels at a constant speed between each position point and along a straight line path connecting these position points;
[0032] Suppose there are a series of coordinates of position points, represented as (x1, y1), (x2, y2), ..., (x n ,y n ), where x i and i is the horizontal and vertical coordinates of the i-th position of the vehicle;
[0033] The linear interpolation formula of equation (3) and equation (4) is used to predict the vehicle's driving trajectory:
[0034]
[0035]
[0036] Among them, the adjustment coefficients α and β are introduced, which change dynamically based on external conditions or prior knowledge and are used to fine-tune the interpolation results. φ(α) and φ(β) are introduced nonlinear adjustment terms, which are set to ln(1+z), where z is any real number, which is used to increase or decrease the fine-tuning of the interpolation. t is the predicted time point, t i is the time of the i-th position point; considering possible time delay or acceleration, the time adjustment function τ(t)=t+δ is introduced; the time offsets dynamically adjusted based on certain conditions, Δx(t) and Δy(t) are used to optimize the accuracy of the interpolation results; based on historical data or prediction models, x(t) and y(t) represent the predicted horizontal and vertical coordinates at time point t, respectively;
[0037] Formulas (3) and (4) calculate the linear interpolation between two position points of the vehicle at a given time point t to obtain the position coordinates (x(t), y(t)) of the vehicle.
[0038] Preferably, in S6, a support vector machine is used to construct an algorithm model to predict whether the vehicle deviates from the electronic fence, specifically including:
[0039] Assume that the training data set contains m samples, each sample contains n features; for the i-th sample, it is expressed as in represents the jth feature of the sample, and the true label of the sample (whether it deviates from the electronic fence) is y i ,y i ∈{-1,1};
[0040] In order to predict the labels of new samples, a classification model needs to be learned from the training data set. The goal of the support vector machine algorithm is to find a hyperplane that can separate samples with different labels, while also ensuring that the "minimum distance" between the hyperplane and the training data is maximized, that is, the distance from the point closest to the hyperplane to the hyperplane is maximized.
[0041] Consider the standard form of the separating hyperplane: w T x+b=0, where w is the normal vector, indicating the direction of the hyperplane, and b is the offset; for a given sample x i ,y i (w T x i +b) is compared with 0 to determine its location. If y i (w T x i +b)>0, the sample is correctly classified, otherwise it is misclassified; so we need to find a suitable set of w and b so that all samples are correctly classified and the generalization error between the training data set and the test data set is minimized;
[0042] On the basis of the support vector machine algorithm, a soft margin support vector machine is adopted, which takes into account that there may be some noise or atypical data in the training data set, so a slack variable is introduced to allow some samples to be relaxed in the case of hyperplane misclassification, thereby obtaining a wide margin area;
[0043] Specifically, the objective function becomes:
[0044]
[0045] Among them, the constant c represents the penalty weight of the misclassified point; ε i is a slack variable, representing the classification error of the i-th sample, represents the sum of squares of distances from the hyperplane to each support vector. In order to make the support vector farthest from the hyperplane, the formula (5) should achieve the minimum value;
[0046] By solving formula (5), we get the corresponding classification decision function:
[0047]
[0048] Among them, α i is the coefficient obtained by Lagrangian optimization, which indicates the importance of each sample vector; represents the feature vector x i The inner product between the predicted data point x and the predicted data point x; b is the bias term, which is used to adjust the position of the decision boundary and thus affect the classification result; the sign() function in formula (6) represents the sign function, whose value is 1 or -1, which is used to classify new samples.
[0049] Preferably, after predicting whether the vehicle deviates from the electronic fence area, an alarm message is sent to the terminal device, and the alarm message is pushed to the corresponding vehicle driver's mobile phone.
[0050] The present invention has the following advantages:
[0051] The method for determining the range of an electronic fence for a hazardous chemical vehicle provided by the present invention can perform target detection within an irregular polygonal electronic fence area, thereby improving the flexibility of the determination method; it can also accurately determine whether a hazardous chemical vehicle exceeds the range of the electronic fence, and promptly issue an alarm or take measures, while preventing hazardous chemical vehicles from entering restricted areas or exceeding a control range, thereby reducing the probability of accidents, protecting the safety of vehicles and personnel, and improving safety; in addition, the present invention predicts vehicle trajectories based on commonly used routes in combination with a machine learning algorithm, thereby strengthening the early warning mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A flow chart of the method for determining the range of an electronic fence for hazardous chemicals vehicles provided by the present invention;
[0053] Figure 2 A visual schematic diagram of the electronic fence provided by the present invention;
[0054] Figure 3 A schematic diagram of an improved ray casting algorithm for setting arc margin provided by the present invention;
[0055] Figure 4 A predictive deviation warning flow chart provided by the present invention;
[0056] Figure 5 This is a schematic diagram of the predicted driving trajectory of a vehicle provided by the present invention. DETAILED DESCRIPTION
[0057] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Example 1
[0059] like Figure 1 As shown, this embodiment provides a method for determining the range of an electronic fence for a hazardous chemical vehicle, the method comprising:
[0060] S1, obtaining the longitude and latitude coordinate source data of each vertex of the polygonal electronic fence area to be determined, and performing vertex data deduplication processing, and sequentially connecting and constructing the polygonal electronic fence area according to the longitude and latitude positions of each vertex, and determining the polygonal electronic fence information;
[0061] In S1, the coordinate information of the positions of the vertices of the original electronic fence can be manually input by the user, or can be automatically identified and obtained by drawing with a mouse on an online map; the input process can be local input or remote input. The visual schematic diagram of the electronic fence is as follows: Figure 2 shown.
[0062] Specifically, the vertex position coordinates are mainly longitude and latitude coordinate information; due to occasional vertex duplication events caused by manual input or map recognition of raw data, vertex data deduplication processing is performed, and then each vertex position in the area is connected in sequence, and the hazardous chemical vehicle associated with it is selected.
[0063] S2, performing standardized preprocessing on the source data obtained in S1, and then persistently storing the preprocessed electronic fence area data in the database;
[0064] S3. Real-time communication with the vehicle positioning device to exchange data: The longitude and latitude coordinates of the hazardous chemicals vehicle are obtained in real time through the positioning device installed on the hazardous chemicals vehicle;
[0065] S4. Find one or more polygonal electronic fence information associated with the hazardous chemical vehicle according to the license plate number of the hazardous chemical vehicle, indicating that the vehicle should only be allowed to travel within this electronic fence area, and find out the longitude and latitude coordinate information of each vertex of the polygonal electronic fence area to provide judgment data for subsequent judgment of whether the position of the hazardous chemical vehicle is within the electronic fence area;
[0066] S5. Use an improved ray casting algorithm to determine whether the location of the hazardous chemicals vehicle is within the associated polygonal electronic fence area. From the target location of the vehicle, emit a ray in any direction to intersect the polygonal electronic fence area. Use the algorithm to determine whether the target location is beyond the polygonal electronic fence area. If it is beyond the area, issue an alarm.
[0067] In S5, the specific steps of the improved ray casting algorithm include:
[0068] S5.1. Assume that the current position of the vehicle is (x, y), the polygonal electronic fence has n edges, and the endpoints of each edge are (x1, y1) and (x2, y2). A ray is emitted from the target point of the vehicle position to intersect with the polygonal electronic fence area;
[0069] S5.2. Initialize the number of intersection points count = 0. For each edge of the polygonal electronic fence area, obtain the two endpoints of the edge (x1, y1) and (x2, y2), and determine whether the ray intersects with the edge:
[0070] If the starting point (x, y) of the ray is between the two endpoints of the edge, or the edge is parallel to the ray, they do not intersect and continue to the next edge; otherwise, use equations (1) and (2) to calculate whether the ray intersects the fence boundary:
[0071] intersect x =x∈[x1,x2] (1)
[0072] intersect y =x∈[y1,y2] (2)
[0073] S5.3. If the x-coordinate and y-coordinate of the intersection point meet the above conditions, it is considered to be intersecting, and the intersection point count count is increased by count=count+1;
[0074] S5.4. Determine the parity of the number of intersection points count:
[0075] If count is an odd number, it means the vehicle is inside the polygonal electronic fence;
[0076] If count is an even number, it means the vehicle is outside the polygonal electronic fence;
[0077] S5.5. Based on the special target point, set the arc margin for movement. When the target point is at the fence boundary, fence vertex, projection line intersecting the fence vertex, or ray coinciding with the fence boundary, set the boundary distance to b. Draw a circle with b as radius for each vertex of the fence boundary involved. Extend the projection line to intersect the arc of the circle. The original vertex remains unchanged. The connecting lines of other boundaries are extended to the intersection point and set to p. Draw rays from the original vertex to re-judge the number of intersection points. Set the coordinates of the original vertex to (x0, y0), the angle between the projection line and the horizontal axis to θ, and the x and y in the coordinates of point p (x, y) are:
[0078] x=x0+b·cos(f(θ)+2πn)
[0079] y=y0+b·sin(f(θ)+2πn)
[0080] For example, the selected data is that the vehicle position is located at the vertex of the fence area, and the angle between the projection line and the horizontal axis is 30 degrees, which can be substituted into the data for calculation.
[0081] The above algorithm determines whether the vehicle is within the polygonal electronic fence by adding arc margin ray intersection, and determines the position according to the parity of the number of intersections, such as Figure 3 shown.
[0082] S6. Perform data analysis (S6.1) based on the common routes and historical records of hazardous chemicals vehicles exceeding the electronic fence provided by the vehicle positioning system, and use machine learning algorithms to predict whether the hazardous chemicals vehicle's running trajectory will deviate from the electronic fence, implement predictive deviation warning, and improve the timeliness and effectiveness of responding to emergencies.
[0083] In S6, according to the scheduled route of the vehicle, a linear interpolation method is used to predict the position of the vehicle at a certain time point, so as to obtain a predicted vehicle running trajectory, which specifically includes:
[0084] Assuming that the vehicle travels at a constant speed between each position point and travels along a straight line connecting these position points, the schematic diagram of the vehicle's predicted driving trajectory is as follows: Figure 5 As shown;
[0085] Suppose there are a series of coordinates of position points, represented as (x1, y1), (x2, y2), ..., (x n ,y n ), where x i andi is the horizontal and vertical coordinates of the i-th position of the vehicle;
[0086] The linear interpolation formula of equation (3) and equation (4) is used to predict the vehicle's driving trajectory:
[0087]
[0088]
[0089] Among them, the adjustment coefficients α and β are introduced, which change dynamically based on external conditions or prior knowledge and are used to fine-tune the interpolation results. φ(α) and φ(β) are introduced nonlinear adjustment terms, which are set to ln(1+z), where z is any real number, which is used to increase or decrease the fine-tuning of the interpolation. t is the predicted time point, t i is the time of the i-th position point; considering possible time delay or acceleration, the time adjustment function τ(t)=t+δ is introduced; the time offsets dynamically adjusted based on certain conditions, Δx(t) and Δy(t) are used to optimize the accuracy of the interpolation results; based on historical data or prediction models, x(t) and y(t) represent the predicted horizontal and vertical coordinates at time point t, respectively;
[0090] For example, select the following data, a series of location point coordinates are: (35.66, 256.8), (65.42, 66.8), (78.6, 398.66)…, the latitude and longitude coordinates of the vehicle are: (32.66, 106.2).
[0091] Formulas (3) and (4) calculate the linear interpolation between two position points of the vehicle at a given time point t to obtain the position coordinates (x(t), y(t)) of the vehicle.
[0092] In S6, a support vector machine is used to construct an algorithm model to predict whether the vehicle deviates from the electronic fence (S6.2), which specifically includes:
[0093] Assume that the training data set contains m samples, each sample contains n features; for the i-th sample, it is expressed as in represents the jth feature of the sample, and the true label of the sample (whether it deviates from the electronic fence) is y i ,y i ∈{-1,1};
[0094] In order to predict the labels of new samples, a classification model needs to be learned from the training data set. The goal of the support vector machine algorithm is to find a hyperplane that can separate samples with different labels (S6.3), while also ensuring that the "minimum distance" between the hyperplane and the training data is maximized, that is, the distance from the point closest to the hyperplane to the hyperplane is maximized.
[0095] Consider the standard form of the separating hyperplane: w T x+b=0, where w is the normal vector, indicating the direction of the hyperplane, and b is the offset; for a given sample x i ,y i (w T x i +b) is compared with 0 to determine its location. If y i (w T x i +b)>0, the sample is correctly classified, otherwise it is misclassified; so we need to find a suitable set of w and b so that all samples are correctly classified and the generalization error between the training data set and the test data set is minimized;
[0096] On the basis of the support vector machine algorithm, a soft margin support vector machine is adopted, which takes into account that there may be some noise or atypical data in the training data set, so a slack variable is introduced to allow some samples to be relaxed in the case of hyperplane misclassification, thereby obtaining a wide margin area (S6.4);
[0097] Specifically, the objective function becomes:
[0098]
[0099] Among them, the constant c represents the penalty weight of the misclassified point; ε i is a slack variable, representing the classification error of the i-th sample, represents the sum of squares of distances from the hyperplane to each support vector. In order to make the support vector farthest from the hyperplane, the formula (5) should achieve the minimum value;
[0100] By solving formula (5), we get the corresponding classification decision function:
[0101]
[0102] Among them, α i is the coefficient obtained by Lagrangian optimization, which indicates the importance of each sample vector; represents the feature vector x i The inner product between the data point x to be predicted; b is the bias term, which is used to adjust the position of the decision boundary, thereby affecting the classification result; the sign() function in formula (6) represents the sign function, whose value is 1 or -1, which is used to classify new samples. The flowchart of prediction deviation warning is as follows Figure 4 shown.
[0103] Classification is performed according to the solution result of the sign() decision classification function (S6.5). A result of 1 indicates that the prediction result is that the vehicle is inside the fence range, and a result of -1 indicates that the prediction result is that the vehicle is outside the fence range. After predicting whether the vehicle deviates from the electronic fence area, an alarm message is sent to the terminal device and the alarm message is pushed to the corresponding vehicle driver's mobile phone.
[0104] The method and system disclosed in the present invention have the beneficial effects of improving safety, enhancing control ability, improving efficiency and strengthening early warning mechanism when applied in specific applications. It has important application value in the field of hazardous chemical vehicle transportation, can improve the safety and controllability of transportation, and ensure the safety of personnel and property.
[0105] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A method for determining the range of an electronic fence for hazardous chemicals vehicles. Features: Methods include: S1, obtaining the longitude and latitude coordinate source data of each vertex of the polygonal electronic fence area to be judged, and performing vertex data deduplication processing, and sequentially connecting and constructing the polygonal electronic fence area according to the longitude and latitude positions of each vertex; S2, perform standardized preprocessing on the source data obtained in S1, and then persist the preprocessed electronic fence area data in the database; S3. Obtain the longitude and latitude coordinates of the hazardous chemicals vehicle in real time through the positioning equipment installed on the hazardous chemicals vehicle; S4. Find one or more polygonal electronic fence information associated with the hazardous chemical vehicle according to the license plate number of the hazardous chemical vehicle, and find out the longitude and latitude coordinate information of each vertex of the polygonal electronic fence area, so as to provide judgment data for subsequent judgment of whether the position of the hazardous chemical vehicle is within the electronic fence area; S5. Using an improved ray casting algorithm to determine whether the location of the hazardous chemicals vehicle is within the associated polygonal electronic fence area; S6. Perform data analysis based on the common routes and historical records of hazardous chemicals vehicles exceeding the electronic fence provided by the vehicle positioning system, and use machine learning algorithms to predict whether the hazardous chemicals vehicle's running trajectory will deviate from the electronic fence, thereby achieving predictive deviation warning.
2. A method for determining the range of an electronic fence for a hazardous chemical vehicle according to claim 1, Features: In S5, the specific steps of the improved ray casting algorithm include: S5.
1. Assume that the current position of the vehicle is (x, y), and the polygonal electronic fence has n edges, and the endpoints of each edge are (x 1 ,y 1 ) and (x 2 ,y 2 ), a ray is sent from the vehicle position target point to intersect with the polygonal electronic fence area; S5.
2. Initialize the number of intersections count = 0. For each edge of the polygonal electronic fence area, obtain the two endpoints of the edge (x 1 ,y 1 ) and (x 2 ,y 2 ), determine whether the ray intersects the edge: If the starting point (x, y) of the ray is between the two endpoints of the edge, or the edge is parallel to the ray, they do not intersect and continue to the next edge; otherwise, use equations (1) and (2) to calculate whether the ray intersects the fence boundary: intersect x =x∈[x1,x2] (1) intersect y =x∈[y1,y2] (2) S5.
3. If the x-coordinate and y-coordinate of the intersection point meet the above conditions, it is considered to be an intersection, and the intersection point count count is increased by count=count+1; S5.
4. Determine the parity of the number of intersection points count: If count is an odd number, it means the vehicle is inside the polygonal electronic fence; If count is an even number, it means the vehicle is outside the polygonal electronic fence; S5.
5. Based on the special target point, set the arc margin to move. When the target point is at the fence boundary, fence vertex, projection line intersecting the fence vertex, or ray coinciding with the fence boundary, set the boundary distance to b. Draw a circle with b as radius for each vertex of the fence boundary involved. Extend the projection line to intersect the arc of the circle. The original vertex remains unchanged. The connecting lines of other boundaries are extended to the intersection point and set to p. Draw rays from the original vertex to re-judge the number of intersection points. Set the coordinates of the original vertex to (x 0 ,y 0 ), the angle between the projection line and the horizontal axis is θ, and the x and y in the coordinates of point p(x, y) are: x=x 0 +b·cos(f(θ)+2πn) y=y 0 +b sin(f(θ)+2πn) The above algorithm determines whether the vehicle is within the polygonal electronic fence by adding arc margin ray intersections, and determines the position according to the parity of the number of intersections.
3. According to claim 1, a method for determining the range of an electronic fence for a hazardous chemical vehicle, Features: In S6, according to the scheduled route of the vehicle, a linear interpolation method is used to predict the position of the vehicle at a certain time point, so as to obtain a predicted vehicle running trajectory, which specifically includes: Assume that the vehicle travels at a constant speed between each position point and along a straight line path connecting these position points; Assume that there are a series of coordinates of position points, represented by (x 1 ,y 1 ), (x 2 ,y 2 ),…,(x n ,y n ), where x i and i is the horizontal and vertical coordinates of the i-th position of the vehicle; The linear interpolation formula of equation (3) and equation (4) is used to predict the vehicle's driving trajectory: Among them, the adjustment coefficients α and β are introduced, which change dynamically based on external conditions or prior knowledge and are used to fine-tune the interpolation results. φ(α) and φ(β) are introduced nonlinear adjustment terms, which are set to ln(1+z), where z is any real number, which is used to increase or decrease the fine-tuning of the interpolation. t is the predicted time point, t i is the time of the i-th position point; considering possible time delay or acceleration, the time adjustment function τ(t)=t+δ is introduced; the time offsets dynamically adjusted based on certain conditions, Δx(t) and Δy(t) are used to optimize the accuracy of the interpolation results; based on historical data or prediction models, x(t) and y(t) represent the predicted horizontal and vertical coordinates at time point t, respectively; Formulas (3) and (4) calculate the linear interpolation between two position points of the vehicle at a given time point t to obtain the position coordinates (x(t), y(t)) of the vehicle.
4. A method for determining the range of an electronic fence for a hazardous chemical vehicle according to claim 1, Features: In S6, a support vector machine is used to build an algorithm model to predict whether the vehicle deviates from the electronic fence, including: Assume that the training data set contains m samples, each sample contains n features; for the i-th sample, it is expressed as in represents the jth feature of the sample, and the true label of the sample (whether it deviates from the electronic fence) is y i ,y i ∈{-1,1}; In order to predict the labels of new samples, a classification model needs to be learned from the training data set. The goal of the support vector machine algorithm is to find a hyperplane that can separate samples with different labels, while also ensuring that the "minimum distance" between the hyperplane and the training data is maximized, that is, the distance from the point closest to the hyperplane to the hyperplane is maximized. Consider the standard form of the separating hyperplane: w T x+b=0, where w is the normal vector, indicating the direction of the hyperplane, and b is the offset; for a given sample x i ,y i (w T x i +b) is compared with 0 to determine its location. If y i (w T x i +b)>0, the sample is correctly classified, otherwise it is misclassified; so we need to find a suitable set of w and b so that all samples are correctly classified and the generalization error between the training data set and the test data set is minimized; On the basis of the support vector machine algorithm, the soft margin support vector machine (SM SVM) is adopted, which takes into account that there may be some noise or atypical data in the training data set, so a slack variable is introduced to allow some samples to be relaxed in the case of hyperplane misclassification, thereby obtaining a wide margin area; Specifically, the objective function becomes: Among them, the constant c represents the penalty weight of the misclassified point; ε i is a slack variable, representing the classification error of the i-th sample, represents the sum of squares of distances from the hyperplane to each support vector. In order to make the support vector farthest from the hyperplane, the formula (5) should achieve the minimum value; By solving formula (5), we get the corresponding classification decision function: Among them, α i is the coefficient obtained by Lagrangian optimization, which indicates the importance of each sample vector; represents the feature vector x i The inner product between the predicted data point x and the predicted data point x; b is the bias term, which is used to adjust the position of the decision boundary and thus affect the classification result; the sign() function in formula (6) represents the sign function, whose value is 1 or -1, which is used to classify new samples.
5. According to claim 1, a method for determining the range of an electronic fence for a hazardous chemical vehicle, Features: After predicting whether the vehicle has deviated from the electronic fence area, an alarm message is sent to the terminal device and an alarm message is pushed to the corresponding vehicle driver's mobile phone.
Citation Information
Patent Citations
Method for judging entry and exit of bus based on electronic fence of bus stop
CN109859514A
Method and device for judging range of electronic fence of express delivery network
CN117251649A
Limited position-based region prewarning method
CN107154133A
Vehicle driving early warning method, system, device and equipment
CN112235712A
Electronic fence early warning method and device, computer equipment and storage medium
CN114140992A
Cited By
Electronic fence entering and leaving judgment method
CN120343495A
