Agricultural machine working area detection method and system

By constructing the outer contour polygon of agricultural machinery operation using clustering and KNN algorithms, and combining it with vector product to calculate the agricultural machinery operation area, the problems of time-consuming, labor-intensive and low-accuracy in traditional methods are solved, and efficient and accurate detection of agricultural machinery operation area is achieved.

CN116704004BActive Publication Date: 2026-05-15CHINA AGRI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA AGRI UNIV
Filing Date
2022-02-25
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Traditional methods for measuring the operating area of ​​agricultural machinery are time-consuming and labor-intensive, and suffer from human error and low detection accuracy. In particular, when the movement trajectory of agricultural machinery is complex, it is difficult to accurately calculate the operating area of ​​agricultural machinery.

Method used

Clustering algorithms are used to classify agricultural machinery movement trajectory data, identify operation trajectory segments, and construct outer contour polygons using the KNN algorithm. The area of ​​the agricultural machinery operation area is calculated by combining vector product, and movement trajectory data is obtained using GNSS positioning equipment.

Benefits of technology

It reduces the manpower and resources required for manual inspection, improves calculation speed and inspection accuracy, and accurately determines the area to be covered by agricultural machinery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116704004B_ABST
    Figure CN116704004B_ABST
Patent Text Reader

Abstract

The application provides a kind of agricultural machinery working area detection method and system, the method comprises: obtaining the motion trajectory data of agricultural machinery in preset period;Through clustering algorithm, the motion trajectory points in motion trajectory data are classified, and the agricultural machinery working trajectory section is determined;Obtain the starting contour point in agricultural machinery working trajectory section, and based on starting contour point, through KNN algorithm, the outer contour polygon corresponding to agricultural machinery working trajectory section is constructed;According to the outer contour polygon, the agricultural machinery working area is generated, and the area of agricultural machinery working area is calculated by the method of vector product.The application identifies the motion trajectory point of agricultural equipment in farmland working area by clustering algorithm, and constructs the outer contour polygon of agricultural machinery in farmland working area according to the motion trajectory, and then the working area of agricultural machinery is determined by calculating the area of outer contour polygon, which reduces the manpower and material resources of traditional manual detection, improves the calculation speed and the detection precision of agricultural machinery working area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural application technology, and in particular to a method and system for detecting the area of ​​agricultural machinery operations. Background Technology

[0002] Traditional farmland area measurement is done manually, and the manually measured farmland area is used as the agricultural area for agricultural machinery. This method is time-consuming and labor-intensive, and many farmlands are irregularly shaped polygons, which makes measurement difficult and introduces human error.

[0003] Existing methods for measuring the area of ​​agricultural machinery operations mainly involve using the Global Positioning System (GPS) to measure the actual distance the machinery travels, and using ultrasonic sensors to measure the width of the machinery's work area. These two methods are then multiplied to obtain the real-time area of ​​the machinery's work. Other methods use Kalman filtering to improve positioning accuracy and reduce errors. However, in actual agricultural machinery operations, the movement trajectory is highly complex, and there are instances where the machinery travels into non-operational areas or performs repeated tillage, leading to a decrease in the accuracy of the detected area of ​​the machinery's work.

[0004] Therefore, there is an urgent need for a method and system for detecting the area of ​​agricultural machinery operations to solve the above problems. Summary of the Invention

[0005] To address the problems existing in the prior art, the present invention provides a method and system for detecting the operating area of ​​agricultural machinery.

[0006] This invention provides a method for detecting the operating area of ​​agricultural machinery, comprising:

[0007] Acquire the movement trajectory data of agricultural machinery within a preset time period;

[0008] Clustering algorithms are used to classify the motion trajectory points in the motion trajectory data to determine the agricultural machinery operation trajectory segments;

[0009] Obtain the starting contour point in the agricultural machinery operation trajectory segment, and based on the starting contour point, construct the outer contour polygon corresponding to the agricultural machinery operation trajectory segment using the KNN algorithm;

[0010] Based on the outer contour polygon, the agricultural machinery operation area is generated, and the area of ​​the agricultural machinery operation area is calculated by the vector product method.

[0011] According to the present invention, a method for detecting the operating area of ​​agricultural machinery includes classifying the motion trajectory points in the motion trajectory data using a clustering algorithm to determine the agricultural machinery operating trajectory segment, comprising:

[0012] The motion trajectory data is preprocessed to obtain the target motion trajectory points;

[0013] Using a density clustering algorithm, the target motion trajectory points are classified into work trajectory points and non-work trajectory points based on their trajectory point information. The trajectory point information includes at least one of the following: trajectory point distribution density, trajectory point velocity, trajectory point direction, and time information.

[0014] Based on the time sequence of the trajectory points, the operational trajectory points and the non-operational trajectory points are divided into multiple segments of agricultural machinery operational trajectory points and agricultural machinery non-operational trajectory points.

[0015] According to a method for detecting the operating area of ​​agricultural machinery provided by the present invention, the step of obtaining the starting contour point in the agricultural machinery operating trajectory segment includes:

