Trajectory optimization method, system, device and storage medium based on angle analysis
Through the angle analysis and processing of the inspection trajectory, abnormal trajectory points are deleted, and the problems of slow calculation speed and inaccurate optimization in the existing technology are solved, and efficient and accurate trajectory optimization is achieved.
Patent Information
- Application Number
- CN202310626436.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2043-05-30
AI Technical Summary
When the existing technology optimizes the inspection trajectory, the calculation speed is slow and the optimization trajectory is not accurate enough to effectively reflect the actual inspection route.
The trajectory optimization method based on angle analysis is adopted, and the optimized trajectory is obtained by angular calculation and analysis of the trajectory point time series array, abnormal trajectory points are deleted, and the optimized trajectory is obtained.
The calculation speed of patrol trajectory optimization is improved to ensure the accuracy of the optimized trajectory, making it more in line with the actual patrol route.
Smart Images

Figure CN117191014B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of trajectory processing technology, and in particular to a trajectory optimization method, system, device and storage medium based on angle analysis. Background Art
[0002] At present, when inspectors perform inspection tasks (such as forest fire prevention inspections, power circuit inspections, and water conservancy inspections), they generally carry inspection terminals (such as smart terminals such as mobile phones or other mobile inspection devices) equipped with positioning modules (such as GPS positioning modules and Beidou positioning modules) to locate the inspectors in real time and collect their inspection tracks. The collection of inspection tracks is conducive to supervising the effectiveness of inspection operations on the one hand, and is also conducive to serving as a reference for inspection routes for subsequent inspection operations, which has very good application value.
[0003] However, during the inspection process, the positioning signal received by the inspection terminal is easily interfered by external objects, such as buildings, viaducts, tunnels, dense forests and weather. In addition, the frequency of the inspection terminal collecting the inspection trajectory cannot be too low, which leads to many discrete trajectory points in the collected inspection trajectory. At the same time, due to the round trips and detours that may occur during the actual inspection operation, coupled with abnormal points caused by weak positioning signals, there are a lot of redundant or erroneous data in the inspection trajectory, causing the actual generated inspection trajectory to jump back and forth, which looks messy and disorderly, and its effectiveness in supervising the inspection operation and guiding the subsequent inspection operation is greatly reduced. Therefore, it is necessary to optimize the inspection trajectory, remove those useless trajectories that jump back and forth, and only keep the normal inspection trajectory.
[0004] In the prior art, a density clustering algorithm is usually used to optimize the inspection trajectory, that is, all trajectory point data within a preset clustering radius M (for example, 10 meters) with the number of trajectory points exceeding N (for example, 10) is deleted. This will cause many normal points to be deleted at the same time, resulting in the inspection trajectory obtained after optimization being unable to accurately reflect the actual inspection route; in addition, when the density clustering algorithm is used to optimize the inspection trajectory, because there are too many points to be compared, the number of cycles is large, and the calculation complexity is high, resulting in a slow optimization calculation speed.
[0005] Therefore, how to improve the calculation speed of inspection trajectory optimization while ensuring the accuracy of the optimized inspection trajectory is a problem that needs to be solved urgently. Summary of the invention
[0006] To solve the above technical problems, the present application provides a trajectory optimization method based on angle analysis, which can improve the calculation speed of inspection trajectory optimization while ensuring the accuracy of the optimized inspection trajectory. The present application also provides a trajectory optimization system, device and storage medium based on angle analysis, which have the same technical effects.
[0007] The first objective of this application is to provide a trajectory optimization method based on angle analysis.
[0008] The above-mentioned application objective 1 of the present application is achieved through the following technical solutions:
[0009] A trajectory optimization method based on angle analysis, the method comprising the following steps:
[0010] S1, preprocessing the target trajectory to obtain a trajectory point time series array of the target trajectory;
[0011] S2, performing angle calculation based on the trajectory point time series array to obtain an angle time series array of the target trajectory;
[0012] S3, performing angle analysis on the angle time series array to obtain an angle analysis result of the target trajectory;
[0013] S4, deleting abnormal trajectory points in the target trajectory based on the angle analysis result to obtain an optimized trajectory.
[0014] Preferably, step S3 specifically includes:
[0015] It is determined in turn whether each angle in the angle time series array meets the preset conditions. If so, the trajectory points corresponding to the angles that meet the conditions are marked as normal trajectory points. If not, the trajectory points corresponding to the angles that do not meet the conditions are marked as abnormal trajectory points.
[0016] Preferably, the preset condition includes a first preset condition and a second preset condition, and the normal track point includes a first normal track point and a second normal track point, wherein:
[0017] The first preset condition is: there are at least X consecutive angles that satisfy a first preset angle threshold range α, wherein the first preset angle threshold range α is: 90°<α≤180°, X is a positive integer, and X≥2;
[0018] The second preset condition is: a maximum of Y angles in a group of continuous angles satisfy a second preset angle threshold range β, wherein the second preset angle threshold range β is: 0°≤α≤90°, Y is a positive integer, and Y≥2;
[0019] Correspondingly, the step of sequentially judging whether each angle in the angle time series array meets a preset condition, and if so, marking the trajectory point corresponding to the angle meeting the condition as a normal trajectory point, and if not, marking the trajectory point corresponding to the angle not meeting the condition as an abnormal trajectory point specifically includes the following steps:
[0020] S31, traversing the angle time series array, determining in turn whether each angle in the angle time series array satisfies the first preset condition, and marking the trajectory points corresponding to the continuous angles that satisfy the first preset condition as the first normal trajectory points;
[0021] S32, determining whether each group of continuous angles obtained by dividing the continuous angles corresponding to each of the first normal trajectory points in the angle time series array by the continuous angles as dividing points meets the second preset condition, if so, executing S33, if not, executing S34;
[0022] S33, marking the trajectory points corresponding to each group of continuous angles that meet the second preset condition as the second normal trajectory points;
[0023] S34, marking the trajectory points corresponding to each group of continuous angles that do not meet the second preset condition as the abnormal trajectory points.
[0024] Preferably, the value of X is 5, and the value of Y is 10.
[0025] Preferably, step S4 specifically includes the following steps:
[0026] Deleting all abnormal trajectory points in the target trajectory and retaining all normal trajectory points;
[0027] All retained trajectory points are connected in chronological order to obtain the optimized trajectory.
[0028] Preferably, step S1 specifically includes the following steps:
[0029] Extracting a trajectory starting point and a trajectory end point of the target trajectory;
[0030] Extracting trajectory points between a trajectory starting point and a trajectory ending point of the target trajectory according to a preset trajectory point extraction frequency;
[0031] The trajectory starting point, the trajectory end point and the extracted trajectory points are combined in time sequence to obtain the trajectory point time series array of the target trajectory.
[0032] Preferably, step S2 specifically includes the following steps:
[0033] Calculating the angle between two line segments formed by connecting any three adjacent trajectory points in the trajectory point time series array in time sequence;
[0034] All calculated angles are combined in chronological order to obtain the angle time series array of the target trajectory.
[0035] The second object of this application is to provide a trajectory optimization system based on angle analysis.
[0036] The second application objective of the present application is achieved through the following technical solutions:
[0037] A trajectory optimization system based on angle analysis, the system comprising:
[0038] A trajectory preprocessing module, used for preprocessing the target trajectory to obtain a trajectory point time series array of the target trajectory;
[0039] An angle calculation module, used for performing angle calculation based on the trajectory point time series array to obtain the angle time series array of the target trajectory;
[0040] An angle analysis module, used to perform angle analysis on the angle time series array to obtain an angle analysis result of the target trajectory;
[0041] The trajectory optimization module is used to delete abnormal trajectory points in the target trajectory based on the angle analysis result to obtain an optimized trajectory.
[0042] Preferably, the angle analysis module is specifically used for:
[0043] It is determined in turn whether each angle in the angle time series array meets the preset conditions. If so, the trajectory points corresponding to the angles that meet the conditions are marked as normal trajectory points. If not, the trajectory points corresponding to the angles that do not meet the conditions are marked as abnormal trajectory points.
[0044] Preferably, the preset condition includes a first preset condition and a second preset condition, and the normal track point includes a first normal track point and a second normal track point, wherein:
[0045] The first preset condition is: there are at least X consecutive angles that satisfy a first preset angle threshold range α, wherein the first preset angle threshold range α is: 90°<α≤180°, X is a positive integer, and X≥2;
[0046] The second preset condition is: a maximum of Y angles in a group of continuous angles satisfy a second preset angle threshold range β, wherein the second preset angle threshold range β is: 0°≤α≤90°, Y is a positive integer, and Y≥2;
[0047] Correspondingly, the angle analysis module sequentially determines whether each angle in the angle time series array meets the preset conditions. If so, the trajectory point corresponding to the angle that meets the conditions is marked as a normal trajectory point. If not, the trajectory point corresponding to the angle that does not meet the conditions is marked as an abnormal trajectory point, which specifically includes the following steps:
[0048] S31, traversing the angle time series array, determining in turn whether each angle in the angle time series array satisfies the first preset condition, and marking the trajectory points corresponding to the continuous angles that satisfy the first preset condition as the first normal trajectory points;
[0049] S32, determining whether each group of continuous angles obtained by dividing the continuous angles corresponding to each of the first normal trajectory points in the angle time series array by the continuous angles as dividing points meets the second preset condition, if so, executing S33, if not, executing S34;
[0050] S33, marking the trajectory points corresponding to each group of continuous angles that meet the second preset condition as the second normal trajectory points;
[0051] S34, marking the trajectory points corresponding to each group of continuous angles that do not meet the second preset condition as the abnormal trajectory points.
[0052] Preferably, the value of X is 5, and the value of Y is 10.
[0053] Preferably, the trajectory optimization module deletes abnormal trajectory points in the target trajectory based on the angle analysis result to obtain an optimized trajectory, specifically comprising the following steps:
[0054] Deleting all abnormal trajectory points in the target trajectory and retaining all normal trajectory points;
[0055] All retained trajectory points are connected in chronological order to obtain the optimized trajectory.
[0056] Preferably, the trajectory preprocessing module performs preprocessing on the target trajectory to obtain the trajectory point time series array of the target trajectory, specifically comprising the following steps:
[0057] Extracting a trajectory starting point and a trajectory end point of the target trajectory;
[0058] Extracting trajectory points between a trajectory starting point and a trajectory ending point of the target trajectory according to a preset trajectory point extraction frequency;
[0059] The trajectory starting point, the trajectory end point and the extracted trajectory points are combined in time sequence to obtain the trajectory point time series array of the target trajectory.
[0060] Preferably, the angle calculation module performs angle calculation based on the trajectory point time series array to obtain the angle time series array of the target trajectory, specifically comprising the following steps:
[0061] Calculating the angle between two line segments formed by connecting any three adjacent trajectory points in the trajectory point time series array in time sequence;
[0062] All calculated angles are combined in chronological order to obtain the angle time series array of the target trajectory.
[0063] The third object of the present application is to provide an electronic device.
[0064] The third application objective of this application is achieved through the following technical solutions:
[0065] An electronic device, comprising:
[0066] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the trajectory optimization method based on angle analysis as described in any one of the first objectives of the present application are implemented.
[0067] The fourth object of this application is to provide a computer-readable storage medium.
[0068] The fourth application objective of this application is achieved through the following technical solutions:
[0069] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the trajectory optimization method based on angle analysis as described in any one of the first objectives of the present application.
[0070] In summary, the present application discloses a trajectory optimization method, system, device and storage medium based on angle analysis, which processes the target trajectory into a trajectory point time series array, and further performs angle calculation on the trajectory point time series array to obtain an angle time series array, and then performs angle analysis on each angle in the angle time series array to obtain an angle analysis result, and finally deletes abnormal trajectory points in the target trajectory according to the angle analysis result, thereby obtaining an optimized trajectory. The present application optimizes the target trajectory based on angle analysis of the angle formed by the connection of each trajectory point in the target trajectory. The calculation process is simple and the calculation complexity is low. It can effectively improve the calculation speed of the inspection trajectory optimization, and the optimized inspection trajectory is more consistent with the actual inspection trajectory of the inspection personnel, effectively ensuring the accuracy of the optimized inspection trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0072] Figure 1 A schematic diagram of a flow chart of a trajectory optimization method based on angle analysis in an embodiment of the present application;
[0073] Figure 2 This is a flow chart of an analysis method for performing angle analysis on an angle time series array in an embodiment of the present application;
[0074] Figure 3 It is a structural schematic diagram of a trajectory optimization system based on angle analysis in an embodiment of the present application;
[0075] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application;
[0076] Figure 5 It is a schematic diagram of the trajectory before optimization in a specific example of the present application;
[0077] Figure 6 for Figure 5 The trajectory shown is a schematic diagram of the trajectory obtained after optimization by the method of the present application;
[0078] Figure 7 A schematic diagram of a trajectory before optimization in another specific example of the present application;
[0079] Figure 8 for Figure 7 The trajectory shown is a schematic diagram of the trajectory obtained after optimization by the method of the present application;
[0080] Fig. 9 This is a schematic diagram of a trajectory before optimization in another specific example of the present application;
[0081] Fig.10 for Fig. 9 The trajectory shown is a schematic diagram of the trajectory obtained after optimization by the method of the present application. DETAILED DESCRIPTION
[0082] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0083] In the embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are merely schematic. For example, the division of units and modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or modules can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0084] In addition, all functional units in the embodiments of the present application may be integrated into one processor, or each unit may be a separate device, or two or more units may be integrated into one device; each functional unit in the embodiments of the present application may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0085] A person skilled in the art can understand that all or part of the steps of the following method embodiments can be completed by program instructions and related hardware. The aforementioned program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, the steps of the following method embodiments are executed; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a magnetic disk or an optical disk, and other media that can store program codes.
[0086] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "multiple" and "several" mean two or more, unless otherwise clearly and specifically defined.
[0087] like Figure 1 As shown, the embodiment of the present application provides a trajectory optimization method based on angle analysis, which may include the following steps:
[0088] S1, preprocessing the target trajectory to obtain a time series array of trajectory points of the target trajectory;
[0089] Since the inspection trajectory obtained by the inspection terminal carried by the inspection personnel contains a large amount of abnormal data such as redundant data and erroneous data, the effectiveness of supervising the inspection work and the value of guiding subsequent inspection work are greatly reduced. Therefore, the inspection trajectory needs to be optimized in order to remove the abnormal data in the inspection trajectory.
[0090] When the inspection trajectory needs to be optimized, the target trajectory needs to be preprocessed first and converted into the trajectory point time series data of the target trajectory so as to perform angle analysis on the target trajectory later.
[0091] It should be noted that the target trajectory is the inspection trajectory that needs to be optimized. Specifically, the target trajectory can be, but is not limited to, the inspection trajectory of a certain day or a specific time period of a certain day generated by the inspection terminal carried by the inspection personnel when the inspection personnel perform inspection tasks such as forest fire prevention inspection, power circuit inspection or water conservancy inspection. The target trajectory can be obtained from the inspection terminal, or from a management device that communicates with the inspection terminal (such as an inspection management platform).
[0092] Specifically, the preprocessing of the target trajectory in step S1 can be implemented by the following method:
[0093] First, extract the starting point and end point of the target trajectory;
[0094] Then, according to the preset trajectory point extraction frequency, the trajectory point is extracted between the trajectory starting point and the trajectory end point of the target trajectory;
[0095] Finally, the trajectory starting point, trajectory end point and extracted trajectory points are combined in chronological order to obtain the trajectory point time series array of the target trajectory.
[0096] It can be understood that for a target trajectory, since the trajectory itself is a continuous trajectory obtained by connecting several trajectory points obtained by positioning the inspection terminal in time sequence, the target trajectory includes a trajectory starting point, a trajectory end point and several trajectory points located between the trajectory starting point and the trajectory end point, and the trajectory starting point, the trajectory end point and any trajectory point located between the trajectory starting point and the trajectory end point have at least two attributes: time and position.
[0097] It can be seen that in order to obtain the trajectory point time series array of the target trajectory, when preprocessing the target trajectory, it is first necessary to extract the trajectory starting point and the trajectory end point of the target trajectory, and then extract trajectory points between the trajectory starting point and the trajectory end point of the target trajectory according to the preset trajectory point extraction frequency, until the time interval between the last trajectory point extracted between the trajectory starting point and the trajectory end point and the trajectory end point is less than or equal to the preset trajectory point extraction frequency, and finally the trajectory starting point, the trajectory end point and the extracted trajectory points are combined in chronological order to obtain the trajectory point time series array of the target trajectory.
[0098] It should be noted that the trajectory point extraction frequency refers to the interval time or interval distance between two adjacent trajectory points in the extracted trajectory points. The smaller the trajectory point extraction frequency, the more trajectory points are extracted on the same target trajectory, which makes the accuracy of the optimized result higher, but more trajectory points may increase the calculation time to a certain extent; the greater the trajectory point extraction frequency, the fewer trajectory points are extracted on the same target trajectory, which makes the accuracy of the optimized result relatively low, but fewer trajectory points will reduce the calculation time to a certain extent, thereby improving the optimization calculation speed. Therefore, the trajectory point extraction frequency can be specifically set according to user needs or device performance, and can also be determined according to user needs and combined with device performance. For example, for devices with excellent computing performance, a smaller trajectory point extraction frequency can be used to extract more trajectory points to maximize the accuracy of the optimized results.
[0099] Since the inspection terminal usually receives the positioning signal at a certain frequency (generally 10 seconds / time), in order to optimize the calculation speed and the accuracy of the optimized results, it is preferred that the trajectory point extraction frequency is consistent with the frequency at which the inspection terminal receives the positioning signal.
[0100] S2, calculate the angle based on the trajectory point time series array to obtain the angle time series array of the target trajectory;
[0101] After preprocessing the target trajectory to obtain the trajectory point time series array of the target trajectory, it is necessary to perform angle calculation based on the trajectory point time series array to obtain the angle time series array of the target trajectory.
[0102] Specifically, the angle calculation based on the trajectory point time series array in step S2 can be implemented by the following method:
[0103] First, the angle between two line segments formed by connecting any three adjacent trajectory points in the trajectory point time series array in time sequence is calculated;
[0104] Then, all calculated angles are combined in chronological order to obtain the angle time series array of the target trajectory.
[0105] It can be understood that for a trajectory point time series array, if the number of trajectory point elements (including the trajectory start point and the trajectory end point) in the array is n (n is a positive integer), then the number of angles between two line segments formed by connecting any three adjacent trajectory points in the trajectory point time series array in chronological order is n-2, that is, n trajectory points can be connected in chronological order to obtain n-2 angles (for example, if the number of trajectory points in the trajectory point time series array is 5000, the number of angles in the angle time series array is 4998). Therefore, after combining all the calculated angles in chronological order, the angle elements contained in the angle time series array of the target trajectory are also n-2.
[0106] It should be noted that each angle element in the angle time series array of the target trajectory obtained by combining all calculated angles in chronological order may have two attributes: the time corresponding to the angle vertex and the angle value.
[0107] S3, performing angle analysis on the angle time series array to obtain an angle analysis result of the target trajectory;
[0108] After the angle time series array of the target trajectory is obtained by performing angle calculation based on the trajectory point time series array, it is necessary to perform angle analysis on the angle time series array in order to obtain the angle analysis result of the target trajectory.
[0109] Specifically, the angle analysis of the angle time series array in step S2 can be implemented by the following method:
[0110] It is determined in turn whether each angle in the angle time series array meets the preset conditions. If so, the trajectory point corresponding to the angle that meets the conditions is marked as a normal trajectory point. If not, the trajectory point corresponding to the angle that does not meet the conditions is marked as an abnormal trajectory point.
[0111] In this way, normal trajectory points and abnormal trajectory points are judged by judging whether each angle in the angle time series array meets the preset conditions, so as to screen out abnormal trajectory points in the target trajectory based on angle analysis.
[0112] The inventors of the present application discovered through studying a large number of patrol trajectories that the angles between trajectory points generated by normal patrols and the angles between trajectory points generated during patrols due to abnormal positioning signals or the patrol personnel staying in place or the patrol personnel turning back and forth, detouring, etc. have different characteristics (the angles between trajectory points generated during normal patrols are generally larger, and the angles between trajectory points generated during patrols due to abnormal positioning signals or the patrol personnel staying in place or the patrol personnel turning back and forth, detouring, etc. are generally smaller). Therefore, the method of the present application of judging normal trajectory points and abnormal trajectory points by performing angle analysis on the angles formed by each trajectory point is scientific and feasible, and has high reliability and accuracy.
[0113] S4, based on the angle analysis result, delete the abnormal trajectory points in the target trajectory to obtain the optimized trajectory.
[0114] After performing angle analysis on the angle time series array to obtain the angle analysis result of the target trajectory, it is necessary to delete abnormal trajectory points in the target trajectory based on the angle analysis result to obtain an optimized trajectory.
[0115] Specifically, in step S4, the optimized trajectory obtained by deleting abnormal trajectory points in the target trajectory based on the angle analysis result can be implemented by the following method:
[0116] First, delete all abnormal trajectory points in the target trajectory and keep all normal trajectory points;
[0117] Then, all the retained trajectory points are connected in chronological order to obtain the optimized trajectory.
[0118] It should be noted that all the retained trajectory points include the trajectory starting point, the trajectory ending point, and all the retained normal trajectory points.
[0119] Specifically, if Figure 5-Figure 10 As shown, Figure 5 , Figure 7 , Fig. 9 They are the trajectories before optimization (i.e., target trajectories) in three different instances. Figure 6 , Figure 8 , Fig.10 The trajectory optimization method based on angle analysis of this embodiment is used to Figure 5 , Figure 7 , Fig. 9The optimized trajectory obtained by trajectory optimization of the target trajectory shown in the figure can be obviously seen by comparing the trajectory before optimization with the trajectory after optimization that the irregular trajectory points that jump back and forth in the target trajectory (i.e., abnormal trajectory points caused by abnormal positioning signals or the inspection personnel staying in place or the inspection personnel turning back and forth or detouring in a small range) are successfully removed. The obtained optimized trajectory can more accurately reflect the actual inspection route, which improves the effectiveness of the optimized trajectory in supervising the inspection operation and the value of guiding subsequent inspection operations.
[0120] In summary, the trajectory optimization method based on angle analysis in the above embodiment processes the target trajectory into a trajectory point time series array, and further performs angle calculation on the trajectory point time series array to obtain an angle time series array, and then performs angle analysis on each angle in the angle time series array to obtain an angle analysis result, and finally deletes abnormal trajectory points in the target trajectory according to the angle analysis result, thereby obtaining an optimized trajectory. The present application optimizes the target trajectory based on angle analysis of the angle formed by the connecting lines of each trajectory point in the target trajectory. The calculation process is simple and the calculation complexity is low. It can effectively improve the calculation speed of the inspection trajectory optimization, and the optimized inspection trajectory is more consistent with the actual inspection trajectory of the inspection personnel, effectively ensuring the accuracy of the optimized inspection trajectory.
[0121] On the basis of the above embodiment, the preset condition includes a first preset condition and a second preset condition, and the normal track point includes a first normal track point and a second normal track point, wherein:
[0122] The first preset condition is: there are at least X consecutive angles that satisfy the first preset angle threshold range α, wherein the first preset angle threshold range α is: 90°<α≤180°, X is a positive integer, and X≥2;
[0123] The second preset condition is: a maximum of Y angles in a group of continuous angles satisfy a second preset angle threshold range β, wherein the second preset angle threshold range β is: 0°≤α≤90°, Y is a positive integer, and Y≥2;
[0124] Accordingly, if Figure 2 As shown, it is determined in turn whether each angle in the angle time series array meets the preset conditions. If so, the trajectory point corresponding to the angle that meets the conditions is marked as a normal trajectory point. If not, the trajectory point corresponding to the angle that does not meet the conditions is marked as an abnormal trajectory point. The specific steps include the following:
[0125] S31, traversing the angle time series array, determining in turn whether each angle in the angle time series array satisfies a first preset condition, and marking the trajectory points corresponding to the continuous angles that satisfy the first preset condition as first normal trajectory points;
[0126] S32, determining whether each group of continuous angles obtained by dividing the continuous angles corresponding to each first normal trajectory point in the angle time series array with the continuous angles corresponding to each first normal trajectory point as the dividing point meets the second preset condition, if so, executing S33, if not, executing S34;
[0127] S33, marking the trajectory points corresponding to each group of continuous angles that meet the second preset condition as second normal trajectory points;
[0128] S34, marking the trajectory points corresponding to each group of continuous angles that do not meet the second preset condition as abnormal trajectory points.
[0129] The inventors of this application discovered through studying a large number of inspection trajectories that the angle between trajectory points generated by normal inspections is generally greater than 90 degrees, while the angle between trajectory points generated during the inspection due to abnormal positioning signals, the inspection personnel not moving in place, or the inspection personnel turning back and forth or making detours in a small area is generally less than or equal to 90 degrees.
[0130] Therefore, in this embodiment, it is first determined whether each angle in the angle time series array satisfies the condition that at least X consecutive angles satisfy the first preset angle threshold range α (90°<α≤180°). If so, the trajectory points corresponding to this group of at least X consecutive angles are determined as the first normal trajectory points, that is, all groups of continuous trajectory points corresponding to the angles satisfying the first preset angle threshold range α in the angle time series array are screened out and marked as the first normal trajectory points. In other words, when the number of continuous angles satisfying the first preset angle threshold range α (90°<α≤180°) is greater than or equal to X (indicating that the trajectory points in this small segment of the trajectory do not have a situation of turning back or jumping), the trajectory points corresponding to this group of continuous angles satisfying the first preset angle threshold range α are determined as the first normal trajectory points.
[0131] In this way, after the first normal trajectory point is marked, a total of multiple groups of continuous trajectory points will be separated between the trajectory starting point (including the trajectory starting point) and the first group of first normal trajectory points, between two adjacent groups of first normal trajectory points, and between the last group of normal trajectory points and the trajectory end point (including the trajectory end point).
[0132] Since inspection personnel may make a small number of small-angle (less than or equal to 90 degrees) turns during the inspection process, it is necessary to further determine whether the continuous angles corresponding to each group of continuous trajectory points satisfy the condition that at most Y angles satisfy the second preset angle threshold range β (0°≤α≤90°) for these groups of continuous trajectory points. If so, the trajectory points corresponding to each group of continuous angles that satisfy the second preset condition are marked as second normal trajectory points, that is, all groups of continuous trajectory points corresponding to angles that satisfy the second preset angle threshold range α in the angle time series array are screened out and marked as second normal trajectory points. If not, the trajectory points corresponding to each group of continuous angles that do not satisfy the second preset condition are marked as abnormal trajectory points, that is, all groups of continuous trajectory points corresponding to angles that do not satisfy the second preset angle threshold range α in the angle time series array are screened out and marked as abnormal trajectory points. That is to say, for the continuous angles corresponding to each group of separated continuous trajectory points, if the angle in this group of continuous angles that satisfies the second preset angle threshold range β (0°≤α≤90°) is less than or equal to Y, it means that the trajectory points turn back and jump too frequently (indicating that the trajectory points in this small segment of the trajectory do not frequently turn back and jump), then this group of continuous trajectory points is marked as the second normal trajectory point; if the angle in this group of continuous angles that satisfies the second preset angle threshold range β (0°≤α≤90°) is greater than Y (indicating that the trajectory points in this small segment of the trajectory turn back and jump too frequently), then this group of continuous trajectory points is marked as abnormal trajectory points.
[0133] It should be noted that X and Y are both empirical values and can be obtained based on experimental analysis. In this embodiment, by optimizing and analyzing a large number of inspection trajectories according to the trajectory optimization method based on angle analysis of this application and comparing the optimized results, when the value of X is 5 and the value of Y is 10, the trajectory optimization effect is the best.
[0134] In order to better understand the judgment and marking method of normal trajectory points (including the first normal trajectory point and the second normal trajectory point) and abnormal trajectory points in this embodiment, the working principle of this embodiment is described below with a specific example:
[0135] Assume that the value of X is 5 and the value of Y is 10. Assume that the number of trajectory points (trajectory starting point and trajectory end point) extracted from the patrol personnel's one-day inspection trajectory (a continuous trajectory) is 5000, and the angle time series array obtained after angle calculation contains 4998 angles.
[0136] First, starting from the first angle, analyze the subsequent angles in the order of the positioning time of the trajectory points corresponding to the angles. If there are more than 5 (including 5) consecutive angles greater than 90 degrees and less than or equal to 180 degrees, the trajectory points corresponding to this group of more than 5 consecutive angles greater than 90 degrees and less than or equal to 180 degrees are marked as the first normal trajectory points. Assuming that the 5 angles from the 81st angle to the 85th angle are all greater than 90 degrees and less than or equal to 180 degrees, the trajectory points corresponding to these 5 angles are marked as the first normal trajectory points, and so on, until all the angles in the angle time series array are analyzed;
[0137] Then, the angles corresponding to the first normal trajectory points that have been marked are ignored, and the angle time series array will have several groups of continuous angles corresponding to the unmarked trajectory points remaining. Next, the continuous angles corresponding to each group of unmarked trajectory points are judged according to the second preset condition, that is, whether the number of angles greater than or equal to 0 degrees and less than or equal to 90 degrees in the continuous angles corresponding to each group of unmarked trajectory points is less than or equal to 10.
[0138] If so, the trajectory points corresponding to the continuous angles corresponding to the group of unmarked trajectory points (except the trajectory points that coincide with the first normal trajectory points) are marked as the second normal trajectory points. Assuming that among the angles corresponding to all trajectory points before the first trajectory point of the first group of first normal trajectory points (assuming that they are the trajectory points corresponding to the 81st angle to the 85th angle), only 10 angles are greater than or equal to 0 degrees and less than or equal to 90 degrees, all trajectory points from the trajectory starting point to the previous trajectory point of the first group of first normal trajectory points are marked as the second normal trajectory points.
[0139] If not, the trajectory points corresponding to the continuous angles corresponding to the group of unmarked trajectory points (except the trajectory points that coincide with the first normal trajectory point) are marked as abnormal trajectory points. Assuming that among the angles corresponding to all trajectory points before the first trajectory point of the first group of first normal trajectory points (assuming that they are the trajectory points corresponding to the 81st angle to the 85th angle), the number of angles greater than or equal to 0 degrees and less than or equal to 90 degrees is greater than 10, then all trajectory points from the trajectory starting point to the previous trajectory point of the first normal trajectory point of the first group are marked as abnormal trajectory points.
[0140] At this point, all trajectory points corresponding to the angles in the angle time series array have been marked, that is, all trajectory points extracted from the target trajectory have been marked.
[0141] In some other embodiments, it is determined in turn whether each angle in the angle time series array meets the preset conditions. If so, the trajectory point corresponding to the angle that meets the conditions is marked as a normal trajectory point. If not, the trajectory point corresponding to the angle that does not meet the conditions is marked as an abnormal trajectory point. The specific implementation can also be achieved by the following method:
[0142] Step a, starting from the first angle in the angle time series array, determine in turn whether each angle in the angle time series array satisfies the first preset angle threshold range α (90°<α≤180°), if there are more than 5 (including 5) consecutive angles greater than 90 degrees and less than or equal to 180 degrees, then mark the trajectory points corresponding to this group of more than 5 consecutive angles greater than 90 degrees and less than or equal to 180 degrees as the first normal trajectory point. Assuming that the 5 angles from the 81st angle to the 85th angle are all greater than 90 degrees and less than or equal to 180 degrees, mark the trajectory points corresponding to these 5 angles as the first normal trajectory point.
[0143] Step b, sequentially judging whether all the unmarked angles before the continuous angles corresponding to the group of marked continuous trajectory points meet the second preset angle threshold range β (0°≤α≤90°); if among all the unmarked angles before the continuous angles corresponding to the group of marked continuous trajectory points, only 10 angles are greater than or equal to 0 degrees and less than or equal to 90 degrees, then the trajectory points corresponding to all the unmarked angles before the continuous angles corresponding to the group of marked continuous trajectory points (excluding the first trajectory point in the group of trajectory points that have been marked) are marked as second normal trajectory points; if among all the unmarked angles before the continuous angles corresponding to the group of marked continuous trajectory points, the number of angles greater than or equal to 0 degrees and less than or equal to 90 degrees is greater than 10, then the trajectory points corresponding to all the unmarked angles before the continuous angles corresponding to the group of marked continuous trajectory points (excluding the first trajectory point in the group of trajectory points that have been marked) are marked as abnormal normal trajectory points;
[0144] Step c, starting from the first angle among the angles corresponding to the unmarked trajectory points, loop through steps a to b until all trajectory points corresponding to all angles in the angle time series array are marked, that is, all trajectory points extracted from the target trajectory are marked.
[0145] like Figure 3 As shown, an embodiment of the present application provides a trajectory optimization system based on angle analysis, which may include:
[0146] The trajectory preprocessing module 201 is used to preprocess the target trajectory to obtain a trajectory point time series array of the target trajectory;
[0147] An angle calculation module 202, used to perform angle calculation based on the trajectory point time series array to obtain an angle time series array of the target trajectory;
[0148] Angle analysis module 203, used to perform angle analysis on the angle time series array to obtain an angle analysis result of the target trajectory;
[0149] The trajectory optimization module 204 is used to delete abnormal trajectory points in the target trajectory based on the angle analysis result to obtain an optimized trajectory.
[0150] Based on the above embodiment, the angle analysis module 203 is specifically used for:
[0151] It is determined in turn whether each angle in the angle time series array meets the preset conditions. If so, the trajectory point corresponding to the angle that meets the conditions is marked as a normal trajectory point. If not, the trajectory point corresponding to the angle that does not meet the conditions is marked as an abnormal trajectory point.
[0152] On the basis of the above embodiment, the preset condition includes a first preset condition and a second preset condition, and the normal track point includes a first normal track point and a second normal track point, wherein:
[0153] The first preset condition is: there are at least X consecutive angles that satisfy the first preset angle threshold range α, wherein the first preset angle threshold range α is: 90°<α≤180°, X is a positive integer, and X≥2;
[0154] The second preset condition is: a maximum of Y angles in a group of continuous angles satisfy a second preset angle threshold range β, wherein the second preset angle threshold range β is: 0°≤α≤90°, Y is a positive integer, and Y≥2;
[0155] Accordingly, if Figure 2 As shown, the angle analysis module 203 sequentially determines whether each angle in the angle time series array meets the preset conditions. If so, the trajectory point corresponding to the angle meeting the conditions is marked as a normal trajectory point. If not, the trajectory point corresponding to the angle not meeting the conditions is marked as an abnormal trajectory point, which specifically includes the following steps:
[0156] S31, traversing the angle time series array, determining in turn whether each angle in the angle time series array satisfies a first preset condition, and marking the trajectory points corresponding to the continuous angles that satisfy the first preset condition as first normal trajectory points;
[0157] S32, determining whether each group of continuous angles obtained by dividing the continuous angles corresponding to each first normal trajectory point in the angle time series array with the continuous angles corresponding to each first normal trajectory point as the dividing point meets the second preset condition, if so, executing S33, if not, executing S34;
[0158] S33, marking the trajectory points corresponding to each group of continuous angles that meet the second preset condition as second normal trajectory points;
[0159] S34, marking the trajectory points corresponding to each group of continuous angles that do not meet the second preset condition as abnormal trajectory points.
[0160] In summary, the trajectory optimization system based on angle analysis in the above-mentioned embodiment processes the target trajectory into a trajectory point time series array, and further performs angle calculation on the trajectory point time series array to obtain an angle time series array, and then performs angle analysis on each angle in the angle time series array to obtain an angle analysis result, and finally deletes abnormal trajectory points in the target trajectory according to the angle analysis result, thereby obtaining an optimized trajectory. The present application optimizes the target trajectory based on angle analysis of the angle formed by the connecting lines of each trajectory point in the target trajectory. The calculation process is simple and the calculation complexity is low. It can effectively improve the calculation speed of the inspection trajectory optimization, and the optimized inspection trajectory is more consistent with the actual inspection trajectory of the inspection personnel, effectively ensuring the accuracy of the optimized inspection trajectory.
[0161] Based on the above embodiment, the value of X is 5, and the value of Y is 10.
[0162] On the basis of the above embodiment, the trajectory optimization module 204 executes the deletion of abnormal trajectory points in the target trajectory based on the angle analysis result to obtain the optimized trajectory, which specifically includes the following steps:
[0163] Delete all abnormal trajectory points in the target trajectory and keep all normal trajectory points;
[0164] All retained trajectory points are connected in chronological order to obtain the optimized trajectory.
[0165] On the basis of the above embodiment, the trajectory preprocessing module 201 performs preprocessing on the target trajectory to obtain the trajectory point time series array of the target trajectory, which specifically includes the following steps:
[0166] Extract the starting point and the end point of the target trajectory;
[0167] According to a preset trajectory point extraction frequency, a trajectory point is extracted between a trajectory start point and a trajectory end point of the target trajectory;
[0168] The trajectory starting point, trajectory end point and extracted trajectory points are combined in chronological order to obtain the trajectory point time series array of the target trajectory.
[0169] On the basis of the above embodiment, the angle calculation module 202 performs angle calculation based on the trajectory point time series array to obtain the angle time series array of the target trajectory, specifically including the following steps:
[0170] Calculate the angle between two line segments formed by connecting any three adjacent trajectory points in the trajectory point time series array in time sequence;
[0171] Combine all calculated angles in chronological order to obtain the angle time series array of the target trajectory.
[0172] It should be noted that the trajectory optimization system based on angle analysis in the above embodiment has the same working principle and technical effect as the trajectory optimization method based on angle analysis in the above embodiment, which will not be repeated here.
[0173] like Figure 4 As shown, an embodiment of the present application provides an electronic device 3, which includes a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and executable on the processor 302. When the processor 302 executes the computer program 303, the steps of the trajectory optimization method based on angle analysis in the above-mentioned method embodiment of the present application are implemented.
[0174] Specifically, the electronic device 3 may be an intelligent device with a memory and a processor, such as an industrial computer, a PC, or an intelligent mobile terminal, or may be a computer component with a memory and a processor, such as a CPU or a GPU.
[0175] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the trajectory optimization method based on angle analysis in the above-mentioned method embodiment of the present application are implemented.
[0176] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0177] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0178] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, software modules executed by a processor, or a combination of the two. The software modules may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0179] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A trajectory optimization method based on angle analysis, characterized in that: The method comprises the following steps: S1, preprocessing the target trajectory to obtain a trajectory point time series array of the target trajectory; S2, performing angle calculation based on the trajectory point time series array to obtain an angle time series array of the target trajectory; S3, performing angle analysis on the angle time series array to obtain an angle analysis result of the target trajectory; S4, deleting abnormal trajectory points in the target trajectory based on the angle analysis result to obtain an optimized trajectory; Step S3 specifically includes: Determine in turn whether each angle in the angle time series array meets the preset conditions, if so, mark the trajectory point corresponding to the angle that meets the conditions as a normal trajectory point, if not, mark the trajectory point corresponding to the angle that does not meet the conditions as an abnormal trajectory point; in, The preset conditions include a first preset condition and a second preset condition, and the normal track points include a first normal track point and a second normal track point, wherein: The first preset condition is: there are at least X consecutive angles that satisfy a first preset angle threshold range α, wherein the first preset angle threshold range α is: 90°<α≤180°, X is a positive integer, and X≥2; The second preset condition is: a maximum of Y angles in a group of continuous angles satisfy a second preset angle threshold range β, wherein the second preset angle threshold range β is: 0°≤β≤90°, Y is a positive integer, and Y≥2; Correspondingly, the step of sequentially judging whether each angle in the angle time series array meets a preset condition, and if so, marking the trajectory point corresponding to the angle meeting the condition as a normal trajectory point, and if not, marking the trajectory point corresponding to the angle not meeting the condition as an abnormal trajectory point specifically includes the following steps: S31, traversing the angle time series array, determining in turn whether each angle in the angle time series array satisfies the first preset condition, and marking the trajectory points corresponding to the continuous angles that satisfy the first preset condition as the first normal trajectory points; S32, determining whether each group of continuous angles obtained by dividing the continuous angles corresponding to each of the first normal trajectory points in the angle time series array by the continuous angles as dividing points meets the second preset condition, if so, executing S33, if not, executing S34; S33, marking the trajectory points corresponding to each group of continuous angles that meet the second preset condition as the second normal trajectory points; S34, marking the trajectory points corresponding to each group of continuous angles that do not meet the second preset condition as the abnormal trajectory points.
2. The trajectory optimization method based on angle analysis according to claim 1, characterized in that: The value of X is 5, and the value of Y is 10.
3. The trajectory optimization method based on angle analysis according to any one of claims 1-2, characterized in that: Step S4 specifically includes the following steps: Deleting all abnormal trajectory points in the target trajectory and retaining all normal trajectory points; All retained trajectory points are connected in chronological order to obtain the optimized trajectory.
4. The trajectory optimization method based on angle analysis according to any one of claims 1-2, characterized in that: Step S1 specifically includes the following steps: Extracting a trajectory starting point and a trajectory end point of the target trajectory; Extracting trajectory points between a trajectory starting point and a trajectory ending point of the target trajectory according to a preset trajectory point extraction frequency; The trajectory starting point, the trajectory end point and the extracted trajectory points are combined in time sequence to obtain the trajectory point time series array of the target trajectory.
5. The trajectory optimization method based on angle analysis according to any one of claims 1-2, characterized in that: Step S2 specifically includes the following steps: Calculating the angle between two line segments formed by connecting any three adjacent trajectory points in the trajectory point time series array in time sequence; All calculated angles are combined in chronological order to obtain the angle time series array of the target trajectory.
6. A trajectory optimization system based on angle analysis, characterized in that: The system comprises: A trajectory preprocessing module, used for preprocessing the target trajectory to obtain a trajectory point time series array of the target trajectory; An angle calculation module, used for performing angle calculation based on the trajectory point time series array to obtain the angle time series array of the target trajectory; An angle analysis module, used to perform angle analysis on the angle time series array to obtain an angle analysis result of the target trajectory; A trajectory optimization module, used for deleting abnormal trajectory points in the target trajectory based on the angle analysis result to obtain an optimized trajectory; Wherein, the angle analysis module is specifically used for: Determine in turn whether each angle in the angle time series array meets the preset conditions, if so, mark the trajectory point corresponding to the angle that meets the conditions as a normal trajectory point, if not, mark the trajectory point corresponding to the angle that does not meet the conditions as an abnormal trajectory point; The preset conditions include a first preset condition and a second preset condition, and the normal track points include a first normal track point and a second normal track point, wherein: The first preset condition is: there are at least X consecutive angles that satisfy a first preset angle threshold range α, wherein the first preset angle threshold range α is: 90°<α≤180°, X is a positive integer, and X≥2; The second preset condition is: a maximum of Y angles in a group of continuous angles satisfy a second preset angle threshold range β, wherein the second preset angle threshold range β is: 0°≤β≤90°, Y is a positive integer, and Y≥2; Correspondingly, the angle analysis module sequentially determines whether each angle in the angle time series array meets the preset conditions. If so, the trajectory point corresponding to the angle that meets the conditions is marked as a normal trajectory point. If not, the trajectory point corresponding to the angle that does not meet the conditions is marked as an abnormal trajectory point, which specifically includes the following steps: S31, traversing the angle time series array, determining in turn whether each angle in the angle time series array satisfies the first preset condition, and marking the trajectory points corresponding to the continuous angles that satisfy the first preset condition as the first normal trajectory points; S32, determining whether each group of continuous angles obtained by dividing the continuous angles corresponding to each of the first normal trajectory points in the angle time series array by the continuous angles as dividing points meets the second preset condition, if so, executing S33, if not, executing S34; S33, marking the trajectory points corresponding to each group of continuous angles that meet the second preset condition as the second normal trajectory points; S34, marking the trajectory points corresponding to each group of continuous angles that do not meet the second preset condition as the abnormal trajectory points.
7. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the trajectory optimization method based on angle analysis as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the trajectory optimization method based on angle analysis as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Inspection track optimizing method and system for electric power circuit
CN107578133A
Water moving object track thinning method and device and computer equipment
CN115905342A