A method and system for matching massive agricultural machinery operation data and land boundary data

By constructing a spatiotemporal coding index for agricultural machinery operations and an RTree spatial index for land boundaries, the problems of excessive time consumption and resource consumption in matching agricultural machinery operation data with land boundary data are solved. This achieves efficient and accurate data matching and real-time querying, making it suitable for spatiotemporal data analysis in precision agriculture.

CN120743909BActive Publication Date: 2025-11-11江西省农业技术推广中心 +3
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511171727.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-21
Publication Date
2025-11-11
Estimated Expiration
2045-08-21

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as excessively long matching time, excessive resource consumption, and inability to support dynamic updates and real-time queries when matching agricultural machinery operation data with land boundary data. In particular, the query efficiency is low and the accuracy is poor when the data scale is large.

Method used

By constructing a spatiotemporal coding index for agricultural machinery operations and an RTree spatial index for land boundaries, the temporal and spatial dimensions of agricultural machinery trajectories are uniformly mapped to form a fast query structure. Google S2 encoding and RTree indexes are used to process agricultural machinery trajectory data and land boundary data respectively, achieving efficient data matching.

Benefits of technology

It enables rapid matching of agricultural machinery operation data and land boundary data, improving query efficiency and accuracy. It supports dynamic updates and real-time queries, making it suitable for the spatiotemporal data analysis needs of precision agriculture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743909B_ABST
    Figure CN120743909B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for matching massive agricultural machinery operation data with land boundary data, belonging to the field of data processing technology. The method includes: acquiring and preprocessing agricultural machinery trajectory data and land boundary data; constructing a spatiotemporal index based on the spatiotemporal characteristics of agricultural machinery trajectory points, and integrating timestamps and location codes to achieve data fragmentation and storage; for the land boundary data, calculating the minimum bounding rectangle (MBR) of each plot, clustering according to spatial proximity rules to generate an RTree index, forming a hierarchical tree structure, and storing it. When matching agricultural machinery operation data with land boundary data, the spatiotemporal index is used to filter the agricultural machinery operation range, and the MBR of spatially intersecting plots is quickly retrieved based on the RTree index to accurately match the land boundary data. This invention, through dual index collaboration and distributed storage optimization, effectively reduces storage resource consumption and reduces query time to the second level, providing reliable technical support for precision agriculture supervision and intelligent scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, specifically to a method and system for matching massive agricultural machinery operation data with land boundary data. Background Technology

[0002] With the development of precision agriculture and intelligent agricultural machinery, agricultural machinery operation data and land boundary data are experiencing massive growth. How to efficiently link agricultural machinery operation behavior with specific plot information has become a core requirement for land management, operation subsidy calculation, and agricultural scheduling.

[0003] In the scenario of matching agricultural machinery operation data with land boundary data, the trajectory of agricultural machinery has both temporal continuity and spatial mobility. Data needs to be filtered by time range, such as operation cycle, and geographical area, such as plot boundary. Land boundary data usually contains tens of thousands to millions of polygon plots. Directly calculating the spatial relationship between trajectory points and polygons (such as point-to-polygon inclusion judgment) is extremely complex.

[0004] Existing methods often employ single-dimensional indexing or full traversal calculations, resulting in excessively long matching times, high resource consumption, and an inability to support dynamic updates and real-time queries. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a method and system for matching massive agricultural machinery operation data with land boundary data, aiming to solve the above-mentioned problems described in the prior art.

[0006] The first aspect of the present invention is to provide a method for matching massive agricultural machinery operation data with land boundary data, the method comprising:

[0007] Acquire agricultural machinery trajectory data and land boundary data, and preprocess the agricultural machinery trajectory data and land boundary data respectively; wherein the land boundary data is the boundary data of the land in four directions, including the boundary lines between the land and adjacent land in the four directions;

[0008] Based on the preprocessed agricultural machinery trajectory data, the operation trajectory points in the agricultural machinery trajectory data are encoded, and the agricultural machinery operation time is integrated to construct and store the spatiotemporal index data of the agricultural machinery operation data;

[0009] Based on the preprocessed land boundary data, the minimum bounding rectangle of each plot in the land layer is calculated. The minimum bounding rectangle of each plot is then constructed into a tree structure according to the spatial proximity rule to obtain the RTree index data of the land boundary data and store it.

[0010] The agricultural machinery operation data range is determined by querying agricultural machinery operation data in the database using the spatiotemporal index in the spatiotemporal index data.