[0016] The trajectory point with the highest latitude in the agricultural machinery operation trajectory segment is taken as the starting contour point. If there are multiple trajectory points with the highest latitude, then any trajectory point is selected from the multiple trajectory points with the highest latitude as the starting contour point.

[0017] According to the present invention, a method for detecting the operating area of ​​agricultural machinery includes constructing an outer contour polygon corresponding to the agricultural machinery operating trajectory segment based on the starting contour point using the KNN algorithm, comprising:

[0018] Step S1: Obtain the K nearest neighbor points corresponding to the starting contour point using the KNN algorithm;

[0019] Step S2: Using the starting contour point as the endpoint, construct a horizontal measurement axis with the latitudinal ray of the starting contour point, obtain the counterclockwise rotation angle between the horizontal measurement axis and the K nearest neighbor points, take the nearest neighbor point corresponding to the smallest counterclockwise rotation angle as the outer contour point of the current round, and take the starting contour point as the outer contour point of the previous round.

[0020] Step S3: Obtain the K nearest neighbor points corresponding to the outer contour point of the current round using the KNN algorithm;

[0021] Step S4: Obtain the counterclockwise rotation angle between the first connecting line and each of the second connecting lines, wherein the first connecting line is the connecting line between the outer contour point of the current round and the outer contour point of the previous round; the second connecting line is the connecting line between the outer contour point of the current round and the K nearest neighbor points corresponding to the outer contour point of the current round.

[0022] Step S5: Obtain the target nearest neighbor point corresponding to the minimum counterclockwise rotation angle between the first line and the second line. If the second line corresponding to the target nearest neighbor point does not intersect with the existing outer contour, then the target nearest neighbor point is used as the outer contour point in the next round.

[0023] Step S6: If the outer contour point of the next round is the starting contour point, it is determined that all outer contour points in the agricultural machinery operation trajectory segment have been obtained; otherwise, steps S3 to S5 are repeated until the outer contour point of the next round is the starting contour point.

[0024] Step S7: According to the order in which the outer contour points are obtained, all the outer contour points are combined into the outer contour polygon corresponding to the agricultural machinery operation trajectory segment.

[0025] According to the present invention, a method for detecting the operating area of ​​agricultural machinery includes generating the operating area of ​​agricultural machinery based on the outer contour polygon, comprising:

[0026] Obtain multiple outer contour polygons within the target area;

[0027] Determine whether each outer contour polygon intersects with another polygon. If they do intersect, merge the intersecting outer contour polygons to obtain the agricultural machinery operation area.

[0028] According to the present invention, a method for detecting the area of ​​agricultural machinery operation is provided, wherein the area of ​​the agricultural machinery operation area is calculated by means of a vector product method, including:

[0029] Determine any point within the outer contour polygon as a fixed point;

[0030] Multiple vector triangles are formed by each side of the outer contour polygon and the fixed point;

[0031] Calculate the area of ​​each vector triangle to obtain the area of ​​the agricultural machinery operation area corresponding to the outer contour polygon.

[0032] According to a method for detecting the operating area of ​​agricultural machinery provided by the present invention, the step of acquiring the movement trajectory data of the agricultural machinery within a preset time period includes:

[0033] The movement trajectory data of agricultural machinery within a preset time period is obtained through GNSS positioning equipment, wherein the GNSS positioning equipment includes at least one of the following: Beidou satellite navigation system, Global Positioning System, Galileo satellite navigation system and GLONASS satellite navigation system.

[0034] The present invention also provides an agricultural machinery operation area detection system, comprising:

[0035] The trajectory data acquisition module is used to acquire the movement trajectory data of agricultural machinery within a preset time period;

[0036] The operation trajectory segment generation module is used to classify the motion trajectory points in the motion trajectory data through a clustering algorithm to determine the agricultural machinery operation trajectory segment;

[0037] The outer contour construction module of the working area is used to obtain the starting contour point in the agricultural machinery working trajectory segment, and construct the outer contour polygon corresponding to the agricultural machinery working trajectory segment based on the starting contour point using the KNN algorithm.

[0038] The operation area calculation module is used to generate the agricultural machinery operation area based on the outer contour polygon, and calculate the area of ​​the agricultural machinery operation area by means of the vector product method.

[0039] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the agricultural machinery operation area detection method as described above.

[0040] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the agricultural machinery operation area detection method as described above.

[0041] This invention provides a method and system for detecting the operating area of ​​agricultural machinery. It identifies the movement trajectory points of agricultural machinery in the farmland operating area through a clustering algorithm, constructs the outer contour polygon of the agricultural machinery in the farmland operating area based on the movement trajectory, and then determines the operating area of ​​the agricultural machinery by calculating the area of ​​the outer contour polygon. This reduces the manpower and material resources required for traditional manual detection and improves the calculation speed and the detection accuracy of the agricultural machinery operating area. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0043] Figure 1 This is a flowchart illustrating the agricultural machinery operation area detection method provided by the present invention;

