Farmer's agricultural material demand prediction method and system based on time sequence behavior analysis

By using time-series behavior analysis, a continuous-time demand signal sequence at the ordering entity level is generated, the demand arrival intensity function is estimated and calibrated, solving the problem of coordinating farmers' agricultural input demand forecasting with operational constraints in existing technologies, and improving the accuracy and efficiency of ordering decisions.

CN121504531BActive Publication Date: 2026-05-12ANHUI ZHINONG TECH SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI ZHINONG TECH SERVICE CO LTD
Filing Date
2026-01-09
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies struggle to coordinate farmers' agricultural input demand forecasts based on historical transaction and behavioral signals with discrete operational constraints such as lead time, packaging, minimum order quantity, and shelf life without relying on extensive human threshold and experience-based corrections. This leads to biased ordering decisions, resulting in stockouts, inventory backlogs, and depreciation due to expiration.

Method used

A time-series behavior analysis-based approach is adopted to collect timestamps of farmers' behavioral events, generate a continuous time demand signal sequence at the order subject granularity, estimate the demand arrival intensity function and uncertainty parameters, and solve the order submission time and integer order quantity by combining packaging step size, minimum order quantity and shelf life constraints. Rolling calibration is performed through transaction, stockout unmet and damage data.

Benefits of technology

It enables the direct calculation of future demand within the lead time of supply. The generation of order submission time and integer order quantity has a clear input, calculation path and result collection mechanism, which reduces the deviation of ordering decision and improves the accuracy and efficiency of order execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504531B_ABST
    Figure CN121504531B_ABST
Patent Text Reader

Abstract

The application discloses a method and system for predicting agricultural material demand of farmers based on time sequence behavior analysis, relates to the field of agricultural digital management, and aims at the scene that county store network and cooperative society complete order submission before agricultural time nodes and are jointly restricted by supply lead time, packaging step, minimum order quantity and quality guarantee period, solves the problem that an order subject is difficult to form a repeatable demand process description under discrete touch events, and the method takes order subject identification and target agricultural material identification as primary keys, generates a continuous time demand signal sequence of order subject granularity, estimates a demand arrival intensity function and an uncertainty parameter sequence online, jointly solves order submission time and integer order quantity, and is rolled over and calibrated according to transaction data, unsatisfied data of out-of-stock and loss report data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural digitalization, and more specifically, to a method and system for predicting farmers' agricultural input needs based on time-series behavioral analysis. Background Technology

[0002] In scenarios such as county-level agricultural input distribution, cooperative centralized procurement, supply and marketing system store networks, and platform-based agricultural input services, ordering is often organized based on a multi-level supply chain consisting of stores, warehouses, and suppliers. This requires completing preparation, acceptance upon arrival, and distribution before key agricultural timeframes such as sowing, topdressing, and pest and disease control. Because agricultural inputs cover a wide range of categories and specifications, including fertilizers, pesticides, seeds, and adjuvants, their varieties and specifications are numerous; especially with significant differences in specifications and concentrations. Therefore, they are greatly affected by operational constraints such as supply period fluctuations, packaging, minimum order quantities, batch delivery capabilities, shelf life, and storage conditions.

[0003] Existing business systems typically store historical sales, order, price, and inventory data in their inventory management or order systems. These data are then supplemented with statistical or machine learning forecasts to estimate future demand. Ordering recommendations are then calculated using rules such as safety stock, replenishment points, service level coefficients, or economic order quantities. In some applications, probability distributions or quantile forecasts are also used, combined with cost preferences to select forecast values. Meanwhile, agricultural input demand in reality is not only determined by historical transactions but is also triggered in advance by farmers' inquiries, browsing, price requests, agricultural technical service records, crop structure at different plots, and weather disturbances. This leads to strong seasonality, suddenness, and unstable repurchase intervals across years. Because the demand values ​​output by the forecasting module often do not match the discrete constraints of the purchase order, ordering personnel still need to rely on experience to calculate, split, and merge forecast results, existing stock, in-transit stock, and supply constraints, forming a usable but difficult-to-execute ordering process.

[0004] However, existing technologies struggle to simultaneously coordinate demand forecasts based on historical transaction and behavioral signals with discrete operational constraints such as lead time, packaging, minimum order quantity, and shelf life without relying heavily on human thresholds and experience-based adjustments. This hinders the stable and repeatable conversion of forecast outputs into directly executable order submission times and quantities. The reason for this is that forecasting models often output continuous demand, while order execution is constrained by discrete batch sizes and delivery schedules. Furthermore, demand during the lead time is subject to time-varying uncertainties due to agricultural timing windows, weather, and pest and disease events, making it difficult for fixed replenishment points or static safety stock rules to cover these variable situations. When this coordination is lacking, ordering decisions are prone to deviations within agricultural timing windows, manifesting as delayed arrivals of key product categories, mismatched specifications, or overstocking. This can lead to stockouts, missed application windows, inventory backlogs and expired discounts, increased capital tied up, and increased frequency of inter-store transfers and emergency replenishments.

[0005] To address the aforementioned business needs and constraints, a method and system for predicting farmers' agricultural input needs based on time-series behavior analysis are proposed. Summary of the Invention

[0006] This invention proposes a method and system for predicting farmers' agricultural input demand based on time-series behavior analysis. This method uses the ordering entity identifier and the target agricultural input identifier as the primary keys, collects the current stock and lead time of the target agricultural input, extracts the timestamps of events such as consultation, inquiry, order placement, and payment completion, and generates a continuous time demand signal sequence at the ordering entity level. It estimates the demand arrival intensity function and uncertainty parameters within the lead time coverage window online, and solves the order submission time and integer order quantity under the constraints of packaging step size, minimum order quantity, and shelf life. Subsequently, it performs rolling calibration based on the results of completed transactions, unmet stock shortages, and damage reports.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] S1: Collect the current stock and delivery lead time of the target agricultural input corresponding to the ordering entity identifier, extract the timestamp of the farmer's behavior event and perform consistency verification, and transcribe the continuous time demand signal sequence at the ordering entity granularity according to the contribution coefficient of the behavior event and the time decay.

[0009] S2: Count arrivals during the lead time coverage window, estimate the demand arrival strength function based on the continuous time demand signal sequence of the ordering entity, update the uncertainty parameter sequence using the temperature factor, and output the discretized sequence of the demand arrival strength function and the uncertainty parameter sequence.

[0010] S3: Taking the expected total cost corresponding to the stockout loss unit price, holding cost unit price, and expired discount unit price as the objective, based on the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence, under the constraints of packaging step size, minimum order quantity, and shelf life, solve the order submission time and integer order quantity, and output the order instruction;

[0011] S4: Collect transaction, stockout, and loss data after order execution, establish a cost decomposition ledger, update the discretized sequence of demand arrival intensity function, uncertainty parameter sequence, and three types of unit costs based on ledger errors, and output a set of calibration results.

[0012] In a preferred embodiment, in step S1, a one-to-one mapping table between the original material code and the target agricultural input identifier is established based on the commodity master data. The successfully mapped consultation records, inquiry records, order records, payment completion records and return records are extracted as a sequence of timestamps for farmer behavior events. The behavior event type is taken from the fixed category code of the touchpoint enumeration table, and the farmer behavior event timestamp is taken from the time the business occurred.

[0013] In a preferred embodiment, in step S1, the fulfillment subject field of the most recently completed order within a supply lead time window prior to the order calculation start time is used to determine the overlay mapping value. When the fulfillment subject field is missing, the customer master data ownership subject field is used to determine the overlay mapping value. Deduplication is performed using the event source serial primary key, and the earliest written record is retained. Timing verification is performed according to the constraints that the payment completion timestamp is not earlier than the order placement timestamp and the return timestamp is not earlier than the payment completion timestamp, forming a farmer behavior event timestamp sequence arranged in ascending order of timestamps.

[0014] In a preferred embodiment, in step S2, a time interval is formed by adjacent sampling timestamps within the supply lead time coverage window, and the interval arrival count is counted. The interval arrival count corresponds to the number of completed orders whose payment time falls into the time interval. Based on the value of the continuous time demand signal sequence of the ordering entity at the beginning of the time interval, the prior mean of the demand arrival intensity function is generated by exponential mapping, and the target agricultural input intensity benchmark coefficient and the target agricultural input signal sensitivity coefficient are estimated by Poisson log-likelihood iteration.

[0015] In a preferred embodiment, in step S2, a mixture likelihood of the regular Poisson component and the heavy-tailed component is constructed for the interval arrival count. The temperature factor is calculated according to the posterior probability of the regular Poisson component and the mixture coefficient is updated with the expectation maximization. Then, the shape parameter sequence and the rate parameter sequence are conjugately updated with the temperature factor and the uncertainty parameter sequence is output. The temperature factor and the mixture coefficient are output as audit fields.

