Agricultural machine motion mode recognition method combining road network map and agricultural machine trajectory clustering algorithm
By combining road network maps and agricultural machinery trajectory data, and using HFTMM and DBSCAN algorithms to correct mapping deviations and segment agricultural machinery trajectories, the problems of high labor costs and low accuracy in existing agricultural machinery motion pattern recognition are solved, achieving efficient and accurate agricultural machinery motion pattern recognition.
Patent Information
- Application Number
- CN202310692957.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2026-03-20
- Estimated Expiration
- 2043-06-12
AI Technical Summary
Existing methods for recognizing agricultural machinery movement patterns suffer from high labor and time costs, low accuracy, and low efficiency. They are particularly difficult to distinguish between farmland operations and road travel trajectories, and relying on satellite imagery consumes significant computational resources while limiting recognition results.
By combining road network maps and agricultural machinery trajectory data, the HFTMM algorithm is used to correct the mapping deviation between the agricultural machinery positioning trajectory and the road network map. The DBSCAN density clustering algorithm is used to segment the agricultural machinery trajectory points, and the road network map information is used to correct the misidentification of the density clustering algorithm, thereby achieving high-precision agricultural machinery movement pattern recognition.
It reduces the cost of manual annotation, improves the accuracy and efficiency of agricultural machinery motion pattern recognition, reduces reliance on satellite imagery, reduces computing resource consumption, and achieves efficient agricultural machinery motion pattern recognition.
Smart Images