[0044] Figure 2 This is a schematic diagram illustrating the process of merging multiple outer contour polygons provided by the present invention;

[0045] Figure 3 A schematic diagram illustrating the process of acquiring outer contour points provided by the present invention;

[0046] Figure 4 This is a schematic diagram of the outer contour point determination process provided by the present invention;

[0047] Figure 5 This is a schematic diagram of the agricultural machinery operation area detection system provided by the present invention;

[0048] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0050] Existing methods for measuring the operating area of ​​agricultural machinery mainly include the following: 1. Using GPS to measure the actual forward distance of the agricultural machinery and using ultrasonic sensors to measure the operating width of the agricultural machinery, multiplying the two measured data to obtain the operating area of ​​the agricultural machinery in real time; 2. Using Kalman filtering to improve positioning accuracy and reduce errors; 3. Using the data trajectory point set collected by the vehicle-mounted GPS device, filtering drift points, eliminating interference points, and finally calculating the total operating area by accumulating the equivalent rectangular areas of the tillage trajectory; 4. Using the grid method to calculate the operating area, by gridding the agricultural machinery operating area, finding the number of small grids containing GPS trajectory points, and multiplying by the area of ​​each small grid to obtain the total operating area; 5. Using the buffer method and an improved Alpha+Shapes algorithm to calculate the operating area.

[0051] However, in actual agricultural machinery operations, the same farmland may be operated by the same machine at two different times (for example, the machine leaves the farmland at some point in the middle). There may be overlapping tillage between the two operation trajectory segments, leading to duplicate calculations of the work area. Existing agricultural machinery work area detection methods, which calculate the work area of ​​each farmland based on the entire movement trajectory of the machine over a certain time period, suffer from problems such as high measurement difficulty and low detection accuracy. This invention provides an agricultural machinery work area detection method based on the entire scene's work trajectory. This method is applicable to actual agricultural machinery operation scenarios. The research object is the movement trajectory of the agricultural machinery within a preset time period (e.g., a whole day or half a day). A clustering algorithm is used to identify farmland areas in the trajectory. In the time dimension, the entire trajectory is divided into multiple different work intervals and field transfer intervals (i.e., non-work trajectory segments) according to chronological order. Then, the outer contour of the work area is found for the trajectory points of each work interval. Simultaneously, the outer contours of multiple overlapping areas are merged to obtain the final work area. This invention calculates the operating area of ​​agricultural machinery by using operation trajectory points, which reduces the manpower and material resources required for traditional manual inspection, improves the calculation speed, and reduces the calculation error in repetitive operation areas, thereby enabling more accurate and efficient detection of the operating area of ​​agricultural machinery.

[0052] Figure 1 This is a flowchart illustrating the agricultural machinery operation area detection method provided by the present invention, as shown below. Figure 1 As shown, the present invention provides a method for detecting the operating area of ​​agricultural machinery, comprising:

[0053] Step 101: Obtain the movement trajectory data of the agricultural machinery within a preset time period.

[0054] This invention describes a method for detecting the working area of ​​agricultural machinery based on the complete daily movement trajectory of the machinery. For a given trajectory, the calculation process for the working area includes finding the outer contour of a single working area. If multiple overlapping outer contours exist, the outer contours of the overlapping areas need to be merged.

[0055] Preferably, acquiring the movement trajectory data of the agricultural machinery within a preset time period specifically includes:

[0056] The movement trajectory data of agricultural machinery within a preset time period is obtained through GNSS positioning equipment, wherein the GNSS positioning equipment includes at least one of the following: Beidou satellite navigation system, Global Positioning System, Galileo satellite navigation system and GLONASS satellite navigation system.

[0057] In this invention, the movement trajectory of agricultural machinery is acquired through a GNSS positioning device, and the collected trajectory data is uploaded to a server. The server then performs subsequent agricultural machinery area detection to obtain the operating area of ​​the agricultural machinery within a day. In this invention, the GNSS positioning device is the BeiDou satellite navigation system.

[0058] Step 102: Classify the motion trajectory points in the motion trajectory data using a clustering algorithm to determine the agricultural machinery operation trajectory segment.