[0016] In a preferred embodiment, in step S3, the delivery time is determined by the order submission time and the delivery lead time, and a set of indexes for the time intervals of the delivery lead time coverage window and the shelf life coverage window are generated accordingly; the distribution of the number of demand arrivals in each time interval is determined based on the shape parameter sequence and the rate parameter sequence, and the distribution of demand in the delivery lead time coverage window and the shelf life coverage window is calculated by inter-interval discrete convolution recursion, with the recursion process using numerical precision parameters to truncate limited support.

[0017] In a preferred embodiment, in step S3, an integer order quantity set is constructed using the packaging step size multiple rule and the minimum order quantity segmentation rule, and the expected total cost is constituted using the stockout loss unit price, holding cost unit price, and expiration discount unit price; after determining the upper bound of the order quantity based on the cumulative probability and cost ratio of the demand distribution within the shelf life coverage window, candidate order submission times and integer order quantities are enumerated, the order instruction corresponding to the minimum expected total cost is selected, and three types of expected amount decomposition fields are output.

[0018] In a preferred embodiment, in step S4, the sampling timestamp sequence is used to form a time interval number, and the actual transaction quantity, the quantity of unmet stock shortage, the actual demand quantity, and the quantity of reported losses in the interval are summarized according to the time interval number. The actual demand quantity in the interval is the sum of the actual transaction quantity and the quantity of unmet stock shortage in the interval. A window summary quantity is formed on the supply lead time coverage window and the shelf life coverage window, and a cost breakdown ledger is established to record the expected quantity, the actual quantity, and the error in the amount.

[0019] In a preferred embodiment, in step S4, the interval residual is constructed by the difference between the actual demand quantity and the predicted demand quantity in the interval, and the update amplitude factor is calculated by the total error of cost decomposition and the monetary scale; the shape parameter sequence is updated by exponential mapping, and the demand arrival intensity function discretization sequence is recalculated based on the shape parameter sequence and the rate parameter sequence; at the same time, the unit price of stockout loss, the unit price of holding cost, and the unit price of overdue discount are updated with positive values ​​driven by logarithmic difference based on the three types of actual loss amounts, and the calibration result set is output for the next cycle to read.

[0020] The agricultural input demand forecasting system for farmers based on time-series behavior analysis includes a signal generation unit, an intensity estimation unit, an order solving unit, and a closed-loop calibration unit.

[0021] The signal generation unit collects the current stock and delivery lead time of the target agricultural input corresponding to the ordering entity identifier, extracts the timestamp of the farmer's behavior event and performs consistency verification, and generates a continuous time demand signal sequence at the ordering entity granularity based on the contribution coefficient of the behavior event and time decay.

[0022] The intensity estimation unit counts arrivals within the statistical interval of the lead time coverage window, estimates the demand arrival intensity function based on the continuous time demand signal sequence of the order subject granularity, updates the uncertainty parameter sequence with the temperature factor, and outputs the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence.

[0023] The order solving unit uses the stockout loss unit price, holding cost unit price and expiration discount unit price to form the expected total cost. Based on the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence, under the constraints of packaging step size, minimum order quantity and shelf life, it solves the order submission time and integer order quantity and outputs the order instruction.

[0024] The closed-loop calibration unit collects transaction data, out-of-stock data, and damage data after the order instruction is executed, establishes a cost decomposition ledger, and updates the discretized sequence of the demand arrival intensity function, the uncertainty parameter sequence, and the three types of unit costs based on the ledger error, and outputs a set of calibration results.

[0025] The technical effects and advantages of the method and system for predicting farmers' agricultural input demand based on time-series behavioral analysis in this invention are as follows:

[0026] This invention uses the ordering entity identifier and the target agricultural input identifier as the primary keys to collect the current inventory and lead time of the target agricultural input. It then transcribes touchpoint events such as inquiries, price requests, order placements, and payment completions into a continuous-time demand signal sequence at the ordering entity level. The discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence form a unified standard within the lead time coverage window, allowing the ordering solution stage to directly reference this sequence without relying on fixed rules such as replenishment points.

[0027] This invention collects transaction, stockout, and loss data after an order is executed, establishing a cost breakdown ledger consistent with the expected total cost. It aligns actual and expected quantities under the same criteria (ordering entity and target agricultural input identifier), and updates the discretized sequence of demand arrival intensity function, uncertainty parameter sequence, and three types of unit costs accordingly. The order submission time and integer order quantity have a traceable input, processing, and output chain within a rolling cycle. Attached Figure Description

[0028] Figure 1 This is a flowchart illustrating the method for predicting farmers' agricultural input demand based on time-series behavior analysis, as described in this invention.

[0029] Figure 2 This is a schematic diagram of the structure of the farmer's agricultural input demand prediction system based on time-series behavior analysis according to the present invention. Detailed Implementation

[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0031] Example 1: Figure 1 This invention presents a method for predicting farmers' agricultural input demand based on time-series behavioral analysis, comprising:

[0032] S1: Collect the current stock and delivery lead time of the target agricultural input corresponding to the ordering entity identifier, extract the timestamp of the farmer's behavior event and perform consistency verification, and transcribe the continuous time demand signal sequence at the ordering entity granularity according to the contribution coefficient of the behavior event and the time decay.

[0033] Suppose a county-level cooperative plans to replenish compound fertilizer before topdressing. At the start of the order calculation, staff log into the cooperative's inventory management system, select the cooperative's warehouse by ordering entity identifier, select the corresponding compound fertilizer material by target agricultural input identifier, and read the target agricultural input's current inventory and lead time. Then, the system exports consultation records, inquiry records, order records, payment completion records, and return records matching the target agricultural input identifier. Duplicates are removed by event source primary key, and abnormal records are eliminated according to the rule that the payment completion timestamp is no earlier than the order timestamp, and the return timestamp is no earlier than the payment completion timestamp. The cleaned farmer behavior event timestamps are arranged in ascending order. The system then rewrites these timestamps into a continuous-time demand signal sequence at the ordering entity granularity based on the behavior event contribution coefficient and time decay, and encapsulates the sequence along with the target agricultural input's current inventory and lead time into an output data packet.

[0034] S2: Count arrivals during the lead time coverage window, estimate the demand arrival strength function based on the continuous time demand signal sequence of the ordering entity, update the uncertainty parameter sequence using the temperature factor, and output the discretized sequence of the demand arrival strength function and the uncertainty parameter sequence.

[0035] The system uses the lead time coverage window as the boundary, divides the window into adjacent time intervals using the sampling timestamp sequence, and counts the number of payment completion timestamps falling into each time interval to obtain the interval arrival count. At the beginning of the time interval, the system reads the values ​​of the continuous time demand signal sequence of the order subject granularity, generates the prior mean of the demand arrival strength function, and updates the demand arrival strength function according to the interval arrival count. When multiple payment completion records are written in a certain time interval, the system calculates the temperature factor and updates the uncertainty parameter sequence according to the temperature factor. When step S2 ends, the system outputs the discretized sequence of the demand arrival strength function and the uncertainty parameter sequence for order solving.

[0036] S3: Taking the expected total cost corresponding to the stockout loss unit price, holding cost unit price, and expired discount unit price as the objective, based on the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence, under the constraints of packaging step size, minimum order quantity, and shelf life, solve the order submission time and integer order quantity, and output the order instruction;

[0037] The ordering personnel initiate the order calculation at the start of the order process. The system reads the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence, and combines them with the packaging step size, minimum order quantity, and shelf life to generate a set of candidate order submission times and a set of integer order quantities. The system calculates the expected total cost corresponding to each set of candidate order submission times and integer order quantities, and selects the combination with the minimum expected total cost as the order instruction. The ordering personnel generate a purchase order in the ordering system according to the order instruction and submit it to the supplier. The order submission time and integer order quantity in the purchase order are consistent with the order instruction.

[0038] S4: Collect transaction, stockout, and loss data after order execution, establish a cost decomposition ledger, update the discretized sequence of demand arrival intensity function, uncertainty parameter sequence, and three types of unit costs based on ledger errors, and output a set of calibration results.

[0039] After the supplier delivers the goods, the cooperative records the completion time of the acceptance in the warehousing and acceptance record, and continuously generates transaction records, shortage registration records, and loss reports during subsequent operations. The system generates time interval numbers according to the sampling timestamp sequence, summarizes the actual transaction quantity, the quantity of unmet shortages, and the quantity of losses for each time interval, and calculates the actual demand quantity for the interval accordingly. The system establishes a cost decomposition ledger based on the ordering entity identifier, the target agricultural input identifier, and the order submission time, recording three types of expected quantities, three types of actual quantities, and their differences. Subsequently, the system updates the discretized sequence of the demand arrival intensity function, the uncertainty parameter sequence, and the unit price of shortage loss, holding cost, and expired discount based on the ledger error, outputs the calibration result set, and stores it in the next cycle's read position.

[0040] The processing approach and intent of this invention are as follows:

[0041] The processing approach of this invention can be summarized as follows: first, organize the farmers' behavioral clues into demand indicators on a timeline; then, convert the demand indicators into executable ordering instructions; and finally, use the actual results after ordering to correct the calculation method for the next time.

[0042] Specifically, firstly, using the ordering entity identifier and the target agricultural input identifier as a unified index, the current inventory of the target agricultural input in the cooperative's warehouse and the lead time of delivery are determined as the boundary conditions for order calculation. Then, behavioral events such as inquiries, price requests, order placements, and payment completions generated by farmers at various points of contact within the cooperative are extracted in chronological order. Duplicate and time-series inconsistencies are eliminated through consistency checks, ensuring that the input information has a traceable source on the same timeline. Subsequently, these discrete events are transcribed into a continuous-time demand signal sequence at the ordering entity granularity according to the behavioral event contribution coefficient and time decay rules. This ensures that recent behaviors leading to transactions exhibit stronger demand indicators in the sequence, while earlier or weakly correlated behaviors gradually weaken, thus forming a continuous expression of demand changes.

[0043] Based on this, using the lead time coverage window as the forecast range, a demand arrival strength function is estimated using a continuous-time demand signal sequence, and an uncertainty parameter sequence is simultaneously provided to describe the degree of fluctuation in demand within the same window. The aim is to transform behavioral cues into a characterization of the demand arrival process, enabling subsequent ordering decisions to directly calculate future demand arrival in units of lead time.

[0044] Subsequently, in the order calculation phase, packaging step size, minimum order quantity, and shelf life are established as mandatory operational constraints. Order submission time and integer order quantity are limited to executable values. A unified expected total cost target is constructed using three cost categories: stockout losses, inventory holding, and expiration discounts. By evaluating and comparing candidate order submission times and integer order quantities, the combination with the minimum expected total cost is selected as the order instruction, ensuring that the calculation results directly correspond to the cooperative's actual order placement actions.

[0045] Finally, after the order instruction is executed, the system collects real transaction data such as completed transactions, stockouts, and reported losses, establishes a cost breakdown ledger, aligns the expected results before ordering with the actual results after ordering under the same caliber, identifies the sources of discrepancies, and updates the discretized sequence of demand arrival intensity function, uncertainty parameter sequence, and three types of unit costs accordingly, forming a calibration result set for use in the next cycle. Through this closed-loop process, the intention of this invention is to integrate behavioral events, lead times, and discrete operating constraints into a single recalculated link, ensuring that the generation of order submission time and integer order quantities has clear input criteria, a clear calculation path, and a clear result recovery mechanism, thereby facilitating understanding, verification, and continuous use.

[0046] County-level store networks and cooperative procurement typically require order submission before the agricultural season. Delivery lead time determines the arrival schedule, packaging increments and minimum order quantities result in discrete order quantities, and shelf-life limits constrain inventory levels. Business touchpoints accumulate inquiry, price quote, order, and payment completion records as discrete events, which may be repeated and may contain missing fields or temporal inconsistencies. Step S1 integrates the operational input from the ordering entity and farmer behavior events onto the same timeline, transforming discrete events into a continuous-time demand signal sequence, forming a clear and recalculated framework.

[0047] S101. Determining the mapping logic between order subject input and agricultural input identifier.

[0048] The ordering entity identifier is defined as a unique code used to generate order documents in the inventory master data, and the target agricultural input identifier is defined as a unique material code used for inventory measurement and order measurement in the commodity master data.

[0049] Step S101 collects two operational inputs: the current inventory of the target agricultural input within the ordering entity and the lead time for delivery. The current inventory is the available inventory quantity at the start of the order calculation, and the lead time is the length of time obtained from the historical arrival and acceptance statistics corresponding to the ordering entity and the target agricultural input.

[0050] When extracting behavioral events, a mapping table is first established from the original material code to the target agricultural input identifier. The mapping table comes from the one-to-one correspondence of the commodity master data. Only behavioral records that are successfully mapped can be included in the behavioral event set.

[0051] The farmer identifier is defined as a unique code in the customer master data. The behavior event timestamp is defined as the time when the business occurred and the touchpoint flow is written. The behavior event type is defined as a fixed category code in the touchpoint enumeration table. The touchpoint enumeration table covers at least the consultation category, inquiry category, order category, payment completion category, and return category. Each category corresponds to a unique business semantic and a unique data collection source.

[0052] S102. Determination logic for covering mapping and event sequence consistency verification.

[0053] Coverage mapping is defined as the service attribution relationship between farmer identifiers and ordering entity identifiers. Coverage mapping values ​​are either one or zero. One indicates that the farmer's service is fulfilled by the ordering entity, while zero indicates that the farmer's service is not fulfilled by the ordering entity.

[0054] The overlay mapping is determined using a two-level priority order. The first priority order uses the fulfillment subject field of the most recent completed order within the lead time window before the order calculation start time. When the fulfillment subject field is equal to the order subject identifier, the overlay mapping value is 1. The second priority order uses the customer master data home subject field. When the home subject field is equal to the order subject identifier, the overlay mapping value is 1. When both levels of fields are missing, the overlay mapping value is not 1.

[0055] Event consistency verification is performed at the level of the behavior event set. The deduplication rule uses the primary key of the event source as the sole criterion, and retains the earliest written record when the primary key is duplicated. The time sequence logic verification uses event type constraints: the timestamp of the payment completion category cannot be earlier than the timestamp of the order placement category, and the timestamp of the return category cannot be earlier than the timestamp of the payment completion category. Records violating these constraints are removed. After verification, the event sets of the farmer identifier and the target agricultural input identifier dimensions are arranged in ascending order of timestamps to form a behavior event timestamp sequence. The sequence elements only retain the behavior event timestamp and behavior event type.

[0056] S103. Determination logic of transaction markers and contribution coefficient estimation of behavioral events.

[0057] The transaction timestamp is defined as the payment completion time of a completed order. Multiple transactions may correspond to the same farmer and the same agricultural input. For each behavioral event timestamp, a matching transaction timestamp selection rule is established. The rule selects the earliest transaction timestamp that satisfies two constraints: first, the transaction timestamp is not earlier than the behavioral event timestamp; second, the difference between the transaction timestamp and the behavioral event timestamp does not exceed the delivery lead time. If a matching transaction timestamp exists, the transaction flag is set to one; otherwise, it is set to zero.

[0058] The behavioral event contribution coefficient is defined as the logarithmic ratio of the event type to the benchmark and the transaction evidence. Estimation involves first calculating the event type conditional transaction probability, then calculating the benchmark transaction probability, and finally taking the natural logarithm of the ratio. The event type conditional transaction probability is expressed as the ratio of success counts to failure counts. Success counts are defined as the number of times a transaction is marked as one under the same event type, and failure counts are defined as the number of times a transaction is marked as zero under the same event type.

[0059] To ensure that the probability remains defined even with sparse samples or zero success rates, prior success counts and prior failure counts for each event type are introduced. These are initialized from historical population statistics and updated with the scrolling window. The probability of a transaction under an event type condition equals the sum of the event type success count and the prior success count, divided by the sum of the event type success count, the event type failure count, and the two prior counts.

[0060] The benchmark transaction probability is calculated by combining the success count and failure count of all events, and a benchmark prior success count and a benchmark prior failure count are also introduced.

[0061] The contribution coefficient of behavioral events is estimated separately for each event type and each target agricultural input, and the update cycle is fixed within the same statistical caliber, so that the contribution coefficient can be reused among different ordering entities.

[0062] S104. Logic for constructing continuous-time demand signal sequences and determining the recursive calculation caliber.

[0063] The continuous-time demand signal sequence uses a single-sided exponential decay kernel to convert discrete events into continuous signals.

[0064] The time decay constant is defined as the time scale by which the impact of an event type on a target agricultural input decays over time. The time decay constant is estimated separately for each event type and each target agricultural input. The value of the one-sided exponential decay kernel is equal to the reciprocal of the time decay constant multiplied by the exponential decay term. The exponent of the exponential decay term is equal to the negative time difference divided by the time decay constant. The time difference is the sampling timestamp minus the event timestamp. The kernel is zero when the time difference is negative.

[0065] The sampling timestamp sequence is defined as a set of incremental time points within the supply lead time coverage window, with the sampling interval consistent with the business time precision. The value of the farmer-level continuous-time demand signal sequence at each sampling timestamp is equal to the sum of the products of the contribution coefficients of all behavioral events and the corresponding exponential decay kernel values. The contribution coefficients are determined by the event type and the target agricultural input, while the exponential decay kernel is determined by the event type, target agricultural input, and time difference. The value of the ordering entity-level continuous-time demand signal sequence at each sampling timestamp is equal to the sum of all farmer-level continuous-time demand signal sequences with a coverage mapping value of one. The calculation adopts a recursive approach to reduce the computational cost of full convolution. The recursive approach splits and stores the cumulative contribution of the previous sampling timestamp according to the event type. For each advance of the sampling timestamp, the cumulative contribution of the previous time step is first updated by decaying according to the exponential decay factor of the corresponding event type. Then, newly occurring events falling within the current sampling interval are injected into the cumulative contribution in the form of contribution coefficient multiplied by the reciprocal of the time decay constant. After updating all event type components, the summation is used to obtain the continuous time demand signal sequence of the farmer granularity. Finally, the summation is used according to the coverage mapping to obtain the continuous time demand signal sequence of the order subject granularity.