[0011] Based on the agricultural machinery operation data range, the matching land boundary data is quickly retrieved from the RTree index data through spatial relationships.

[0012] According to one aspect of the above technical solution, the steps of encoding the operation trajectory points in the preprocessed agricultural machinery trajectory data, integrating the agricultural machinery operation time, constructing and storing spatiotemporal index data of the agricultural machinery operation data include:

[0013] Based on the preprocessed agricultural machinery trajectory data, extract the operation trajectory points corresponding to agricultural machinery operations from the agricultural machinery trajectory data;

[0014] The operation trajectory points are randomly numerically mapped to obtain the operation trajectory point location code. The timestamp of the agricultural machinery operation time is randomly combined with the operation trajectory point location code to obtain spatiotemporal index data.

[0015] The spatiotemporal index data is sorted according to its geographic location relationship, and then the spatiotemporal index data is sharded so that agricultural machinery operation data in different regions are distributed to different data shards, and the different data shards are stored on big data nodes.

[0016] According to one aspect of the above technical solution, the step of randomly mapping the operation trajectory points to obtain operation trajectory point location codes, and randomly combining the timestamp of the agricultural machinery operation time with the operation trajectory point location codes to obtain spatiotemporal index data includes:

[0017] The longitude and latitude of the operation trajectory points are randomly mapped and connected in sequence to obtain the position code of the operation trajectory points.

[0018] At least one timestamp within the time range of the agricultural machinery operation time is obtained, and the timestamp is randomly combined with the location code of the operation trajectory point to obtain spatiotemporal index data.

[0019] According to one aspect of the above technical solution, the step of obtaining at least one timestamp within the time range of the agricultural machinery operation time, and randomly combining the timestamp with the location code of the operation trajectory point to obtain spatiotemporal index data includes:

[0020] Identify the time range of the agricultural machinery operation time, and divide the time range into multiple consecutive time windows based on a preset time granularity;

[0021] Extract the start timestamp of each time window as the time identifier of that time window, and encode the position of each operation trajectory point and associate it with the matching time window according to the actual collection time of its corresponding trajectory point;

[0022] The start timestamp of the time window and the location code of the operation trajectory point are XORed using a hash function to generate a hybrid code value. The hybrid code value is then randomly rearranged according to the binary bits to form a unique key value for the spatiotemporal index data.

[0023] Based on the numerical range of the unique key value, the agricultural machinery operation data corresponding to different key values ​​are distributed and stored in multiple distributed nodes.

[0024] According to one aspect of the above technical solution, based on the preprocessed land boundary data, the steps of calculating the minimum bounding rectangle of each plot in the land layer, constructing a tree structure of the minimum bounding rectangle of each plot according to the spatial proximity rule, and constructing and storing the RTree index data of the land boundary data include:

[0025] Based on the preprocessed land boundary data, identify each plot in the land layer and calculate the minimum bounding rectangle of each plot;

[0026] When constructing the RTree index of land boundary data, the minimum bounding rectangle corresponding to each plot is constructed into a tree structure according to the spatial proximity rule to obtain the RTree index data of land boundary data;

[0027] The constructed RTree index data is stored in the Redis cluster.

[0028] According to one aspect of the above technical solution, when constructing the RTree index of land boundary data, the step of constructing a tree structure by building the minimum bounding rectangle corresponding to each plot according to the spatial proximity rule to obtain the RTree index data of land boundary data includes:

[0029] Based on the geographic coordinates of the minimum bounding rectangle of each plot, spatially adjacent or overlapping rectangles are clustered into the same node, forming the leaf nodes of the RTree index;

[0030] Based on the geographical distribution density of leaf nodes, adjacent nodes are recursively merged and parent nodes are generated until the root node is formed, thus completing the hierarchical construction of the tree structure.

[0031] During the merging process, the minimum bounding rectangle of the parent node is calculated to completely cover the geographical areas corresponding to all child nodes, and the hierarchical mapping relationship between the parent node and child nodes is recorded.

[0032] Add a unique identifier to the generated RTree node data, bind the node identifier with the corresponding minimum bounding rectangle coordinates and hierarchical relationship, and generate RTree index metadata;

[0033] Based on the Redis cluster's sharding rules, the RTree index metadata is hashed and mapped to different shards by node identifier, and the index data is compressed into binary format for storage.

