Routing inspection trajectory data correction method, system and equipment based on least square method and path planning and medium
Through the least squares method and path planning technology, the problem of limited positioning methods in the acquisition of inspection trajectory data is solved, and efficient data correction and optimization are achieved. It is suitable for water conservancy and water facilities and other fields, improving data accuracy and easy use sex.
Patent Information
- Application Number
- CN202411108156.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-01-10
AI Technical Summary
The existing inspection trajectory data acquisition methods are limited by the positioning method, resulting in incomplete data and low accuracy. Especially in scenarios such as water conservancy facilities, expensive equipment and professional knowledge limit their application.
The patrol trajectory data correction method based on least squares method and path planning is adopted. The original trajectory data is obtained through the mobile terminal, fitted to the polynomial model, and the model coefficients are solved by the least squares method, and the deviation correction process is performed, and the trajectory is optimized through the path planning API. to ensure the accuracy and completeness of the data.
It significantly improves the convenience and economicality of data collection, reduces the dependence on expensive equipment and professional knowledge, ensures the accuracy and reliability of trajectory data, and is suitable for water conservancy and water facilities and other fields.
Smart Images

Figure CN119294627A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing and analysis, and in particular to a method, system, device and medium for correcting inspection trajectory data based on least squares method and path planning. Background Art
[0002] In water environment engineering, daily inspections of infrastructure such as reservoirs and canals, water plant pumping stations, pipe network manholes, and various water monitoring equipment are essential. The safe operation of these facilities is directly related to the construction of ecological civilization and the safety of people's lives and property. During the inspection process, in order to effectively manage and supervise, it is usually necessary to record the trajectory data information of the inspectors in real time.
[0003] At present, in order to obtain accurate trajectory data, the common practice is to use professional vehicle tracking systems or high-end GIS software and hardware equipment. However, these professional equipment are expensive to use and require operators to have certain professional knowledge, which to a certain extent limits their widespread application. In particular, in some specific scenarios, such as water conservancy facilities such as reservoirs and ponds and hidden monitoring equipment, vehicle tracking systems are not always applicable.
[0004] Smartphone applications have gradually become a popular way to obtain inspection trajectory data due to their economy and portability. Smartphone applications are mainly divided into two types: pure native APP and web hybrid APP. Although both methods are affected by factors such as network signals and human operations, in business scenarios where PC-side trajectory viewing is required, developing native APPs will significantly increase costs, while the improvement in data quality is not obvious.
[0005] Therefore, the use of hybrid APP has become a relatively appropriate choice. However, when existing hybrid APPs continuously obtain personnel trajectory data through web pages, they mainly rely on third-party map plug-ins. Its positioning logic usually first obtains coordinates through SDK. If it fails, it calls the browser's positioning API. If it fails again, it finally uses IP positioning. This positioning method is highly dependent on network signal strength and the stability of user operations, which often leads to incomplete and low-precision trajectory data. Summary of the invention
[0006] 1. Technical issues to be resolved
[0007] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method, system, device and medium for correcting inspection trajectory data based on least squares method and path planning, which solves the technical problems of incomplete and low-precision trajectory data caused by limited positioning methods when obtaining inspection trajectory data in existing solutions.
[0008] (II) Technical solution
[0009] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0010] In a first aspect, an embodiment of the present invention provides a method for correcting inspection trajectory data based on least squares method and path planning, comprising:
[0011] The original trajectory data is obtained through the hybrid APP in the mobile terminal carried by the inspection personnel;
[0012] In response to a trajectory viewing request sent by an inspection personnel on a mobile terminal, the original trajectory data is fitted to a determined path model, and the least squares method is used for fitting to solve the model coefficients;
[0013] Using the solved model coefficients, each original trajectory data point is corrected;
[0014] Determine whether every two adjacent corrected trajectory data points meet the preset path planning optimization conditions;
[0015] If every two adjacent corrected trajectory data points meet the path planning optimization conditions, the path optimization is performed to obtain the final corrected trajectory point data, and the data is sent to the mobile terminal for display;
[0016] If every two adjacent corrected trajectory data points do not meet the path planning optimization condition, the corrected trajectory data points are directly sent to the mobile terminal for display.
[0017] Optionally, obtaining the original trajectory data through a hybrid APP in a mobile terminal carried by the inspection personnel includes:
[0018] Use the positioning service of mobile terminals or the browser positioning API to obtain the original trajectory data of inspection personnel in real time;
[0019] Verify the integrity and validity of the received raw trajectory data according to the preset collection standards;
[0020] After verification, the original trajectory data is stored in the specified database in real time through the interface service;
[0021] Record the timestamp of each data collection, the inspection personnel information, and the relevant environmental parameters during data collection.
[0022] Optionally, in response to a trajectory viewing request sent by an inspection personnel on a mobile terminal, the original trajectory data is fitted to a determined path model, and the least squares method is used for fitting to solve the model coefficients, including:
[0023] In response to a track viewing request sent by an inspection personnel on a mobile terminal, the original track data corresponding to the request is retrieved from a database storing the original track data or called from the original track data received in real time;
[0024] Selecting a polynomial model as a path model for fitting the original trajectory data, and determining the order of the polynomial model according to the characteristics of the original trajectory data and the set smoothness requirement;
[0025] The original trajectory data were fitted to the selected path model by minimizing the residual sum of squares using the least squares method;
[0026] According to the order of the polynomial model after fitting, a corresponding polynomial coefficient row is constructed for each original data point to form a coefficient matrix;
[0027] Construct a column vector consisting of the position coordinates of the original trajectory data;
[0028] The transpose of the coefficient matrix, the product of the coefficient matrix and the transpose of the coefficient matrix, and the product of the coefficient matrix and the target vector are calculated in sequence, and the coefficient vector of the polynomial model is solved by the relationship between the product of the coefficient matrix and the transpose of the coefficient matrix and the product of the coefficient matrix and the target vector;
[0029] Store or directly output the solved model coefficients.
[0030] Optionally, the polynomial model is:
[0031] y(x)=a0+a1x+a2x 2 +…+a n x n ;
[0032] Among them, a0, a1, a2…a n are the coefficients of the polynomial, x is the independent variable, and y is the dependent variable;
[0033] The polynomial model after fitting is:
[0034]
[0035] Among them, (x i ,y i ) is the i-th group of original trajectory data points, m is the number of original trajectory data points; the coefficient matrix A is:
[0036]
[0037] The target vector b is:
[0038]
[0039] The transpose of the coefficient matrix A T for:
[0040]
[0041] Coefficient matrix A and transpose of coefficient matrix A T The product is:
[0042]
[0043] The product of the coefficient matrix A and the target vector b is calculated as:
[0044]
[0045] Coefficient matrix A and transpose of coefficient matrix A T The relationship between the product of and the product of the coefficient matrix A and the target vector b is:
[0046] A T Acoeffs=A T b;
[0047] Among them, coeffs is the coefficient vector.
[0048] Optionally, using the solved model coefficients, performing a correction process on each original trajectory data point includes:
[0049] Traverse each original trajectory data point stored in the database, and substitute each original trajectory data point into the polynomial model;
[0050] Use the polynomial model and the solved model coefficients to calculate the corrected position coordinates of each data point;
[0051] The calculated corrected position coordinates are stored in a database or output directly.
[0052] Optionally, judging whether every two adjacent corrected trajectory data points meet a preset path planning optimization condition includes:
[0053] Obtain all corrected trajectory data points from the correction processing result;
[0054] From all the corrected trajectory data points, select every two adjacent points as a pair for processing;
[0055] For each pair of adjacent trajectory data points, use the path planning API or related algorithms to determine whether the preset path planning optimization conditions are met;
[0056] Among them, the preset path planning optimization conditions include: the distance between adjacent trajectory data points is less than the set distance threshold, the time interval between adjacent trajectory data points is less than the set time interval, the speed between adjacent trajectory data points exceeds the set speed range, the path connecting two adjacent trajectory data points deviates from the road network or appears in a non-driving area, the height difference between adjacent trajectory data points exceeds the set height difference range, and the direction change between adjacent data points exceeds the set direction change threshold.
[0057] Optionally, if every two adjacent corrected trajectory data points meet the path planning optimization condition, path optimization is performed to obtain the final corrected trajectory point data, and the data is sent to the mobile terminal for display, including:
[0058] If the adjacent data points meet the optimization conditions, the path between the two points is optimized using the path planning algorithm or calling the path planning API;
[0059] By using the optimized path points as new trajectory data points, replacing the original trajectory data or interpolating between missing original data points, a series of final corrected trajectory data points are generated;
[0060] The final corrected trajectory data is sent to the mobile terminal, so that after receiving the trajectory data, the mobile terminal uses a map component or a visualization tool to render the data on a map.
[0061] In a second aspect, an embodiment of the present invention provides an inspection trajectory data correction system based on least squares method and path planning, comprising:
[0062] The data acquisition module is used to obtain the original trajectory data through the hybrid APP in the mobile terminal carried by the inspection personnel;
[0063] A coefficient obtaining module is used to respond to a trajectory viewing request sent by an inspection personnel on a mobile terminal, fit the original trajectory data to a determined path model, and use the least squares method to perform the fitting to solve the model coefficients;
[0064] A correction processing module is used to perform correction processing on each original trajectory data point using the solved model coefficients;
[0065] A condition judgment module is used to judge whether every two adjacent trajectory data points after deviation correction meet the preset path planning optimization conditions;
[0066] A path optimization module is used to perform path optimization if every two adjacent corrected trajectory data points meet the path planning optimization conditions, obtain the final corrected trajectory point data, and send it to the mobile terminal for display;
[0067] The direct display module is used to directly send the corrected trajectory data points to the mobile terminal for display if every two adjacent corrected trajectory data points do not meet the path planning optimization conditions.
[0068] In the third aspect, an embodiment of the present invention provides a patrol trajectory data correction device based on the least squares method and path planning, including: a mobile terminal, used to obtain the original trajectory data of the patrol personnel in real time through a positioning service or a browser positioning API; a database, used to store the original trajectory data collected by the mobile terminal; a central control platform, which is communicated with the database and the mobile terminal respectively, and is used to execute the patrol trajectory data correction method based on the least squares method and path planning as described above.
[0069] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having computer executable instructions stored thereon, which, when executed by a processor, implements the inspection trajectory data correction method based on least squares method and path planning as described above.
[0070] (III) Beneficial effects
[0071] The beneficial effects of the present invention are:
[0072] First of all, the inspection trajectory data correction method proposed in the present invention has the significant advantages of being convenient and economical in data collection. By using the mobile phone positioning service or browser positioning API, it is possible to easily obtain the original trajectory data and store it in the database in real time without relying on expensive professional equipment, thereby greatly reducing the cost burden of users. In addition, users do not need to learn additional professional knowledge and can complete all operations through the mobile phone APP, which greatly simplifies the use process.
[0073] Secondly, the present invention also has significant advantages for developers. It does not require additional development and maintenance costs because it mainly processes data through mathematical modeling, avoiding the use of complex algorithm models. By combining the path planning API in the map, this method can optimize the processing of coordinate data with poor quality, thereby obtaining more realistic driving path data.
[0074] Furthermore, the present invention has shown extremely high practical application value in water conservancy and water conservancy facilities and equipment inspections that require a lot of repetition and frequency. By using the least squares method to model polynomial data and selecting an appropriate path model to fit the trajectory data to the model, the corrected position coordinates corresponding to each original data point can be accurately calculated. The accuracy of the trajectory data is further ensured by judging the path planning API optimization of the corrected trajectory points.
[0075] Therefore, the present invention is not only simple and easy to implement, but also economical and applicable, and has significant beneficial effects from the perspectives of both users and developers. It has extremely high practical application significance and promotion value in multiple fields such as water conservancy and water affairs facility equipment inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 A flowchart of a method for correcting inspection trajectory data based on least squares method and path planning provided by an embodiment of the present invention;
[0077] Figure 2 A graph of inspection trajectory data collected by a hybrid APP based on a least squares method and path planning inspection trajectory data correction method provided by an embodiment of the present invention;
[0078] Figure 3 A display effect diagram of the inspection trajectory data collected by the hybrid APP based on a least squares method and path planning inspection trajectory data correction method provided by an embodiment of the present invention;
[0079] Figure 4 A specific flow chart of step S1 of a method for correcting inspection trajectory data based on least squares method and path planning provided by an embodiment of the present invention;
[0080] Figure 5 A specific flow chart of step S2 of a method for correcting inspection trajectory data based on least squares method and path planning provided by an embodiment of the present invention;
[0081] Figure 6 A specific flow chart of step S3 of a method for correcting inspection trajectory data based on least squares method and path planning provided by an embodiment of the present invention;
[0082] Figure 7 A method for correcting inspection trajectory data based on least squares method and path planning provided in an embodiment of the present invention is a data graph processed by least squares method mathematical modeling;
[0083] Figure 8 A display effect diagram of data processed by least squares mathematical modeling of a patrol trajectory data correction method based on least squares method and path planning provided in an embodiment of the present invention;
[0084] Fig. 9 A specific flow chart of step S4 of a method for correcting inspection trajectory data based on least squares method and path planning provided by an embodiment of the present invention;
[0085] Fig.10A specific flow chart of step S5a of a method for correcting inspection trajectory data based on least squares method and path planning provided by an embodiment of the present invention;
[0086] Fig.11 A data graph of a method for correcting inspection trajectory data based on least squares method and path planning provided by an embodiment of the present invention, which is further optimized by a path planning API;
[0087] Fig.12 A display effect diagram of data further optimized by a path planning API for a method for correcting inspection trajectory data based on least squares method and path planning provided in an embodiment of the present invention;
[0088] Fig.13 A schematic diagram of the composition of an inspection trajectory data correction device for an inspection trajectory data correction method based on the least squares method and path planning provided by an embodiment of the present invention;
[0089] Fig.14 An overall flow chart of the inspection trajectory data collection to trajectory data display of an inspection trajectory data correction method based on least squares method and path planning provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0090] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0091] Prior to this, in order to facilitate understanding of the technical solution provided by the present invention, some concepts are first introduced below.
[0092] Inspection: Inspection is a regular inspection process designed to ensure the normal operation of equipment, facilities or systems to prevent failures, improve safety and maintain efficient performance. It helps to extend the life of equipment, reduce maintenance costs, and improve the reliability and safety of operations. For large or critical equipment, inspection is usually an important maintenance step.
[0093] Inspection track: Inspection track usually refers to the movement path recorded during regular inspection, inspection or monitoring in a specific area or facility. This path recording can be achieved through various devices and technologies, such as global positioning system (GPS), wireless sensor network or indoor positioning system.
[0094] Mobile web page positioning: Mobile web page positioning refers to obtaining the user's geographic location information through the browser of a mobile device (such as a smartphone or tablet). This positioning method relies on the location sensor of the mobile phone and the browser's geolocation API.
[0095] Track correction: Track correction is a data processing technique usually applied to the Global Positioning System (GPS) or other location data sources. Its purpose is to correct or smooth the track data to reduce noise, increase accuracy, and improve the quality of the track.
[0096] Least Squares Method: Least Squares Method is a regression analysis method commonly used in statistics and mathematics to fit the relationship between data points and mathematical models. Its main goal is to find a mathematical model that best fits the known data points, even if these data points are affected by noise or errors.
[0097] like Figure 1 As shown, an inspection trajectory data correction method based on least squares method and path planning proposed in an embodiment of the present invention includes: obtaining original trajectory data through a hybrid APP in a mobile terminal carried by an inspection personnel; in response to a trajectory viewing request issued by the inspection personnel on the mobile terminal, fitting the original trajectory data to a determined path model, and fitting using the least squares method to solve the model coefficient; using the solved model coefficient, performing correction processing on each original trajectory data point; judging whether every two adjacent trajectory data points after correction meet the preset path planning optimization conditions; if every two adjacent trajectory data points after correction meet the path planning optimization conditions, performing path optimization to obtain the final corrected trajectory point data, and sending it to the mobile terminal for display; if every two adjacent trajectory data points after correction do not meet the path planning optimization conditions, directly sending the corrected trajectory data points to the mobile terminal for display.
[0098] First of all, the inspection trajectory data correction method proposed in the present invention has the significant advantages of being convenient and economical in data collection. By using the mobile phone positioning service or browser positioning API, it is possible to easily obtain the original trajectory data and store it in the database in real time without relying on expensive professional equipment, thereby greatly reducing the cost burden of users. In addition, users do not need to learn additional professional knowledge and can complete all operations through the mobile phone APP, which greatly simplifies the use process.
[0099] Secondly, the present invention also has significant advantages for developers. It does not require additional development and maintenance costs because it mainly processes data through mathematical modeling, avoiding the use of complex algorithm models. By combining the path planning API in the map, this method can optimize the processing of coordinate data with poor quality, thereby obtaining more realistic driving path data.
[0100] Furthermore, the present invention has shown extremely high practical application value in water conservancy and water conservancy facilities and equipment inspections that require a lot of repetition and frequency. By using the least squares method to model polynomial data and selecting an appropriate path model to fit the trajectory data to the model, the corrected position coordinates corresponding to each original data point can be accurately calculated. The accuracy of the trajectory data is further ensured by judging the path planning API optimization of the corrected trajectory points.
[0101] Therefore, the present invention is not only simple and easy to implement, but also economical and applicable, and has significant beneficial effects from the perspectives of both users and developers. It has extremely high practical application significance and promotion value in multiple fields such as water conservancy and water affairs facility equipment inspection.
[0102] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0103] Specifically, an embodiment of the present invention provides a method for correcting inspection trajectory data based on least squares method and path planning, comprising:
[0104] S1. Obtain the original trajectory data through the hybrid APP in the mobile terminal carried by the inspection personnel.
[0105] During the inspection process, a hybrid APP is installed on the mobile device carried by the inspector. This APP has a positioning function and can record the movement trajectory of the inspector in real time. When the inspector walks along the predetermined inspection route, the APP will automatically collect and record the coordinate data of each location point in the background, and these data constitute the original trajectory data.
[0106] These data are detailed records of the actual walking paths of the inspectors, but due to various reasons (such as signal interference, equipment errors, etc.), the data may contain some noise points, that is, points that deviate from the actual walking paths. Figure 2 As shown in the figure, the original trajectory data of a section of the inspection route is selected, where the coordinate data of each point is expressed as (x i ,y i ) indicates that reference Figure 3 ,If these noise points are directly displayed on the map, they will affect the ,accuracy and aesthetics of the trajectory, and may even mislead the understanding of the ,inspection route.
[0107] Therefore, after obtaining these raw trajectory data, further processing and optimization are usually required to remove noise and make the trajectory smoother and more realistic. In this way, the processed data can more accurately reflect the actual walking path of the inspectors and is more suitable for display and analysis on the map.
[0108] Furthermore, if Figure 4 As shown, step S1 includes:
[0109] S11. Utilize the positioning service of the mobile terminal or the browser positioning API to obtain the original trajectory data of the inspection personnel in real time.
[0110] S12: Verify the integrity and validity of the received original trajectory data according to the preset collection standard.
[0111] S13, after verification, the original trajectory data is stored in a designated database in real time. The original trajectory data is stored in a designated database in real time through an interface service for subsequent processing and analysis.
[0112] S14. Record the timestamp of each data collection, the inspection personnel information, and the relevant environmental parameters during data collection to ensure data traceability and analysis accuracy.
[0113] S2. In response to the trajectory viewing request sent by the inspection personnel on the mobile terminal, the original trajectory data is fitted to the determined path model, and the least squares method is used for fitting to solve the model coefficients.
[0114] Furthermore, if Figure 5 As shown, step S2 includes:
[0115] S21 . In response to a trajectory viewing request sent by an inspection personnel on a mobile terminal, original trajectory data corresponding to the request is retrieved from a database storing original trajectory data or called from original trajectory data received in real time.
[0116] S22 , selecting a polynomial model as a path model for fitting the original trajectory data, and determining the order of the polynomial model according to the characteristics of the original trajectory data and the set smoothness requirement.
[0117] When constructing a least squares fitting model, it is first necessary to select a suitable path model. In this embodiment, a polynomial model is selected to fit the trajectory data. The polynomial model is flexible and can adapt to data of different complexity by adjusting the order.
[0118] The general form of a polynomial model consists of multiple terms, each with a coefficient. These coefficients are adjusted during the fitting process to minimize the difference between the data points and the model (i.e., the residual sum of squares). The order refers to the degree of the highest-order term in the polynomial.
[0119] There are two main factors to consider when choosing the order of a polynomial model: the complexity of the data and the requirement for smoothness. The complexity of the data refers to the patterns and regularities of change inherent in the data. If the data exhibits complex nonlinear relationships, a higher order may be necessary to better capture these changes. However, a high-order polynomial may also lead to overfitting, where the model is so complex that it performs well on the training data but generalizes poorly to new data.
[0120] On the other hand, the smoothness requirement reflects the preference for model simplicity and interpretability. If the simplicity of the model is more important, a lower order may be chosen. Doing so can reduce the complexity of the model, but may sacrifice some fitting accuracy to data details.
[0121] The specific polynomial model form used is as follows:
[0122] y(x)=a0+a1x+a2x 2 +…+a n x n ;
[0123] Among them, a0, a1, a2…a n are the coefficients of the polynomial, x is the independent variable, and y is the dependent variable.
[0124] S23. Using the least squares method, fit the original trajectory data to the selected path model by minimizing the residual sum of squares.
[0125] Using the least squares method, the goal is to minimize the residual sum of squares to achieve the best fit between the original trajectory data and the selected path model. This method calculates the residual between each data point and the model prediction value and sums the squares of these residuals to find the model parameters that minimize the sum of squares. In this way, it can be ensured that the model reflects the characteristics and trends of the original trajectory data as accurately as possible.
[0126] The specific polynomial model after fitting is:
[0127]
[0128] Among them, (x i ,y i ) is the i-th group of original trajectory data points, and m is the number of original trajectory data points.
[0129] S24. According to the order of the polynomial model after fitting, a corresponding polynomial coefficient row is constructed for each original data point to form a coefficient matrix.
[0130] S25. Construct a column vector consisting of the position coordinates of the original trajectory data.
[0131] In one specific implementation, given m original data points It is necessary to construct a coefficient matrix A and a target vector b. Each row of the coefficient matrix A is a data point (x i ,y i ) is the coefficient of each term in the polynomial model. For an n-order polynomial model, each data point x i Corresponding behavior Therefore, the coefficient matrix A is of the form:
[0132]
[0133] In this embodiment, the target vector b is a column vector composed of the original position coordinates y:
[0134]
[0135] It is important to understand that the coefficient matrix x corresponds to the x in the polynomial model, It corresponds to the power x in the polynomial model, m corresponds to the number of data points, and similarly, the target vector b.
[0136] S26. Calculate the transpose of the coefficient matrix, the product of the coefficient matrix and the transpose of the coefficient matrix, and the product of the coefficient matrix and the target vector in sequence, and solve the coefficient vector of the polynomial model through the relationship between the product of the coefficient matrix and the transpose of the coefficient matrix and the product of the coefficient matrix and the target vector.
[0137] In order to solve the coefficient vector coeffs, coeffs = [a0, a1, ..., a n ] T .
[0138] First, solve for the transpose of the coefficient matrix A T for:
[0139]
[0140] Next, solve the coefficient matrix A and the transpose of the coefficient matrix A T The product is:
[0141]
[0142] Furthermore, the product of the calculation coefficient matrix A and the target vector b is solved as:
[0143]
[0144] Finally, according to the coefficient matrix A and the transpose of the coefficient matrix A T The coefficient vector is solved by the product of the coefficient matrix A and the target vector b: A T Acoeffs=A T b; where coeffs is the coefficient vector.
[0145] S27. Store or directly output the solved model coefficients.
[0146] It is worth noting that in the process of data processing, the embodiment of the present invention adopts the mathematical modeling method of least squares method. In addition, it can also be replaced by filtering algorithms such as Kalman filtering, Bayesian filtering, etc., but it is necessary to collect some relevant data for assistance.
[0147] S3. Using the solved model coefficients, perform deviation correction processing on each original trajectory data point.
[0148] Furthermore, if Figure 6 As shown, step S3 includes:
[0149] S31, traversing each original trajectory data point stored in the database, and substituting each original trajectory data point into the polynomial model.
[0150] S32. Using the polynomial model and the solved model coefficients, calculate the position coordinates of each data point after correction.
[0151] S33, storing the calculated corrected position coordinates in a database or directly outputting them. Figure 7 The data after least squares mathematical modeling is shown, that is, the position coordinates after correction. Figure 8 The effect of the data after least squares mathematical modeling is specifically demonstrated.
[0152] According to actual needs, the corrected position coordinates can be stored back in the corresponding fields in the database. The advantage of this is that it facilitates long-term storage, management and subsequent analysis of data. By associating the corrected data with the original data, it is possible to track changes in the trajectory, evaluate the correction effect, and perform other advanced data analysis operations.
[0153] In addition to being stored in the database, the corrected position coordinates can also be directly output to the central control platform, files (such as CSV, TXT, KML, etc.) or other required media. This instant output is very useful for users who need to quickly view the correction effect, monitor trajectory changes in real time, or perform path optimization operations.
[0154] S4. Determine whether every two adjacent corrected trajectory data points meet a preset path planning optimization condition.
[0155] Furthermore, if Fig. 9 As shown, step S4 includes:
[0156] S41, obtaining all corrected trajectory data points from the result of the correction process.
[0157] S42: From all the corrected trajectory data points, select every two adjacent points as a pair for processing.
[0158] S43: For each pair of adjacent trajectory data points, use the path planning API or related algorithms to determine whether the preset path planning optimization conditions are met.
[0159] Specifically, the preset path planning optimization conditions include:
[0160] (1) The distance between adjacent trajectory data points is less than the set distance threshold. This condition takes into account the rationality of the data point spacing. If the distance between adjacent data points is too far, exceeding the range that can be covered by normal driving speed, or the distance is too close and almost overlaps, then these data points may need to be optimized. A reasonable distance threshold can be set as a criterion for judging the rationality of the data point spacing.
[0161] (2) The time interval between adjacent trajectory data points is less than the set time interval, and the speed between adjacent trajectory data points exceeds the set speed range. This condition takes into account the rationality of time. The timestamp of the trajectory data point should reasonably reflect the driving process. If the time interval between adjacent data points is too long or too short and does not match the normal driving speed, then these data points may have problems. The judgment condition of time rationality can be set according to the road speed limit and the actual driving speed.
[0162] (3) The path between two adjacent trajectory data points deviates from the road network or appears in a non-driving area. This condition takes into account road accessibility, and the trajectory data points should be located on actual drivable roads. If the data points obviously deviate from the road network or appear in a non-driving area (such as inside a building, in water, etc.), then these data points need to be corrected. The road accessibility of the data points can be determined using map data or road network information.
[0163] (4) The height difference between adjacent trajectory data points exceeds the set height difference range. This condition takes into account the rationality of the height. If the trajectory data contains height information (such as altitude), a reasonable range of height changes can be set. Abnormal height changes may indicate errors in the positioning equipment and need to be optimized.
[0164] (5) The direction change between adjacent data points exceeds the set direction change threshold. This condition takes into account the continuity of the driving direction. The driving direction between trajectory data points should maintain a certain degree of continuity. If the direction change between adjacent data points is too large, it may be abnormal data caused by positioning error or signal interference. A direction change threshold can be set to determine the continuity of the driving direction.
[0165] S5a. If every two adjacent corrected trajectory data points meet the path planning optimization condition, path optimization is performed to obtain the final corrected trajectory point data, and the data is sent to the mobile terminal for display.
[0166] Furthermore, if Fig.10 As shown, step S5a includes:
[0167] S5a1. If the adjacent data points meet the optimization conditions, the path between the two points is optimized by using a path planning algorithm or calling a path planning API.
[0168] Once these points meet the optimization conditions, a path planning algorithm will be used or a path planning API will be called to optimize the path between the two points.
[0169] S5a2, by using the optimized path points as new trajectory data points to replace the original trajectory data or interpolate between the missing original data points to generate a series of final corrected trajectory data points.
[0170] After the path optimization is completed, the optimized path points are used as new trajectory data points. These new points may replace the original trajectory data points, or interpolate to make up for the missing original data points. The purpose of interpolation is to prevent simply drawing a straight line between two points, so as to ensure the continuity and rationality of the trajectory. Through this step, a series of final corrected trajectory data points are generated, which are closer to the actual driving path. Reference Fig.11 , which shows the data further optimized by the path planning API, and Fig.12 To show the specific effect of data.
[0171] S5a3, sending the finally corrected trajectory data to the mobile terminal, so that after receiving the trajectory data, the mobile terminal uses a map component or a visualization tool to render the data on a map.
[0172] Finally, the corrected trajectory data is sent to the mobile terminal. After receiving the data, the mobile terminal uses the built-in map component or visualization tool to render the data on the map. In this way, the user can clearly see the optimized trajectory on the mobile device, so as to better understand and analyze the driving path. This step improves the visualization and interactivity of the trajectory data, providing users with a more intuitive and convenient trajectory viewing experience.
[0173] S5b: If every two adjacent trajectory data points after deviation correction do not meet the path planning optimization condition, the trajectory data points after deviation correction are directly sent to the mobile terminal for display.
[0174] For those adjacent corrected trajectory data points that do not meet the path planning optimization conditions, path planning optimization will not be performed. These corrected trajectory data points will be directly sent to the mobile terminal for display. This can save computing resources and avoid unnecessary complex optimization of the trajectory.
[0175] It is worth noting that the path planning function is used in path optimization. The path planning API in some other third-party map plug-ins can also be used for optimization, such as the path planning function in Baidu Maps.
[0176] In addition, an embodiment of the present invention provides an inspection trajectory data correction system based on least squares method and path planning, comprising:
[0177] The data acquisition module is used to obtain the original trajectory data through the hybrid APP in the mobile terminal carried by the inspection personnel.
[0178] The coefficient obtaining module is used to respond to the trajectory viewing request sent by the inspection personnel on the mobile terminal, fit the original trajectory data to the determined path model, and use the least squares method to fit it to solve the model coefficients.
[0179] The correction processing module is used to perform correction processing on each original trajectory data point by using the solved model coefficients.
[0180] The condition judgment module is used to judge whether every two adjacent trajectory data points after correction meet the preset path planning optimization conditions.
[0181] The path optimization module is used to perform path optimization if every two adjacent corrected trajectory data points meet the path planning optimization conditions, obtain the final corrected trajectory point data, and send it to the mobile terminal for display.
[0182] The direct display module is used to directly send the corrected trajectory data points to the mobile terminal for display if every two adjacent corrected trajectory data points do not meet the path planning optimization conditions.
[0183] like Fig.13 As shown, an embodiment of the present invention provides an inspection trajectory data correction device based on least squares method and path planning, including: a mobile terminal, used to obtain the original trajectory data of the inspection personnel in real time through a positioning service or a browser positioning API; a database, used to store the original trajectory data collected by the mobile terminal; a central control platform, which is communicated with the database and the mobile terminal respectively, and is used to execute the inspection trajectory data correction method based on least squares method and path planning as described above.
[0184] The embodiment of the present invention provides a patrol track data deviation correction device based on the least square method and path planning, and the device includes several main parts;
[0185] (1) Mobile terminals, which use location services or browser location APIs to obtain the original trajectory data of patrol personnel in real time. These data are generated by patrol personnel during the field inspection process and are highly real-time and field-oriented.
[0186] (2) At least one database whose main function is to store the raw trajectory data collected by the mobile terminal in real time. The design of the database ensures the security and integrity of the data and also facilitates subsequent data processing and analysis.
[0187] (3) As the core of the entire system, the central control platform maintains communication connections with the database and mobile terminals. The central control platform is responsible for executing the inspection trajectory data correction method based on the least squares method and path planning. Through this method, the central control platform can process and analyze the original trajectory data stored in the database, correct the abnormal data, and make the trajectory path more reasonable and beautiful. In this way, when users view the trajectory, they can get a more accurate and clear trajectory path.
[0188] In general, this equipment realizes the complete process from data collection, storage to processing by integrating mobile terminals, databases and central control platforms, greatly improving the accuracy and visualization of inspection trajectory data. At the same time, the correction method based on least squares method and path planning makes the trajectory data closer to reality, providing strong technical support for inspection work.
[0189] Furthermore, an embodiment of the present invention provides a computer-readable medium having computer executable instructions stored thereon, and when the executable instructions are executed by a processor, the inspection trajectory data correction method based on the least squares method and path planning as described above is implemented.
[0190] The embodiment of the present invention also provides a computer-readable medium on which specific computer executable instructions are stored. When these executable instructions are executed by the processor, the inspection trajectory data correction method based on least squares method and path planning described above will be implemented. This computer-readable medium not only facilitates the storage and dissemination of the method, but also enables the correction method to be flexibly applied in different computer systems, thereby greatly improving the practicality and popularity of the method. In this way, users can easily implement the correction of inspection trajectory data on various computing devices, thereby improving the accuracy and reliability of trajectory data.
[0191] In summary, the embodiments of the present invention provide a method, system, device and medium for correcting inspection trajectory data based on least squares method and path planning. The implementation process of the present invention covers the complete process from data collection to final trajectory correction.
[0192] like Fig.14 As shown in the figure, first, trajectory data is collected through mobile terminal applications. These mobile terminal applications are usually composed of web hybrid APPs, which use mobile phone positioning services or browser positioning APIs to obtain trajectory data, which are called raw data. Then, through the interface service, these raw data are stored in the database in real time, laying the foundation for subsequent processing.
[0193] Next, when the inspector views the track on the mobile client, the web service will play a key role. Here, the abnormal data is processed in real time by the present invention. The cleverness of this processing method is that it does not affect the integrity of the original data, and at the same time makes the display effect of the track path more reasonable and beautiful.
[0194] In the processing process, the acquired original trajectory data is firstly modeled into polynomial data using the least square method. By selecting an appropriate path model, such as a polynomial model, the trajectory data is fitted to this model. This step is the key to distinguishing it from other simple data processing methods, which makes the correction method more scientific and accurate.
[0195] After the model is built, the coefficients are used to calculate the corrected position coordinates of each original data point. This step ensures that the accuracy of the trajectory data is significantly improved.
[0196] Subsequently, the corrected trajectory points are judged for path planning API optimization. Specifically, it is judged whether every two corrected points can be optimized through the path planning API. If the judgment result shows that path planning can be performed between every two points, path optimization is performed to obtain the final corrected trajectory point data. The introduction of this step makes the trajectory correction method closer to the actual application scenario, especially when there are roads in the inspection area.
[0197] However, if the judgment result shows that path planning is not possible between two points, the original trajectory data is displayed directly. The advantage of this is that it retains the authenticity of the original data while avoiding the errors that may be caused by unnecessary correction processing.
[0198] In general, the present invention provides a trajectory data correction method based on the least squares method and map path planning function. This method not only relies on the trajectory data obtained by the hybrid APP in the mobile phone carried by the patrol personnel for processing and optimization, but also performs refined correction processing on the trajectory data through mathematical modeling and path planning. This makes the method of the present invention stand out among many trajectory correction technologies and provides more accurate and reliable trajectory data support for patrol work.
[0199] Since the system / device described in the above embodiments of the present invention is a system / device used to implement the method of the above embodiments of the present invention, a person skilled in the art can understand the specific structure and deformation of the system / device based on the method described in the above embodiments of the present invention, and thus will not be described in detail here. All systems / devices used in the method of the above embodiments of the present invention belong to the scope of protection of the present invention.
[0200] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0201] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions.
[0202] It should be noted that in the claims, any reference numerals placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by the same hardware. The use of the words first, second, third, etc., is for convenience of expression only and does not indicate any order. These words may be understood as part of the component name.
[0203] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0204] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments after knowing the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0205] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include these modifications and variations.
Claims
1. A method for correcting inspection trajectory data based on least squares method and path planning, characterized in that: include: The original trajectory data is obtained through the hybrid APP in the mobile terminal carried by the inspection personnel; In response to a trajectory viewing request sent by an inspection personnel on a mobile terminal, the original trajectory data is fitted to a determined path model, and the least squares method is used for fitting to solve the model coefficients; Using the solved model coefficients, each original trajectory data point is corrected; Determine whether every two adjacent corrected trajectory data points meet the preset path planning optimization conditions; If every two adjacent corrected trajectory data points meet the path planning optimization conditions, the path optimization is performed to obtain the final corrected trajectory point data, and the data is sent to the mobile terminal for display; If every two adjacent corrected trajectory data points do not meet the path planning optimization condition, the corrected trajectory data points are directly sent to the mobile terminal for display.
2. The inspection trajectory data correction method based on least squares method and path planning as claimed in claim 1, characterized in that: The original trajectory data obtained through the hybrid APP in the mobile terminal carried by the inspection personnel include: Use the positioning service of mobile terminals or the browser positioning API to obtain the original trajectory data of inspection personnel in real time; Verify the integrity and validity of the received raw trajectory data according to the preset collection standards; After verification, the original trajectory data is stored in the specified database in real time; Record the timestamp of each data collection, the inspection personnel information, and the relevant environmental parameters during data collection.
3. The inspection trajectory data correction method based on least squares method and path planning as claimed in claim 1, characterized in that: In response to the trajectory viewing request sent by the patrol personnel on the mobile terminal, the original trajectory data is fitted to the determined path model, and the least squares method is used for fitting to solve the model coefficients including: In response to a track viewing request sent by an inspection personnel on a mobile terminal, the original track data corresponding to the request is retrieved from a database storing the original track data or called from the original track data received in real time; Selecting a polynomial model as a path model for fitting the original trajectory data, and determining the order of the polynomial model according to the characteristics of the original trajectory data and the set smoothness requirement; The original trajectory data were fitted to the selected path model by minimizing the residual sum of squares using the least squares method; According to the order of the polynomial model after fitting, a corresponding polynomial coefficient row is constructed for each original data point to form a coefficient matrix; Construct a column vector consisting of the position coordinates of the original trajectory data; The transpose of the coefficient matrix, the product of the coefficient matrix and the transpose of the coefficient matrix, and the product of the coefficient matrix and the target vector are calculated in sequence, and the coefficient vector of the polynomial model is solved by the relationship between the product of the coefficient matrix and the transpose of the coefficient matrix and the product of the coefficient matrix and the target vector; Store or directly output the solved model coefficients.
4. The inspection trajectory data correction method based on least squares method and path planning as claimed in claim 3, characterized in that: The polynomial model is: y(x)=a0+a1x+a2x 2 +…+a n x n ; Among them, a0, a1, a2…a n are the coefficients of the polynomial, x is the independent variable, and y is the dependent variable; The polynomial model after fitting is: Among them, (x i ,y i ) is the i-th group of original trajectory data points, m is the number of original trajectory data points; The coefficient matrix A is: The target vector b is: The transpose of the coefficient matrix A T for: Coefficient matrix A and transpose of coefficient matrix A T The product is: The product of the coefficient matrix A and the target vector b is calculated as: Coefficient matrix A and transpose of coefficient matrix A T The relationship between the product of and the product of the coefficient matrix A and the target vector b is: A T Acoeffs=A T b; Among them, coeffs is the coefficient vector.
5. The inspection trajectory data correction method based on least squares method and path planning as claimed in claim 3 or 4, characterized in that: Using the solved model coefficients, the correction processing for each original trajectory data point includes: Traverse each original trajectory data point stored in the database, and substitute each original trajectory data point into the polynomial model; Use the polynomial model and the solved model coefficients to calculate the corrected position coordinates of each data point; The calculated corrected position coordinates are stored in a database or output directly.
6. The inspection trajectory data correction method based on least squares method and path planning as claimed in claim 1, characterized in that: Determining whether every two adjacent corrected trajectory data points meet the preset path planning optimization conditions includes: Obtain all corrected trajectory data points from the correction processing result; From all the corrected trajectory data points, select every two adjacent points as a pair for processing; For each pair of adjacent trajectory data points, use the path planning API or related algorithms to determine whether the preset path planning optimization conditions are met; Among them, the preset path planning optimization conditions include: the distance between adjacent trajectory data points is less than the set distance threshold, the time interval between adjacent trajectory data points is less than the set time interval, the speed between adjacent trajectory data points exceeds the set speed range, the path connecting two adjacent trajectory data points deviates from the road network or appears in a non-driving area, the height difference between adjacent trajectory data points exceeds the set height difference range, and the direction change between adjacent data points exceeds the set direction change threshold.
7. The inspection trajectory data correction method based on least squares method and path planning as claimed in claim 6, characterized in that: If every two adjacent corrected trajectory data points meet the path planning optimization conditions, the path optimization is performed to obtain the final corrected trajectory point data, which is sent to the mobile terminal for display, including: If the adjacent data points meet the optimization conditions, the path between the two points is optimized using the path planning algorithm or calling the path planning API; By using the optimized path points as new trajectory data points, replacing the original trajectory data or interpolating between missing original data points, a series of final corrected trajectory data points are generated; The final corrected trajectory data is sent to the mobile terminal, so that after receiving the trajectory data, the mobile terminal uses a map component or a visualization tool to render the data on a map.
8. A patrol track data correction system based on least squares method and path planning, characterized in that: include: The data acquisition module is used to obtain the original trajectory data through the hybrid APP in the mobile terminal carried by the inspection personnel; A coefficient obtaining module is used to respond to a trajectory viewing request sent by an inspection personnel on a mobile terminal, fit the original trajectory data to a determined path model, and use the least squares method to perform the fitting to solve the model coefficients; A correction processing module is used to perform correction processing on each original trajectory data point using the solved model coefficients; A condition judgment module is used to judge whether every two adjacent trajectory data points after deviation correction meet the preset path planning optimization conditions; A path optimization module is used to perform path optimization if every two adjacent corrected trajectory data points meet the path planning optimization conditions, obtain the final corrected trajectory point data, and send it to the mobile terminal for display; The direct display module is used to directly send the corrected trajectory data points to the mobile terminal for display if every two adjacent corrected trajectory data points do not meet the path planning optimization conditions.
9. A patrol track data correction device based on least squares method and path planning, characterized in that: include: Mobile terminals are used to obtain the original trajectory data of patrol personnel in real time through positioning services or browser positioning APIs; Database, used to store the original trajectory data collected by the mobile terminal The central control platform is respectively connected to the database and the mobile terminal for executing the inspection trajectory data correction method based on the least square method and path planning as described in any one of claims 1 to 7.
10. A computer-readable medium having computer-executable instructions stored thereon, characterized in that: When the executable instructions are executed by the processor, the inspection trajectory data correction method based on least squares method and path planning as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Smooth processing method and device of action block, electronic equipment and storage medium
CN121848409A