[0066] S105. Logic for determining the output data packet and the aperture encapsulation.

[0067] The output data packet is defined as a set of structured content corresponding to the ordering entity identifier and the target agricultural input identifier. This content includes the current stock of the target agricultural input, the delivery lead time, the ordering entity-level continuous-time demand signal sequence, and the coverage mapping caliber identifier. The coverage mapping caliber identifier records the source of the fields and the time window version used in the coverage mapping determination rules, facilitating the reuse of a consistent caliber within the same ordering entity during rolling calculations. The ordering entity-level continuous-time demand signal sequence is stored using a sampling timestamp sequence as an index, with the start and end range of the sampling timestamp sequence consistent with the delivery lead time coverage window. The output data packet is stored using the ordering entity identifier and the target agricultural input identifier as primary keys, forming the demand signal entry point for the single agricultural input dimension at the ordering entity level. Subsequent steps read the delivery lead time to determine the coverage window and directly reference the ordering entity-level continuous-time demand signal sequence to perform arrival strength estimation.

[0068] After step S1 is completed, the target agricultural input's existing stock and delivery lead time corresponding to the ordering entity identifier and the target agricultural input identifier form a stable input caliber. The farmer behavior event timestamp sequence is then verified for consistency through coverage mapping, and the contribution coefficient is estimated and transcribed exponentially to obtain the ordering entity-level continuous-time demand signal sequence. The ordering entity-level continuous-time demand signal sequence expresses the strength of demand cues changing over time on the same sampling time axis, and carries event type semantics and time decay semantics. The ordering entity-level continuous-time demand signal sequence, along with the existing stock and delivery lead time, is encapsulated into an output data packet.

[0069] In one embodiment, for example, a cooperative in Town A of a certain county acts as the ordering entity. First, it collects the current inventory and lead time of its target agricultural input (e.g., a compound fertilizer). For instance, as of early March, the cooperative's warehouse had 5 bags of the fertilizer in stock, while the supplier typically requires a 7-day lead time to deliver new products. Subsequently, the cooperative extracts the timestamps of relevant farmer behavior events from its business system and performs consistency checks on them. Farmer behavior events related to the fertilizer in the past period include: farmer Li Si consulted the cooperative about fertilizer usage on March 1st (consultation event); farmer Zhang San called to inquire about fertilizer prices on March 3rd (price inquiry event); Li Si placed an online order for 2 bags on March 5th (order event); and completed payment on March 6th (payment completion event). After extracting the timestamp sequence of these events, the cooperative's information system performs consistency checks, eliminating duplicate records and abnormal records that violate the time sequence (e.g., ensuring that the payment completion time is not earlier than the order time). During the processing in step S1, the system, based on pre-set contribution coefficients for behavioral events and considering time decay factors, transcribes the aforementioned discrete farmer behavioral events into a continuous-time demand signal sequence at the ordering entity level. This sequence maps discrete events such as inquiries, price requests, and order placements into demand signals that change continuously over time, reflecting the changes in the cooperative's demand intensity for the target agricultural inputs over time.

[0070] The continuous-time demand signal sequence at the order subject granularity output in step S1 can characterize the attenuation and superposition of clues such as inquiries, price requests, and order placements on the time axis. However, the object of ordering decision-making is the transaction arrival process within the supply lead time coverage window. Step S2 maps the continuous-time demand signal sequence at the order subject granularity to a discretized sequence of demand arrival intensity function, and performs online calibration of the mapping result with transaction arrival observations. At the same time, it provides the uncertainty parameter calibrator, so that the expected total cost can be calculated under the same calibrator during the ordering solution stage.

[0071] S201. Organization of supply lead time coverage window and transaction arrival count.

[0072] The estimation of the demand arrival intensity function is expanded with the supply lead time coverage window as the boundary. The starting point of the supply lead time coverage window is the order calculation start time minus the supply lead time, and the ending point is the order calculation start time. The sampling timestamp sequence within the supply lead time coverage window follows the sampling timestamp sequence determined in step S1, and the timestamps are strictly increasing. The transaction arrival timestamp is the payment completion time of the completed order where the fulfilling entity is equal to the ordering entity identifier and the agricultural input identifier is equal to the target agricultural input identifier. Two adjacent timestamps in the sampling timestamp sequence form a left-closed, right-open time interval. The number of transaction arrival timestamps is counted in each time interval to obtain the interval arrival count; the interval duration is the difference between the previous and subsequent timestamps. The interval arrival count and the interval duration are aligned with the continuous-time demand signal sequence at the ordering entity granularity on the same time axis, forming a unified observation sequence for intensity estimation.

[0073] S202. Mapping and parameter estimation of prior mean of demand arrival intensity.

[0074] The demand arrival strength function is defined as the expected number of transactions arriving per unit time. The prior mean of strength is used to express the immediate impact of the continuous-time demand signal sequence at the ordering entity granularity on the strength. The prior mean of strength takes the value of an exponential function at each sampling timestamp. The independent variable of the exponential function is composed of two parts: the target agricultural input strength benchmark coefficient and the target agricultural input signal sensitivity coefficient multiplied by the value of the continuous-time demand signal sequence at the same sampling timestamp.

[0075] The target agricultural input intensity benchmark coefficient is indexed by the target agricultural input identifier, and the target agricultural input signal sensitivity coefficient is also indexed by the target agricultural input identifier. Both types of coefficients are obtained by maximizing the Poisson log-likelihood. The Poisson log-likelihood for each time interval consists of the sum of three terms: interval arrival count multiplied by the natural logarithm of interval intensity multiplied by interval duration, minus interval intensity multiplied by interval duration, and minus the natural logarithm of the factorial of interval arrival count. The interval intensity is calculated using the prior mean of intensity at the sampling timestamp at the start of the interval. The objective function is summed over all ordering entities and all time intervals. The numerical solution uses an iterative optimization method, and the iteration termination criterion is that the increment of the objective function is lower than the preset convergence accuracy or the gradient norm is lower than the preset convergence accuracy.

[0076] S203. Construction of temperature factor and online updating of mixing coefficient.

[0077] Under normal circumstances, interval arrival counts conform to the Poisson arrival assumption. However, concentrated ordering during promotions and concentrated settlement during delays can lead to anomalous clustering within a single time interval. This anomalous clustering directly participates in parameter updates, causing short-term distortion of the prior mean of intensity. A temperature factor is used to measure the reliable proportion of observations entering the update within a single time interval. The temperature factor ranges from greater than zero to no greater than one. The temperature factor is given by a two-component mixture likelihood, which includes a regular Poisson component and a heavy-tailed component. The probabilistic quality of the regular Poisson component equals the interval arrival count raised to the power of the interval intensity multiplied by the interval duration, multiplied by an exponential decay term, and then divided by the interval arrival count factorial. The probabilistic quality of the heavy-tailed component is inversely proportional to the interval arrival count plus one squared, multiplied by the reciprocal of the normalization constant. The normalization constant is a series sum from zero to infinity, with each term equal to the reciprocal of the square of the index plus one. A finite number of terms is used to approximate the normalization constant, with the number of terms set to a pre-configured value to implement the parameter. The mixing coefficient is indexed by the target agricultural input identifier and represents the prior probability that the interval observation originates from the regular Poisson component.

[0078] The temperature factor is equal to the posterior probability of the regular Poisson component, calculated by dividing the unnormalized posterior probability of the regular Poisson component by the sum of the unnormalized posterior probabilities of the two components. The mixing coefficients are updated using expectation-maximization, with the updated value being the arithmetic mean of the temperature factors over all time intervals. The iteration termination criterion is that the change in the mixing coefficients between two consecutive iterations is lower than the preset convergence precision.

[0079] S204. Conjugate update of uncertainty parameters and discretized sequence output of demand arrival strength function.