[0034] A second aspect of the present invention is to provide a system for matching massive agricultural machinery operation data with land boundary data, applied to the method described in the above-mentioned technical solution, the system comprising:

[0035] The data acquisition module is used to acquire agricultural machinery trajectory data and land boundary data, and to preprocess the agricultural machinery trajectory data and land boundary data respectively; wherein the land boundary data is the boundary data of the land in four directions, including the boundary lines between the land and adjacent land in the four directions;

[0036] The first processing module is used to encode the operation trajectory points in the preprocessed agricultural machinery trajectory data, integrate the agricultural machinery operation time, construct and store the spatiotemporal index data of the agricultural machinery operation data;

[0037] The second processing module is used to calculate the minimum bounding rectangle of each plot in the land layer based on the preprocessed land boundary data, construct a tree structure of the minimum bounding rectangle of each plot according to the spatial proximity rule, construct the RTree index data of the land boundary data and store it.

[0038] The index query module is used to query agricultural machinery operation data in the database through the spatiotemporal index in the spatiotemporal index data to determine the range of agricultural machinery operation data;

[0039] The result output module is used to quickly retrieve the matching land boundary result data in the RTree index data according to the range of agricultural machinery operation data through spatial relationships.

[0040] According to one aspect of the above technical solution, the first processing module is used for:

[0041] Based on the preprocessed agricultural machinery trajectory data, extract the operation trajectory points corresponding to agricultural machinery operations from the agricultural machinery trajectory data;

[0042] The operation trajectory points are randomly numerically mapped to obtain the operation trajectory point location code. The timestamp of the agricultural machinery operation time is randomly combined with the operation trajectory point location code to obtain spatiotemporal index data.

[0043] The spatiotemporal index data is sorted according to its geographic location relationship, and then the spatiotemporal index data is sharded so that agricultural machinery operation data in different regions are distributed to different data shards, and the different data shards are stored on big data nodes.

[0044] A third aspect of the present invention is to provide a readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method described in the above-described technical solution.

[0045] A fourth aspect of the present invention is to provide 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 steps of the method described in the above technical solutions.

[0046] Compared with existing technologies, the method for matching massive agricultural machinery operation data with land boundary data as shown in this invention has the following advantages:

[0047] This invention constructs a spatiotemporal coding index for agricultural machinery operations and an RTree spatial index for land boundaries, unifying the temporal and spatial dimensions of agricultural machinery trajectories with the geographical location of the land into a structure that can be quickly queried. The spatiotemporal index supports rapid filtering of target datasets, such as agricultural machinery operation data for a specific area within a specific day, based on time range and location coding; the RTree index directly locates corresponding plots based on spatial relationships, such as intersection and coverage, avoiding the computational overhead of full-database scanning in traditional methods. Through the collaborative optimization of dual indexes, this invention solves the pain points of large data scale, low query efficiency, and poor accuracy in traditional agricultural machinery-land matching, providing efficient and practical spatiotemporal data analysis capabilities for precision agriculture. Attached Figure Description

[0048] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0049] Figure 1 This is a flowchart illustrating a method for matching massive agricultural machinery operation data with land boundary data in one embodiment of the present invention.

[0050] Figure 2 This is a structural block diagram of a system for matching massive agricultural machinery operation data with land boundary data in one embodiment of the present invention. Detailed Implementation

[0051] To make the objectives, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Several embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of the present invention will be more thorough and complete.

[0052] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0054] Example 1

[0055] Please see Figure 1 The first embodiment of the present invention provides a method for matching massive agricultural machinery operation data with land boundary data, the method comprising steps S10-S50:

[0056] Step S10: Obtain agricultural machinery trajectory data and land boundary data, and preprocess the agricultural machinery trajectory data and land boundary data respectively.

[0057] Among them, the land boundary data is the boundary data of the land in four directions, including the boundary lines between the land and adjacent land in the four directions.

[0058] In this embodiment, when matching agricultural machinery operation data with land boundary data, it is first necessary to obtain agricultural machinery trajectory data and land boundary data, and then preprocess the agricultural machinery trajectory data and land data respectively.

[0059] Specifically, preprocessing agricultural machinery trajectory data includes deleting drifting trajectory data, deleting data with consecutive positions according to time sequence, and removing redundant data with the same trajectory data at consecutive time points, thereby reducing the amount of data to facilitate subsequent processing; preprocessing land boundary data includes constructing boundary vector data from text files based on text descriptions, vectorizing irregular shapes to obtain vector data, uniformly converting data with inconsistent coordinate systems to the CGCS2000 coordinate system, and unifying the coordinate system, field format, and field content of vector data.