Figure CN116738313B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application discloses a farm machine motion mode recognition method combining a road network map and a farm machine trajectory clustering algorithm, and belongs to the technical field of map matching. BACKGROUND
[0002] With the development of global positioning system, farmland information acquisition system and geographic information system technologies, a farm machine equipped with a Beidou positioning terminal can easily obtain farm machine positioning trajectory data, and the data contains rich geographic position information and farm machine activity information. In-depth research on the data and mining of the hidden spatio-temporal information behind the data have very important technical significance for modern agricultural production management.
[0003] In recent years, the use of farm machine positioning trajectory data to identify farm machine motion modes and then calculate farm machine operation areas has become one of important strategies for calculating effective farm machine operation areas. The farm machine motion modes include farmland operation, road driving and farmland turning. Accurate farm machine motion mode recognition results can accurately calculate farm machine operation areas and effectively reduce the labor, material and financial resources for manually calculating farm machine operation areas. However, the current farm machine motion mode recognition method based on farm machine GPS trajectory data still has defects, mainly including:
[0004] 1. A farm machine positioning trajectory segmentation method based on traditional machine learning: Traditional machine learning methods usually need a large amount of labeled data to train and obtain accurate models, which requires a large amount of labor and time cost. At the same time, such methods need to manually design features, and in the farm machine positioning trajectory segmentation task, effective trajectory features need to be extracted to distinguish different farm machine motion modes, which requires professional knowledge and a lot of practical experience.
[0005] 2. A farm machine positioning trajectory segmentation method based on single density clustering: According to the feature that the density of farm machine trajectory points is different on farmland and roads, a density clustering algorithm can be used for farm machine positioning trajectory segmentation. However, due to the single density feature of the farm machine trajectory, only using such an algorithm cannot accurately segment the farm machine trajectory. For example, the trajectory density of the farm machine when turning on the farmland is similar to the trajectory density of the farm machine when driving on the road, and only relying on the density clustering algorithm is easy to misidentify the farmland turning trajectory as the road driving state, and the segmentation accuracy is low.
[0006] 3. Satellite image and clustering algorithm-based agricultural machinery positioning trajectory segmentation method: Given the satellite image of the agricultural machinery driving area, the semantic segmentation method is used to segment the farmland and road, and then the clustering algorithm is used to preliminarily segment the agricultural machinery positioning trajectory. The segmented satellite image is used as the bottom map for the preliminary segmentation of the trajectory, and the trajectory is fine-tuned. This method will cause great loss of computing resources, and the operation is very complex, the recognition efficiency is low, and the recognition result is easily limited by satellite image data. For example, when the satellite image is low resolution, the farmland and road segmentation effect is poor, and the fine-tuning of the agricultural machinery positioning trajectory cannot be effectively performed, and the agricultural machinery positioning trajectory segmentation effect is poor.
[0007] Chinese patent document CN104992072A proposes a space grid subdivision-based work plot automatic identification and area statistics method. This method uses regional iterative clustering to identify agricultural machinery movement patterns, involves few movement pattern categories, and only one movement pattern (field work). Because the characteristics of agricultural machinery during field work and passing through road intersections and entering and exiting the garage are similar (high point density), the algorithm will misidentify agricultural machinery road intersection driving points and agricultural machinery entering and exiting garage points as agricultural machinery field work movement patterns, resulting in low recognition accuracy. Compared with this method, the present invention involves three agricultural machinery movement patterns (field work, field transfer, and road driving), and involves complete agricultural machinery movement pattern categories. At the same time, the present invention uses the real and effective road network map to assist in identifying agricultural machinery movement patterns, resulting in high recognition efficiency and high recognition accuracy.
[0008] Chinese patent document CN113409240B proposes a Beidou positioning data-based agricultural machinery behavior analysis and work area statistics method. This method uses a spatial clustering algorithm to identify agricultural machinery movement patterns, involves three agricultural machinery movement patterns (field work, field transfer, and road driving), and involves complete agricultural machinery movement pattern categories. Because the field transfer trajectory and road driving trajectory of agricultural machinery have very similar characteristics (low point density and similar trajectory shape), a large number of experimental adjustments are required to determine the values of the initial parameters (cluster number, density threshold, etc.), resulting in high time cost. At the same time, based on the determined initial parameters, the spatial clustering algorithm used by this method cannot distinguish between the field transfer points and road driving points that have very similar characteristics, as well as the field work points and the entering and exiting garage points. Compared with this method, the present invention also involves three agricultural machinery movement patterns, and involves complete categories. Unlike this method, the present invention combines the road network map and the agricultural machinery trajectory clustering algorithm, uses the real and effective road network map to determine the road driving points of agricultural machinery, and further uses the density clustering algorithm to identify the field work trajectory and field transfer trajectory of agricultural machinery. Reliable initialization density clustering parameters can be determined without a large number of experiments, resulting in low time cost, high recognition accuracy, and high recognition efficiency.
[0009] Therefore, in view of the above problems, there is an urgent need for a farm machine positioning trajectory segmentation method capable of effectively improving the efficiency and accuracy of farm machine motion mode recognition. SUMMARY
[0010] In view of the deficiencies of the prior art, the application discloses a farm machine motion mode recognition method combining a road network map and a farm machine trajectory clustering algorithm.
[0011] The detailed technical solutions of the application are as follows:
[0012] A farm machine motion mode recognition method combining a road network map and a farm machine trajectory clustering algorithm, characterized in that it comprises:
[0013] S1: determining road network image data according to the longitude and latitude information of the farm machine positioning trajectory data after data cleaning, and then correcting the mapping deviation of the farm machine positioning trajectory to the road network map by using the HFTMM algorithm based on the road network topology, i.e., high-frequency trajectory map matching, to realize accurate mapping of the farm machine positioning trajectory to the road network map, which is a key step of the application;
[0014] S2: determining the farm machine positioning trajectory points falling on the road network map as a road driving motion mode according to the high-precision mapping graph between the farm machine positioning trajectory corrected by the map matching technology and the road network map, which is the most innovative step of the application compared with other applications;
[0015] S3: based on the DBSCAN density clustering algorithm, segmenting the farm machine positioning trajectory points that are not recognized in S2 according to the different density of the farm machine positioning trajectory points in the field and during field operation, and the segmentation result is a field transfer motion mode and a field operation motion mode.
[0016] According to the preferred embodiment of the application, the specific method in S1 comprises:
[0017] Before data cleaning, the farm machine positioning trajectory data is acquired on the farm machine management platform to obtain a farm machine positioning trajectory data set:
[0018] P(m)={(long1,lat1,t1),(long2,lat2,t2)...(long n ,lat n ,t n )} n n n
[0019] wherein t represents time; long represents longitude; lat represents latitude; n represents the number of trajectory points; and m represents the number of agricultural machines, each agricultural machine working a set of trajectory data per day.
[0020] In the specific implementation scenario of the present application, the agricultural machine positioning trajectory data set is obtained from the agricultural machine management cloud platform of Shandong Province. The test data obtained mainly comes from the agricultural machine operation data of Jining City in Shandong Province, and a total of 300 trajectory groups are obtained. The trajectory data collection time interval is about 2 seconds;
[0021] S11: agricultural machine positioning trajectory data cleaning. Due to the influence of the working environment of the agricultural machine, during the collection of the agricultural machine positioning trajectory data by the Beidou positioning system, repeated sampling, stationary trajectory sampling and other error conditions often occur. In order to reduce the influence of data sampling errors on the accuracy of the subsequent agricultural machine positioning trajectory segmentation results, the 300 agricultural machine positioning trajectory data obtained need to be cleaned to obtain the most suitable trajectory data, including:
[0022] S111: deleting the points with a time interval of 0 between two or more positioning trajectory points, and retaining the first positioning trajectory point;
[0023] S112: deleting the points with the same longitude and latitude and a speed of 0 between two or more positioning trajectory points, and retaining the first positioning trajectory point;
[0024] S113: deleting the points with the same longitude and latitude and a continuous speed of 0 between two or more positioning trajectory points, and retaining the first positioning trajectory point;
[0025] S114: deleting the points with different longitude and latitude and a continuous speed of 0 between two or more positioning trajectory points, and retaining the first positioning point;
[0026] S12: road network image data acquisition. The road network refers to a road system in a certain area, which is composed of various roads and is interconnected and interwoven in a network distribution, including city branch roads, residential area vehicle roads, city main vehicle roads and rural, rural and field roads, etc. In the embodiment of the present application, as shown in the accompanying drawings, Figure 2 Fig. 1 shows part of the road network image of Jining City in Shandong Province, wherein the black solid line represents various roads;
[0027] The road network graph is defined as a directed graph G=(V, E), wherein V is composed of transition nodes, non-transition nodes (start nodes and end nodes), and is represented as V={v1, v2, …, vn};
[0028] The transition nodes in the V include the intersection end points v tr = (lat tr , lontr ), where lat tr lon tr These represent the latitude and longitude of the transition node, respectively.
[0029] The non-transition nodes (start node and end node) in V are represented by v. od =(lat od lon od ) indicates that lat od lon od Let E represent the latitude and longitude information of non-transition nodes (start node or end node), respectively; E uses the set E={e1, e2, ..., em} to represent all road segments, where e is a directed edge, denoted by e=(e... id e id start e id end ) indicates that e id Represents the road segment identifier, e id start Indicates road segment e id The starting point, e id end Indicates road segment e id The end point;
[0030] S13: The HFTMM algorithm based on road network topology is used to correct the mapping deviation between agricultural machinery positioning trajectory and road network map. Due to unavoidable problems such as signal blocking, signal interruption, and communication anomalies during the acquisition of BeiDou positioning data, and the influence of road network map image resolution and mapping accuracy, there is a certain deviation in the mapping between the acquired BeiDou positioning data and road network image data, as shown in the attached figure. Figure 4 As shown, there is a significant offset between the mapping of many trajectory points within the elliptical area and the roads on the road network map. This mapping deviation will seriously affect the accuracy of subsequent agricultural machinery trajectory segmentation. The specific steps are as follows:
[0031] S131: Select key samples. Key samples refer to the positioning trajectory points used to divide the agricultural machinery positioning trajectory into several sub-trajectories. They represent the transition from one road segment to another, achieving one-to-one matching between sub-trajectories and road segments. The HFTMM algorithm is used to select key samples based on transition nodes v. tr =(lat tr lon tr Within a circle centered at a point with radius r, find the trajectory point closest to the transition node and use it as the key sample for the agricultural machinery positioning trajectory data. Based on this key sample, the entire trajectory data is divided into multiple sub-trajectories, specifically including:
[0032] 1) Using ArcGIS to map the agricultural machinery positioning trajectory data to the road network map, according to the preliminary mapping results of the agricultural machinery positioning trajectory data and the road network image data, the road section closest to the trajectory point is selected to form the agricultural machinery positioning trajectory road buffer zone;
[0033] 2) According to the characteristics of the arrangement of the agricultural machinery positioning trajectory data in time sequence, whether there is a U-turn phenomenon when the agricultural machinery positioning trajectory passes through the transition node is determined:
[0034] If there is a U-turn, the transition node corresponds to 2 key samples;
[0035] If there is no U-turn, the transition node corresponds to 1 key sample;
[0036] After determining the U-turn condition, a circle is made with the transition node C as the center and r as the radius, the trajectory point closest to the transition node in the circle is found as the key sample, and the formula for finding the key sample Sc is as follows:
[0037] (1)
[0038] In formula (1), d(p i ,C) represents the Euclidean distance function; C represents the transition node; S represents the set of agricultural machinery positioning trajectory points in the circle with the transition node C as the center and r as the radius; p i represents the agricultural machinery positioning trajectory point belonging to S ;
[0039] S132: Error ellipse matching, using error ellipse to respectively map the sub-trajectory after passing through the key sample to the nearby road section, the specific steps are as follows:
[0040] 3) Define error ellipse: the focal distance 2c of the ellipse refers to the Euclidean distance between two consecutive agricultural machinery positioning trajectory points and , the center of the ellipse refers to the center point of and , the major axis 2a of the ellipse is the maximum distance that the two agricultural machinery positioning trajectory points move at the maximum speed at the current time, and the minor axis of the ellipse is represented as , wherein the major axis of the ellipse is a variable value, and the Euclidean distance between the previous trajectory point of the trajectory point and the next trajectory point of the trajectory point ;
[0041] 4) Take the first key sample (the point with earlier timestamp information) as the trajectory point of the ellipse , and evaluate whether the road segment is contained in the error ellipse; take the first key sample as the trajectory point of the ellipse , and evaluate whether the road segment is contained in the error ellipse. The above method for evaluating whether the road segment is contained in the error ellipse is an algebraic method for judging the positional relationship between the line segment and the ellipse:
[0042] If , and the road segment are all in the error ellipse, then adjustments are made according to the following cases:
[0043] Case one: both points are in the road segment, is in the road segment but is not in the road segment;
[0044] Case two: is in the road segment but is not in the road segment;
[0045] Case three: both points are not in the road segment;
[0046] The adjustment method is to change the latitude and longitude to the same latitude and longitude as the corresponding road segment, and keep the timestamp unchanged;
[0047] 5) After the processing of S131 and S132, the new mapping relationship diagram of the randomly selected agricultural machinery positioning trajectory points and the road network map is as shown in Figure 5 It can be seen that, after the map matching algorithm processing, the agricultural machinery positioning trajectory points can be uniformly and accurately landed on the road segment.
[0048] According to the application, the specific method of S2 preferably comprises:
[0049] When the agricultural machinery enters or exits the garage or passes through the road intersection, it will slow down, so that the density of the agricultural machinery positioning trajectory points is similar to that when the agricultural machinery is working in the field, and the density clustering algorithm will incorrectly identify this part of the trajectory points as field work. When the agricultural machinery is driving in the field, occasionally, the trajectory points are lost or the agricultural machinery is turning in the field, which will result in a lower density of the agricultural machinery positioning trajectory points, and the density clustering algorithm will incorrectly identify this part of the trajectory points as road driving. The application uses the high-precision mapping relationship between the agricultural machinery positioning trajectory points and the road of the road network map to correct such incorrect identification. According to the new mapping relationship diagram, the agricultural machinery positioning trajectory points A (long i , lat i ) falling in the road scene are determined as road driving motion mode, and a road driving label is assigned thereto.
[0050] According to the application, the S3 specifically comprises:
[0051] The DBSCAN density clustering algorithm is an unsupervised learning method, and has a good effect on classifying data with different densities, but it is not easy to obtain a fixed value in parameter selection. In the application, randomly selected agricultural machinery positioning track data is artificially labeled, and then parameter selection testing is performed. After a large number of experiments, the parameter values with better use effect are selected to classify the motion mode of the agricultural machinery track:
[0052] S31: Arbitrarily selecting a track point in the agricultural machinery positioning track data, and traversing all track points within a distance less than or equal to eps from the track point:
[0053] If the number of track points within the distance of eps is less than min_samples, the selected track point is marked as a farmland transition mode;
[0054] If the number of track points within the distance of eps is greater than or equal to min_samples, the selected track point is marked as a farmland working mode;
[0055] Wherein, eps represents a neighborhood radius, which is used to determine whether two points are similar or belong to the same class, and the parameter value is determined through multiple experimental results; min_samples represents the minimum point, which affects the number of clusters and outliers, and the confirmation of the point is not the content to be protected by the application;
[0056] In order to assist in the determination of eps, the DBSCAN algorithm provides a visualization method, that is, given a k value, the distance kdist between each object in the agricultural machinery positioning track database and the nearest neighbor is calculated, and the kdist values are sorted from large to small, and then the sequence number in the sorted kdist sequence is taken as the horizontal coordinate of the above nearest neighbor, and the corresponding kdist value is taken as the vertical coordinate, and a two-dimensional kdist curve is drawn; the user sets the kdist value at the inflection point where the kdist curve changes from steep to flat as the parameter eps; in actual operation, the eps parameter determined by this interactive method has a certain rationality, but requires too much manual participation; the value of eps is 1e 4 to 3e 4; the value of min_samples is 13 to 27;
[0057] S32: Accessing all track points within the neighborhood radius range of the marked track point eps in S31 in turn:
[0058] If the track point is not marked, the track point is marked according to the marking rule in S31;
[0059] If the trajectory point has been marked, skip the trajectory point; until all trajectory points in the eps range have been marked;
[0060] S33: In turn, all trajectory points in the eps range of all accessed trajectory points in S32 are traversed again:
[0061] If the trajectory point has not been marked, the trajectory point is marked or assigned a cluster label according to the marking rule in S31;
[0062] If the trajectory point has been marked, skip the trajectory point; until all trajectory points in the eps range have been marked; and so on, until each traversable trajectory point is marked;
[0063] S34: Assign a cluster label to the marked trajectory point:
[0064] Marked as a farm field operation mode, assign the same field work cluster label to all trajectory points in the eps range thereof; the remaining trajectory points are marked as a farm field transfer operation mode, and are assigned a field transfer cluster label;
[0065] S35: Optionally select another trajectory point from the untraversed trajectory points, repeat S31-S34: until all agricultural positioning trajectory points are marked and assigned to the corresponding cluster label, to obtain the final agricultural positioning trajectory segmentation result.
[0066] According to the application, in step 4), the construction and evaluation continue until the end of the second key sample, and the road network corresponding to the randomly selected agricultural positioning trajectory is stored in a key sample, so that the construction and evaluation are performed twice.
[0067] According to the application, in step 4), in order to ensure that the construction and evaluation process does not occur on the sub-trajectory perpendicular to the road segment, the angle between the connecting line between the error ellipse trajectory points and and the adjacent road segment should not exceed a threshold .
[0068] The technical advantages of the application are
[0069] (1) Compared with the traditional machine learning algorithm, the application adopts a method combining a road network map and an agricultural positioning trajectory density clustering algorithm to segment agricultural positioning trajectories, without the need for manual annotation of a large amount of agricultural positioning trajectory data, which can greatly reduce the time cost and labor cost generated by manual annotation, and achieve high-accuracy identification of agricultural motion patterns;
[0070] (2) Compared with the single density clustering algorithm, the road network map and the agricultural machinery positioning trajectory density clustering algorithm are combined to segment the agricultural machinery positioning trajectory, not only relying on the density clustering algorithm to identify the agricultural machinery movement mode, but also introducing the road network map on the basis of the density clustering algorithm, using the road information of the road network map to realize more accurate segmentation of the agricultural machinery positioning trajectory, which can greatly improve the accuracy of the agricultural machinery positioning trajectory segmentation;
[0071] (3) Compared with the combination of satellite images and clustering algorithms, the road network map and the agricultural machinery positioning trajectory density clustering algorithm are combined to segment the agricultural machinery positioning trajectory, without the need for satellite image labeling work, which can greatly reduce the time cost and labor cost of labeling; and without the need to train the semantic segmentation model using satellite images, which can greatly reduce the loss of computing resources; finally, the invention is not limited by the effect of satellite image semantic segmentation, and can realize efficient and accurate identification of agricultural machinery movement mode.
[0072] (4) Compared with the existing map matching technology, the present application adopts a kind of HFTMM (high-frequency trajectory map matching) algorithm based on road network topology to correct the mapping deviation between agricultural machinery positioning trajectory and road network image, realize high-precision matching of agricultural machinery positioning trajectory to road network map, effectively map high sampling frequency trajectory to real road network, and lay a solid foundation for subsequent high-precision segmentation of agricultural machinery positioning trajectory. BRIEF DESCRIPTION OF DRAWINGS
[0073] Figure 1 Flow chart of agricultural machinery movement mode recognition method based on combination of road network map and density clustering algorithm;
[0074] Figure 2 Road network image of part of roads in Jining City, Shandong Province;
[0075] Figure 3 Mapping diagram between randomly selected agricultural machinery positioning trajectory and road network;
[0076] Figure 4 Mapping deviation diagram between trajectory points and road network map roads;
[0077] Figure 5 New mapping relationship diagram between randomly selected agricultural machinery positioning trajectory points and road network map;
[0078] Figure 6 Agricultural machinery positioning trajectory segmentation effect diagram. DETAILED DESCRIPTION
[0079] The application will be described in detail below in conjunction with the embodiments and the accompanying drawings, but is not limited thereto.
[0080] Embodiment 1,
[0081] As Figure 1 shown, a farm machine motion mode recognition method combining a road network map and a farm machine trajectory clustering algorithm includes:
[0082] S1: determining road network image data according to longitude and latitude information of the farm machine positioning trajectory data after data cleaning, and then correcting mapping deviation of the farm machine positioning trajectory to the road network map by using an HFTMM algorithm based on the road network topology structure, to realize accurate mapping of the farm machine positioning trajectory to the road network map road;
[0083] S2: determining the farm machine positioning trajectory points falling on the road network map road as a road driving motion mode according to the high-precision mapping between the farm machine positioning trajectory corrected by the map matching technology and the road network map;
[0084] S3: based on the DBSCAN density clustering algorithm, segmenting the farm machine positioning trajectory points not recognized in S2 according to the different density of the farm machine positioning trajectory points in the field transfer and the field operation of the farm machine, and the segmentation result is a field transfer motion mode and a field operation motion mode.
[0085] The specific method in S1 includes:
[0086] Before data cleaning, the farm machine positioning trajectory data is acquired first, and the farm machine positioning trajectory data set is acquired on the farm machine management platform:
[0087] P(m)={(long1,lat1,t1),(long2,lat2,t2)...(long n ,lat n ,t n )}
[0088] Wherein t represents time, long represents longitude, lat represents latitude, n represents the number of trajectory points, and m represents the number of farm machines, each farm machine working a set of trajectory data per day.
[0089] Taking the specific implementation scene of the application as an example, the farm machine positioning trajectory data set is acquired from the farm machine management cloud platform in Shandong Province, the test data acquired mainly comes from the farm machine operation data in Jining City, Shandong Province, and a total of 300 groups of trajectories, the trajectory data collection time interval is about 2 seconds;
[0090] S11: agricultural machinery positioning trajectory data cleaning, due to the influence of the working environment of agricultural machinery, during the process of collecting agricultural machinery positioning trajectory data by the Beidou positioning system, repeated sampling, static trajectory sampling and other errors often occur, in order to reduce the influence of data sampling errors on the accuracy of subsequent agricultural machinery positioning trajectory segmentation results, 300 pieces of agricultural machinery positioning trajectory data obtained need to be cleaned to obtain the most suitable trajectory data, including:
[0091] S111: deleting points with a time interval of 0 between two or more positioning trajectory points, and retaining the first positioning trajectory point;
[0092] S112: deleting points with the same latitude and longitude and a speed of 0 between two or more positioning trajectory points, and retaining the first positioning trajectory point;
[0093] S113: deleting points with the same latitude and longitude, a speed of 0 and continuity between two or more positioning trajectory points, and retaining the first positioning trajectory point;
[0094] S114: deleting points with different latitude and longitude, a speed of 0 and continuity between two or more positioning trajectory points, and retaining the first positioning point;
[0095] S12: road network image data acquisition, the road network refers to a road system distributed in a network shape in a certain area, which is composed of various roads and interconnected and interwoven, including city branch roads, residential area vehicle roads, city main vehicle roads and rural, rural and field roads, etc., in the embodiment of the present application, as shown in the accompanying drawings, it is a part of the road network image of Jining City in Shandong Province, wherein the black solid line represents various roads; Figure 2
[0096] The road network graph is defined as a directed graph G=(V, E), wherein V is composed of transition nodes, non-transition nodes (start nodes and end nodes), and is represented as V={v1, v2, …, vn};
[0097] The transition nodes in the V include the intersection end points v tr = (lat tr , lon tr ) of one road segment and another road segment, wherein lat tr , lon tr represent the latitude and longitude of the transition node, respectively;
[0098] The non-transition nodes (start nodes and end nodes) in the V are represented by v od = (lat od , lon od ), lat od , lon od Let E represent the latitude and longitude information of non-transition nodes (start node or end node), respectively; E uses the set E={e1, e2, ..., em} to represent all road segments, where e is a directed edge, denoted by e=(e... id e id start e id end ) indicates that e id Represents the road segment identifier, e id start Indicates road segment e id The starting point, e id end Indicates road segment e id The end point;
[0099] In this embodiment, the latitude and longitude coordinates of all the positioning trajectory points of a certain agricultural machine during a day's work are used to determine the range of the agricultural machine's activities, that is, to determine the maximum longitude value (max). long Minimum longitude (min) long maximum latitude lat and latitude minimum value min lat This allows us to determine the coordinates of the top-left pixel in the road network image (min). long max lat ) and the coordinates of the bottom right pixel (max) long min lat Finally, download the road network image within this range. From the 300 agricultural machinery positioning trajectory data points cleaned by S11 data, randomly select a set of trajectories. Based on the latitude and longitude coordinates of this set of trajectories, determine the coordinates of the top left pixel of the road network image (min). long max lat ) and the coordinates of the bottom right pixel (max) long min lat Download the road network image. The downloaded image has a scale of 3000:1, a spatial resolution of 1.07 meters, an image resolution of 72 dips, 93 pixels, a distance of 3.28 centimeters on the map, and an actual distance of 100 meters. A mapping diagram between randomly selected agricultural machinery positioning trajectories and the road network is attached. Figure 3 As shown, the dashed lines represent the positioning trajectory points of agricultural machinery, the black solid lines represent road segments, e1-e3 represent road segment numbers, and (lat, long) represent the latitude and longitude coordinates of the road segment nodes.
[0100] S13: using the HFTMM algorithm based on the road network topology to correct the mapping deviation between the agricultural machinery positioning trajectory and the road network map. Due to the inevitable problems such as signal blockage, signal interruption and communication anomaly in the collection process of Beidou positioning data, and the influence of the road network map image resolution and mapping accuracy, there is a certain deviation in the mapping between the collected Beidou positioning data and the road network image data. As shown in the attached Figure 4 illustration, there are many trajectory points in the elliptical area that are obviously deviated from the mapping between the road network map and the road. This mapping deviation problem will seriously affect the subsequent agricultural machinery trajectory segmentation accuracy. The specific steps are as follows:
[0101] S131: selecting key samples. The key sample refers to a positioning trajectory point used to divide the agricultural machinery positioning trajectory into several sub-trajectories, and is used to represent the transition from one road section to another, so as to realize one-to-one matching between the sub-trajectory and the road section. The HFTMM algorithm is used to find the trajectory point closest to the transition node in the range of the circle with the transition node v tr = (lat tr , lon tr ) as the center and r as the radius, and take it as the key sample of the agricultural machinery positioning trajectory data. According to the key sample, the entire trajectory data is divided into multiple sub-trajectories, which specifically includes:
[0102] 1) using ArcGIS to map the agricultural machinery positioning trajectory data to the road network map, and selecting the road section closest to the trajectory point to form the agricultural machinery positioning trajectory road buffer zone according to the preliminary mapping result of the agricultural machinery positioning trajectory data and the road network image data;
[0103] 2) determining whether there is a U-turn phenomenon when the agricultural machinery positioning trajectory passes through the transition node according to the time sequence arrangement characteristics of the agricultural machinery positioning trajectory data:
[0104] if there is a U-turn, the transition node corresponds to 2 key samples;
[0105] if there is no U-turn, the transition node corresponds to 1 key sample;
[0106] After determining the U-turn condition, a circle is made with the transition node C as the center and r as the radius, and the trajectory point closest to the transition node in the circle is found as the key sample. The formula for finding the key sample Sc is as follows:
[0107] (1)
[0108] In formula (1), d(p i ,C) represents the Euclidean distance function; C represents the transition node;S representing the agricultural machine positioning trajectory point set in the circle with the transition node as the center and r as the radius; C p i representing the agricultural machine positioning trajectory point belonging to S
[0109] S132: error ellipse matching, using error ellipse to respectively map the sub-trajectory after the key sample division to the nearby road section, the specific steps are as follows:
[0110] 3) define error ellipse: the focal distance 2c of the ellipse refers to the Euclidean distance between two consecutive agricultural machine positioning trajectory points and , the center of the ellipse refers to the center point of and , the major axis 2a of the ellipse refers to the maximum distance of the two agricultural machine positioning trajectory points moving at the maximum speed at the current time, and the minor axis of the ellipse is expressed as , wherein the major axis of the ellipse is a variable value, and the Euclidean distance between the previous trajectory point of the trajectory point and the next trajectory point of the trajectory point ;
[0111] 4) take the first key sample (the point with earlier timestamp information) as the trajectory point of the ellipse, continuously construct the error ellipse in reverse, and evaluate whether the road section is contained in the error ellipse; take the first key sample as the trajectory point of the ellipse, continuously construct the error ellipse in forward, and evaluate whether the road section is contained in the error ellipse. The above method for evaluating whether the road section is contained in the error ellipse is the algebraic method for judging the position relationship between the line segment and the ellipse:
[0112] If , and the road section are all in the error ellipse, then adjust according to the following cases:
[0113] Case one: both points are in the road section, is in the road section but is not in the road section;
[0114] Case two: is in the road section but is not in the road section;
[0115] Case three: both points are not in the road section;
[0116] The adjustment method is: change the latitude and longitude to the same latitude and longitude as the corresponding road section, and keep the timestamp unchanged;
[0117] 5) After processing by S131 and S132, a new mapping relationship diagram between randomly selected agricultural machinery positioning trajectory points and the road network map is shown below. Figure 5 As shown, after processing by the map matching algorithm, the positioning trajectory points of agricultural machinery can fall evenly and accurately on the road segment.
[0118] The specific method of S2 includes:
[0119] When agricultural machinery slows down when entering or leaving garages or passing through road intersections, the density of its location trajectory points may be similar to that when it is working in the field, even if the machinery is not actually operating there. In such cases, relying solely on density clustering algorithms will misidentify these trajectory points as being used in the field. When agricultural machinery is traveling in the field, trajectory points may occasionally be lost, or the machinery may be moving between fields, resulting in a lower density of location trajectory points. Relying solely on density clustering algorithms will again misidentify these trajectory points as being used on roads. This invention utilizes a high-precision mapping relationship between agricultural machinery location trajectory points and roads on a road network map to correct these misidentifications. Based on the new mapping relationship, agricultural machinery location trajectory points A (long i lat i If the mode is determined to be road driving, a road driving label will be assigned to it.
[0120] S3 specifically includes:
[0121] The DBSCAN density clustering algorithm is an unsupervised learning method that performs well in classifying data with varying densities, but it's not easy to find fixed values for its parameters. This invention manually labels randomly selected agricultural machinery positioning trajectory data and then tests the selection of parameters. After extensive experiments, parameter values that show good performance are selected for classifying the motion patterns of agricultural machinery trajectories.
[0122] S31: Randomly select a trajectory point from the agricultural machinery positioning trajectory data, and iterate through all trajectory points whose distance to the selected trajectory point is less than or equal to eps:
[0123] If the number of trajectory points within eps is less than min_samples, then the selected trajectory point will be marked as farmland relocation mode.
[0124] If the number of trajectory points within a distance of eps is greater than or equal to min_samples, then the selected trajectory point will be marked as farmland working mode;
[0125] Wherein, eps represents the neighborhood radius, used to determine whether two points are similar or belong to the same class, the parameter value is determined by multiple experimental results; min_samples represents the minimum point, which affects the number of clusters and outliers, and the confirmation of the point is not the content to be protected by the present application;
[0126] In order to assist the determination of eps, the DBSCAN algorithm provides a visual method, that is, given the value of k, the distance kdist between each object in the agricultural machinery positioning trajectory database and the nearest neighbor is calculated, and the kdist values are sorted from large to small, and then the serial number in the sorted kdist sequence is taken as the horizontal coordinate of the above nearest neighbor, and the corresponding kdist value is taken as the vertical coordinate, and a two-dimensional kdist curve is drawn; The user sets the kdist value at the inflection point where the kdist curve changes from steep to flat as the parameter eps; In actual operation, the eps parameter determined by this interactive method has a certain rationality, but it needs too much manual participation; The eps value is 1e 4 to 3e 4; min_samples takes a value between 13 and 27;
[0127] S32: Access all trajectory points in the neighborhood radius range of the trajectory point eps marked in S31 in turn:
[0128] If the trajectory point is not marked, the trajectory point will be marked according to the marking rule in S31;
[0129] If the trajectory point has been marked, skip the trajectory point; until all trajectory points in the eps range have been marked;
[0130] S33: In turn, all trajectory points in the eps range of all trajectory points accessed in S32:
[0131] If the trajectory point is not marked, the trajectory point will be marked or assigned a cluster label according to the marking rule in S31;
[0132] If the trajectory point has been marked, skip the trajectory point; until all trajectory points in the eps range have been marked; in this way, until each accessible trajectory point is marked;
[0133] S34: Assign a cluster label to the marked trajectory point:
[0134] Marked as an agricultural field operation mode, assign the same field work cluster label to all trajectory points in the eps range thereof; the rest of the trajectory points are marked as an agricultural field transfer operation mode, and are assigned a field transfer cluster label;
[0135] S35: Select another trajectory point from the untraversed trajectory points and repeat S31-S34: until all agricultural machinery positioning trajectory points are marked and assigned to the corresponding cluster labels, to obtain the final agricultural machinery positioning trajectory segmentation result.
[0136] The effect diagram of agricultural machinery positioning trajectory segmentation is attached. Figure 6 As shown in the diagram, solid circles represent agricultural machinery traveling on roads, solid triangles represent agricultural machinery operating in the field, solid pentagrams represent agricultural machinery moving between fields, black represents the road network, and white represents the background. The results demonstrate that this invention has excellent recognition capabilities for agricultural machinery movement.
[0137] Example 2
[0138] A method for recognizing agricultural machinery movement patterns that combines road network maps and agricultural machinery trajectory clustering algorithms, wherein in step 4), the construction and evaluation continue until the end of the second key sample, and the road network corresponding to the randomly selected agricultural machinery positioning trajectory exists in one key sample, so the construction and evaluation are carried out twice.
[0139] In step 4), to ensure that the construction and evaluation process does not occur on sub-trajectories perpendicular to the road segment, the error ellipse trajectory points are... and The angle between the line connecting the two road segments and the adjacent road segment must not exceed the threshold. .
Claims
1. A method for recognizing agricultural machinery movement patterns by combining road network maps and agricultural machinery trajectory clustering algorithms, characterized in that, include: S1: Determine the road network image data based on the latitude and longitude information of the agricultural machinery positioning trajectory data after data cleaning, and then use the HFTMM algorithm based on the road network topology to correct the mapping deviation from the agricultural machinery positioning trajectory to the road network map, so as to achieve accurate mapping from the agricultural machinery positioning trajectory to the road network map. The HFTMM algorithm based on road network topology is used to correct the mapping deviation between agricultural machinery positioning trajectory and road network map. The specific steps are as follows: S131: Select key samples and use the HFTMM algorithm with transition node v tr =(lat tr lon tr Within a circle centered at a point with radius r, find the trajectory point closest to the transition node and use it as the key sample for the agricultural machinery positioning trajectory data. Based on this key sample, the entire trajectory data is divided into multiple sub-trajectories, specifically including: 1) Use ArcGIS to map the agricultural machinery positioning trajectory data to the road network map. Based on the preliminary mapping results of the agricultural machinery positioning trajectory data and the road network image data, select the road segment closest to the trajectory point to form the agricultural machinery positioning trajectory road buffer. 2) Based on the characteristic that agricultural machinery positioning trajectory data is arranged in chronological order, determine whether there is a backtracking phenomenon when the agricultural machinery positioning trajectory passes through transition nodes: If a return occurs, the transition node corresponds to two key samples; If there is no return, then the transition node corresponds to one key sample; After determining the turnaround situation, use the transition node. C Centered on, with r Draw a circle with radius , and find the trajectory point within this circle that is closest to the transition node as the key sample. The formula for finding the key sample Sc is as follows: (1) In formula (1), d(p) i ,C) Represents the Euclidean distance function; C Represents a transition node; S Represented by transition nodes C The set of agricultural machinery positioning trajectory points within a circle centered at r with radius r; p i Representative belongs to S Agricultural machinery positioning trajectory points; S132: Error Ellipse Matching. This method uses error ellipses to map the sub-trajectories segmented by key samples to nearby road segments. The specific steps are as follows: 3) Define the error ellipse: The focal length 2c of the ellipse refers to the distance between two consecutive agricultural machinery positioning trajectory points. and The Euclidean distance between them, the center of the ellipse refers to and The center point of the ellipse, the major axis 2a of the ellipse refers to the maximum distance that the two agricultural machinery positioning trajectory points move at the maximum speed at the current moment, and the minor axis of the ellipse is represented as... Where the major axis of the ellipse is a variable value, and represents the trajectory points. Previous trajectory point and trajectory point The Euclidean distance between the next trajectory points; 4) Use the first key sample as the trajectory point of the ellipse. The error ellipse is constructed continuously in reverse, and the road segment is evaluated as being included in the error ellipse; the first key sample is used as the trajectory point of the ellipse. A forward continuous error ellipse is constructed, and it is evaluated whether a road segment is contained within the error ellipse. The method for evaluating whether a road segment is contained within the error ellipse is an algebraic method for determining the positional relationship between a line segment and the ellipse. like , If both the road segment and the road section are within the error ellipse, adjustments will be made according to the following: Scenario 1: Both points are on the road segment In the section of road but Not on the road section; Scenario 2: In the section of road but Not on the road section; Scenario 3: Neither point is on the road segment; The adjustment method is as follows: change the latitude and longitude to the same latitude and longitude as the corresponding road segment, and keep the timestamp unchanged; 5) A new mapping relationship between randomly selected agricultural machinery positioning trajectory points and the road network map after processing by S131 and S132; S2: Based on the high-precision mapping between the agricultural machinery positioning trajectory corrected by map matching technology and the road network map, the agricultural machinery positioning trajectory points that fall on the roads in the road network map are determined as: road driving movement mode; S3: Based on the DBSCAN density clustering algorithm, the unidentified agricultural machinery positioning trajectory points in S2 are segmented, and the segmentation results are: farmland transfer movement mode and farmland operation movement mode.
2. The method for recognizing agricultural machinery movement patterns by combining road network maps and agricultural machinery trajectory clustering algorithms according to claim 1, characterized in that, In S1, the specific method for determining road network image data based on the latitude and longitude information of the agricultural machinery positioning trajectory data after data cleaning includes: S11: Agricultural machinery positioning trajectory data cleaning, including: S111: Delete points where the time interval between two or more positioning trajectory points is 0, and keep the first positioning trajectory point among them; S112: Delete two or more positioning trajectory points that have the same latitude and longitude and have a speed of 0, and keep the first positioning trajectory point; S113: Delete two or more consecutive positioning trajectory points with the same latitude and longitude, non-zero speed, and retain the first positioning trajectory point; S114: Delete two or more points with different latitude and longitude, zero speed and continuous between two or more positioning trajectories, and keep the first positioning point; S12: Road network image data acquisition A road network graph is defined as a directed graph G = (V, E), where V includes transition nodes and non-transition nodes, denoted as V = {v1, v2, ..., vn}; The transition nodes in V include the intersection points of one road segment and another road segment. tr =(lat tr lon tr ), where lat tr lon tr These represent the latitude and longitude of the transition node, respectively. The non-transition nodes in V include start nodes and end nodes, denoted by v. od =(lat od lon od ) indicates that lat od lon od Let represent the latitude and longitude information of non-transition nodes, respectively; E uses the set E={e1, e2, ..., em} to represent all road segments, where e is a directed edge, denoted as e=(e id e id start e id end ) indicates that e id Represents the road segment identifier, e id start Indicates road segment e id The starting point, e id end Indicates road segment e id The end point.
3. The method for recognizing agricultural machinery movement patterns by combining road network maps and agricultural machinery trajectory clustering algorithms according to claim 1, characterized in that, The specific method of S2 includes: According to the new mapping diagram, the agricultural machinery positioning trajectory point A (long) falling on the road scene will be... i lat i If the mode is determined to be road driving, a road driving label will be assigned to it.
4. The method for recognizing agricultural machinery movement patterns by combining road network maps and agricultural machinery trajectory clustering algorithms according to claim 1, characterized in that, S3 specifically includes: S31: Randomly select a trajectory point from the agricultural machinery positioning trajectory data, and iterate through all trajectory points whose distance to the selected trajectory point is less than or equal to eps: If the number of trajectory points within eps is less than min_samples, then the selected trajectory point will be marked as farmland relocation mode. If the number of trajectory points within a distance of eps is greater than or equal to min_samples, then the selected trajectory point will be marked as farmland working mode; Where eps represents the neighborhood radius, which is used to determine whether two points are similar or belong to the same class. This parameter value is determined through multiple experimental results. min_samples represents the minimum point, which affects the number of clusters and outliers. The confirmation of this point is not the content to be protected by this invention. Given a value of k, calculate the distance kdist between each object in the agricultural machinery positioning trajectory database and its nearest neighbor, and sort the kdist values from largest to smallest. Then, use the index of the sorted kdist sequence as the x-axis of the nearest neighbor and the corresponding kdist value as the y-axis to plot a two-dimensional kdist curve. The user sets the kdist value at the inflection point where the kdist curve changes from steep to gentle as the parameter eps. S32: Visit all trajectory points within the neighborhood radius of the marked trajectory point eps in S31 in sequence: If the trajectory point is not marked, it will be marked according to the marking rules in S31; If a trajectory point has already been marked, skip that trajectory point; continue until all trajectory points within the eps range have been marked. S33: Then, iterate through all the trajectory points within the range of all the trajectory points visited in S32: If a trajectory point is not marked, it will be marked or assigned a cluster label according to the marking rules in S31; If a trajectory point has already been marked, skip that trajectory point; continue until all trajectory points within the eps range have been marked; and so on, until every traversable trajectory point has been marked. S34: Assign cluster labels to the marked trajectory points: The track points marked as agricultural machinery field operation mode are assigned the same field operation cluster label to all track points within their eps range; the remaining track points are marked as agricultural machinery field transfer operation mode and assigned a field transfer cluster label. S35: Select another trajectory point from the untraversed trajectory points and repeat S31-S34 until all agricultural machinery positioning trajectory points are marked and assigned to the corresponding cluster labels.
5. The method for recognizing agricultural machinery movement patterns by combining road network maps and agricultural machinery trajectory clustering algorithms according to claim 2, characterized in that, In step 4), the construction and evaluation continue until the second key sample is completed, and the construction and evaluation are carried out twice.
6. The method for recognizing agricultural machinery movement patterns by combining road network maps and agricultural machinery trajectory clustering algorithms according to claim 2, characterized in that, In step 4), the error ellipse trajectory point and The angle between the line connecting the two road segments and the adjacent road segment must not exceed the threshold. .
Citation Information
Patent Citations
Operation land parcel automatic identification and area statistics method based on spatial mesh division
CN104992072A
A Method for Agricultural Machinery Behavior Analysis and Operating Area Statistics Based on BeiDou Positioning Data
CN113409240B
Urban intersection lane-level structure extraction method based on time-space trajectory big data
CN105788274A
High-sampling-rate trajectory data map matching method based on road network connectivity
CN114485692A