[0080] Uncertainty parameters are characterized by a gamma distribution to represent the uncertainty of interval intensity, which is expressed using shape and rate parameters. The prior shape parameter is indexed by the target agricultural input identifier, while the prior rate parameter is indexed by the ordering entity identifier, the target agricultural input identifier, and the time interval. The prior shape parameter is initialized by summing historical transaction arrival times and adding a prior pseudo-count, with the pseudo-count taken from an updatable configuration item in the business knowledge base. The prior rate parameter is initialized by summing historical observation durations and adding a prior pseudo-duration, with the pseudo-duration taken from an updatable configuration item in the business knowledge base. Prior mean consistency is achieved through prior rate parameter reparameterization. The reparameterization rule is that the prior rate parameter equals the prior shape parameter divided by the intensity prior mean value at the corresponding sampling timestamp, and the prior mean equals the prior shape parameter divided by the prior rate parameter. After observation, temperature-based conjugate updates are used. The posterior shape parameter equals the prior shape parameter plus a temperature factor multiplied by the interval arrival count, and the posterior rate parameter equals the prior rate parameter plus a temperature factor multiplied by the interval duration. The output of the demand arrival intensity function at the sampling timestamp is taken as the posterior mean, which is equal to the posterior shape parameter divided by the posterior rate parameter.

[0081] S205. Step S2 outputs the data packet and field specifications.

[0082] The output data packet for step S2 uses the ordering entity identifier and the target agricultural input identifier as primary keys. Fields include the sampling timestamp sequence, the discretized value sequence of the demand arrival intensity function on the sampling timestamp sequence, and the posterior shape parameter and posterior rate parameter sequences corresponding to each time interval. The temperature factor sequence and mixing coefficient can be output as audit fields to illustrate the impact of abnormal clustering intervals during updates. The definitions of the ordering entity identifier and the target agricultural input identifier in the output data packet of step S2 are consistent with those in the output data packet of step S1. The start and end rules of the supply lead time coverage window are consistent with the definitions of the sampling timestamp sequence. During the order calculation stage, the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence can be directly read to form a probabilistic description of the demand within the lead time.

[0083] After step S2 is completed, the continuous-time demand signal sequence at the ordering entity granularity is mapped to a discretized sequence of the demand arrival intensity function within the supply lead time coverage window. The transaction arrival count is updated via temperature factor-based temperature conjugate, and the output obtains the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence. The impact of abnormal clustering intervals is automatically adjusted through mixed likelihood a posteriori probability.

[0084] In one embodiment, in step S2, the cooperative sets a forecast window based on the supply lead time and counts the demand arrivals within that window. For example, within a 7-day supply lead time coverage window, the system predicts several instances of farmer purchasing demand, assuming 5 instances of demand arrival are expected within these 7 days (i.e., 5 farmers may come to purchase). Next, based on the continuous-time demand signal sequence at the order subject granularity obtained in step S1, the system estimates the demand arrival intensity function, i.e., the demand occurrence intensity changing over time. Simultaneously, the system adjusts the model using a temperature factor and updates the uncertainty parameter sequence to reflect the uncertain fluctuations in demand. After the above calculations, the system outputs a discretized sequence of the demand arrival intensity function and the corresponding uncertainty parameter sequence. For example, the output may provide a sequence of predicted demand intensity values ​​per day, along with an uncertainty parameter corresponding to each day, for reference in the next decision-making step.

[0085] Step S2 outputs the discretized sequence of the demand arrival intensity function and the sequence of uncertainty parameters. During the order execution phase, the discrete order quantity constraints formed by the packaging step size and minimum order quantity, coupled with the shelf life limiting the acceptable inventory size, are present. However, arrival intensity is a process characterization and still needs to be rewritten as the demand distribution within the supply lead time coverage window and the demand distribution within the shelf life coverage window. Then, stockout losses, holding costs, and expired discounts are written as the same objective function, completing the joint solution for order submission time and integer order quantity.

[0086] S301. Input object alignment and decision element definition.

[0087] Step S3 uses the ordering entity identifier and the target agricultural input identifier as primary keys to read the current stock and delivery lead time of the target agricultural input from the output data packet of Step S1. Simultaneously, it reads the sampling timestamp sequence, the discretized sequence of the demand arrival intensity function, and the uncertainty parameter sequence from the output data packet of Step S2. The uncertainty parameter sequence consists of a shape parameter sequence and a rate parameter sequence, both indexed by the time interval formed by adjacent sampling timestamps. Based on this, Step S3 defines two types of decision elements: the first is the order submission time, whose value comes from the set of timestamps in the sampling timestamp sequence that are no earlier than the start time of the order calculation; the second is the integer order quantity, with dimensions consistent with the current stock of the target agricultural input. Along with the decision elements, four types of business constants are fixed: packaging step size represents the minimum discrete increment of the order quantity; minimum order quantity represents the minimum allowed value when the order quantity is non-zero; shelf life represents the length of time the target agricultural input is allowed to be sold and used after it enters the warehouse; and the three types of unit costs are the stockout loss unit price, holding cost unit price, and expired discount unit price.

[0088] S302. Time window construction and time interval index set generation.

[0089] Once the order submission time is determined, the delivery time is obtained by adding the order submission time to the lead time. Two types of time windows are constructed around the delivery time. The lead time coverage window starts at the order submission time and ends at the delivery time; the shelf life coverage window starts at the delivery time and ends at the sum of the delivery time and the shelf life. The sampling timestamp sequence is given in ascending order. Adjacent timestamp pairs falling within the lead time coverage window are selected from the sampling timestamp sequence to form the lead time coverage window time interval index set; similarly, adjacent timestamp pairs falling within the shelf life coverage window are selected to form the shelf life coverage window time interval index set. Each time interval has a start sampling timestamp, an end sampling timestamp, and a duration. The duration is obtained by subtracting the start timestamp from the end timestamp. Step S3 matches the uncertainty parameter sequence output in step S2 according to the time interval index, thereby binding a unique shape parameter and rate parameter to each time interval.

[0090] S303. Calculation method for the distribution of the number of arrivals of demand in a given area.

[0091] The uncertainty parameter sequence output in step S2 is used to characterize the uncertainty of the time interval intensity. Step S3 treats the number of demand arrivals within the time interval as a discrete random quantity and uses a negative binomial distribution obtained from a Gamma-Poisson mixture as the interval distribution. The shape parameter of the interval distribution is taken as the posterior shape parameter of the interval output in step S2. The success probability of the interval distribution is determined according to the following rules: add the interval duration to the posterior rate parameter of the interval, divide the interval duration by the sum to obtain the success probability, and divide the posterior rate parameter by the sum to obtain the failure probability. The probability mass when the number of demand arrivals in the interval is any non-negative integer is calculated according to the standard formula of the negative binomial distribution. The formula consists of three parts multiplied together: the first part is the combination coefficient, which is equal to the value of the gamma function at the sum of the number of demand arrivals and the shape parameter, divided by the product of the gamma function value at the shape parameter and the factorial of the number of demand arrivals; the second part is the success probability raised to the power of the number of demand arrivals; and the third part is the failure probability raised to the power of the shape parameter. All probabilities here are dimensionless quantities. The interval duration and the posterior rate parameter have the same time dimension. The success probability and the failure probability have a clear and calculable caliber.

[0092] S304. Convolutional recursion and finite support truncation of window demand distribution.

[0093] The demand quantity within the lead time coverage window is defined as the sum of the number of demand arrivals in each time interval within the lead time coverage window time interval index set. Similarly, the demand quantity within the shelf life coverage window is defined as the sum of the number of demand arrivals in each time interval within the shelf life coverage window time interval index set. The window demand distribution is calculated recursively using interval-wise convolution. The initial value is set to a probability of 1 when the window demand is zero, and zero for all other values. Interval distributions are merged sequentially according to time interval order. Each merge involves a discrete convolution between the current window distribution and an interval distribution. The convolution update rule is expressed as a point-by-point summation: the new probability when the window demand is a non-negative integer is equal to the sum of the products of the probabilities of all splitting methods. A splitting method refers to dividing the target demand into the previous window demand and the number of demand arrivals in the current interval. The product of the previous probability and the interval probability is summed over all splits. The convolution recursion is performed separately for the lead time coverage window and the shelf life coverage window, resulting in two distribution sequences. The computational complexity is controlled by finite support truncation. The truncation is based on the residual probability mass controlled by the numerical precision parameter. The upper bound of the truncation is taken as the smallest non-negative integer upper bound that makes the residual probability mass lower than the numerical precision parameter. During the recursion process, only the probability mass within the range of zero to the upper bound of the truncation is saved.

[0094] S305. Construction and Discrete Summation Calculation of Expected Total Cost.