[0060] Step S20: Based on the preprocessed agricultural machinery trajectory data, the operation trajectory points in the agricultural machinery trajectory data are encoded, and the agricultural machinery operation time is integrated to construct and store the spatiotemporal index data of the agricultural machinery operation data.

[0061] In this embodiment, the steps of encoding the operation trajectory points in the preprocessed agricultural machinery trajectory data, integrating the agricultural machinery operation time, constructing and storing spatiotemporal index data of the agricultural machinery operation data include:

[0062] Based on the preprocessed agricultural machinery trajectory data, extract the operation trajectory points corresponding to agricultural machinery operations from the agricultural machinery trajectory data;

[0063] The operation trajectory points are randomly numerically mapped to obtain the operation trajectory point location code. The timestamp of the agricultural machinery operation time is randomly combined with the operation trajectory point location code to obtain spatiotemporal index data.

[0064] The spatiotemporal index data is sorted according to its geographic location relationship, and then the spatiotemporal index data is sharded so that agricultural machinery operation data in different regions are distributed to different data shards, and the different data shards are stored on big data nodes.

[0065] The steps of randomly mapping the operation trajectory points to obtain operation trajectory point location codes, and randomly combining the timestamp of the agricultural machinery operation time with the operation trajectory point location codes to obtain spatiotemporal index data include:

[0066] The longitude and latitude of the operation trajectory points are randomly mapped and connected in sequence to obtain the position code of the operation trajectory points.

[0067] At least one timestamp within the time range of the agricultural machinery operation time is obtained, and the timestamp is randomly combined with the location code of the operation trajectory point to obtain spatiotemporal index data.

[0068] Specifically, Google S2 is a hierarchical indexing system based on spherical spatial partitioning. The method shown in this embodiment uses Google S2 to map agricultural machinery trajectory points (longitude and latitude) to a unique one-dimensional value, also called CellID, thereby integrating the spatial information of agricultural machinery operations into the Google S2 spatial indexing system. This encoding method ensures that adjacent geographic locations remain adjacent in the one-dimensional encoding space, which is beneficial for subsequent index construction and querying.

[0069] Building upon the Google S2 encoding of agricultural machinery track points, the agricultural machinery operation time is integrated. The agricultural machinery time is represented as a timestamp, and this timestamp is combined with the location encoding of the agricultural machinery track point to form a new CellID. This CellID is a one-dimensional value containing both the agricultural machinery operation point and the operation time. The order of CellIDs is determined by chronological order and geographic adjacency. The CellID can serve as a temporal and spatial index for agricultural operation data.

[0070] Finally, the index data is sorted according to the geospatial relationship of CellID and then sharded, so that the agricultural machinery operation data of different regions are distributed on different data shards; and the different data shards are stored on different Cassandra big data nodes.

[0071] The step of obtaining at least one timestamp within the time range of the agricultural machinery operation time, and randomly combining the timestamp with the location code of the operation trajectory point to obtain spatiotemporal index data includes:

[0072] Identify the time range of the agricultural machinery operation time, and divide the time range into multiple consecutive time windows based on a preset time granularity;

[0073] Extract the start timestamp of each time window as the time identifier of that time window, and encode the position of each operation trajectory point and associate it with the matching time window according to the actual collection time of its corresponding trajectory point;

[0074] The start timestamp of the time window and the location code of the operation trajectory point are XORed using a hash function to generate a hybrid code value. The hybrid code value is then randomly rearranged according to the binary bits to form a unique key value for the spatiotemporal index data.

[0075] Based on the numerical range of the unique key value, the agricultural machinery operation data corresponding to different key values ​​are distributed and stored in multiple distributed nodes.

