A method and system for agricultural production resource allocation based on multi-constraint optimization
By constructing a resource substitution spatiotemporal diagram and improving the STSGCN model, the problem of deviation between resource allocation results and actual state in existing technologies is solved, and the continuity and executability of resource allocation are realized.
Patent Information
- Application Number
- CN202611491732.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-23
- Publication Date
- 2026-11-17
AI Technical Summary
Existing agricultural production resource allocation methods struggle to distinguish between rigid resource demands and substitutable resource demands in complex, multi-constraint scenarios, and lack a unified conversion process, leading to deviations between resource allocation results and actual conditions, affecting continuity and feasibility.
By collecting agricultural production data, distinguishing between rigid and substitutable resource demands, constructing a spatiotemporal map of resource substitution, and using an improved STSGCN model to generate spatiotemporal characteristics of resource allocation, resource allocation is adjusted to meet the timing of agricultural activities and the location of land plots, thereby generating a target resource allocation sequence.
It enables accurate expression of resource substitution relationships and collaborative processing of multiple constraints, reduces resource allocation conflicts, and improves the continuity and executability of resource allocation.
Smart Images

Figure CN123117477A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, and in particular to a method and system for allocating agricultural production resources based on multi-constraint optimization.
[0002] With the development of smart agriculture, agricultural IoT, and agricultural mechanization technologies, the allocation of agricultural production resources is gradually shifting from manual, experience-based scheduling to digitalization and intelligence. Current agricultural production resource allocation typically revolves around the overall planning of land plots, production tasks, agricultural machinery, operating times, and various agricultural resources, generating resource allocation schemes based on task type, workload, time requirements, and resource availability. However, in actual agricultural production, different land plots exhibit spatial differences, different production tasks have sequential relationships, and different agricultural resources have varying operational capabilities and availability. Furthermore, the same production task may be simultaneously constrained by multiple factors such as resource quantity, resource type, operating time, and land location. Existing methods often employ rule matching, linear programming, heuristic scheduling, or machine learning models to allocate production tasks and agricultural resources. Some methods combine graph neural networks or time-series models to handle the spatiotemporal relationships between land plots, tasks, and resources, thereby achieving dynamic scheduling of agricultural production resources.
[0003] Existing methods for allocating agricultural production resources still have shortcomings in complex and multi-constrained scenarios. Current methods typically complete task matching based on fixed resource types, making it difficult to distinguish between rigid and substitutable resource demands. They also lack a process for uniformly calculating substitutable resource demands based on agricultural resource operational capacity, making it difficult to integrate the substitution relationships between different resources into the allocation process at a unified scale. Existing scheduling models insufficiently handle the correlation between agricultural timing, plot location, resource allocation, resource relocation, and the coordinated arrival of multiple resources. When multiple production tasks share the same agricultural resource or allowable operation periods overlap, resource duplication, untimely relocation, and allocation conflicts easily occur. Furthermore, existing methods often generate allocation results directly at the task or time period level, lacking a process for continuously adjusting agricultural resources based on changes in time-sharing operational volume and reconstructing candidate configurations from both production task and agricultural resource dimensions. This leads to discrepancies between the resource allocation results and the actual occupancy status, affecting the continuity and executability of agricultural production resource allocation.
[0004] Therefore, how to provide a method and system for agricultural production resource allocation based on multi-constraint optimization is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a method and system for agricultural production resource allocation based on multi-constraint optimization. This invention utilizes agricultural production data organization, the division of rigid and substitutable resource demands, the construction of a spatiotemporal resource substitution map, an improved STSGCN model, time-sharing resource adjustment, and the reconstruction techniques for task allocation segments and resource occupancy segments. It details the implementation process of agricultural production resource demand conversion, spatiotemporal relationship modeling, multi-constraint feature extraction, candidate resource allocation generation, and target resource allocation reconstruction, achieving collaborative allocation under conditions of multiple plots, multiple production tasks, and multiple types of agricultural resources. Compared to traditional agricultural resource scheduling methods, this invention has advantages such as accurate expression of resource substitution relationships, strong multi-constraint collaborative processing capabilities, timely response to agricultural time conflicts, thorough consideration of resource transfer and allocation relationships, and high continuity and executability of resource allocation.
[0006] An agricultural production resource allocation method based on multi-constraint optimization according to an embodiment of the present invention includes:
[0007] Collect agricultural production data, organize it by plot and production cycle, and generate an agricultural production resource dataset;
[0008] Based on the agricultural production resource dataset, rigid resource demand and substitutable resource demand are distinguished, and substitutable resource demand is uniformly converted according to operational capacity to generate a task resource substitution table.
[0009] Based on the task resource substitution table, establish fixed resource branches and equivalent substitution branches, organize branches according to the order of agricultural seasons and the location of land plots, and generate a resource substitution spatiotemporal map.
[0010] The resource substitution spatiotemporal map is input into the improved STSGCN model to generate resource allocation spatiotemporal features. The improved STSGCN model includes a collaborative arrival gate, a ratio coordination layer, a resource transfer attenuation layer, and an agricultural season preemption and recovery mechanism.
[0011] The time-sharing workload of production tasks is determined based on the spatiotemporal characteristics of resource allocation. Agricultural resource allocation is adjusted according to the changes in workload between adjacent time periods, and continuously allocated agricultural resources are retained to generate a candidate resource allocation sequence.
[0012] The candidate resource allocation sequence is expanded into task allocation segments and resource occupation segments according to production tasks and agricultural resources, respectively. The task allocation segments are then divided and reorganized by the boundaries of the resource occupation segments to generate the target resource allocation sequence.
[0013] The target resource allocation sequence is mapped to production tasks and land parcels to determine the allocation amount and occupation period of agricultural resources, and to generate agricultural production resource allocation results.
[0014] Optionally, the agricultural production data specifically includes plot data, production task data, agricultural resource data, and production constraint data. The plot data includes plot number and plot location; the production task data includes task number, operation type, operation volume, and resource requirement; the agricultural resource data includes resource number, resource type, applicable operation type, operation capacity, available quantity, location, and occupation period; and the production constraint data includes the agricultural time sequence of production tasks, allowed operation periods, and resource allocation relationships.
[0015] Optionally, generating the agricultural production resource dataset includes:
[0016] Collect agricultural production data, group the production tasks and agricultural resources corresponding to the same plot according to the plot number, and generate plot production data groups;
[0017] The production cycles in the production data group of the plot are divided according to the allowed working time period and the order of agricultural time, and the production tasks in each production cycle are arranged according to the order of agricultural time to generate the plot cycle task group.
[0018] Based on the operation type of the production task and the applicable operation type of the agricultural resources, the agricultural resources are mapped to the corresponding production tasks in the plot periodic task group, and the corresponding agricultural resources are organized according to the location and occupation period of the agricultural resources to generate plot periodic resource units.
[0019] Arrange the periodic resource units of the land parcels according to their parcel numbers and production cycles, and retain the correspondence between production tasks and agricultural resources to generate an agricultural production resource dataset.
[0020] Optionally, the generation of the task resource substitution table includes:
[0021] The resource demand and agricultural resources in the agricultural production resource dataset are collected according to the task number. The resource demand is divided into rigid resource demand and substitutable resource demand according to the number of resource types that can perform the same operation, and a task resource demand record is generated.
[0022] For the alternative resource requirements in the task resource requirement record, the workload of the corresponding production task is determined as the required workload, and the corresponding agricultural resources are aggregated according to the resource type to generate alternative resource groups.
[0023] The equivalent demand for each resource type is determined by dividing the demand amount by the product of the operational capacity of each agricultural resource in the alternative resource group and the duration of the corresponding allowed operational period, and resource equivalent substitution records are generated.
[0024] Merge task resource requirement records and equivalent resource substitution records according to task number, retain the resource type and resource requirement quantity corresponding to rigid resource requirements, and arrange the resource type and equivalent requirement quantity corresponding to substitute resource requirements to generate a task resource substitution table.
[0025] Optionally, the generation of the resource substitution spatiotemporal graph includes:
[0026] Arrange the task resource substitution table according to the task number, and establish task nodes and resource nodes based on production tasks and corresponding agricultural resources;
[0027] Connect the resource nodes corresponding to rigid resource requirements directly to the task nodes, and mark the corresponding resource requirements to generate fixed resource branches.
[0028] Connect each resource node corresponding to the alternative resource demand to the same task node, and mark the corresponding equivalent demand quantity to generate an equivalent alternative branch.
[0029] Arrange each task node and its corresponding fixed resource branch and equivalent substitute branch according to the order of agricultural time. Based on the location of the plot, connect the resource nodes corresponding to the same agricultural resource in the adjacent task nodes according to the order of agricultural time to generate the spatiotemporal connection relationship of resources.
[0030] Combine task nodes, resource nodes, fixed resource branches, equivalent alternative branches, and resource spatiotemporal connections to generate a resource substitution spatiotemporal graph.
[0031] Optionally, the spatiotemporal characteristics of the generated resource configuration include:
[0032] An improved STSGCN model is constructed, which includes a collaborative arrival gate, a resource allocation coordination layer, a resource transfer attenuation layer, and a preemptive recovery mechanism for agricultural seasons.
[0033] The improved STSGCN model was trained by constructing a joint loss function using collaborative arrival loss, allocation coordination loss, transfer attenuation consistency loss, and agricultural time preemption recovery loss. The parameters of the collaborative arrival gate, allocation coordination layer, resource transfer attenuation layer, agricultural time preemption recovery mechanism, and STSGCN backbone network were iteratively updated. The training was completed when the change of the joint loss value was less than 0.002 for 6 consecutive rounds.
[0034] The collaborative arrival gate receives the resource substitution spatiotemporal map, gathers fixed resource branches and equivalent substitution branches according to task nodes, calculates the resource satisfaction rate based on the available quantity of agricultural resources and the corresponding resource demand or equivalent demand, and generates arrival gate coefficients through the Sigmoid function. The resource node features are weighted by the arrival gate coefficients to generate collaborative arrival features.
[0035] The allocation coordination layer receives the coordination arrival features, generates a benchmark allocation vector based on the resource allocation relationship, gathers the coordination arrival features according to resource type to generate the current resource allocation vector, calculates the allocation deviation between the current resource allocation vector and the benchmark vector, and performs an exponential mapping on the allocation deviation to generate an allocation coordination coefficient. The allocation coordination coefficient is used to adjust the corresponding resource features to generate allocation coordination features.
[0036] The resource transfer attenuation layer receives the allocation coordination features, determines the adjacent task nodes corresponding to the same agricultural resource along the spatiotemporal connection relationship of the resources, determines the transfer distance according to the location of the plot, and determines the transfer load in combination with the allowed operation period. The transfer load is normalized and exponentially attenuated to generate the transfer attenuation coefficient. The feature propagation weight of the spatiotemporal connection relationship of the resources is adjusted with the transfer attenuation coefficient to generate the transfer attenuation feature.
[0037] The transition attenuation feature is processed by the agricultural time preemption and recovery mechanism. The task nodes corresponding to the same agricultural resource and whose operation time periods are allowed to overlap are identified. The agricultural time urgency value is calculated according to the order of the allowed operation time period and the agricultural time. The preemption weight is generated by the Softmax function. The corresponding feature connection weight is adjusted according to the preemption weight. The suppressed connection feature is retained as the interruption residual. When the overlapping time period ends and the interrupted production task is still in the allowed operation time period, the residual is added back to generate the spatiotemporal feature of resource allocation.
[0038] Optionally, generating the candidate resource configuration sequence includes:
[0039] Based on the task number and allowed work period, the spatiotemporal characteristics of resource allocation are divided to determine the time-sharing workload of each production task in each allowed work period;
[0040] Arrange the time-sharing workload of the same production task in chronological order, determine the workload change value between adjacent time periods, and determine the resource allocation adjustment amount based on the agricultural resource operation capacity and the duration of the corresponding allowable operation period.
[0041] Based on the resource allocation adjustment amount, increase or decrease the corresponding agricultural resources, and maintain the continuous allocation of agricultural resources with the same resource number in adjacent time periods and whose adjusted allocation amount is positive, and generate a time period resource allocation record;
[0042] Arrange the time-slot resource allocation records according to production tasks and permitted operating periods to generate a candidate resource allocation sequence.
[0043] Optionally, generating the target resource configuration sequence includes:
[0044] Candidate resource allocation sequences are divided according to task numbers. Agricultural resource allocation relationships with the same resource number and consecutive time periods in the same production task are merged to generate task allocation segments.
[0045] Candidate resource allocation sequences are divided according to resource number, and the production task allocation relationship corresponding to the same agricultural resource is arranged according to the occupation period. The resource occupation segment is divided according to the start and end time of each production task.
[0046] Using the start and end times of the resource occupation segment as the boundary of the resource occupation segment, locate the boundary of the resource occupation segment within the time period of the task configuration segment, and divide the task configuration segment according to the boundary of the resource occupation segment to generate the divided task configuration segment;
[0047] Align the task configuration segments with the corresponding resource occupancy segments according to the resource number and the occupancy period. For the task configuration segments with overlapping occupancy periods, extend them to the idle period of the corresponding agricultural resource within the allowed operation period according to the order of agricultural time. Then, reorganize them according to the order of occupancy periods to generate the target resource configuration sequence.
[0048] Optionally, generating agricultural production resource allocation results includes:
[0049] The target resource allocation sequence is divided according to the task number, the allocation relationship of each agricultural resource is mapped to the corresponding production task, and the corresponding plot is determined according to the production task to generate the task plot configuration record.
[0050] Collect agricultural resources from the task plot configuration record according to resource number, summarize the quantity of agricultural resources in the time period occupied by each production task, determine the configuration quantity and retain the time period occupied, and generate resource configuration quantity record;
[0051] The resource allocation records are arranged according to the occupation period. The allocation records with the same resource number and consecutive occupation periods within the same production task and plot are merged to determine the occupation period corresponding to each agricultural resource and generate resource allocation execution records.
[0052] The resource allocation execution records are arranged according to production tasks and land parcels. The allocation amount and occupation period of each agricultural resource are summarized to generate the agricultural production resource allocation results.
[0053] An agricultural production resource allocation system based on multi-constraint optimization according to an embodiment of the present invention includes the following modules:
[0054] The agricultural data organization module is used to organize agricultural production data by plot and production cycle to generate agricultural production resource datasets.
[0055] The resource demand processing module is used to distinguish between rigid resource demands and alternative resource demands, and to perform operational capacity conversion on alternative resource demands to generate a task resource substitution table.
[0056] The resource spatiotemporal mapping module is used to construct fixed resource branches and equivalent substitution branches, organize branches according to the order of agricultural seasons and the location of land parcels, and generate a resource substitution spatiotemporal map.
[0057] The spatiotemporal feature generation module is used to process the resource substitution spatiotemporal graph using the improved STSGCN model and generate spatiotemporal features of resource allocation.
[0058] The candidate configuration generation module is used to adjust the allocation of agricultural resources according to changes in the time-sharing workload and generate a sequence of candidate resource configurations.
[0059] The target configuration refactoring module is used to refactor the candidate resource configuration sequence based on the boundary relationship between the task configuration segment and the resource occupancy segment, and generate the target resource configuration sequence.
[0060] The configuration result generation module is used to map the target resource configuration sequence to production tasks and plots, and generate agricultural production resource configuration results.
[0061] The beneficial effects of this invention are:
[0062] This invention proposes a method and system for agricultural production resource allocation based on multi-constraint optimization. Through agricultural production data organization, the distinction between rigid and substitutable resource demands, the construction of a spatiotemporal map of resource substitution, and the improvement of the STSGCN model, it achieves collaborative modeling of land parcels, production tasks, agricultural resources, the sequence of agricultural activities, and resource allocation relationships. Compared to the traditional allocation method that directly matches resources according to fixed types, this invention can distinguish between non-substitutable and substitutable resource demands, and uniformly calculate substitutable resource demands based on the operational capacity of agricultural resources. This allows different types of agricultural resources to participate in allocation under a unified operational capacity scale, improving the accuracy of expressing agricultural resource substitution relationships and multi-constraint collaborative processing.
[0063] This invention processes the spatiotemporal map of resource substitution through a collaborative arrival gate, a resource allocation coordination layer, a resource transfer attenuation layer, and a time-seizure recovery mechanism. This comprehensively reflects the impact of available agricultural resources, resource allocation ratios, plot location, permitted operating periods, and the order of agricultural time on resource allocation. By jointly processing resource satisfaction status, resource allocation deviations, cross-plot transfer loads, and task seizure relationships, it reduces resource allocation conflicts, untimely transfers, and resource allocation imbalances that occur when multiple production tasks share agricultural resources. Furthermore, it preserves the recovery relationships of interrupted tasks when there is competition for agricultural time, improving the resource allocation process's adaptability to dynamic agricultural time constraints and cross-plot resource flow states.
[0064] This invention adjusts agricultural resource allocation based on the time-sharing changes in production tasks, while retaining continuously allocated resources in adjacent time periods. Based on this, candidate resource allocation sequences are developed according to production tasks and agricultural resources respectively. Task allocation segments are divided using resource occupation segment boundaries, and configurations with overlapping occupation periods are extended and reorganized to generate the target resource allocation sequence. Through this process, the discontinuity in allocation caused by frequent switching and repeated occupation of agricultural resources can be reduced, ensuring consistency between allocation quantities, occupation periods, production tasks, and land parcels in the final agricultural production resource allocation result. This improves the continuity, coordination, and executability of resource allocation results under conditions of multiple land parcels, multiple tasks, and multiple types of agricultural resources. Attached Figure Description
[0065] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0066] Figure 1 This is a flowchart of an agricultural production resource allocation method based on multi-constraint optimization proposed in this invention;
[0067] Figure 2 This is a schematic diagram of the structure of the improved STSGCN model, which is a method for allocating agricultural production resources based on multi-constraint optimization proposed in this invention.
[0068] Figure 3 This is a schematic diagram of the structure of an agricultural production resource allocation system based on multi-constraint optimization proposed in this invention. Detailed Implementation
[0069] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0070] refer to Figure 1 and Figure 2 A method for allocating agricultural production resources based on multi-constraint optimization, comprising:
[0071] Collect agricultural production data, organize it by plot and production cycle, and generate an agricultural production resource dataset;
[0072] Based on the agricultural production resource dataset, rigid resource demand and substitutable resource demand are distinguished, and substitutable resource demand is uniformly converted according to operational capacity to generate a task resource substitution table.
[0073] Based on the task resource substitution table, establish fixed resource branches and equivalent substitution branches, organize branches according to the order of agricultural seasons and the location of land plots, and generate a resource substitution spatiotemporal map.
[0074] The resource substitution spatiotemporal map is input into the improved STSGCN model to generate resource allocation spatiotemporal features. The improved STSGCN model includes a collaborative arrival gate, a ratio coordination layer, a resource transfer attenuation layer, and an agricultural season preemption and recovery mechanism.
[0075] The time-sharing workload of production tasks is determined based on the spatiotemporal characteristics of resource allocation. Agricultural resource allocation is adjusted according to the changes in workload between adjacent time periods, and continuously allocated agricultural resources are retained to generate a candidate resource allocation sequence.
[0076] The candidate resource allocation sequence is expanded into task allocation segments and resource occupation segments according to production tasks and agricultural resources, respectively. The task allocation segments are then divided and reorganized by the boundaries of the resource occupation segments to generate the target resource allocation sequence.
[0077] The target resource allocation sequence is mapped to production tasks and land parcels to determine the allocation amount and occupation period of agricultural resources, and to generate agricultural production resource allocation results.
[0078] In this embodiment, the agricultural production data specifically includes plot data, production task data, agricultural resource data, and production constraint data. The plot data includes plot number and plot location. The production task data includes task number, operation type, operation quantity, and resource requirement. The agricultural resource data includes resource number, resource type, applicable operation type, operation capacity, available quantity, location, and occupation period. The production constraint data includes the agricultural time sequence of production tasks, allowed operation period, and resource allocation relationship.
[0079] In this embodiment, generating the agricultural production resource dataset includes:
[0080] Collect agricultural production data, group the production tasks and agricultural resources corresponding to the same plot according to the plot number, and generate plot production data groups;
[0081] The production cycles in the land parcel production data group are divided according to the permitted working hours and the order of agricultural seasons. Production tasks within each production cycle are then arranged according to the order of agricultural seasons to generate land parcel cycle task groups, where:
[0082] The task group for generating land parcels is as follows:
[0083] The allowed working time period for each production task in the plot production data group is represented as a time interval consisting of the start time and the end time. The production tasks are arranged according to the start time of the allowed working time period, and the order of agricultural time is converted into a directed connection between production tasks.
[0084] Compare the allowable working periods and the order of agricultural time for adjacent production tasks, and classify adjacent production tasks that have a direct or indirect order of agricultural time into the same production cycle;
[0085] For adjacent production tasks that do not have a time order relationship, overlapping work periods are allowed to be included in the same production cycle, and separate work periods are allowed to be set with cycle breakpoints, and production cycles are divided according to cycle breakpoints.
[0086] In each production cycle, count the number of predecessor tasks of the production task. Start arranging the production tasks with 0 predecessor tasks, remove the directed connections formed by the sorted production tasks in turn, and recount the number of predecessor tasks of the remaining production tasks. When the number of predecessor tasks of multiple production tasks is 0 at the same time, prioritize the production tasks with the earlier allowed work period termination time.
[0087] Organize each production task according to the production cycle division results and the production task arrangement results to generate the plot cycle task group;
[0088] Based on the operation type of production tasks and the applicable operation type of agricultural resources, agricultural resources are mapped to the corresponding production tasks in the plot periodic task group. Then, according to the location and occupation period of the agricultural resources, corresponding agricultural resources are organized to generate plot periodic resource units, where:
[0089] The generation of land parcel periodic resource units is as follows:
[0090] Compare the operation type of each production task in the plot periodic task group with the applicable operation type of agricultural resources item by item, and retain agricultural resources whose applicable operation type includes the production task operation type.
[0091] The location of the production task plot and the location of the agricultural resources are represented as two-dimensional coordinates. The difference between the horizontal and vertical coordinates are calculated respectively. The square root of the sum of the squares of the horizontal and vertical coordinate differences is obtained to get the transfer distance from the agricultural resources to the production task plot. The agricultural resources corresponding to the same production task are arranged in ascending order of transfer distance.
[0092] Compare the occupation period of agricultural resources with the allowable operation period of production tasks, deduct the time intervals that overlap with the occupation period from the allowable operation period to form a set of available time intervals, and eliminate agricultural resources whose set of available time intervals is empty;
[0093] Agricultural resources are organized and retained according to resource type, and the mapping relationship between agricultural resources and production tasks is recorded according to the order of migration distance and the set of available time intervals to generate plot periodic resource units;
[0094] Arrange the periodic resource units of the land parcels according to their parcel numbers and production cycles, and retain the correspondence between production tasks and agricultural resources to generate an agricultural production resource dataset.
[0095] In this embodiment, generating the task resource substitution table includes:
[0096] Resource requirements and agricultural resources from the agricultural production resource dataset are collected according to task number. Resource requirements are then categorized into rigid and substitutable resource requirements based on the number of resource types available for performing the same task, generating task resource requirement records.
[0097] Generate a task resource requirement record, specifically as follows:
[0098] The agricultural production resource dataset is divided according to the task number, the resource demand and agricultural resources corresponding to each production task are collected, and the agricultural resources are classified according to the resource type.
[0099] The resource types corresponding to each production task are deduplicated to determine the number of resource types that can perform the same operation.
[0100] When the number of resource types is 1, the resource requirements corresponding to the production task are determined as rigid resource requirements;
[0101] When the number of resource types is greater than 1, the resource requirements corresponding to the production task are identified as substitute resource requirements.
[0102] Record the resource requirement allocation results, resource types, and resource requirement quantities according to the task number, and generate a task resource requirement record;
[0103] For the alternative resource requirements in the task resource requirement record, the workload of the corresponding production task is determined as the required workload, and the corresponding agricultural resources are aggregated according to resource type to generate alternative resource groups, where:
[0104] Generate alternative resource groups, specifically:
[0105] Extract the alternative resource requirements from the task resource requirement record, determine the corresponding production task according to the task number, and use the workload of the production task as the required workload.
[0106] Agricultural resources that can perform corresponding production tasks are classified according to their resource type. Agricultural resources of the same type are grouped into the same resource set, and the resource number, operational capacity, and allowed operation period of the corresponding production task are recorded.
[0107] Organize the required workload and resource sets according to the task number, and generate alternative resource groups;
[0108] The equivalent demand for each resource type is determined by dividing the required workload by the product of the operational capacity of each agricultural resource in the substitutable resource group and the duration of the corresponding permitted operational period. This generates a resource equivalent substitution record, where:
[0109] Generate a resource equivalent substitution record, specifically:
[0110] Calculate the difference between the end time and the start time of the allowable operation period for each agricultural resource in the alternative resource group, and convert the duration of the allowable operation period into hours.
[0111] Multiply the operational capacity of each agricultural resource by the duration of the permitted operational period to obtain the amount of work that each agricultural resource can complete within the permitted operational period;
[0112] Divide the required workload by the available workload of each agricultural resource to obtain the equivalent workload of each agricultural resource. Collect the resource number and equivalent workload of each agricultural resource under the same resource type according to the resource type, and arrange them according to the task number and resource type to generate a resource equivalent substitution record.
[0113] Merge task resource requirement records and equivalent resource substitution records according to task number, retain the resource type and resource requirement quantity corresponding to rigid resource requirements, and arrange the resource type and equivalent requirement quantity corresponding to substitute resource requirements to generate a task resource substitution table.
[0114] In this embodiment, generating the resource substitution spatiotemporal graph includes:
[0115] Arrange the task resource substitution table according to the task number, and establish task nodes and resource nodes based on production tasks and corresponding agricultural resources, wherein:
[0116] Establish task nodes and resource nodes, specifically as follows:
[0117] Arrange the task resource substitution table according to the task number, establish task nodes according to the production task corresponding to the task number, and record the plot number, plot location, allowed operation period and agricultural time sequence in the agricultural production resource dataset according to the task number in the task node.
[0118] Based on the resource type in the task resource substitution table, the corresponding agricultural resource is determined in the agricultural production resource dataset according to the task number. The resource node is identified by both the task number and the resource number, and the resource number, resource type, operational capacity, available quantity, location and occupation period are recorded.
[0119] When the same agricultural resource corresponds to different production tasks, each resource node retains the same resource number;
[0120] Connect the resource nodes corresponding to rigid resource requirements directly to the task nodes, and mark the corresponding resource requirements to generate fixed resource branches.
[0121] Connect each resource node corresponding to the alternative resource demand to the same task node, and mark the corresponding equivalent demand quantity to generate an equivalent alternative branch.
[0122] Arrange the task nodes and their corresponding fixed resource branches and equivalent substitute branches according to the order of agricultural seasons. Based on the location of the plots, connect the resource nodes corresponding to the same agricultural resource in adjacent task nodes according to the order of agricultural seasons to generate a spatiotemporal connection relationship of resources, where:
[0123] The spatiotemporal connectivity relationships for generating resources are as follows:
[0124] Arrange the task nodes according to the order of agricultural seasons. The preceding and following task nodes that have a direct order of agricultural seasons are identified as adjacent task nodes, and the corresponding fixed resource branches and equivalent alternative branches are arranged synchronously.
[0125] Extract the resource IDs of each resource node under adjacent task nodes, and identify resource nodes with the same resource ID as the preceding and following resource nodes corresponding to the same agricultural resource.
[0126] Extract the plot positions of the preceding and following task nodes, record the plot position of the preceding task node as the starting plot position, record the plot position of the following task node as the target plot position, and establish a connection according to the direction from the preceding resource node to the following resource node.
[0127] Organize the resource nodes corresponding to the same agricultural resource and the starting and target plot positions according to the task node arrangement order to generate the spatiotemporal connection relationship of the resources;
[0128] Combine task nodes, resource nodes, fixed resource branches, equivalent alternative branches, and resource spatiotemporal connections to generate a resource substitution spatiotemporal graph.
[0129] In this embodiment, the spatiotemporal characteristics of the generated resource configuration include:
[0130] An improved STSGCN model is constructed, which includes a collaborative arrival gate, a resource allocation coordination layer, a resource transfer attenuation layer, and a preemptive recovery mechanism for agricultural seasons.
[0131] The improved STSGCN model is constructed as follows:
[0132] The spatiotemporal synchronization graph convolutional backbone structure is retained based on the input layer, spatiotemporal synchronization graph convolutional layer and output layer of the traditional STSGCN model;
[0133] A collaborative positioning gate is connected between the input layer and the first spatiotemporal synchronization graph convolutional layer. The node features of the resource substitution spatiotemporal graph after transformation by the input layer are input into the collaborative positioning gate, and the output of the collaborative positioning gate is further passed to the matching coordination layer.
[0134] A matching coordination layer is set between the collaborative positioning gate and the first spatiotemporal synchronization graph convolutional layer. The output of the collaborative positioning gate is used as the input of the matching coordination layer, and the output of the matching coordination layer is connected to the first spatiotemporal synchronization graph convolutional layer.
[0135] In the process of calculating the adjacency weights formed by the original local adjacency matrix and the learnable mask matrix in the spatiotemporal synchronization graph convolutional layer, a resource transition attenuation layer is embedded. The transition attenuation coefficient corresponding to the spatiotemporal connection relationship of the resources is introduced. The transition attenuation coefficient is multiplied by the corresponding adjacency weight to form the propagation weight after transition correction.
[0136] An agricultural time preemption and recovery mechanism is introduced between the final-level spatiotemporal synchronization graph convolutional layer and the output layer. The output features of the final-level spatiotemporal synchronization graph convolutional layer are input into the agricultural time preemption and recovery mechanism. After preemption weight adjustment and interruption residual re-addition, it is connected to the output layer to obtain the improved STSGCN model.
[0137] The improved STSGCN model was trained using a joint loss function constructed from collaborative arrival loss, allocation coordination loss, transfer attenuation consistency loss, and agricultural time preemption recovery loss. The parameters of the collaborative arrival gate, allocation coordination layer, resource transfer attenuation layer, agricultural time preemption recovery mechanism, and STSGCN backbone network were iteratively updated. Training was completed when the change in the joint loss value was less than 0.002 for six consecutive rounds.
[0138] The improved STSGCN model was trained as follows:
[0139] The resource substitution spatiotemporal map in the training samples is input into the STSGCN model in batches of 32 groups. For rigid resource demand, the resource availability quantity is divided by the resource demand quantity, and for substitutable resource demand, the resource availability quantity is divided by the equivalent demand quantity to obtain the resource satisfaction rate. The resource satisfaction rate is then mapped by the Sigmoid function to determine the collaborative arrival label.
[0140] After normalizing the resource allocation relationship, the target allocation vector is determined. The target relocation attenuation coefficient is calculated based on the location of the plot and the allowed operation period. The target seizure weight is calculated based on the allowed operation period and the order of agricultural time.
[0141] The resource substitution spatiotemporal graph passes through the STSGCN backbone network, which consists of a collaborative arrival gate, a resource allocation coordination layer, an embedded resource transfer attenuation layer, and an agricultural time preemption and recovery mechanism, to obtain the arrival gate coefficient, the adjusted resource allocation vector, the transfer attenuation coefficient, the preemption weight, the connection features before preemption, and the connection features after recovery.
[0142] The mean squared difference between the arrival gating coefficient and the coordinated arrival tag is calculated to obtain the coordinated arrival loss.
[0143] The average squared difference of each component of the adjusted resource allocation vector and the target allocation vector is calculated to obtain the allocation coordination loss.
[0144] The mean squared difference between the transition attenuation coefficient and the target transition attenuation coefficient is calculated to obtain the transition attenuation consistency loss.
[0145] Calculate the mean square of the difference between the preemption weight and the target preemption weight, and calculate the mean square of the difference between the post-recovery connectivity features and the pre-preemption connectivity features. Take the average of the two mean squares to obtain the preemption recovery loss for agricultural seasons.
[0146] Multiply the collaborative arrival loss by 0.30, the allocation coordination loss by 0.25, the transfer attenuation consistency loss by 0.20, and the agricultural time preemption recovery loss by 0.25, and then sum them up to obtain the batch joint loss value. Use 0.001 as the initial learning rate for backpropagation to calculate the gradients of the collaborative arrival gate, allocation coordination layer, resource transfer attenuation layer, agricultural time preemption recovery mechanism, and STSGCN backbone network parameters, and update the parameters.
[0147] The average value of the joint loss for all batches in each round is taken to obtain the joint loss value for that round. Starting from the second round, the absolute difference between the joint loss value of the current round and the joint loss value of the previous round is calculated, and the absolute difference is used as the change range of the joint loss value in the current round. When the change range of the joint loss value for 6 consecutive rounds is less than 0.002, the parameter update is stopped, and the training of the improved STSGCN model is completed.
[0148] The collaborative arrival gate receives the resource substitution spatiotemporal graph, aggregates fixed resource branches and equivalent substitution branches according to task nodes, calculates the resource satisfaction rate based on the available quantity of agricultural resources and the corresponding resource demand or equivalent demand, and generates arrival gate coefficients using the Sigmoid function. These arrival gate coefficients are then used to weight resource node features to generate collaborative arrival features, where:
[0149] Collaborative access control includes:
[0150] Task Branch Index Table: Records the fixed resource branches and equivalent alternative branches corresponding to task nodes;
[0151] Resource status register array: Stores the available quantity of resources, resource demand, and equivalent demand according to task number and resource number;
[0152] Resource Satisfaction Rate Calculator: Calculates the ratio of available resources to corresponding demand.
[0153] Gating coefficient mapper: maps resource satisfaction rate using the Sigmoid function;
[0154] Feature-weighted accumulator: Weights resource node features with arrival gate coefficients and outputs collaborative arrival features;
[0155] The process of handling the coordinated arrival door is as follows:
[0156] The task branch index table receives the resource substitution spatiotemporal graph, retrieves fixed resource branches and equivalent substitution branches according to task nodes. Let N be the number of task nodes in the resource substitution spatiotemporal graph, m be the number of resource nodes associated with the current task node, and C be the number of resource types contained in the resource substitution spatiotemporal graph. The task branch index table records the resource number, resource type and branch type of each resource node according to the task number, and arranges the resource nodes associated with the same task node according to the resource number.
[0157] The resource status register array extracts the available quantity of each resource node based on the task number and resource number, and determines the demand baseline based on the branch type. The resource nodes corresponding to the fixed resource branches use the resource demand as the demand baseline, and the resource nodes corresponding to the equivalent replacement branches use the equivalent demand as the demand baseline, forming m sets of available resource quantities and demand baselines, and then transmitting them to the resource satisfaction rate calculator.
[0158] The resource satisfaction rate calculator divides the available resource quantity by the demand baseline in each group to obtain m resource satisfaction rates; the gating coefficient mapper takes the opposite of each resource satisfaction rate, performs natural exponentiation, adds it to 1 and takes the reciprocal to obtain m on-time gating coefficients with values between 0 and 1, and forms an on-time gating coefficient vector of size m×1 according to the resource node arrangement order.
[0159] The resource node feature dimension is fixed at 64 dimensions. The m resource node features corresponding to the current task node are extracted from the node features after transformation by the STSGCN input layer according to the task number and resource number. The m resource node feature matrix with size m×64 is formed according to the resource node arrangement order in the task branch index table.
[0160] The feature weighted accumulator copies the m×1 arrival gating coefficient vector along the feature dimension to an m×64 gating weight matrix. It then multiplies the gating weight matrix element by element with the resource node feature matrix. Next, it accumulates the weighted resource node features corresponding to the same resource type according to the resource type, and divides it by the sum of the arrival gating coefficients of the corresponding resource type and the accumulated value of 10^-6. The 64-dimensional accumulated results are arranged according to the resource type. For resource types that do not exist in the current task node, 64-dimensional zero values are filled to obtain a collaborative arrival feature of size C×64.
[0161] Process N task nodes sequentially according to their task numbers, and combine each C×64-dimensional collaborative arrival feature according to the order of the task nodes to generate a collaborative arrival feature of size N×C×64.
[0162] N, m, and C are dynamically determined based on the number of task nodes in the resource substitution spatiotemporal graph, the number of resource nodes associated with the current task node, and the number of resource types, respectively. The feature dimension of the resource node is fixed at 64, and the normalization stability term is fixed at 10^-6.
[0163] The resource allocation coordination layer receives the coordination arrival features, generates a baseline allocation vector based on the resource allocation relationship, aggregates the coordination arrival features according to resource type to generate the current resource allocation vector, calculates the allocation deviation between the current resource allocation vector and the baseline vector, and performs an exponential mapping on the allocation deviation to generate an allocation coordination coefficient. The corresponding resource features are then adjusted using the allocation coordination coefficient to generate allocation coordination features, where:
[0164] The proportioning coordination layer includes:
[0165] Resource Type Index Table: Records the resource types and resource allocation relationships corresponding to each task node;
[0166] Baseline Allocation Register: Stores the normalized baseline allocation for each resource type;
[0167] Current allocation aggregator: Aggregates collaborative features according to resource type and forms the current resource allocation vector;
[0168] Resource Allocation Deviation Calculator: Calculates the signed component deviation between the current resource allocation vector and the baseline allocation vector;
[0169] Coordination Coefficient Mapper: Performs exponential mapping on proportion deviations and generates proportion coordination coefficients;
[0170] Resource Feature Adjuster: Adjusts the corresponding resource type features using the matching coordination coefficient to generate the adjusted resource matching vector and matching coordination features;
[0171] The specific process of the proportioning and coordination layer is as follows:
[0172] The resource type index table receives collaborative arrival features of size N×C×64. It retrieves the resource allocation relationship corresponding to each task node according to the task number. When a resource allocation relationship exists, it extracts the allocation value of each resource type. Let c be the number of resource types participating in the allocation calculation, and arrange c sets of allocation values and corresponding 64-dimensional collaborative arrival features according to resource type. When no resource allocation relationship exists, it retains the C×64-dimensional collaborative arrival feature corresponding to the current task node.
[0173] For task nodes with resource allocation relationships, the baseline allocation register accumulates c sets of allocation values, divides the allocation value of each resource type by the sum of the allocation values, obtains c normalized baseline allocation components, and forms a baseline allocation vector of size c×1 according to the order of resource types.
[0174] The current resource allocation aggregator calculates the sum of the absolute values of the 64-dimensional collaborative arrival features of each resource type, obtaining c resource feature intensities. Each resource feature intensity is divided by the sum of the c resource feature intensities and the cumulative value of 10^-6 to form a current resource allocation vector of size c×1.
[0175] The ratio deviation calculator subtracts the baseline ratio component from the current resource ratio component for each resource type, resulting in c signed ratio deviations.
[0176] The coordination coefficient mapper takes the negative of each signed ratio deviation and performs natural exponential operation to obtain c ratio coordination coefficients. These coefficients are then arranged into a ratio coordination coefficient vector of size c×1 according to the resource type. The ratio coordination coefficient is less than 1 when the current resource ratio component is higher than the benchmark ratio component, greater than 1 when the current resource ratio component is lower than the benchmark ratio component, and equal to the benchmark ratio component when the ratio coordination coefficient is 1.
[0177] The resource feature adjuster copies the c×1 ratio coordination coefficient vector along the feature dimension to a c×64 coordination weight matrix. The coordination weight matrix is then multiplied element-wise with the c×64-dimensional coordinated features corresponding to the current task node to obtain the adjusted c×64-dimensional resource features.
[0178] Calculate the sum of the absolute values of the 64-dimensional resource features of each resource type after adjustment, and divide by the sum of the absolute values of all resource type features and the cumulative value of 10^-6 to obtain an adjusted resource allocation vector of size c×1. For resource types that do not participate in the resource allocation relationship, retain the original 64-dimensional collaborative arrival features. For resource types that do not exist in the current task node, maintain the 64-dimensional zero value and restore them to C×64-dimensional features according to the order of resource types. For task nodes that do not have a resource allocation relationship, retain the original C×64-dimensional collaborative arrival features. Process N task nodes in sequence to generate a allocation coordination feature of size N×C×64.
[0179] Wherein, N and C are determined based on the number of task nodes and the number of resource types in the collaborative arrival feature, respectively, and c is dynamically determined based on the number of resource types contained in the resource allocation relationship corresponding to the current task node. The resource feature dimension is fixed at 64, and the normalization stability term is fixed at 10^-6.
[0180] The resource transfer attenuation layer receives the allocation coordination features, determines adjacent task nodes corresponding to the same agricultural resource along the spatiotemporal connectivity of resources, determines the transfer distance based on the location of the land parcel, and determines the transfer load in conjunction with the allowed operating period. The transfer load is normalized and exponentially attenuated to generate a transfer attenuation coefficient. This coefficient is then used to adjust the feature propagation weights of the resource spatiotemporal connectivity to generate transfer attenuation features, where:
[0181] The resource transition attenuation layer includes:
[0182] Resource Connection Index Table: Records adjacent task nodes and spatiotemporal connection relationships of the same agricultural resource;
[0183] Land parcel location register: stores the starting and target land parcel locations corresponding to adjacent task nodes;
[0184] Transition Distance Calculator: Calculates the transition distance based on the starting and destination plot locations;
[0185] Job Period Register: Stores the allowed job periods corresponding to adjacent task nodes;
[0186] Relocation Load Calculator: Calculates relocation load based on relocation distance and permitted operating time period;
[0187] Attenuation coefficient mapper: Performs exponential attenuation processing on the normalized transfer load based on the transfer attenuation intensity parameter to generate the transfer attenuation coefficient;
[0188] Propagation weight adjuster: Adjusts the feature propagation weights corresponding to the spatiotemporal connectivity of resources with the transition attenuation coefficient to generate transition attenuation features;
[0189] The process of resource transition attenuation layer processing is as follows:
[0190] The resource connection index table receives the matching coordination features and resource spatiotemporal connection relationships with a size of N×C×64. It retrieves the preceding and following resource nodes corresponding to the same agricultural resource according to the resource number, and determines the preceding task node, the following task node and the corresponding resource type.
[0191] Let the number of spatiotemporal connections of resources be E. When E is greater than 0, E groups of resource connection records are formed according to the resource number and task node arrangement order. When E is equal to 0, the original feature propagation weights of the STSGCN spatiotemporal synchronization graph convolutional layer are maintained, and the matching coordination features are propagated by spatiotemporal synchronization graph convolution according to the original feature propagation weights to generate a transition attenuation feature of size N×C×64. The calculation of transition distance, transition load and transition attenuation coefficient is not performed.
[0192] When E is greater than 0, the land parcel location register extracts the starting land parcel location and the target land parcel location based on the resource connection record of group E, and then converts the starting land parcel location and the target land parcel location into two-dimensional coordinates and transmits them to the transition distance calculator;
[0193] The transition distance calculator calculates the difference in x-coordinate and y-coordinate between the starting plot position and the target plot position, respectively. The square root of the sum of the squares of the x-coordinate difference and the squares of the y-coordinate difference is then used to obtain the E transition distances.
[0194] The job time register extracts the allowed job time periods of the preceding and following task nodes and transmits the corresponding allowed job time periods to the transfer load calculator;
[0195] The transfer load calculator subtracts the end time of the allowed operation period of the preceding task node from the start time of the allowed operation period of the subsequent task node to obtain the transfer time interval. When the transfer time interval is less than 1 minute, it is recorded as 1 minute. The transfer distance is divided by the corresponding transfer time interval to obtain E initial transfer loads. The maximum value of the E initial transfer loads is counted. Each initial transfer load is divided by the maximum value and the cumulative value of 10^-6 to obtain E normalized transfer loads.
[0196] The attenuation coefficient mapper multiplies each normalized transfer load by the transfer attenuation intensity parameter, takes the negative of the product and performs a natural exponential operation to obtain E transfer attenuation coefficients that are greater than 0 and not greater than 1, and forms a transfer attenuation coefficient vector of size E×1 according to the resource connection record order.
[0197] The propagation weight adjuster extracts the original feature propagation weights corresponding to the E resource spatiotemporal connection relationships in the STSGCN spatiotemporal synchronization graph convolutional layer. It multiplies the E×1 transition attenuation coefficients by the corresponding original feature propagation weights to obtain E transition-corrected feature propagation weights. It then writes back the corresponding resource spatiotemporal connection relationships according to the resource number and task node connection position. The updated feature propagation weights are used to perform spatiotemporal synchronization graph convolution propagation on the N×C×64 ratio coordination features, keeping the number of task nodes, the number of resource types, and the feature dimension unchanged, to generate a transition attenuation feature of size N×C×64.
[0198] N and C are determined based on the number of task nodes and the number of resource types in the matching and coordination features, respectively. E is dynamically determined based on the number of spatiotemporal connections of resources. The resource feature dimension is fixed at 64, the minimum transition time interval is set to 1 min, the normalization stability term is fixed at 10^-6, and the initial value of the transition attenuation intensity parameter is set to 1.0. It is iteratively updated during the training of the improved STSGCN model. When the update value is less than 0.1, it is set to 0.1, and when the update value is greater than 3.0, it is set to 3.0.
[0199] The transition attenuation characteristics are processed using an agricultural time preemption and recovery mechanism. Task nodes corresponding to the same agricultural resource and with allowed overlapping work periods are identified. The agricultural time urgency value is calculated based on the allowed work periods and the order of agricultural time, and a preemption weight is generated using the Softmax function. The corresponding feature connection weights are adjusted according to the preemption weights, and suppressed connection features are retained as interruption residuals. When the overlapping period ends and the interrupted production task is still within the allowed work period, the residuals are added back to generate the spatiotemporal features of resource allocation, where:
[0200] The agricultural season preemption and recovery mechanism has three state settings: normal propagation state, resource preemption state, and interruption recovery state.
[0201] Normal propagation state: There is no overlap in allowed operation periods between task nodes corresponding to the same agricultural resource, and the current feature connection weights are maintained;
[0202] Resource preemption status: At least two task nodes corresponding to the same agricultural resource have overlapping allowed operation periods. Adjust the corresponding feature connection weights according to the agricultural time urgency value and save the interruption residuals.
[0203] Interruption recovery status: If the interrupted production task is still in the allowed operation period after the overlapping period ends, the interruption residual is added back; if the allowed operation period of the interrupted production task has ended, the interruption residual is cleared.
[0204] The specific process of the agricultural season recovery mechanism is as follows:
[0205] The receiving area attenuation feature has a size of N×C×64. The task nodes corresponding to the same agricultural resource are grouped according to the resource number. The 64-dimensional attenuation feature of each task node corresponding to the resource type position is used as the connection feature. The feature connection weight is initially set to 1.
[0206] The start and end times of the allowed work period are taken as time events and arranged by time. The time interval between adjacent time events is taken as the detection interval. The detection intervals with a continuous number of task nodes in the allowed work period are merged into overlapping time periods. When the overlap starts, the resource preemption state is entered and when the overlap ends, the interruption recovery state is entered.
[0207] Within the overlapping time period, the preemptive calculation interval is divided according to adjacent time events. Let the number of task nodes participating in the same agricultural resource competition be q. Subtract the start time of the current preemptive calculation interval from the end time of the allowed operation period to obtain q remaining allowed time periods. Divide the remaining allowed time period by the sum of the maximum remaining allowed time period and 10^-6, and then subtract the calculation result from 1 to obtain the time-urgent component.
[0208] According to the order of agricultural time in the resource substitution spatiotemporal diagram, q task nodes are assigned sequential values from q to 1 from front to back, and the agricultural time urgency component is obtained by dividing each sequential value by the sum of the sequential values.
[0209] The time urgency component and the agricultural time sequence urgency component are multiplied by their corresponding weights and then summed to obtain q agricultural time urgency values. These values are then normalized using the Softmax function to generate a q×1 dimensional preemption weight vector.
[0210] The task node with the largest preemption weight is determined. If the preemption weights are the same, the task node that comes first is determined according to the order of the agricultural time. The 64-dimensional connection features before the weight adjustment are recorded as the connection features before preemption. The current feature connection weight and 64-dimensional connection features of the determined task node are kept unchanged. The preemption weight is multiplied by the current feature connection weight to obtain the adjusted feature connection weight. The preemption weight is multiplied by the connection features before preemption to obtain the adjusted 64-dimensional connection features. The adjusted 64-dimensional connection features are subtracted from the connection features before preemption and then multiplied by the interruption residual retention coefficient to obtain the 64-dimensional interruption residual.
[0211] The interruption residuals within the same overlapping time period are collected according to resource number and task number and accumulated dimension by dimension to form a 64-dimensional cumulative interruption residual;
[0212] After reaching the overlap termination time, the system enters the interruption recovery state. If the overlap termination time is earlier than the end time of the allowed operation period of the interrupted production task, the cumulative interruption residual is added dimension by dimension to the 64-dimensional connection feature after the overlap ends, and the recovered connection feature is obtained and the cumulative interruption residual is cleared.
[0213] If the overlap termination time is not earlier than the allowable operation period termination time, the accumulated interruption residual is directly cleared, and the normal propagation state is restored after processing is completed.
[0214] All agricultural resources and their corresponding overlapping time periods are processed according to resource number. The connection features under normal propagation state, the connection features after adjustment under resource preemption state, and the connection features after recovery under interruption recovery state are taken as the final connection features corresponding to each resource number.
[0215] When the same task node and resource type location correspond to one resource number, the final connection feature is written directly. When they correspond to multiple resource numbers, the final connection feature is averaged dimension by dimension and then written to generate a resource configuration spatiotemporal feature of size N×C×64.
[0216] Wherein, N and C are determined based on the number of task nodes and the number of resource types in the transition decay feature, respectively, and q is dynamically determined based on the number of task nodes participating in the competition within the current preemption calculation interval. The resource feature dimension is fixed at 64, the normalization stability term is fixed at 10^-6, the initial values of the time urgency weight and the agricultural time order urgency weight are 0.60 and 0.40, respectively, the training update value is limited to between 0.05 and 0.95 and normalized to a sum of 1, the interruption residual retention coefficient is initially 0.80, and the training update value is limited to between 0.50 and 1.00;
[0217] This invention structurally optimizes the traditional STSGCN model and proposes a spatiotemporal feature modeling method for multi-constraint configuration scenarios of agricultural production resources. It introduces a collaborative availability gate to adjust resource features according to the actual availability of agricultural resources, so that the resource features can reflect the satisfaction relationship between agricultural resources and production task requirements, and reduce the interference of actual resource shortage on configuration features.
[0218] To address the constraints on the allocation of different agricultural resources, an allocation coordination layer is introduced. Based on the deviation between the actual resource allocation and the benchmark allocation, the corresponding resource characteristics are adjusted to differentiate between situations where the resource allocation is too high or too low, thereby enhancing the consistency between resource combination and production task requirements.
[0219] To address the migration constraints caused by the cross-plot allocation of agricultural resources, a resource migration attenuation layer is introduced. This layer incorporates migration distance and permitted operation time into the spatiotemporal connectivity of resources, thereby giving lower propagation weights to resource connections with high migration loads and weakening resource associations that do not conform to actual migration conditions.
[0220] To address the situation where the same agricultural resource experiences time conflicts among multiple production tasks, a time-seizure recovery mechanism is introduced. This mechanism adjusts the feature connections under resource competition based on the urgency of the time, retains suppressed features, and restores them according to the allowed working hours after the conflict ends, thereby reducing the loss of task features caused by temporary resource seizure.
[0221] The improved STSGCN model not only retains the original spatiotemporal synchronous graph convolution modeling capability, but also realizes the joint modeling of agricultural resource availability, resource allocation relationship, cross-plot transfer constraints and agricultural time competition relationship. This makes the generated spatiotemporal characteristics of resource allocation more consistent with the actual resource status under the combined effect of multiple constraints in agricultural production, and improves the rationality and spatiotemporal consistency of agricultural production resource allocation results.
[0222] In this embodiment, generating the candidate resource configuration sequence includes:
[0223] Based on the task number and allowed work period, the spatiotemporal characteristics of resource allocation are divided, and the time-sharing workload of each production task in each allowed work period is determined, where:
[0224] The workload for each task is determined as follows:
[0225] According to the task number, extract the resource features corresponding to each production task from the spatiotemporal features of resource allocation, match the allowed operation time periods in the agricultural production resource dataset, and map the corresponding resource features to each allowed operation time period according to the start and end times of each allowed operation time period.
[0226] For each allowed job time period, the characteristics of each resource type in the available state are collected, the mean of the 64-dimensional resource characteristics is calculated and mapped by the Sigmoid function to obtain the resource allocation coefficient;
[0227] The rigid resource demand and the alternative resource demand are collected according to the task resource substitution table. The operational capacity, allowable operation period and corresponding resource allocation coefficient of agricultural resources are multiplied to obtain the operational quantity of each agricultural resource.
[0228] The achievable workload of agricultural resources corresponding to the same rigid resource demand is summed up separately, and the achievable workload of the same substitutable resource demand is converted according to the equivalent substitution relationship to obtain the achievable workload of each resource demand. The minimum value among them is taken as the achievable workload of the allowed working period.
[0229] The initial remaining demand is determined by using the required workload of the production task as the initial remaining demand workload. The executable workload and the remaining demand workload are compared in chronological order for each allowed work period. The smaller value is determined as the time-sharing workload, and the time-sharing workload is deducted from the remaining demand workload.
[0230] Record the corresponding time-sharing workload according to the task number and the allowed work period, and obtain the time-sharing workload of each production task in each allowed work period;
[0231] Arrange the time-sharing workload of the same production task in chronological order, determine the workload variation between adjacent time periods, and determine the resource allocation adjustment based on the operational capacity of agricultural resources and the duration of the corresponding allowable operational period, wherein:
[0232] The specific amount of resource allocation adjustment is as follows:
[0233] Arrange the time-sharing workload corresponding to each allowed work period of the same production task in chronological order, and subtract the time-sharing workload of the previous allowed work period from the time-sharing workload of the next allowed work period to obtain the workload change value between adjacent time periods.
[0234] Determine the rigid resource requirements and alternative resource requirements from the task resource substitution table according to the task number. For rigid resource requirements, obtain the operation capacity of each available agricultural resource of the corresponding resource type in adjacent allowed operation periods. Select the minimum operation capacity of each period and multiply it by the duration of the corresponding allowed operation period to obtain the amount of operation that can be completed by a single resource in each period.
[0235] For the demand for alternative resources, the operational capacity of each available agricultural resource is calculated according to the equivalent substitution relationship. The minimum equivalent operational capacity for each time period is selected and multiplied by the duration of the corresponding allowed operational time period to obtain the equivalent operational quantity that can be completed by a single resource for each time period.
[0236] Divide the time-sharing workload of the previous allowed work period by the corresponding workload that can be completed by a single resource or the equivalent workload that can be completed by a single resource and round up to obtain the previous resource allocation amount.
[0237] Add the time-sharing workload of the previous allowed work period to the workload change value, then divide by the single-resource workload or single-resource equivalent workload corresponding to the next allowed work period and round up to obtain the next resource allocation amount.
[0238] Subtracting the previous resource allocation from the next resource allocation, if the result is greater than 0, it is determined as an increase in allocation; if the result is less than 0, the absolute value is determined as a decrease in allocation; if the result is equal to 0, the resource allocation adjustment is set to 0.
[0239] Based on the production task, adjacent allowed operation periods, and resource demand records, the resource allocation adjustment amount is obtained by increasing or decreasing the allocation amount and the direction of the allocation adjustment.
[0240] Based on the resource allocation adjustment amount, the corresponding agricultural resources are increased or decreased. Agricultural resources with the same resource number and a positive adjusted allocation amount in adjacent time periods are maintained in continuous allocation, generating a time period resource allocation record, where:
[0241] Generate time-period resource configuration records, specifically as follows:
[0242] The first allowable operation period is determined according to the time sequence of production tasks. Based on the time-sharing operation volume of the first allowable operation period, available agricultural resources are arranged according to the relocation distance within the corresponding rigid resource type or substitutable resource range. The operation volume that each agricultural resource can complete in the current period is accumulated in turn. When the accumulated value reaches the time-sharing operation volume, the selection stops. The number of selected agricultural resources is determined as the initial resource allocation quantity, forming the agricultural resource allocation for the first allowable operation period.
[0243] Process subsequent permitted operation periods sequentially. First, remove agricultural resources that are no longer available in the current permitted operation period from the previous permitted operation period, and then replenish the same number of available agricultural resources in the order of migration distance within the corresponding rigid resource type or substitutable resource range.
[0244] When the resource allocation adjustment amount is to increase the allocation amount, the corresponding amount of agricultural resources will be added from the remaining available agricultural resources. When the resource allocation adjustment amount is to decrease the allocation amount, the corresponding amount of agricultural resources will be reduced in reverse order according to the relocation distance. When the resource allocation adjustment amount is 0, the agricultural resource allocation after the completion of the available state replacement will be maintained.
[0245] Compare the resource numbers of adjacent permitted operation periods. For agricultural resources with the same resource number and a positive allocation after the current permitted operation period adjustment, keep the original resource number and allocate them continuously. For other agricultural resources, re-record them according to the adjustment results of the current permitted operation period.
[0246] Generate a time-period resource configuration record by recording resource type, resource number, adjusted configuration amount, and continuous configuration relationship according to task number and allowed work period;
[0247] Arrange the time-slot resource allocation records according to production tasks and permitted operating periods to generate a candidate resource allocation sequence.
[0248] In this embodiment, generating the target resource configuration sequence includes:
[0249] Candidate resource allocation sequences are divided according to task numbers. Agricultural resource allocation relationships with the same resource number and consecutive occupation periods within the same production task are merged to generate task allocation segments, where:
[0250] The task configuration section is generated as follows:
[0251] Collect time period resource allocation records in the candidate resource allocation sequence according to task number, determine the allowed operation time period corresponding to agricultural resources with positive adjusted allocation amount as the occupation time period, and arrange the agricultural resource allocation relationship corresponding to the same production task according to the occupation start time.
[0252] For the same production task, agricultural resource allocation relationships are further collected according to resource number. The occupation time periods of adjacent agricultural resource allocation relationships are compared in turn. When the end time of the previous occupation time period is the same as the start time of the next occupation time period, the two occupation time periods are merged, and the next occupation time period is compared.
[0253] When adjacent occupation periods are not consecutive, the current merger ends. The start time of the first occupation period after the merger and the end time of the last occupation period are taken as the start time and end time of the task configuration segment, respectively. Agricultural resource allocation relationships that have not been merged consecutively form a separate task configuration segment.
[0254] Arrange the task configuration segments according to the task number and the time period occupied, and record the task number, resource type, resource number, start time of occupation and end time of occupation to generate the task configuration segment;
[0255] Candidate resource allocation sequences are divided according to resource numbers. The allocation relationships of production tasks corresponding to the same agricultural resource are arranged according to the occupation period, and the resource occupation segments are divided according to the start and end times of each production task.
[0256] The resource usage segments are divided as follows:
[0257] Collect time-period resource allocation records in the candidate resource allocation sequence according to resource number, and arrange the time-period resource allocation records corresponding to the same agricultural resource according to the start time of occupation.
[0258] Extract the start and end times of resource allocation records for each time period, arrange them in chronological order and remove duplicate times, and determine the time interval between adjacent times as the resource occupation interval.
[0259] For each resource occupancy interval, identify the production tasks that are in an occupied state within the interval, and record the task number, resource number, occupancy start time, and occupancy end time;
[0260] The resource occupancy intervals in the occupancy period are arranged in order of occupancy time and determined as resource occupancy segments, and resource occupancy segments corresponding to the same agricultural resource are generated.
[0261] Using the start and end times of the resource occupation segment as the boundary of the resource occupation segment, locate the boundary of the resource occupation segment within the time period occupied by the task configuration segment, and divide the task configuration segment according to the boundary of the resource occupation segment to generate the divided task configuration segment, wherein:
[0262] The configuration segment for generating the splitting task is as follows:
[0263] Match the task configuration segment with the corresponding agricultural resource's resource occupation segment according to the resource number, extract the occupation start time and occupation end time of each resource occupation segment, and form the resource occupation segment boundary;
[0264] For each task configuration segment, filter out resource occupation segment boundaries that are later than the start time of the task configuration segment's occupation and earlier than the end time of the occupation, and arrange them in chronological order and remove duplicate boundaries;
[0265] Starting from the beginning of the task configuration segment's occupation, the task configuration segment is divided sequentially according to the resource occupation segment boundary, and ending from the end of the task configuration segment's occupation, forming a continuous segmentation interval. When there is no internal resource occupation segment boundary, the original task configuration segment remains unchanged.
[0266] Assign the task number, resource type, and resource number of the original task configuration segment to each segmentation interval, update the corresponding occupied time period with the start and end times of each segmentation interval, and arrange them in chronological order to generate the segmented task configuration segment;
[0267] Align the task allocation segments with their corresponding resource occupancy segments according to resource number and occupancy time period. For task allocation segments with overlapping occupancy time periods, extend them to the idle time period of the corresponding agricultural resource within the allowed operation time period according to the order of agricultural time. Then, reorganize them according to the order of occupancy time periods to generate the target resource allocation sequence, where:
[0268] The target resource configuration sequence is generated as follows:
[0269] The task configuration segments are matched with the corresponding resource occupancy segments according to the resource number. The start time and end time of occupancy are compared to determine the task configuration segments where the occupancy periods overlap. The time intervals within the allowed operation period of the corresponding production task that are not covered by the resource occupancy segments are determined as the idle periods of the corresponding agricultural resources.
[0270] For the segmented task configuration segments with overlapping time periods, the corresponding production tasks are arranged according to the agricultural time sequence in the resource substitution time-space diagram. The production tasks arranged first retain their current time period, and the remaining production tasks are postponed in order of arrangement.
[0271] Calculate the occupation duration of the task configuration segment to be extended. Within the allowed operation period of the corresponding production task, match the idle time of agricultural resources in chronological order after the original occupation start time. Determine the earliest idle time that can accommodate the occupation duration as the extension position, and use the start time of the idle time as the new occupation start time. Determine the new occupation end time according to the occupation duration.
[0272] After each segment of the task configuration is extended, the new time slot is updated to the resource occupation segment of the corresponding agricultural resource, and the remaining idle time slot is re-determined. Then all the next segment of the task configuration are processed until the time slots corresponding to the same agricultural resource no longer overlap.
[0273] The adjusted task configuration segments are arranged in order of resource number and time period, and then reorganized according to task number, resource type, resource number and adjusted time period to generate target resource configuration sequence.
[0274] In this embodiment, generating agricultural production resource allocation results includes:
[0275] The target resource allocation sequence is divided according to the task number, the allocation relationship of each agricultural resource is mapped to the corresponding production task, and the corresponding plot is determined according to the production task to generate the task plot configuration record.
[0276] Agricultural resources in the task plot allocation records are collected according to resource number. The quantity of agricultural resources in each production task's occupied time period is summarized, the allocation quantity is determined, and the occupied time period is retained to generate a resource allocation quantity record, in which:
[0277] Generate resource allocation records, specifically:
[0278] Based on the production tasks and land parcel allocation records, extract the resource number, resource type, start time of occupation, and end time of occupation for each agricultural resource, and remove duplicate allocation relationships according to task number, resource number, and occupation period.
[0279] The start and end times of occupation of each agricultural resource under the same production task are arranged in chronological order, and the occupation intervals are divided by adjacent times to determine the agricultural resources in the occupation state within each occupation interval.
[0280] Collect resource numbers within each occupied interval according to resource type, count the number of different resource numbers, determine the configuration quantity of the corresponding resource type based on the statistical results, and retain the start and end times of the occupied interval.
[0281] Record resource allocation quantities by task number, land parcel, resource type, resource number set, allocation quantity, and occupation period.
[0282] Resource allocation records are arranged according to their occupancy periods. Records with the same resource number and consecutive occupancy periods within the same production task and plot are merged to determine the occupancy period for each agricultural resource, generating a resource allocation execution record. Among these:
[0283] Generate resource configuration execution records, specifically:
[0284] Based on the resource allocation records collected according to production tasks and land parcels, the resource number and occupation period of each agricultural resource are extracted from the resource number set, and the agricultural resource allocation relationship is arranged according to the resource number and the start time of occupation.
[0285] For the same production task, the same plot of land, and the same resource number, adjacent occupation periods are compared sequentially. If the end time of the previous occupation period is the same as the start time of the next occupation period, the two occupation periods are merged, and the next occupation period is compared.
[0286] When adjacent occupation periods are not consecutive, the current merger ends. The first occupation start time and the last occupation end time in the consecutive occupation period are determined as the occupation start time and occupation end time of agricultural resources, respectively. Occupation periods that do not undergo consecutive mergers remain unchanged.
[0287] Record resource configuration execution records by task number, land parcel, resource type, resource number, and the merged occupation period.
[0288] The resource allocation execution records are arranged according to production tasks and land parcels. The allocation amount and occupation period of each agricultural resource are summarized to generate the agricultural production resource allocation results.
[0289] refer to Figure 3 An agricultural production resource allocation system based on multi-constraint optimization includes the following modules:
[0290] The agricultural data organization module is used to organize agricultural production data by plot and production cycle to generate agricultural production resource datasets.
[0291] The resource demand processing module is used to distinguish between rigid resource demands and alternative resource demands, and to perform operational capacity conversion on alternative resource demands to generate a task resource substitution table.
[0292] The resource spatiotemporal mapping module is used to construct fixed resource branches and equivalent substitution branches, organize branches according to the order of agricultural seasons and the location of land parcels, and generate a resource substitution spatiotemporal map.
[0293] The spatiotemporal feature generation module is used to process the resource substitution spatiotemporal graph using the improved STSGCN model and generate spatiotemporal features of resource allocation.
[0294] The candidate configuration generation module is used to adjust the allocation of agricultural resources according to changes in the time-sharing workload and generate a sequence of candidate resource configurations.
[0295] The target configuration refactoring module is used to refactor the candidate resource configuration sequence based on the boundary relationship between the task configuration segment and the resource occupancy segment, and generate the target resource configuration sequence.
[0296] The configuration result generation module is used to map the target resource configuration sequence to production tasks and plots, and generate agricultural production resource configuration results.
[0297] Example 1: To verify the feasibility of this invention in practice, it was applied to a continuous agricultural production cycle. The system received agricultural production data from six plots, including 18 production task records, 11 types of agricultural resource records, and 36 sets of production constraint records. The six plots were designated A1 to A6, and their locations were represented using local planar coordinates. A1's coordinates were (0.0, 0.0), A2's were (0.8, 0.4), A3's were (1.6, 0.7), A4's were (2.3, 1.1), A5's were (1.0, 1.8), and A6's were (2.1, 2.0). The distance between adjacent plots ranged from 0.63 to 1.36 km. Production tasks included land preparation, sowing, plant protection, and irrigation. The workload of a single task ranged from 12.0 to 24.0 hectares, and the allowable work period was 150 to 420 minutes.
[0298] The system collects agricultural production data according to plot number. Plot A1 corresponds to 3 production tasks and 5 agricultural resources, plot A2 corresponds to 3 production tasks and 4 agricultural resources, and other plots correspond to 2 to 4 production tasks respectively. The system divides the production cycle according to the allowed operation period and the order of agricultural time, organizing the tasks of land preparation, sowing, plant protection, and irrigation in sequence, and mapping the corresponding resources based on the location and occupation period of agricultural resources. After processing, it generates 6 plot production data groups, 14 plot cycle task groups, and 18 plot cycle resource units, forming an agricultural production resource dataset.
[0299] In the task resource requirement processing, plant protection task T08 of A3 is used as a specific sample. T08 has a workload of 20.0 ha and an allowed working period of 240 minutes. The resources available for this task include ground-based plant protection equipment R04 and unmanned plant protection equipment R05, thus it is identified as a replaceable resource requirement. R04 has a working capacity of 7.2 ha / h, and R05 has a working capacity of 10.0 ha / h. Dividing the required workload by the product of the working capacity and the allowed working period, the equivalent requirement for R04 is 0.694, and for R05 it is 0.500. Seeding task T05 of A2 only allows the use of precision seeding equipment R07, with a resource requirement of 1 unit, thus it is identified as a rigid resource requirement. After processing 18 tasks, the system obtained 7 rigid resource requirements and 11 replaceable resource requirements, generating a task resource substitution table.
[0300] The system establishes task nodes and resource nodes according to task numbers. Seven rigid resource requirements form seven fixed resource branches, and eleven substitutable resource requirements expand into 24 equivalent substitution branches. Task nodes are arranged according to the order of agricultural time, and resource nodes of the same agricultural resource in adjacent production tasks are connected based on the location of the plots. For example, R07 first corresponds to planting task T05 of A2, and then to planting task T17 of A6, with a distance of 2.35km between the two plots, forming one resource spatiotemporal connection relationship. All data forms a total of 18 task nodes, 11 resource nodes, 31 resource branches, and 16 resource spatiotemporal connections, generating a resource substitution spatiotemporal map.
[0301] The improved STSGCN model was trained using 2400 sets of agricultural production resource allocation samples, with 1680 sets as the training set, 360 sets as the validation set, and 360 sets as the test set. Each set of samples contained 4–8 plots, 8–20 production tasks, and 6–15 agricultural resources. The initial joint loss was 1.762, which decreased to 0.126 after the 52nd training round. The joint loss values for the six consecutive rounds were 0.1314, 0.1300, 0.1288, 0.1277, 0.1268, and 0.1261, respectively, with adjacent changes all less than 0.002, indicating that the model training was complete.
[0302] After T08 enters the collaborative arrival gate, the available quantity of R04 is 1, the equivalent demand is 0.694, and the resource satisfaction rate is 1.441; the available quantity of R05 is 1, the equivalent demand is 0.500, and the resource satisfaction rate is 2.000. After processing with the Sigmoid function, the arrival gate coefficients are 0.809 and 0.881, respectively, with the resource node corresponding to R05 receiving a higher feature weight. For the A2 seeding task T05, the precision seeding equipment R07 is already in A2, but the supporting material equipment R08 needs to be transferred from A1 by 0.89km, with its actual arrival time 18 minutes later than R07. The collaborative arrival gate postpones the effective resource status of this task until both resources arrive simultaneously.
[0303] When the ratio coordination layer processes T05, the baseline ratio vector of the sowing equipment and the material matching equipment is (0.50, 0.50), the current resource ratio vector is (0.61, 0.39), and the sum of the absolute values of the two-dimensional ratio deviations is 0.22. After exponential mapping, the ratio coordination coefficient is obtained as 0.803, and the resource characteristics corresponding to R08 are adjusted accordingly, so that the corrected current resource ratio vector becomes (0.52, 0.48).
[0304] The resource transfer attenuation layer continues to process the spatiotemporal connectivity of resources between T05 and T17 for R07. Based on the locations of A2 and A6, the straight-line distance is calculated to be 2.35 km. After considering the detour via field roads, the simulated transfer distance is 2.68 km, with a usable transfer time of 42 minutes, corresponding to a normalized transfer load value of 0.64. After exponential decay, the transfer attenuation coefficient is 0.527. The feature propagation weight connecting R07 to T17 is adjusted from 0.76 to 0.40 to prevent the model from prematurely forming a high-intensity configuration before R07 has completed its transfer.
[0305] In the agricultural time preemption and recovery process, A3 plant protection task T08 and A4 plant protection task T11 simultaneously request R04, with a 96-minute overlap in their allowed operation periods. Based on the remaining length of the allowed operation period and the order of agricultural time, the agricultural time urgency value is calculated. Using the Softmax function, the preemption weights for T08 and T11 are 0.38 and 0.62 respectively. The system prioritizes connecting R04 to T11, retaining the R04 connection feature corresponding to T08 as an interruption residual, while simultaneously increasing the weight of the equivalent substitution branch between T08 and R05. After the overlap period ends, T08 remains within the allowed operation period, and the retained interruption residual is added back to the original connection feature, ultimately generating the spatiotemporal features of resource allocation.
[0306] Based on the spatiotemporal characteristics of resource allocation, the system determined that the time-sharing workload of T08 in three consecutive time periods were 6.0 ha, 8.0 ha, and 6.0 ha, respectively, with adjacent workload changes of 2.0 ha and -2.0 ha, respectively. Based on the operational capacity of R05 and the duration of the corresponding allowed operational period, the system maintained the R05 configuration at 1 unit, without incurring additional switching requirements. After processing all 18 tasks, a total of 46 time-period resource allocation records were generated, with continuous resource allocation accounting for 87.0% of all resource allocations, thus generating a candidate resource allocation sequence.
[0307] The system further divides the candidate resource allocation sequence according to production tasks, forming 27 task allocation segments. These segments are then re-divided according to resource numbers, forming 24 resource occupancy segments. The T05 occupancy period corresponding to R07 is 120–312 min, and the initial occupancy period of T17 is 300–516 min, with a 12-min overlap. The system segments the corresponding task allocation segments based on the start and end times of the resource occupancy segments. According to the agricultural time sequence, T17 is postponed to 347 min after R07 becomes idle, including a 35-min transition time. The new occupancy period is 347–563 min, still within the allowed operating period of 300–600 min for T17. Six resource occupancy overlaps were detected among all candidate configurations. After segmentation and postponement, all six overlaps were eliminated, generating the target resource allocation sequence.
[0308] The system maps the target resource allocation sequence to 6 plots and 18 production tasks, generating a total of 18 task plot allocation records. After aggregation, 31 resource allocation quantity records and 24 resource allocation execution records are obtained. Specifically, R04 is allocated to both T11 and another plant protection task, accumulating 210 minutes of usage; R05 is allocated to T08, accumulating 120 minutes; and R07 is allocated to both T05 and T17, with a 35-minute idle period reserved in between. The final agricultural production resource allocation results do not contain any records of duplicate usage of the same resource within the same time period.
[0309] To verify the effectiveness of the method of this invention, a comparison was made between the traditional fixed resource type matching method and the method of sorting by allowed working time period on the same 360 test samples. The proportion of executable configuration schemes using the traditional method was 82.5%, while that using the method of this invention was 96.1%; the traditional method had an average of 2.8 resource occupation conflicts per production cycle, while the method of this invention had 0.5; the proportion of tasks exceeding the allowed working time period limit using the traditional method was 12.2%, while that using the method of this invention was 3.3%; the continuous configuration retention rate of agricultural resources using the traditional method was 69.4%, while that using the method of this invention was 89.1%; the average resource transfer distance using the traditional method was 11.5 km, while that using the method of this invention was 8.4 km; the proportion of repeated occupation of the same resource using the traditional method was 8.9%, while that using the method of this invention was 1.6%; the average time for multiple resource allocation ratios to be unmet using the traditional method was 64 minutes, while that using the method of this invention was 15 minutes.
[0310] As can be seen from Example 1, this invention starts with the organization of agricultural production data, distinguishes and calculates rigid resource demands and substitutable resource demands, and forms a continuous processing chain through a resource substitution spatiotemporal diagram, an improved STSGCN model, time-sharing resource allocation, and the reconstruction of task allocation segments and resource occupancy segments. Under the same simulated production conditions, this invention can reduce the repeated occupation and ineffective transfer of agricultural resources, improve the multi-resource coordination and availability rate and the continuous allocation retention rate, and make the final agricultural production resource allocation result more consistent with the location of the plot, the order of agricultural time, the allowed operation period, and the actual resource occupancy status.
[0311] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for allocating agricultural production resources based on multi-constraint optimization, characterized in that, include: Collect agricultural production data, organize it by plot and production cycle, and generate an agricultural production resource dataset; Based on the agricultural production resource dataset, rigid resource demand and substitutable resource demand are distinguished, and substitutable resource demand is uniformly converted according to operational capacity to generate a task resource substitution table. Based on the task resource substitution table, establish fixed resource branches and equivalent substitution branches, organize branches according to the order of agricultural seasons and the location of land plots, and generate a resource substitution spatiotemporal map. The resource substitution spatiotemporal map is input into the improved STSGCN model to generate resource allocation spatiotemporal features. The improved STSGCN model includes a collaborative arrival gate, a ratio coordination layer, a resource transfer attenuation layer, and an agricultural season preemption and recovery mechanism. The time-sharing workload of production tasks is determined based on the spatiotemporal characteristics of resource allocation. Agricultural resource allocation is adjusted according to the changes in workload between adjacent time periods, and continuously allocated agricultural resources are retained to generate a candidate resource allocation sequence. The candidate resource allocation sequence is expanded into task allocation segments and resource occupation segments according to production tasks and agricultural resources, respectively. The task allocation segments are then divided and reorganized by the boundaries of the resource occupation segments to generate the target resource allocation sequence. The target resource allocation sequence is mapped to production tasks and land parcels to determine the allocation amount and occupation period of agricultural resources, and to generate agricultural production resource allocation results.
2. The method for allocating agricultural production resources based on multi-constraint optimization according to claim 1, characterized in that, The agricultural production data specifically includes plot data, production task data, agricultural resource data, and production constraint data. The plot data includes plot number and plot location. The production task data includes task number, operation type, operation volume, and resource requirement. The agricultural resource data includes resource number, resource type, applicable operation type, operation capacity, available quantity, location, and occupation period. The production constraint data includes the order of agricultural time for production tasks, allowed operation periods, and resource allocation relationships.
3. The method for allocating agricultural production resources based on multi-constraint optimization according to claim 1, characterized in that, The generated agricultural production resource dataset includes: Collect agricultural production data, group the production tasks and agricultural resources corresponding to the same plot according to the plot number, and generate plot production data groups; The production cycles in the production data group of the plot are divided according to the allowed working time period and the order of agricultural time, and the production tasks in each production cycle are arranged according to the order of agricultural time to generate the plot cycle task group. Based on the operation type of the production task and the applicable operation type of the agricultural resources, the agricultural resources are mapped to the corresponding production tasks in the plot periodic task group, and the corresponding agricultural resources are organized according to the location and occupation period of the agricultural resources to generate plot periodic resource units. Arrange the periodic resource units of the land parcels according to their parcel numbers and production cycles, and retain the correspondence between production tasks and agricultural resources to generate an agricultural production resource dataset.
4. The method for allocating agricultural production resources based on multi-constraint optimization according to claim 1, characterized in that, The generated task resource substitution table includes: The resource demand and agricultural resources in the agricultural production resource dataset are collected according to the task number. The resource demand is divided into rigid resource demand and substitutable resource demand according to the number of resource types that can perform the same operation, and a task resource demand record is generated. For the alternative resource requirements in the task resource requirement record, the workload of the corresponding production task is determined as the required workload, and the corresponding agricultural resources are aggregated according to the resource type to generate alternative resource groups. The equivalent demand for each resource type is determined by dividing the demand amount by the product of the operational capacity of each agricultural resource in the alternative resource group and the duration of the corresponding allowed operational period, and resource equivalent substitution records are generated. Merge task resource requirement records and equivalent resource substitution records according to task number, retain the resource type and resource requirement quantity corresponding to rigid resource requirements, and arrange the resource type and equivalent requirement quantity corresponding to substitute resource requirements to generate a task resource substitution table.
5. The method for allocating agricultural production resources based on multi-constraint optimization according to claim 1, characterized in that, The generation of the resource substitution spatiotemporal graph includes: Arrange the task resource substitution table according to the task number, and establish task nodes and resource nodes based on production tasks and corresponding agricultural resources; Connect the resource nodes corresponding to rigid resource requirements directly to the task nodes, and mark the corresponding resource requirements to generate fixed resource branches. Connect each resource node corresponding to the alternative resource demand to the same task node, and mark the corresponding equivalent demand quantity to generate an equivalent alternative branch. Arrange each task node and its corresponding fixed resource branch and equivalent substitute branch according to the order of agricultural time. Based on the location of the plot, connect the resource nodes corresponding to the same agricultural resource in the adjacent task nodes according to the order of agricultural time to generate the spatiotemporal connection relationship of resources. Combine task nodes, resource nodes, fixed resource branches, equivalent alternative branches, and resource spatiotemporal connections to generate a resource substitution spatiotemporal graph.
6. The method for allocating agricultural production resources based on multi-constraint optimization according to claim 1, characterized in that, The spatiotemporal characteristics of the generated resource configuration include: An improved STSGCN model is constructed, which includes a collaborative arrival gate, a resource allocation coordination layer, a resource transfer attenuation layer, and a preemptive recovery mechanism for agricultural seasons. The improved STSGCN model was trained by constructing a joint loss function using collaborative arrival loss, allocation coordination loss, transfer attenuation consistency loss, and agricultural time preemption recovery loss. The parameters of the collaborative arrival gate, allocation coordination layer, resource transfer attenuation layer, agricultural time preemption recovery mechanism, and STSGCN backbone network were iteratively updated. The training was completed when the change of the joint loss value was less than 0.002 for 6 consecutive rounds. The collaborative arrival gate receives the resource substitution spatiotemporal map, gathers fixed resource branches and equivalent substitution branches according to task nodes, calculates the resource satisfaction rate based on the available quantity of agricultural resources and the corresponding resource demand or equivalent demand, and generates arrival gate coefficients through the Sigmoid function. The resource node features are weighted by the arrival gate coefficients to generate collaborative arrival features. The allocation coordination layer receives the coordination arrival features, generates a benchmark allocation vector based on the resource allocation relationship, gathers the coordination arrival features according to resource type to generate the current resource allocation vector, calculates the allocation deviation between the current resource allocation vector and the benchmark vector, and performs an exponential mapping on the allocation deviation to generate an allocation coordination coefficient. The allocation coordination coefficient is used to adjust the corresponding resource features to generate allocation coordination features. The resource transfer attenuation layer receives the allocation coordination features, determines the adjacent task nodes corresponding to the same agricultural resource along the spatiotemporal connection relationship of the resources, determines the transfer distance according to the location of the plot, and determines the transfer load in combination with the allowed operation period. The transfer load is normalized and exponentially attenuated to generate the transfer attenuation coefficient. The feature propagation weight of the spatiotemporal connection relationship of the resources is adjusted with the transfer attenuation coefficient to generate the transfer attenuation feature. The transition attenuation feature is processed by the agricultural time preemption and recovery mechanism. The task nodes corresponding to the same agricultural resource and whose operation time periods are allowed to overlap are identified. The agricultural time urgency value is calculated according to the order of the allowed operation time period and the agricultural time. The preemption weight is generated by the Softmax function. The corresponding feature connection weight is adjusted according to the preemption weight. The suppressed connection feature is retained as the interruption residual. When the overlapping time period ends and the interrupted production task is still in the allowed operation time period, the residual is added back to generate the spatiotemporal feature of resource allocation.
7. The method for allocating agricultural production resources based on multi-constraint optimization according to claim 1, characterized in that, The generation of candidate resource configuration sequences includes: Based on the task number and allowed work period, the spatiotemporal characteristics of resource allocation are divided to determine the time-sharing workload of each production task in each allowed work period; Arrange the time-sharing workload of the same production task in chronological order, determine the workload change value between adjacent time periods, and determine the resource allocation adjustment amount based on the agricultural resource operation capacity and the duration of the corresponding allowable operation period. Based on the resource allocation adjustment amount, increase or decrease the corresponding agricultural resources, and maintain the continuous allocation of agricultural resources with the same resource number in adjacent time periods and whose adjusted allocation amount is positive, and generate a time period resource allocation record; Arrange the time-slot resource allocation records according to production tasks and permitted operating periods to generate a candidate resource allocation sequence.
8. The method for allocating agricultural production resources based on multi-constraint optimization according to claim 1, characterized in that, The generation of the target resource configuration sequence includes: Candidate resource allocation sequences are divided according to task numbers. Agricultural resource allocation relationships with the same resource number and consecutive time periods in the same production task are merged to generate task allocation segments. Candidate resource allocation sequences are divided according to resource number, and the production task allocation relationship corresponding to the same agricultural resource is arranged according to the occupation period. The resource occupation segment is divided according to the start and end time of each production task. Using the start and end times of the resource occupation segment as the boundary of the resource occupation segment, locate the boundary of the resource occupation segment within the time period of the task configuration segment, and divide the task configuration segment according to the boundary of the resource occupation segment to generate the divided task configuration segment; Align the task configuration segments with the corresponding resource occupancy segments according to the resource number and the occupancy period. For the task configuration segments with overlapping occupancy periods, extend them to the idle period of the corresponding agricultural resource within the allowed operation period according to the order of agricultural time. Then, reorganize them according to the order of occupancy periods to generate the target resource configuration sequence.
9. The method for allocating agricultural production resources based on multi-constraint optimization according to claim 1, characterized in that, The generated agricultural production resource allocation results include: The target resource allocation sequence is divided according to the task number, the allocation relationship of each agricultural resource is mapped to the corresponding production task, and the corresponding plot is determined according to the production task to generate the task plot configuration record. Collect agricultural resources from the task plot configuration record according to resource number, summarize the quantity of agricultural resources in the time period occupied by each production task, determine the configuration quantity and retain the time period occupied, and generate resource configuration quantity record; The resource allocation records are arranged according to the occupation period. The allocation records with the same resource number and consecutive occupation periods within the same production task and plot are merged to determine the occupation period corresponding to each agricultural resource and generate resource allocation execution records. The resource allocation execution records are arranged according to production tasks and land parcels. The allocation amount and occupation period of each agricultural resource are summarized to generate the agricultural production resource allocation results.
10. An agricultural production resource allocation system based on multi-constraint optimization, comprising the agricultural production resource allocation method based on multi-constraint optimization as described in any one of claims 1 to 9, characterized in that, include: The agricultural data organization module is used to organize agricultural production data by plot and production cycle to generate agricultural production resource datasets. The resource demand processing module is used to distinguish between rigid resource demands and alternative resource demands, and to perform operational capacity conversion on alternative resource demands to generate a task resource substitution table. The resource spatiotemporal mapping module is used to construct fixed resource branches and equivalent substitution branches, organize branches according to the order of agricultural seasons and the location of land parcels, and generate a resource substitution spatiotemporal map. The spatiotemporal feature generation module is used to process the resource substitution spatiotemporal graph using the improved STSGCN model and generate spatiotemporal features of resource allocation. The candidate configuration generation module is used to adjust the allocation of agricultural resources according to changes in the time-sharing workload and generate a sequence of candidate resource configurations. The target configuration refactoring module is used to refactor the candidate resource configuration sequence based on the boundary relationship between the task configuration segment and the resource occupancy segment, and generate the target resource configuration sequence. The configuration result generation module is used to map the target resource configuration sequence to production tasks and plots, and generate agricultural production resource configuration results.