[0095] The quantity of goods received and the inventory level are defined as the sum of the target agricultural input's current inventory and the integer order quantity, minus the demand within the lead time window. The quantity out of stock is defined as the demand within the lead time window minus the positive portion of the sum of the target agricultural input's current inventory and the integer order quantity; a positive portion is zero for negative values ​​and remains unchanged for positive values. The quantity held is defined as the sum of the target agricultural input's current inventory and the integer order quantity minus the positive portion of the demand within the lead time window. The quantity at a discount due to expiration is defined as the sum of the target agricultural input's current inventory and the integer order quantity minus the positive portion of the demand within the shelf life window. The expected total cost is defined as the sum of the unit price of the stockout loss multiplied by the expected stockout quantity, plus the unit price of the holding cost multiplied by the expected holding quantity, plus the unit price of the discount due to expiration multiplied by the expected quantity at a discount due to expiration. The three types of expectations are calculated using discrete summation. The expected quantity of shortages is calculated by summing the positive part of the difference between each demand value within the supply lead time coverage window and the sum of the target agricultural input's current inventory and integer order quantity, multiplied by the corresponding probability, and then summed. The expected quantity of holdings is also based on the supply lead time coverage window demand distribution, calculating the positive part of the difference between the sum of the target agricultural input's current inventory and integer order quantity and the demand value, multiplied by the corresponding probability, and then summed. The expected quantity of expired items with discounts is based on the shelf-life coverage window demand distribution, calculating the positive part of the difference between the sum of the target agricultural input's current inventory and integer order quantity and the demand value, multiplied by the corresponding probability, and then summed.

[0096] S306. Feasible region construction and joint optimization solution.

[0097] The feasible domain for integer order quantities is jointly determined by the packaging step size and the minimum order quantity. The packaging step size constraint is expressed as a multiple; the integer order quantity must be equal to a non-negative integer multiple of the packaging step size. The minimum order quantity constraint is expressed in segments; when the integer order quantity is zero, no order is allowed; when the integer order quantity is non-zero, it must be no less than the minimum order quantity and still satisfy the packaging step size multiple. The shelf-life constraint is constructed using a statistical upper bound based on the cost ratio. The cost ratio is defined as the stockout loss unit price divided by the sum of the stockout loss unit price, the holding cost unit price, and the expiration discount unit price. The demand distribution within the shelf-life coverage window can be used to calculate the cumulative probability, defined as the sum of the probabilities of demand ranging from zero to a certain value. The statistical upper bound of the demand within the shelf-life coverage window is defined as the minimum demand value that ensures the cumulative probability is not less than the cost ratio. The shelf-life constraint is written as the sum of the target agricultural input's current inventory and the integer order quantity not exceeding the upper limit of the statistical demand for the shelf-life coverage window. Thus, the upper limit of the order quantity is equal to the upper limit of the statistical demand for the shelf-life coverage window minus the positive part of the target agricultural input's current inventory.

[0098] For each candidate order submission time, the following solution process is executed: Calculate the delivery time and generate two types of time interval index sets; calculate the two types of window demand distributions and the upper bound of the shelf-life coverage window demand statistics; construct a set of integer order quantities that satisfy the packaging step size, minimum order quantity, and upper bound of the order quantity; calculate the expected total cost for each integer order quantity in the set and take the minimum value. The global optimal solution is the order submission time and integer order quantity corresponding to the minimum expected total cost under all candidate order submission times. The output order instruction fields include the order subject identifier, target agricultural input identifier, order submission time, and integer order quantity, and output the decomposed amounts of three items: expected stockout loss, expected holding cost, and expected expiration discount, for step S4 to perform reverse calibration based on the completed stockout loss report results.

[0099] After step S3 is completed, the discretized sequence of the demand arrival intensity function and the sequence of uncertainty parameters are rewritten as the demand distribution of the supply lead time coverage window and the demand distribution of the shelf life coverage window. The expected total cost forms a computable objective function under the three types of costs: stockout loss, holding cost, and expiration discount. The packaging step size and minimum order quantity are limited to the feasible domain of order quantity by integer multiple rules. The shelf life constraint is limited to the upper bound of the order quantity by the statistical upper bound of the shelf life coverage window demand driven by the cost ratio. The optimal solution for order submission time and integer order quantity is obtained by enumeration evaluation. The output order instructions and cost decomposition caliber can be compared with the operating results on a periodic basis.

[0100] In step S3, the cooperative aims to reduce the expected total cost in its ordering decisions. This expected total cost consists of three parts: the unit price of stockout losses, the unit price of holding costs, and the unit price of expiration discounts. To this end, the system utilizes the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence output from step S2, combined with business constraints, to solve for the optimal combination of order submission time and integer order quantity. During the order calculation process, constraints such as packaging step size, minimum order quantity, and shelf life need to be considered. For example, assuming the fertilizer's packaging specification is 50 kg / bag, the supplier's minimum order quantity is 10 bags, and the fertilizer's shelf life is 2 years, under these constraints, the system evaluates multiple ordering schemes based on the predicted demand intensity and uncertainty, simulates different ordering timing and quantity combinations, and calculates the expected total cost corresponding to each scheme. The system compares the costs of various options, such as ordering 30 bags two weeks before the planting season versus ordering 20 bags one week before the planting season. It calculates the potential stockout losses, inventory holding costs, and expiration depreciation costs for each option, quantifying the expected total cost. After comparison, the system selects the order submission time and integer order quantity with the lowest expected total cost as the final option. For example, in this scenario, the optimal order instruction calculated by the system is: submit an order for 20 bags of fertilizer 7 days before the start of the planting season. This combination of order submission time and order quantity minimizes the expected total costs related to stockouts, inventory, and expiration, and is therefore selected by the system as the order instruction output.

[0101] After executing an order, the ordering entity will experience a parallel process of order fulfillment and stockouts occurring during the lead time. Within the shelf life, it will also incur damage handling and warehousing costs. Step S3 outputs the order submission time and integer order quantity, along with the expected decomposition of stockout losses, holding costs, and expired discounts. Step S4 uses operational flow data as evidence to align the expected and actual decompositions on the same timeline, further breaking down the deviation into deviations at the demand arrival intensity function level and cost parameter level, forming an auditable rolling calibration loop. However, the calibration process must maintain stable terminology to be valid during multi-period recalculations and traceability.

[0102] S401. Order execution flow data acquisition and time interval observation sequence generation.

[0103] The ordering entity identifier and the target agricultural input identifier are used as primary keys to read the order submission time and integer order quantity output in step S3, and the current stock of the target agricultural input output in step S1. The sampling timestamp sequence follows the time axis of steps S1 and S2. Adjacent sampling timestamps constitute a time interval, and time intervals are assigned a time interval number according to their chronological order. The interval duration is the difference between the later sampling timestamp and the earlier sampling timestamp. For each time interval number, four types of quantity observations are summarized: The first type is the actual transaction quantity in the interval, derived from the payment completion time and outbound quantity fields in the transaction record. The summary criteria are limited to the fulfilling entity being equal to the ordering entity identifier and the agricultural input identifier being equal to the target agricultural input identifier, and the payment completion time falling within the corresponding time interval; the second type is the quantity of unmet needs in the interval, derived from the unmet quantity field in the pre-order replenishment record and customer request record of the shortage registration form. The summary criteria are limited to the demand occurrence time falling within the corresponding time interval, and the consistency between the target agricultural input identifier and the ordering entity identifier is verified. The records passed shall prevail; the third category is the actual demand quantity in the interval, which is calculated as the sum of the actual transaction quantity in the interval and the quantity of unmet shortages in the interval, used to express the actual demand arrival within the same time interval; the fourth category is the interval damage quantity, which comes from the damage time and damage quantity fields in the damage report document, and the summary caliber is limited to the damage time falling into the corresponding time interval and the agricultural input identifier being consistent with the target agricultural input identifier; all four types of interval sequences are written into the execution observation sequence with the time interval sequence number of the sampling timestamp sequence as the index, and the execution observation sequence serves as the only fact entry point for all calibration calculations in step S4.

[0104] S402. The scope of coverage window delineation and window summary quantity is fixed.

[0105] The lead time coverage window starts at the order submission time and ends at the arrival and acceptance timestamp. The arrival and acceptance timestamp is taken from the completion time of acceptance in the warehousing and acceptance record, meaning the moment when the target agricultural input enters the ordering entity's salable inventory. The shelf life coverage window starts at the arrival and acceptance timestamp and ends at the moment when the arrival and acceptance timestamp are added together with the shelf life duration. The shelf life duration follows the shelf life definition from step S3. The lead time coverage window time interval index set consists of all time interval numbers that satisfy the condition that the interval start time is no earlier than the order submission time and the interval end time is no later than the arrival and acceptance timestamp. The shelf life coverage window time interval index set consists of all time interval numbers that satisfy the condition that the interval start time is no earlier than the arrival and acceptance timestamp and the interval end time is no later than the shelf life end time.

[0106] The actual demand quantity within the lead time coverage window is defined as the sum of the actual demand quantities within the time interval index set of the lead time coverage window. The actual demand quantity within the shelf life coverage window is defined as the sum of the actual demand quantities within the time interval index set of the shelf life coverage window. The actual loss quantity within the shelf life coverage window is defined as the sum of the loss quantities within the time interval index set of the shelf life coverage window.

[0107] S403. Establishment of Actual Cost Breakdown Ledger and Definition of Error Quantity.