[0076] Specifically, in the process of randomly combining timestamps and location codes of work trajectory points, the overall work period is first divided into fixed-length windows, such as 5-minute windows, based on the data collection frequency of agricultural machinery operations, for example, per second or per minute. Each window is identified by its starting timestamp; for example, the time window 10:00-10:05 corresponds to timestamp 1623456000000. For each agricultural machinery trajectory point, its actual collection timestamp is matched to the corresponding time window. For example, the collection time 10:03:15 belongs to the 10:00-10:05 window. The timestamp (e.g., 1623456000000) and the location code (e.g., longitude hash 0x3A7B, latitude hash 0x4E2F concatenated to 0x3A7B4E2F) are XORed to generate an intermediate value. Then, the binary bits of the intermediate value are randomly permuted, for example, rearranged according to a preset permutation table, to ensure the uniform distribution of key values ​​and avoid storage hotspots. Finally, the data is divided into slices based on the key value range (such as 0x0000-0x3FFF, 0x4000-0x7FFF, etc.) so that adjacent spatiotemporal data are distributed across different nodes to improve the efficiency of parallel queries.

[0077] In the process of randomly combining timestamps and job trajectory point location codes, the spatiotemporal index key-value pairs have both temporal continuity and spatial dispersion through time window segmentation and hash randomization operations. This supports efficient range queries, such as time period + region retrieval, while also achieving load-balanced storage of massive amounts of data in a distributed system and reducing query latency.

[0078] Step S30: Based on the preprocessed land boundary data, calculate the minimum bounding rectangle of each plot in the land layer, construct a tree structure of the minimum bounding rectangle of each plot according to the spatial proximity rule, construct the RTree index data of the land boundary data and store it.

[0079] In this embodiment, the system first processes land boundary data, calculating a minimum bounding rectangle (MBR) for each plot, enclosing the plot's four directional boundaries. Next, based on the positional relationships of these rectangles, adjacent or overlapping rectangles are grouped into a multi-level tree structure (similar to folders within folders). Each layer's rectangle covers the area of ​​all smaller rectangles in the layer below, ultimately forming a hierarchical index from the top layer to the plots. This structure allows the computer to quickly locate all land boundaries within a given area without having to search them one by one.

[0080] The constructed index is stored in a distributed database, such as a Redis cluster. Through distributed storage and compression techniques, it saves space and supports fast retrieval. When matching agricultural machinery operation data, the system first determines the range based on the location and operation time of the machinery, and then uses the index to quickly find the land boundary data within that range. This method optimizes the originally time-consuming traversal search into a "skip-level search," significantly improving matching efficiency, and is especially suitable for the real-time analysis needs of processing massive amounts of farmland data.

[0081] Step S40: Use the spatiotemporal index in the spatiotemporal index data to query agricultural machinery operation data in the database to determine the range of agricultural machinery operation data.

[0082] Step S50: According to the agricultural machinery operation data range, quickly retrieve the matching land boundary result data in the RTree index data through spatial relationships.

[0083] Specifically, CellIDs are generated using the Google S2 surface algorithm based on time periods. Agricultural machinery operation data is retrieved from the Cassandra database using CeIIID. The minimum bounding rectangle of the agricultural machinery data, i.e., the range of agricultural machinery operation data, is obtained using the Gift-wrapping algorithm. Based on the range of agricultural machinery operation data, the land boundary data is quickly retrieved from the land boundary data index through spatial relationships.

[0084] Compared with existing technologies, the method for matching massive agricultural machinery operation data with land boundary data as shown in this embodiment has the following advantages:

[0085] This embodiment constructs a spatiotemporal coding index for agricultural machinery operations and an RTree spatial index for land boundaries, unifying the temporal and spatial dimensions of agricultural machinery trajectories with the geographical location of the land into a structure that can be quickly queried. The spatiotemporal index supports rapid filtering of target datasets, such as agricultural machinery operation data for a specific area within a specific day, based on time range and location coding; the RTree index directly locates corresponding plots based on spatial relationships, such as intersection and coverage, avoiding the computational overhead of full-database scanning in traditional methods. This embodiment, through the collaborative optimization of dual indexes, solves the pain points of large data scale, low query efficiency, and poor accuracy in traditional agricultural machinery-land matching, providing efficient and practical spatiotemporal data analysis capabilities for precision agriculture.

[0086] Example 2

[0087] The second embodiment of the present invention also provides a method for matching massive agricultural machinery operation data with land boundary data. The method for matching massive agricultural machinery operation data with land boundary data shown in this embodiment is basically similar to the method for matching massive agricultural machinery operation data with land boundary data shown in the first embodiment, except that:

[0088] In this embodiment, the steps of calculating the minimum bounding rectangle of each plot in the land layer based on the preprocessed land boundary data, constructing a tree structure of the minimum bounding rectangle of each plot according to the spatial proximity rule, and constructing and storing the RTree index data of the land boundary data include:

[0089] Based on the preprocessed land boundary data, identify each plot in the land layer and calculate the minimum bounding rectangle of each plot;

[0090] When constructing the RTree index of land boundary data, the minimum bounding rectangle corresponding to each plot is constructed into a tree structure according to the spatial proximity rule to obtain the RTree index data of land boundary data;

[0091] The constructed RTree index data is stored in the Redis cluster.

[0092] The steps involved in constructing the RTree index for land boundary data include: constructing a tree structure from the minimum bounding rectangle of each plot according to spatial proximity rules to obtain the RTree index data for the land boundary data.

[0093] Based on the geographic coordinates of the minimum bounding rectangle of each plot, spatially adjacent or overlapping rectangles are clustered into the same node, forming the leaf nodes of the RTree index;

[0094] Based on the geographical distribution density of leaf nodes, adjacent nodes are recursively merged and parent nodes are generated until the root node is formed, thus completing the hierarchical construction of the tree structure.

[0095] During the merging process, the minimum bounding rectangle of the parent node is calculated to completely cover the geographical areas corresponding to all child nodes, and the hierarchical mapping relationship between the parent node and child nodes is recorded.

[0096] Add a unique identifier to the generated RTree node data, bind the node identifier with the corresponding minimum bounding rectangle coordinates and hierarchical relationship, and generate RTree index metadata;

[0097] Based on the Redis cluster's sharding rules, the RTree index metadata is hashed and mapped to different shards by node identifier, and the index data is compressed into binary format for storage.

[0098] Specifically, based on the geographic coordinates of the MBRs, spatially adjacent or overlapping MBRs are clustered into the same leaf node. For example, using a spatial grid partitioning strategy (such as dividing the geographic area into 1km×1km grids), MBRs within the same grid are preferentially merged into leaf nodes. If the number of MBRs in a single grid exceeds a threshold (e.g., 50), they are sorted a second time by longitude or latitude and divided into multiple child nodes. Adjacent leaf nodes are merged from bottom to top to generate a parent node. Each merge selects the node group with the closest spatial distance or the largest MBR overlap area. The parent node's MBR is expanded to the smallest rectangle covering all child node MBRs. For example, if two child node MBRs are (116.30, 39.90), (116.35, 39.93) and (116.34, 39.91), (116.38, 39.95), then the parent node MBR is (116.30, 39.90), (116.38, 39.95). The process is recursively merged until a root node is generated, forming a complete RTree hierarchical structure.

[0099] Furthermore, a unique identifier is assigned to each node, and the MBR coordinate range, child node ID list, and hierarchy depth are recorded.

[0100] Index data is distributed across different shards in the Redis cluster based on the hash value of the node ID. For example, node ID NODE_001, calculated using CRC16, yields a hash value of 0x8F3A, which is mapped to shard 3. The metadata is then subjected to binary compression using the LZ4 algorithm, achieving a compression rate of 50%-70%, significantly reducing storage space usage.

[0101] Finally, the spatiotemporal index is used to filter out agricultural machinery trajectory points within the target time and spatial range (e.g., the operating area of ​​a certain agricultural machinery on October 1, 2023). Based on the MBR corresponding to the agricultural machinery operating range, drill down layer by layer from the RTree root node to filter out the leaf nodes that intersect with it. Then, extract the MBR of all plots within the leaf nodes, further calculate the spatial relationship between the agricultural machinery trajectory points and the plot polygons (e.g., point-to-surface inclusion judgment), and output the matching land boundary results.

[0102] Example 3

[0103] Please see Figure 2 The third embodiment of the present invention provides a system for matching massive agricultural machinery operation data with land boundary data, applied to the method described in any of the above embodiments, the system comprising:

[0104] The data acquisition module is used to acquire agricultural machinery trajectory data and land boundary data, and to preprocess the agricultural machinery trajectory data and land boundary data respectively; wherein the land boundary data is the boundary data of the land in four directions, including the boundary lines between the land and adjacent land in the four directions;

[0105] The first processing module is used to encode the operation trajectory points in the preprocessed agricultural machinery trajectory data, integrate the agricultural machinery operation time, construct and store the spatiotemporal index data of the agricultural machinery operation data;

[0106] The second processing module is used to calculate the minimum bounding rectangle of each plot in the land layer based on the preprocessed land boundary data, construct a tree structure of the minimum bounding rectangle of each plot according to the spatial proximity rule, construct the RTree index data of the land boundary data and store it.