[0059] In this invention, a clustering algorithm is used to classify the movement trajectory points in the movement trajectory data into field transfer and field operation categories, that is, to classify the movement trajectory points into operation trajectory points and non-operation trajectory points. Furthermore, according to the time series, the operation trajectory points and non-operation trajectory points in the entire movement trajectory are divided into multiple agricultural machinery operation trajectory segments (each agricultural machinery operation trajectory segment represents the operation trajectory points of agricultural machinery in the farmland within a certain time period) and agricultural machinery non-operation trajectory segments. It should be noted that in this invention, based on a pre-trained clustering algorithm, the trajectory points are divided according to information such as the distribution density, speed, direction, and time information of the trajectory points. It can be understood that when agricultural machinery is operating in the field, the distribution density of trajectory points is relatively high. During a period of operation, a high density of trajectory points will form in this area. The clustering algorithm classifies the trajectory points in this area as operational trajectory points, thus forming an agricultural machinery operational trajectory segment. Multiple trajectory points exist within an operational trajectory segment. Further selection of outer contour points generates the corresponding outer contour polygon for this operational trajectory segment. When leaving the field and traveling to other areas, the distribution density of trajectory points is relatively low. Simultaneously, the speed and direction of the trajectory points exhibit characteristics such as increased speed (or prolonged stay in one place) and consistent direction over a long period. The clustering algorithm classifies the trajectory points during this period as non-operational trajectory points, thus forming an agricultural machinery non-operational trajectory segment. In this invention, a clustering algorithm is used to filter out the non-operational trajectory segments of agricultural machinery from the movement trajectory points. This allows for further processing of the agricultural machinery operation trajectory segments during subsequent agricultural machinery operation area detection, reducing the amount of data to be detected and improving detection accuracy.

[0060] Step 103: Obtain the starting contour point in the agricultural machinery operation trajectory segment, and construct the outer contour polygon corresponding to the agricultural machinery operation trajectory segment based on the starting contour point using the KNN algorithm.

[0061] In this invention, for each agricultural machinery operation trajectory segment, a specific starting point, i.e., a starting contour point, of the operation boundary is first obtained from the current agricultural machinery operation trajectory segment. Specifically, obtaining the starting contour point in the agricultural machinery operation trajectory segment includes:

[0062] The trajectory point with the highest latitude in the agricultural machinery operation trajectory segment is taken as the starting contour point. If there are multiple trajectory points with the highest latitude, then any trajectory point is selected from the multiple trajectory points with the highest latitude as the starting contour point.

[0063] In this invention, for any agricultural machinery operation trajectory segment, the starting contour point is the point with the largest latitude in the agricultural machinery operation trajectory segment. When there are multiple trajectory points with the largest latitude in the agricultural machinery operation trajectory segment, preferably, the trajectory point with the smallest longitude is selected from the multiple trajectory points with the largest latitude as the starting contour point (or the trajectory point with the largest longitude can be selected as the starting contour point).

[0064] Furthermore, using the KNN (K-Nearest Neighbor) algorithm, outer contour points are sequentially obtained from the trajectory points of each agricultural machinery operation trajectory segment. When the found outer contour point is equal to the initial outer contour point (i.e., the starting contour point), all outer contour points in the current agricultural machinery operation trajectory segment are obtained. Then, these outer contour points are connected in the order of acquisition to form an outer contour polygon.

[0065] Step 104: Generate the agricultural machinery operation area based on the outer contour polygon, and calculate the area of ​​the agricultural machinery operation area using the vector product method.

[0066] In this invention, each outer contour polygon corresponds to the agricultural machinery's operating area over a period of time. Preferably, generating the agricultural machinery operating area based on the outer contour polygon includes:

[0067] Obtain multiple outer contour polygons within the target area;

[0068] Determine whether each outer contour polygon intersects with another polygon. If they do intersect, merge the intersecting outer contour polygons to obtain the agricultural machinery operation area.

[0069] In this invention, since agricultural machinery may enter the same farmland area multiple times within a day, the operation trajectory points in the same farmland may be divided into different operation trajectory segments due to the long interval between operations, and thus identified as different farmlands when calculating the outer contour. To avoid double-counting of the same area, the system first determines whether the outer contours intersect. For two intersecting outer contours, the intersection points are first identified, and then inserted into the corresponding array sequences of the two outer contours in chronological order. Finally, the two ordered outer contour vertex arrays are merged into a single ordered outer contour vertex array.

[0070] Figure 2 This is a schematic diagram illustrating the process of merging multiple outer contour polygons provided by the present invention. (See attached diagram.) Figure 2As shown, A1 to A7 are the outer contour polygons of A, and B1 to B8 are the outer contour polygons of B. First, it is determined that e1 and e2 are the intersection points between the outer contour polygons of A and B. Then, these two intersection points are inserted into the corresponding sequences of the two polygons in order. Then, the two ordered polygon vertex arrays are merged into an ordered polygon vertex array, thereby more accurately representing the agricultural machinery operation area.

[0071] Furthermore, the calculation of the area of ​​the agricultural machinery operation area using the vector product method includes:

[0072] Determine any point within the outer contour polygon as a fixed point;

[0073] Multiple vector triangles are formed by each side of the outer contour polygon and the fixed point;

[0074] Calculate the area of ​​each vector triangle to obtain the area of ​​the agricultural machinery operation area corresponding to the outer contour polygon.

[0075] In this invention, based on the principle of vector product, the outer contour polygon is divided into multiple triangles to calculate the vector area. Specifically, a fixed point O is selected within the current outer contour polygon, and the vector area of ​​each side P of the outer contour polygon is calculated. i P j Together with a fixed point O, they form a vector triangle OP. i P j Calculate the area of ​​each vector triangle, and finally sum the areas of the outer contour polygon to obtain the area of ​​the outer contour polygon. The formula is:

[0076]

[0077] Where S represents the calculated area of ​​a single agricultural machinery operating area, i.e., the area of ​​the outer contour polygon; length represents the total number of sides of the outer contour polygon. and Let be the adjacent side vectors of the vector triangle.

[0078] The agricultural machinery operation area detection method provided by this invention identifies the movement trajectory points of agricultural machinery equipment in the farmland operation area through a clustering algorithm, constructs the outer contour polygon of the agricultural machinery in the farmland operation area based on the movement trajectory, and then determines the operation area of ​​the agricultural machinery by calculating the area of ​​the outer contour polygon. This reduces the manpower and material resources of traditional manual detection, improves the calculation speed, and improves the detection accuracy of agricultural machinery operation area.

[0079] Based on the above embodiments, the step of classifying the motion trajectory points in the motion trajectory data using a clustering algorithm to determine the agricultural machinery operation trajectory segment includes:

[0080] The motion trajectory data is preprocessed to obtain the target motion trajectory points;

[0081] Using a density clustering algorithm, the target motion trajectory points are classified into work trajectory points and non-work trajectory points based on their trajectory point information. The trajectory point information includes at least one of the following: trajectory point distribution density, trajectory point velocity, trajectory point direction, and time information.

[0082] Based on the time sequence of the trajectory points, the operational trajectory points and the non-operational trajectory points are divided into multiple segments of agricultural machinery operational trajectory points and agricultural machinery non-operational trajectory points.