[0108] Step S3 outputs the expected shortage quantity, expected holding quantity, and expected expired discount quantity. Step S4 generates the actual shortage quantity, actual holding quantity, and actual expired discount quantity under the same primary key. The actual shortage quantity is the sum of the unmet shortage quantities within the supply lead time coverage window. The actual holding quantity is the inventory ledger balance at the arrival and acceptance timestamp, which is taken from the available inventory field of the inventory ledger at the arrival and acceptance timestamp. The actual expired discount quantity is the actual damage quantity reported within the shelf life coverage window, which is derived from the quantity field of the damage report document.

[0109] The quantity caliber error is defined as follows: actual shortage quantity minus expected shortage quantity, actual holding quantity minus expected holding quantity, and actual expired discounted quantity minus expected expired discounted quantity.

[0110] The monetary error is defined as follows: the unit price of stockout loss multiplied by the stockout quantity error, the unit price of holding cost multiplied by the holding quantity error, and the unit price of expired discount multiplied by the expired discount quantity error. The three types of unit costs follow the cost parameter set in step S3.

[0111] The total error in cost breakdown is defined as the algebraic sum of the errors in the three categories of monetary amounts. The cost breakdown ledger uses the ordering entity identifier, the target agricultural input identifier, and the order submission time as the ledger's primary keys. The fields include the window summary quantity, the three categories of actual quantities, the three categories of expected quantities, the errors in the three categories of quantity amounts, the errors in the three categories of monetary amounts, and the total error in cost breakdown. All ledger fields can be recalculated and traced through transaction logs.

[0112] S404. Interval-level inverse calibration of demand arrival strength function and uncertainty parameter.

[0113] Step S2 outputs the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence, where the uncertainty parameter sequence consists of a shape parameter sequence and a rate parameter sequence, with the index caliber consistent with the time interval number. Step S4 first constructs the interval residual for each time interval number. The interval residual is defined as the actual demand quantity in the interval minus the predicted demand quantity in the interval. The predicted demand quantity in the interval is calculated by multiplying the intensity value of the discretized sequence of the demand arrival intensity function at the beginning of the time interval by the interval duration.

[0114] Subsequently, an update magnitude factor is constructed, with its value limited to between zero and one. The calculation is expressed using a natural exponential function: the update magnitude factor equals one minus the value of the natural exponential function at the ratio of the negative absolute value of the total cost decomposition error to the monetary scale. The monetary scale is obtained by multiplying the sum of the three types of unit costs by an inventory scale factor. The inventory scale factor is the sum of the target agricultural input inventory and the integer order quantity, plus a stabilization quantity constant. The stabilization quantity constant is a positive configuration term used to suppress cases where the denominator is zero and does not carry business threshold semantics. Shape parameter updates employ exponential mapping to maintain positive values. The update caliber is the original shape parameter value multiplied by the value of the natural exponential function at the product of the update magnitude factor and the interval residual ratio. The denominator of the interval residual ratio is the sum of the interval predicted demand quantity and the interval actual demand quantity, plus the stabilization quantity constant. The rate parameter update caliber remains unchanged in this embodiment, used to focus calibration on the direction of the interval intensity mean. The demand arrival intensity function update sequence is recalculated according to the ratio of the updated shape parameter value to the original rate parameter value, and written back to the updated demand arrival intensity function discretization sequence using a sampling timestamp sequence. The updated shape parameter sequence and rate parameter sequence together form the updated uncertainty parameter sequence, which serves as the initial input for the online estimation of the next cycle step S2.

[0115] S405. Profit and loss flow caliber and positive value update rules for reverse calibration of cost parameters.

[0116] Cost parameter updates are based on independent observation of actual loss amounts, avoiding insufficient identification caused by inference solely from quantity errors. The actual loss amount for stockouts is calculated by summing two parts: one is the emergency replenishment price difference, calculated by subtracting the regular purchase price from the actual purchase price of the emergency replenishment order and multiplying it by the emergency replenishment quantity; the other is the opportunity loss amount, calculated by multiplying the actual stockout quantity within the supply lead time coverage window by the unit gross profit, with unit gross profit derived from the operating profit and loss caliber. The actual loss amount for holding stock is the amount allocated to the target agricultural input in the warehousing cost allocation flow, with the time frame limited to the arrival and acceptance timestamp to the end of the shelf life. The actual loss amount for expired stockouts is the cumulative value of the reported loss amount field in the damage report within the shelf life coverage window. All three types of actual loss amounts are written into the cost breakdown ledger using the ordering entity identifier and the target agricultural input identifier as indexes. Updates to the three types of unit costs employ logarithmic difference-driven exponential mapping. The update caliber is the original unit cost multiplied by the value of the natural exponential function at the product of the update amplitude factor and the natural logarithmic difference. The independent variable of the natural logarithmic difference is the ratio of the actual loss amount plus the stabilization amount constant to the original unit cost multiplied by the corresponding actual quantity plus the stabilization quantity constant. Both the stabilization amount constant and the stabilization quantity constant are positive configuration items used for numerical stabilization. The stockout loss unit price is updated using the actual stockout loss amount and the actual stockout quantity; the holding cost unit price is updated using the actual holding loss amount and the actual holding quantity; and the expired discount unit price is updated using the actual expired discount loss amount and the actual expired discount quantity. The updated unit costs of the three types are written into the cost parameter set for the next period as input for the expected total cost calculation in step S3 of the next period.

[0117] S406. Relationship between the encapsulation and rolling call of calibration result sets.

[0118] Step S4 outputs a calibration result set, using the ordering entity identifier and the target agricultural input identifier as primary keys. Fields include the updated discretized sequence of the demand arrival intensity function, the updated uncertainty parameter sequence, the updated unit price for stockout losses, the updated unit price for holding costs, and the updated unit price for expired discounts, along with audit fields. The audit fields must include at least the total cost decomposition error, update magnitude factor, actual demand quantity within the lead time coverage window, actual demand quantity within the shelf life coverage window, actual reported losses within the shelf life coverage window, actual stockout quantity, actual holding quantity, actual expired discount quantity, and the amounts of the three types of actual losses. In the next cycle, step S2 reads the updated uncertainty parameter sequence and the updated discretized sequence of the demand arrival intensity function as initialization information for online estimation. In the next cycle, step S3 reads the updated three types of unit costs as input for calculating the expected total cost, thus ensuring a continuous closed loop between the ordering order and operating results under the same terminology system.

[0119] After step S4 is completed, the lead time coverage window and shelf life coverage window respectively obtain the demand fact summary based on the actual demand quantity within the interval, and form the overdue discount fact summary through the loss report documents. The cost decomposition ledger presents the three types of actual quantities, three types of expected quantities, and three types of actual loss amounts side by side, and both quantity and amount errors have recalcible sources. The discretized sequence of demand arrival intensity function and uncertainty parameter sequence complete interval-level calibration through interval residuals and update amplitude factors, and the three types of unit costs complete positive value updates through the actual loss amount calibrator. The calibration result set can be directly called by the next cycle steps S2 and S3, thus forming an auditable and stable rolling mechanism.

[0120] In one embodiment, in step S4, after the order is executed, the cooperative collects actual sales and inventory consumption data, including the number of transactions, the number of unmet needs due to stockouts, and the number of damaged items. For example, of the 20 bags of fertilizer ordered, 18 were successfully sold (actual transactions), and the remaining 2 bags were unsold. Of the 2 unsold bags, 1 bag was recorded as damaged due to prolonged storage and spoilage from moisture, while the other bag, although unsold, was still within its shelf life and stored intact as remaining inventory. In addition, during the sales process, 2 farmers came to purchase fertilizer when it was sold out but were unable to buy any; their demand was recorded as unmet needs due to stockouts. The system then establishes a cost breakdown ledger, comparing the actual data with the expected values ​​calculated before ordering, and calculating the cost errors in terms of stockouts, holding costs, and expiration. Then, based on the errors reflected in the ledger, the system calibrates and updates the discretized sequence of the demand arrival intensity function, the uncertainty parameter sequence, and the three types of unit cost parameters: stockout loss unit price, holding cost unit price, and expiration discount unit price. The updated parameter set is output as the calibration result set, providing a basis for the forecast of agricultural input demand in the next cycle, forming a closed-loop rolling calibration mechanism.

[0121] Example 2: Figure 2 The present invention provides a farmer agricultural input demand prediction system based on time-series behavior analysis, comprising: a signal generation unit, an intensity estimation unit, an order solving unit, and a closed-loop calibration unit;

[0122] The signal generation unit collects the current stock and delivery lead time of the target agricultural input corresponding to the ordering entity identifier, extracts the timestamp of the farmer's behavior event and performs consistency verification, and generates a continuous time demand signal sequence at the ordering entity granularity based on the contribution coefficient of the behavior event and time decay.

[0123] The intensity estimation unit counts arrivals within the statistical interval of the lead time coverage window, estimates the demand arrival intensity function based on the continuous time demand signal sequence of the order subject granularity, updates the uncertainty parameter sequence with the temperature factor, and outputs the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence.