[0107] The index query module is used to query agricultural machinery operation data in the database through the spatiotemporal index in the spatiotemporal index data to determine the range of agricultural machinery operation data;

[0108] The result output module is used to quickly retrieve the matching land boundary result data in the RTree index data according to the range of agricultural machinery operation data through spatial relationships.

[0109] The first processing module is used for:

[0110] Based on the preprocessed agricultural machinery trajectory data, extract the operation trajectory points corresponding to agricultural machinery operations from the agricultural machinery trajectory data;

[0111] The operation trajectory points are randomly numerically mapped to obtain the operation trajectory point location code. The timestamp of the agricultural machinery operation time is randomly combined with the operation trajectory point location code to obtain spatiotemporal index data.

[0112] The spatiotemporal index data is sorted according to its geographic location relationship, and then the spatiotemporal index data is sharded so that agricultural machinery operation data in different regions are distributed to different data shards, and the different data shards are stored on big data nodes.

[0113] Compared with existing technologies, the advantages of using the massive agricultural machinery operation data and land boundary data matching system shown in this embodiment are as follows:

[0114] This embodiment constructs a spatiotemporal coding index for agricultural machinery operations and an RTree spatial index for land boundaries, unifying the temporal and spatial dimensions of agricultural machinery trajectories with the geographical location of the land into a structure that can be quickly queried. The spatiotemporal index supports rapid filtering of target datasets, such as agricultural machinery operation data for a specific area within a specific day, based on time range and location coding; the RTree index directly locates corresponding plots based on spatial relationships, such as intersection and coverage, avoiding the computational overhead of full-database scanning in traditional methods. This embodiment, through the collaborative optimization of dual indexes, solves the pain points of large data scale, low query efficiency, and poor accuracy in traditional agricultural machinery-land matching, providing efficient and practical spatiotemporal data analysis capabilities for precision agriculture.

[0115] Example 4

[0116] A fourth embodiment of the present invention provides a readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the methods described in the above embodiments.

[0117] Example 5

[0118] A fifth embodiment of the present invention 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 steps of the methods described in the above embodiments.

[0119] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0120] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequential list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable storage medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0121] More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable storage media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0122] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0123] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0124] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for matching massive agricultural machinery operation data with land boundary data, characterized in that, The method includes: Acquire agricultural machinery trajectory data and land boundary data, and preprocess the agricultural machinery trajectory data and land boundary data respectively; wherein the land boundary data is the boundary data of the land in four directions, including the boundary lines between the land and adjacent land in the four directions; Based on the preprocessed agricultural machinery trajectory data, the operation trajectory points in the agricultural machinery trajectory data are encoded, and the agricultural machinery operation time is integrated to construct and store spatiotemporal index data of the agricultural machinery operation data; specifically including: Based on the preprocessed agricultural machinery trajectory data, extract the operation trajectory points corresponding to agricultural machinery operations from the agricultural machinery trajectory data; The operation trajectory points are randomly numerically mapped to obtain operation trajectory point location codes. The timestamp of the agricultural machinery operation time is randomly combined with the operation trajectory point location codes to obtain spatiotemporal index data; specifically including: The longitude and latitude of the operation trajectory points are randomly mapped and connected in sequence to obtain the position code of the operation trajectory points. Obtain at least one timestamp within the time range of the agricultural machinery operation time, and randomly combine the timestamp with the location code of the operation trajectory point to obtain spatiotemporal index data; specifically including: Identify the time range of the agricultural machinery operation time, and divide the time range into multiple consecutive time windows based on a preset time granularity; Extract the start timestamp of each time window as the time identifier of that time window, and encode the position of each operation trajectory point and associate it with the matching time window according to the actual collection time of its corresponding trajectory point; The start timestamp of the time window and the location code of the operation trajectory point are XORed using a hash function to generate a hybrid code value. The hybrid code value is then randomly rearranged according to the binary bits to form a unique key value for the spatiotemporal index data. Based on the numerical range of the unique key value, the agricultural machinery operation data corresponding to different key values ​​are distributed and stored in multiple distributed nodes; Sort the spatiotemporal index data according to the geospatial location relationship, and perform data sharding on the spatiotemporal index data so that agricultural machinery operation data in different regions are distributed on different data shards, and the different data shards are stored on big data nodes; Based on the preprocessed land boundary data, the minimum bounding rectangle of each plot in the land layer is calculated. The minimum bounding rectangle of each plot is then constructed into a tree structure according to the spatial proximity rule to obtain the RTree index data of the land boundary data and store it. The agricultural machinery operation data range is determined by querying agricultural machinery operation data in the database using the spatiotemporal index in the spatiotemporal index data. Based on the agricultural machinery operation data range, the matching land boundary data is quickly retrieved from the RTree index data through spatial relationships.