[0083] In this invention, the motion trajectory data is first preprocessed by removing outliers and anomalies to obtain the target motion trajectory points. Then, based on the distribution density, velocity, direction, and time of the target motion trajectory points, a density clustering algorithm is used to classify the operational and non-operational trajectory points. In this invention, different categories of trajectory points correspond to different labels, with operational trajectory points labeled 1 and non-operational trajectory points labeled 0. Finally, according to the time sequence of the trajectory points, the entire agricultural machinery trajectory (based on a day's operational trajectory) is divided into multiple distinct operational and non-operational trajectory segments.

[0084] Based on the above embodiments, the step of constructing the outer contour polygon corresponding to the agricultural machinery operation trajectory segment using the KNN algorithm based on the starting contour point includes:

[0085] Step S1: Obtain the K nearest neighbor points corresponding to the starting contour point using the KNN algorithm;

[0086] Step S2: Using the starting contour point as the endpoint, construct a horizontal measurement axis with the latitudinal ray of the starting contour point, obtain the counterclockwise rotation angle between the horizontal measurement axis and the K nearest neighbor points, take the nearest neighbor point corresponding to the smallest counterclockwise rotation angle as the outer contour point of the current round, and take the starting contour point as the outer contour point of the previous round.

[0087] Step S3: Obtain the K nearest neighbor points corresponding to the outer contour point of the current round using the KNN algorithm;

[0088] Step S4: Obtain the counterclockwise rotation angle between the first connecting line and each of the second connecting lines, wherein the first connecting line is the connecting line between the outer contour point of the current round and the outer contour point of the previous round; the second connecting line is the connecting line between the outer contour point of the current round and the K nearest neighbor points corresponding to the outer contour point of the current round.

[0089] Step S5: Obtain the target nearest neighbor point corresponding to the minimum counterclockwise rotation angle between the first line and the second line. If the second line corresponding to the target nearest neighbor point does not intersect with the existing outer contour, then the target nearest neighbor point is used as the outer contour point in the next round.

[0090] Step S6: If the outer contour point of the next round is the starting contour point, it is determined that all outer contour points in the agricultural machinery operation trajectory segment have been obtained; otherwise, repeat steps S3 to S5 until the outer contour point of the next round is the starting contour point.

[0091] Step S7: According to the order in which the outer contour points are obtained, all the outer contour points are combined into the outer contour polygon corresponding to the agricultural machinery operation trajectory segment.

[0092] In this invention, a specific segment of agricultural machinery operation trajectory is used as an example. The starting contour point S in the agricultural machinery operation end is taken as the first outer contour point. From the remaining trajectory points, the K nearest neighbor points P of the starting contour point S are obtained through the KNN algorithm. i , i∈[1,K]; at the same time, taking the starting contour point S as the endpoint, a horizontal measurement axis SX is constructed with latitudinal rays (in this invention, the ray direction is from west to east), and the distance from the horizontal measurement axis SX to each nearest neighbor point P is calculated. i The counterclockwise rotation angle, and the P corresponding to the minimum counterclockwise rotation angle. i As the outer contour point of the current round.

[0093] Furthermore, using the KNN algorithm, the K nearest neighbors of the current round's outer contour point are obtained from the remaining trajectory points as candidate outer contour points for the next round. Then, based on the principle that the candidate points have the smallest counterclockwise rotation angle and that their line segments do not intersect, the candidate points that meet the conditions are selected as the next outer contour point. Specifically, let AB be the line connecting the current round's outer contour point A and the previous round's outer contour point B (if the previous round is the initial stage, then B is the starting contour point), and let C be the K nearest neighbors of point A. i , i∈[1,K], A and C i The connection is AC. i Calculate AB and each AC respectively. i The counterclockwise rotation angle between them is selected by choosing the smallest counterclockwise rotation angle and AC. i Candidate point C where the line segment does not intersect the existing outer contour iThe next round of outer contour points is used as the initial outer contour point (i.e., the starting contour point). When the obtained next round of outer contour points is the initial outer contour point, the loop ends, all outer contour points of the current agricultural machinery operation trajectory segment are obtained, and the outer contour points are arranged into an outer contour polygon in sequence. Otherwise, the next round of outer contour points is used as the new outer contour points (i.e., as the current round of outer contour points), and the above steps are continued to obtain subsequent outer contour points from the agricultural machinery operation trajectory segment.

[0094] In one embodiment, the overall process of the agricultural machinery operation area detection method provided by the present invention is described. In the present invention, firstly, the movement trajectory of the agricultural machinery is acquired through a Beidou positioning terminal, and the original agricultural machinery movement trajectory points are preprocessed to remove abnormal points; then, through a density clustering algorithm, combined with the characteristics of trajectory points such as speed and direction, the trajectory points are binary classified to divide the agricultural machinery operation trajectory segments.

[0095] Furthermore, a specific boundary point in the operation trajectory segment is selected as the starting contour point. This starting contour point must be one of the outer contour points and must be unique. It also serves as the loop termination condition for the outer contour search. Specifically, the trajectory point with the largest latitude is selected as the starting contour point (that is, when all trajectory points in a certain operation trajectory segment are on the same plane, a coordinate system is established, and the trajectory point with the largest value on the y-axis is selected as the starting contour point). When the trajectory point with the largest latitude is not unique, the trajectory point with the smallest longitude is selected from these trajectory points with the largest latitude as the starting contour point.

[0096] Furthermore, find the K nearest neighbors C of the current outer contour point A. i (i∈[1,K]) are candidate points, and the line connecting A and the i-th candidate point is AC. i The line connecting point A and the previous outer contour point B is AB; then, select AB and AC. i C corresponding to the smallest counterclockwise rotation angle between them i Point D is used as the next outer contour point. Figure 3 This is a schematic diagram of the process for obtaining outer contour points provided by the present invention, specifically as follows: Figure 3 As shown.

[0097] Furthermore, determine whether AD intersects with the previously determined outer contour. If they intersect, point D does not meet the condition, and D is removed from the K candidate points. Then, from the remaining K-1 candidate points, search again for the point with the smallest counterclockwise rotation angle. Figure 4 This is a schematic diagram of the outer contour point determination process provided by the present invention. For details, please refer to... Figure 4 As shown. If all K candidate points are deleted, the value of K is increased, and the K nearest neighbor points C of the current outer contour point A are retrieved again. i The search ends when the next found outer contour point is the starting contour point.

[0098] Finally, determine whether there is any intersection between each pair of outer contour polygons. If there is an intersection, merge the intersecting polygons to obtain the agricultural machinery operation area. Then, calculate the area of ​​the outer contour polygon corresponding to the agricultural machinery operation area to obtain the agricultural machinery operation area.

[0099] This invention provides a method for detecting the operating area of ​​agricultural machinery based on the full-scene operating trajectory. Based on the movement trajectory of the agricultural machinery within a preset time period, this method can directly calculate the number of operating fields (i.e., each outer contour polygon corresponds to one operating field) and the operating area of ​​each field. At the same time, the outer contours of the fields calculated repeatedly are merged to avoid the calculation of repeated operating areas, thus providing a new method for precise operation of agricultural machinery and detection of operating area.

[0100] The agricultural machinery operation area detection system provided by the present invention is described below. The agricultural machinery operation area detection system described below can be referred to in correspondence with the agricultural machinery operation area detection method described above.

[0101] Figure 5 This is a schematic diagram of the agricultural machinery operation area detection system provided by the present invention, as shown below. Figure 5 As shown, this invention provides an agricultural machinery operation area detection system, including a trajectory data acquisition module 501, an operation trajectory segment generation module 502, an operation area outer contour construction module 503, and an operation area calculation module 504. The trajectory data acquisition module 501 acquires the movement trajectory data of the agricultural machinery within a preset time period. The operation trajectory segment generation module 502 classifies the movement trajectory points in the movement trajectory data using a clustering algorithm to determine the agricultural machinery operation trajectory segments. The operation area outer contour construction module 503 acquires the starting contour points in the agricultural machinery operation trajectory segments and, based on the starting contour points, constructs the outer contour polygon corresponding to the agricultural machinery operation trajectory segment using a KNN algorithm. The operation area calculation module 504 generates the agricultural machinery operation area based on the outer contour polygon and calculates the area of ​​the agricultural machinery operation area using a vector product method.

[0102] The agricultural machinery operation area detection system provided by this invention identifies the movement trajectory points of agricultural machinery equipment in the farmland operation area through a clustering algorithm, and constructs the outer contour polygon of the agricultural machinery in the farmland operation area based on the movement trajectory. Then, by calculating the area of ​​the outer contour polygon, the operation area of ​​the agricultural machinery is determined. This reduces the manpower and material resources of traditional manual detection, improves the calculation speed, and improves the detection accuracy of agricultural machinery operation area.

[0103] The system provided by this invention is used to execute the above-described method embodiments. For specific processes and details, please refer to the above embodiments, which will not be repeated here.

[0104] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 6 As shown, the electronic device may include: a processor 601, a communication interface 602, a memory 603, and a communication bus 604. The processor 601, communication interface 602, and memory 603 communicate with each other via the communication bus 604. The processor 601 can call logical instructions in the memory 603 to execute an agricultural machinery operation area detection method. This method includes: acquiring the movement trajectory data of the agricultural machinery within a preset time period; classifying the movement trajectory points in the movement trajectory data using a clustering algorithm to determine the agricultural machinery operation trajectory segment; acquiring the starting contour point in the agricultural machinery operation trajectory segment, and constructing the outer contour polygon corresponding to the agricultural machinery operation trajectory segment based on the starting contour point using a KNN algorithm; generating the agricultural machinery operation area based on the outer contour polygon, and calculating the area of ​​the agricultural machinery operation area using a vector product method.

[0105] Furthermore, the logical instructions in the aforementioned memory 603 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by the computer, the computer is able to execute the agricultural machinery operation area detection method provided by the above methods, the method including: acquiring the movement trajectory data of agricultural machinery within a preset time period; classifying the movement trajectory points in the movement trajectory data by a clustering algorithm to determine the agricultural machinery operation trajectory segment; acquiring the starting contour point in the agricultural machinery operation trajectory segment, and constructing the outer contour polygon corresponding to the agricultural machinery operation trajectory segment based on the starting contour point by a KNN algorithm; generating the agricultural machinery operation area according to the outer contour polygon, and calculating the area of ​​the agricultural machinery operation area by a vector product method.

[0107] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the agricultural machinery operation area detection method provided in the above embodiments. The method includes: acquiring the movement trajectory data of the agricultural machinery within a preset time period; classifying the movement trajectory points in the movement trajectory data using a clustering algorithm to determine the agricultural machinery operation trajectory segment; acquiring the starting contour point in the agricultural machinery operation trajectory segment, and constructing the outer contour polygon corresponding to the agricultural machinery operation trajectory segment based on the starting contour point using a KNN algorithm; generating the agricultural machinery operation area according to the outer contour polygon, and calculating the area of ​​the agricultural machinery operation area using a vector product method.

[0108] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting the operating area of ​​agricultural machinery, characterized in that, include: Acquire the movement trajectory data of agricultural machinery within a preset time period; Clustering algorithms are used to classify the motion trajectory points in the motion trajectory data to determine the agricultural machinery operation trajectory segments; Obtain the starting contour point in the agricultural machinery operation trajectory segment, and based on the starting contour point, construct the outer contour polygon corresponding to the agricultural machinery operation trajectory segment using the KNN algorithm; Based on the outer contour polygon, the agricultural machinery operation area is generated, and the area of ​​the agricultural machinery operation area is calculated by the vector product method. The process of constructing the outer contour polygon corresponding to the agricultural machinery operation trajectory segment based on the starting contour point using the KNN algorithm includes: Step S1: Obtain the K nearest neighbor points corresponding to the starting contour point using the KNN algorithm; Step S2: Using the starting contour point as the endpoint, construct a horizontal measurement axis with the latitudinal ray of the starting contour point, obtain the counterclockwise rotation angle between the horizontal measurement axis and the K nearest neighbor points, take the nearest neighbor point corresponding to the smallest counterclockwise rotation angle as the outer contour point of the current round, and take the starting contour point as the outer contour point of the previous round. Step S3: Obtain the K nearest neighbor points corresponding to the outer contour point of the current round using the KNN algorithm; Step S4: Obtain the counterclockwise rotation angle between the first connecting line and each of the second connecting lines, wherein the first connecting line is the connecting line between the outer contour point of the current round and the outer contour point of the previous round; the second connecting line is the connecting line between the outer contour point of the current round and the K nearest neighbor points corresponding to the outer contour point of the current round. Step S5: Obtain the target nearest neighbor point corresponding to the minimum counterclockwise rotation angle between the first line and the second line. If the second line corresponding to the target nearest neighbor point does not intersect with the existing outer contour, then the target nearest neighbor point is used as the outer contour point in the next round. Step S6: If the outer contour point of the next round is the starting contour point, it is determined that all outer contour points in the agricultural machinery operation trajectory segment have been obtained; otherwise, steps S3 to S5 are repeated until the outer contour point of the next round is the starting contour point. Step S7: According to the order in which the outer contour points are obtained, all the outer contour points are combined into the outer contour polygon corresponding to the agricultural machinery operation trajectory segment.

2. The method for detecting the area of ​​agricultural machinery operation according to claim 1, characterized in that, The step of classifying the motion trajectory points in the motion trajectory data using a clustering algorithm to determine the agricultural machinery operation trajectory segment includes: The motion trajectory data is preprocessed to obtain the target motion trajectory points; Using a density clustering algorithm, the target motion trajectory points are classified into work trajectory points and non-work trajectory points based on their trajectory point information. The trajectory point information includes at least one of the following: trajectory point distribution density, trajectory point velocity, trajectory point direction, and time information. Based on the time sequence of the trajectory points, the operational trajectory points and the non-operational trajectory points are divided into multiple segments of agricultural machinery operational trajectory points and agricultural machinery non-operational trajectory points.

3. The method for detecting the area of ​​agricultural machinery operations according to claim 1, characterized in that, The step of obtaining the starting contour point in the agricultural machinery operation trajectory segment includes: The trajectory point with the highest latitude in the agricultural machinery operation trajectory segment is taken as the starting contour point. If there are multiple trajectory points with the highest latitude, then any trajectory point is selected from the multiple trajectory points with the highest latitude as the starting contour point.

4. The method for detecting the area of ​​agricultural machinery operations according to claim 1, characterized in that, The step of generating the agricultural machinery operating area based on the outer contour polygon includes: Obtain multiple outer contour polygons within the target area; Determine whether each outer contour polygon intersects with another polygon. If they do intersect, merge the intersecting outer contour polygons to obtain the agricultural machinery operation area.

5. The method for detecting the area of ​​agricultural machinery operations according to claim 1, characterized in that, The method of calculating the area of ​​the agricultural machinery operation area using the vector product includes: Determine any point within the outer contour polygon as a fixed point; Multiple vector triangles are formed by each side of the outer contour polygon and the fixed point; Calculate the area of ​​each vector triangle to obtain the area of ​​the agricultural machinery operation area corresponding to the outer contour polygon.

6. The method for detecting the agricultural machinery operating area according to any one of claims 1 to 5, characterized in that, The acquisition of the movement trajectory data of agricultural machinery within a preset time period includes: The movement trajectory data of agricultural machinery within a preset time period is obtained through GNSS positioning equipment, wherein the GNSS positioning equipment includes at least one of the following: Beidou satellite navigation system, Global Positioning System, Galileo satellite navigation system and GLONASS satellite navigation system.

7. A system for detecting the area of ​​agricultural machinery operations, characterized in that, include: The trajectory data acquisition module is used to acquire the movement trajectory data of agricultural machinery within a preset time period; The operation trajectory segment generation module is used to classify the motion trajectory points in the motion trajectory data through a clustering algorithm to determine the agricultural machinery operation trajectory segment; The outer contour construction module of the working area is used to obtain the starting contour point in the agricultural machinery working trajectory segment, and construct the outer contour polygon corresponding to the agricultural machinery working trajectory segment based on the starting contour point using the KNN algorithm. The operation area calculation module is used to generate the agricultural machinery operation area based on the outer contour polygon, and calculate the area of ​​the agricultural machinery operation area by means of the vector product method. The module for constructing the outer contour of the work area is specifically used for: Step S1: Obtain the K nearest neighbor points corresponding to the starting contour point using the KNN algorithm; Step S2: Using the starting contour point as the endpoint, construct a horizontal measurement axis with the latitudinal ray of the starting contour point, obtain the counterclockwise rotation angle between the horizontal measurement axis and the K nearest neighbor points, take the nearest neighbor point corresponding to the smallest counterclockwise rotation angle as the outer contour point of the current round, and take the starting contour point as the outer contour point of the previous round. Step S3: Obtain the K nearest neighbor points corresponding to the outer contour point of the current round using the KNN algorithm; Step S4: Obtain the counterclockwise rotation angle between the first connecting line and each of the second connecting lines, wherein the first connecting line is the connecting line between the outer contour point of the current round and the outer contour point of the previous round; the second connecting line is the connecting line between the outer contour point of the current round and the K nearest neighbor points corresponding to the outer contour point of the current round. Step S5: Obtain the target nearest neighbor point corresponding to the minimum counterclockwise rotation angle between the first line and the second line. If the second line corresponding to the target nearest neighbor point does not intersect with the existing outer contour, then the target nearest neighbor point is used as the outer contour point in the next round. Step S6: If the outer contour point of the next round is the starting contour point, it is determined that all outer contour points in the agricultural machinery operation trajectory segment have been obtained; otherwise, steps S3 to S5 are repeated until the outer contour point of the next round is the starting contour point. Step S7: According to the order in which the outer contour points are obtained, all the outer contour points are combined into the outer contour polygon corresponding to the agricultural machinery operation trajectory segment.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the agricultural machinery operation area detection method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the agricultural machinery operation area detection method as described in any one of claims 1 to 6.