[0124] The order solving unit uses the stockout loss unit price, holding cost unit price and expiration discount unit price to form the expected total cost. Based on the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence, under the constraints of packaging step size, minimum order quantity and shelf life, it solves the order submission time and integer order quantity and outputs the order instruction.

[0125] The closed-loop calibration unit collects transaction data, out-of-stock data, and damage data after the order instruction is executed, establishes a cost decomposition ledger, and updates the discretized sequence of the demand arrival intensity function, the uncertainty parameter sequence, and the three types of unit costs based on the ledger error, and outputs a set of calibration results.

[0126] Specifically, the above description is only a preferred embodiment of this application and is not intended to limit this application.

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

[0128] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for predicting farmers' agricultural input demand based on time-series behavioral analysis, characterized in that, Including the following steps: S1: Collect the current stock and delivery lead time of the target agricultural input corresponding to the ordering entity identifier, extract the timestamp of the farmer's behavior event and perform consistency verification, and transcribe the continuous time demand signal sequence at the ordering entity granularity according to the contribution coefficient of the behavior event and the time decay. S2: Based on the continuous-time demand signal sequence at the order subject granularity, within the supply lead time coverage window, time intervals are formed by adjacent sampling timestamps, and the interval arrival count is counted. The interval arrival count corresponds to the number of completed orders whose payment completion time falls within the time interval; the demand arrival intensity function and uncertainty parameter sequence are estimated online, where the demand arrival intensity function is the expected number of transactions arriving per unit time, and the uncertainty parameter sequence is the shape parameter sequence and rate parameter sequence corresponding to each time interval; and the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence are output. S3: Taking the expected total cost corresponding to the stockout loss unit price, holding cost unit price, and expired discount unit price as the objective, based on the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence, under the constraints of packaging step size, minimum order quantity, and shelf life, solve the order submission time and integer order quantity, and output the order instruction; S4: Collect transaction data, stockout data, and loss data after order execution, establish a cost decomposition ledger, update the discretized sequence of demand arrival intensity function, uncertainty parameter sequence, and three types of unit costs based on ledger errors. The three types of unit costs are stockout loss unit price, holding cost unit price, and expired discount unit price. Output the calibration result set.

2. The method for predicting farmers' agricultural input demand based on time-series behavioral analysis according to claim 1, characterized in that: In step S1, a one-to-one mapping table between the original material code and the target agricultural input identifier is established based on the commodity master data. The successfully mapped consultation records, inquiry records, order records, payment completion records and return records are extracted as a sequence of farmer behavior event timestamps. The behavior event type is taken from the fixed category code of the touchpoint enumeration table, and the farmer behavior event timestamp is taken from the time the business occurred.

3. The method for predicting farmers' agricultural input demand based on time-series behavioral analysis according to claim 2, characterized in that: In step S1, the fulfillment subject field of the most recently completed order within the lead time window before the order calculation start time is used to determine the overlay mapping value. When the fulfillment subject field is missing, the customer master data belonging subject field is used to determine the overlay mapping value. Deduplication is performed using the event source serial primary key and the earliest written record is retained. The timing verification is performed based on the constraint that the payment completion timestamp is not earlier than the order placement timestamp and the return timestamp is not earlier than the payment completion timestamp, forming a sequence of farmer behavior event timestamps arranged in ascending order.

4. The method for predicting farmers' agricultural input demand based on time-series behavioral analysis according to claim 3, characterized in that: In step S2, within the supply lead time coverage window, a time interval is formed by adjacent sampling timestamps and the interval arrival count is counted. The interval arrival count corresponds to the number of completed orders whose payment time falls into the time interval. Based on the value of the continuous time demand signal sequence of the ordering entity at the beginning of the time interval, the prior mean of the demand arrival intensity function is generated by exponential mapping, and the target agricultural input intensity benchmark coefficient and the target agricultural input signal sensitivity coefficient are estimated by Poisson log-likelihood iteration.

5. The method for predicting farmers' agricultural input demand based on time-series behavioral analysis according to claim 4, characterized in that: In step S2, a mixture likelihood of the regular Poisson component and the heavy-tailed component is constructed for the interval arrival count. The temperature factor is calculated based on the posterior probability of the regular Poisson component. The temperature factor is used to measure the confidence ratio of observations entering the update in a single time interval, and its value ranges from greater than zero to no greater than one. The mixture coefficient is updated with the expectation maximization. Subsequently, the shape parameter sequence and the rate parameter sequence are conjugate updated with the temperature factor, and the uncertainty parameter sequence is output. The temperature factor and the mixture coefficient are output as audit fields.

6. The method for predicting farmers' agricultural input demand based on time-series behavioral analysis according to claim 5, characterized in that: In step S3, the delivery time is determined by the order submission time and the lead time, and a set of indexes for the lead time coverage window and the shelf life coverage window are generated accordingly. Based on the shape parameter sequence and rate parameter sequence, the distribution of the number of demand arrivals in each time interval is determined. Then, the distribution of demand in the lead time coverage window and the distribution of demand in the shelf life coverage window are calculated by inter-interval discrete convolution. The recursive process is trunculated with numerical precision parameters to limit support.

7. The method for predicting farmers' agricultural input demand based on time-series behavioral analysis according to claim 6, characterized in that: In step S3, an integer order quantity set is constructed using the packaging step size multiple rule and the minimum order quantity segmentation rule, and the expected total cost is constituted using the stockout loss unit price, holding cost unit price, and expiration discount unit price. After determining the upper bound of the order quantity based on the cumulative probability and cost ratio of the demand distribution within the shelf life coverage window, candidate order submission times and integer order quantities are enumerated, and the order instruction corresponding to the minimum expected total cost is selected and three types of expected amount decomposition fields are output.

8. The method for predicting farmers' agricultural input demand based on time-series behavioral analysis according to claim 7, characterized in that: In step S4, the sampling timestamp sequence is used to form a time interval number, and the actual transaction quantity, the quantity of unmet stock shortage, the actual demand quantity, and the quantity of reported losses in the interval are summarized according to the time interval number. The actual demand quantity in the interval is the sum of the actual transaction quantity and the quantity of unmet stock shortage in the interval. A window summary quantity is formed on the supply lead time coverage window and the shelf life coverage window, and a cost decomposition ledger is established to record the expected quantity, the actual quantity, and the error in the amount.

9. The method for predicting farmers' agricultural input demand based on time-series behavioral analysis according to claim 8, characterized in that: In step S4, the interval residual is constructed by the difference between the actual demand quantity and the predicted demand quantity in the interval, and the update amplitude factor is calculated by the total error of cost decomposition and the monetary scale. The shape parameter sequence is updated by exponential mapping, and the demand arrival intensity function discretization sequence is recalculated based on the shape parameter sequence and the rate parameter sequence. At the same time, the unit price of stockout loss, the unit price of holding cost, and the unit price of overdue discount are updated with positive values ​​driven by logarithmic difference based on the three types of actual loss amounts, and the calibration result set is output for the next cycle to read.

10. A farmer's agricultural input demand forecasting system based on time-series behavior analysis, used to implement the method described in any one of claims 1-9, comprising a signal generation unit, an intensity estimation unit, an order solving unit, and a closed-loop calibration unit; The signal generation unit collects the current stock and delivery lead time of the target agricultural input corresponding to the ordering entity identifier, extracts the timestamp of the farmer's behavior event and performs consistency verification, and generates a continuous time demand signal sequence at the ordering entity granularity based on the contribution coefficient of the behavior event and time decay. The intensity estimation unit counts arrivals within the supply lead time coverage window, with each arrival count corresponding to the number of completed orders whose payment completion time falls within a given time interval. It estimates the demand arrival intensity function based on the continuous-time demand signal sequence at the ordering entity level. This demand arrival intensity function is the expected number of arrivals per unit time. The unit also updates the uncertainty parameter sequence with a temperature factor, which is calculated using the posterior probability of conventional Poisson components to measure the confidence ratio of observations entering the update within a single time interval. The temperature factor's value ranges from zero to no more than one. The uncertainty parameter sequence consists of the shape parameter sequence and rate parameter sequence corresponding to each time interval. The output is a discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence. The order solving unit uses the stockout loss unit price, holding cost unit price and expiration discount unit price to form the expected total cost. Based on the discretized sequence of the demand arrival intensity function and the uncertainty parameter sequence, under the constraints of packaging step size, minimum order quantity and shelf life, it solves the order submission time and integer order quantity and outputs the order instruction. The closed-loop calibration unit collects transaction data, out-of-stock data, and loss data after the order instruction is executed, establishes a cost decomposition ledger, and updates the discretized sequence of demand arrival intensity function, uncertainty parameter sequence, and three types of unit costs based on the ledger error. The three types of unit costs are the out-of-stock loss unit price, the holding cost unit price, and the expired discount unit price. The unit outputs a set of calibration results.