2. The method for matching massive agricultural machinery operation data with land boundary data according to claim 1, characterized in that, Based on the preprocessed land boundary data, the steps of calculating the minimum bounding rectangle of each plot in the land layer, constructing a tree structure of the minimum bounding rectangles of each plot according to the spatial proximity rule, and constructing and storing the RTree index data of the land boundary data include: Based on the preprocessed land boundary data, identify each plot in the land layer and calculate the minimum bounding rectangle of each plot; When constructing the RTree index of land boundary data, the minimum bounding rectangle corresponding to each plot is constructed into a tree structure according to the spatial proximity rule to obtain the RTree index data of land boundary data; The constructed RTree index data is stored in the Redis cluster.

3. The method for matching massive agricultural machinery operation data with land boundary data according to claim 2, characterized in that, When constructing the RTree index for land boundary data, the steps for building the RTree index data for land boundary data include: (1) Constructing a tree structure of the minimum bounding rectangle corresponding to each plot according to the spatial proximity rule. Based on the geographic coordinates of the minimum bounding rectangle of each plot, spatially adjacent or overlapping rectangles are clustered into the same node, forming the leaf nodes of the RTree index; Based on the geographical distribution density of leaf nodes, adjacent nodes are recursively merged and parent nodes are generated until the root node is formed, thus completing the hierarchical construction of the tree structure. During the merging process, the minimum bounding rectangle of the parent node is calculated to completely cover the geographical areas corresponding to all child nodes, and the hierarchical mapping relationship between the parent node and child nodes is recorded. Add a unique identifier to the generated RTree node data, bind the node identifier with the corresponding minimum bounding rectangle coordinates and hierarchical relationship, and generate RTree index metadata; Based on the Redis cluster's sharding rules, the RTree index metadata is hashed and mapped to different shards by node identifier, and the index data is compressed into binary format for storage.

4. A system for matching massive agricultural machinery operation data with land boundary data, characterized in that, The system, applicable to the method of any one of claims 1-3, comprises: The data acquisition module is used to acquire agricultural machinery trajectory data and land boundary data, and to preprocess the agricultural machinery trajectory data and land boundary data respectively; wherein the land boundary data is the boundary data of the land in four directions, including the boundary lines between the land and adjacent land in the four directions; The first processing module is used to encode the operation trajectory points in the preprocessed agricultural machinery trajectory data, integrate the agricultural machinery operation time, construct and store the spatiotemporal index data of the agricultural machinery operation data; The second processing module is used to calculate the minimum bounding rectangle of each plot in the land layer based on the preprocessed land boundary data, construct a tree structure of the minimum bounding rectangle of each plot according to the spatial proximity rule, construct the RTree index data of the land boundary data and store it. The index query module is used to query agricultural machinery operation data in the database through the spatiotemporal index in the spatiotemporal index data to determine the range of agricultural machinery operation data; The result output module is used to quickly retrieve the matching land boundary result data in the RTree index data according to the range of agricultural machinery operation data through spatial relationships.

5. The system for matching massive agricultural machinery operation data with land boundary data according to claim 4, characterized in that, The first processing module is used for: Based on the preprocessed agricultural machinery trajectory data, extract the operation trajectory points corresponding to agricultural machinery operations from the agricultural machinery trajectory data; The operation trajectory points are randomly numerically mapped to obtain the operation trajectory point location code. The timestamp of the agricultural machinery operation time is randomly combined with the operation trajectory point location code to obtain spatiotemporal index data. The spatiotemporal index data is sorted according to its geographic location relationship, and then the spatiotemporal index data is sharded so that agricultural machinery operation data in different regions are distributed to different data shards, and the different data shards are stored on big data nodes.

6. A readable storage medium having computer instructions stored thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-3.

7. 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 program, it implements the steps of the method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Automatic driving agricultural machine field operation path planning system and method

    CN111189444A

  • Hybrid multi-level spatio-temporal index construction method for large-scale GPS (global positioning system) trajectory data

    CN117909436A