Management early warning method based on breeding profit attribution analysis

CN122965808APending Publication Date: 2026-10-23GUANGDONG XINNONG INTERNET TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610874306.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-17
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0003]然而,现有成本管理系统在核算成本时,多依赖批次结束后的人工汇总对账,周期长达数天至数周,系统无法在过程中实时获取盈亏状态,导致错失成本异常的识别与干预窗口;而在需要输出盈利结论时,目前的系统仅能给出总成本偏高的粗放结论,无法将亏损精确拆解至具体管理决策节点(如饲料投喂策略调整、疾病处置时机选择等),导致根因定位模糊,管理者无从判断是哪个环节出现了管控漏洞,只能采取笼统的成本压缩措施

Benefits of technology

[0028]采用本实现方式,将系统的分析能力从专业管理者下沉至一线养户,以可视化和可理解的方式赋能养户基于数据优化饲喂方案和出栏决策,相比传统的"公司技术员定期巡场+口头指导"模式,本方案通过自动化的数据分析和报告生成,大幅降低了养户对专业财务知识和技术指导的依赖,同时使公司的技术资源能够集中于高价值的复杂案例而非日常性的数据解读。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122965808A_ABST
    Figure CN122965808A_ABST
Patent Text Reader

Abstract

The application discloses a management early warning method based on breeding profit attribution analysis, comprising the following steps: acquiring multi-source cost data and market price data of a breeding batch in real time; fusing the cost evolution law with the actual cost data of the current batch, and combining the market price data to generate profit and loss prediction information of the current batch; performing attribution analysis on the cost of the current batch to determine the key cost link and / or management decision behavior that causes the profit and loss deviation; determining a dynamic early warning threshold according to at least the historical cost index distribution of similar batches, and triggering a hierarchical early warning based on the profit and loss prediction information and the dynamic early warning threshold. The application unifies real-time profit and loss perception, cross-cycle knowledge transfer, precise attribution tracing and adaptive early warning into a closed-loop system, so that managers can obtain an interpretable profit and loss conclusion during the process of the batch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of artificial intelligence and digitalized agriculture and animal husbandry, and in particular to a management early warning method based on breeding profit attribution analysis. Background Art

[0002] With the rapid development of large-scale breeding, breeding enterprises have generally deployed digital management systems to realize electronic collection and storage of production process data.

[0003] However, existing cost management systems mostly rely on manual summary and reconciliation after the end of a batch when calculating costs, with a period ranging from several days to several weeks. The systems cannot obtain the profit and loss status in real time during the process, resulting in missing the identification and intervention window for cost anomalies; when a profit conclusion needs to be output, current systems can only give a rough conclusion that the total cost is on the high side, and cannot accurately decompose the loss into specific management decision nodes (such as feed feeding strategy adjustment, disease disposal timing selection, etc.), leading to vague root cause localization, so that managers cannot determine which link has a control loophole, and can only adopt general cost reduction measures.

[0004] The main reason for these problems is that current cost management systems fail to associate the cost data of each batch, so that the cost fluctuation rules and profit and loss evolution trajectories of similar batches cannot be automatically migrated and reused. Therefore, the utilization of historical experience remains highly dependent on manual judgment, lacking a cross-cycle knowledge migration mechanism; in addition, current early warnings mostly adopt static thresholds. For example, a pasture breeding risk prompting method disclosed in Chinese Patent No. CN112633568B can only rely on fixed mapping rules, cannot dynamically adjust sensitivity according to market conditions, historical data distribution and breeding stages, and is prone to false alarms or missed alarms.

[0005] Although some current solutions introduce a hierarchical early warning mechanism based on an LSTM prediction model (such as "real-time cost control method and system for pig breeding enterprises"), they only extrapolate based on the time series data of the current batch, do not realize cross-batch similarity retrieval and knowledge migration, and the early warning thresholds do not have adaptive update capabilities. In scenarios such as variety rotation and seasonal fluctuations, the prediction accuracy and early warning effectiveness are significantly reduced.

[0006] These aspects restrict the transformation of enterprises from the "experience-driven" to "data-driven" operation mode.

[0007] Therefore, in order to simultaneously meet the requirements of real-time monitoring of breeding profit and loss, fine attribution and traceability, and adaptive adjustment of early warning, the present application proposes a management early warning method based on breeding profit attribution analysis that can realize dynamic perception of profit and loss during the breeding process, precise loss localization, and automatic adaptation of early warning sensitivity, so as to provide timely and reliable decision support for breeding managers. Contents of the Invention

[0008] The purpose of this invention is to address the shortcomings of existing technologies by proposing a management and early warning method based on aquaculture profit attribution analysis. This method integrates real-time profit and loss perception, cross-cycle knowledge transfer, accurate attribution tracing, and adaptive early warning into a closed-loop system. Managers can obtain interpretable profit and loss conclusions during batch operations: they not only know whether they are currently profitable, but also the specific reasons for profit or loss, and whether immediate intervention is needed. Compared with existing technologies, this solution has significantly better prediction accuracy and early warning effectiveness in scenarios such as species rotation and seasonal fluctuations through cross-batch similarity retrieval and knowledge transfer.

[0009] Firstly, in order to achieve the above objectives, the present invention provides the following technical solution: Management early warning methods based on aquaculture profitability attribution analysis include: Real-time acquisition of multi-source cost data and market price data for each breeding batch; Based on the breeding characteristic parameters of the current batch, at least one historical batch similar to the current batch is retrieved from the knowledge base storing historical batch data, and the cost evolution pattern of the similar batch is extracted. The cost evolution pattern is integrated with the actual cost data of the current batch, and combined with the market price data to generate profit and loss prediction information for the current batch. Perform cost attribution analysis on the current batch to identify key cost factors and / or management decisions that lead to profit / loss deviations. Based at least on the historical cost index distribution of the similar batches, a dynamic early warning threshold is determined, and a tiered early warning is triggered based on the profit and loss prediction information and the dynamic early warning threshold.

[0010] This implementation method unifies real-time profit and loss perception, cross-cycle knowledge transfer, accurate attribution and tracing, and adaptive early warning into a closed-loop system. Managers can obtain interpretable profit and loss conclusions during batch processing: they not only know whether they are currently profitable, but also the specific reasons for profit or loss, and whether immediate intervention is needed. Compared with existing technologies, this solution has significantly better prediction accuracy and early warning effectiveness in scenarios such as product rotation and seasonal fluctuations through cross-batch similarity retrieval and knowledge transfer.

[0011] In conjunction with the first aspect, in one implementation method, the multi-source cost data includes at least two of the following: feed consumption flow, drug and consumable outbound records, labor cost entry data, and dead feed event records; The breeding characteristic parameters include at least three of the following: breed identification, batch start season, feeding cycle, initial stock quantity, main feed type, and geographical identification.

[0012] This implementation method ensures that the data source and feature dimensions are sufficient to support subsequent retrieval and prediction steps.

[0013] In conjunction with the first aspect, in one implementation, retrieving at least one historical batch similar to the current batch from the historical batch knowledge base includes: Calculate the similarity between the current batch's aquaculture feature vector and the feature vectors of historical batches, and select the top K historical batches with the highest similarity, where K is a preset positive integer.

[0014] This implementation replaces manual screening or simple rule matching (such as two-dimensional cross-screening based solely on variety and season) with vectorized similarity calculation, ensuring the objectivity and accuracy of the search results and providing high-quality input for the subsequent migration of cost evolution patterns, thus achieving true cross-batch knowledge transfer.

[0015] In conjunction with the first aspect, in one implementation method, the fusion of cost evolution patterns with the actual cost data already incurred in the current batch includes: The cost time-series trajectory of each similar batch is weighted by the similarity of each similar batch. The weighted result is then fused with the actual cost trajectory of the current batch to generate a corrected cost prediction curve.

[0016] This implementation ensures that the prediction has a reasonable historical dependency-current trust balance at different stages of the batch, avoiding prediction bias caused by simple equal-weighted migration.

[0017] In conjunction with the first aspect, in one implementation method, the attribution analysis of the cost of the current batch includes: Based on the preset mapping rules between cost events and management decision-making behaviors, each cost transaction that has occurred in the current batch is attributed to the corresponding management decision-making node. The management decision-making node includes at least one of the following: feeding operation node, medication operation node, environmental control operation node, or dead animal disposal operation node.

[0018] By adopting this implementation method, the attribution granularity is refined from the batch level to the operational level. Managers can accurately identify specific decision-making errors or abnormal events, achieving a leap from "knowing that a loss has occurred" to "knowing why a loss occurred and which decision resulted in a loss." Compared to existing systems that can only provide a rough conclusion such as "total cost is too high," the decision-making behavior-level attribution provided by this solution offers an actionable basis for managers' precise intervention.

[0019] In conjunction with the first aspect, in one implementation, the attribution analysis also includes spatial dimension attribution: When a farm contains multiple pens, each cost transaction is further attributed to the specific pen identifier in which the cost occurred; the pen identifier is obtained through the pen ID reported by the IoT device, the pen field associated with the operation record, or the pen information in the inspection record.

[0020] This approach enables detailed cost attribution across spatial dimensions, allowing for independent analysis and comparative display of profits and losses in different enclosures. This helps managers identify problematic enclosures and implement targeted improvements during batch processing, preventing "egalitarianism" from masking individual differences.

[0021] In conjunction with the first aspect, in one implementation, determining the dynamic early warning threshold based at least on the historical cost index distribution of the similar batches includes: Obtain the historical distribution of similar cost indicators for the same batches, and calculate the mean and standard deviation of the distribution; The initial warning threshold is based on the mean plus or minus N times the standard deviation, where N is a configurable parameter; As the current batch progresses, the cost indicator data generated in the current batch is incorporated into the distribution for incremental updates, and the early warning threshold benchmark is periodically updated.

[0022] This implementation method constructs a way to dynamically calculate the dynamic early warning threshold based on the historical distribution of similar batches, and an adaptive boundary that can automatically converge as the batch progresses. Compared with the existing technology, this solution solves the problem of large-scale failure of fixed thresholds in scenarios such as variety rotation, seasonal fluctuations, and new farm commissioning.

[0023] In conjunction with the first aspect, in one implementation method, the triggering of tiered early warnings based on profit and loss forecast information and dynamic early warning thresholds includes: When the cost indicator exceeds the preset range of the dynamic early warning threshold, the corresponding level of early warning is triggered; the level includes at least a first-level early warning and a second-level early warning, which correspond to different ranges of excess.

[0024] By adopting this implementation method, a hierarchical response mechanism is established, allowing managers to allocate attention according to priority: minor deviations require attention, moderate deviations require intervention within a specified period, and severe deviations require immediate response. This avoids information overload and response delays, and upgrades the warning from "telling you there is a problem" to "telling you what the problem is, why the problem occurred, and suggesting how to solve it," truly realizing a closed loop from alarm to decision support.

[0025] In conjunction with the first aspect, one implementation method also includes: Receive user-configured management intervention scenario parameters, and calculate and compare the expected profit and loss under each scenario based on the fusion result of the cost evolution law and the actual cost data that has occurred in the current batch. The scenario parameters include at least one of the following: adjustment of expected slaughter date, feed unit price assumption, and mortality rate assumption.

[0026] This implementation method reuses the established cross-cycle migration model to provide managers with multiple profit and loss comparisons, supporting data-driven business decisions rather than intuitive judgments. Furthermore, all scenarios share the same set of fusion coefficients to ensure the scientific nature and consistency of the comparisons.

[0027] In conjunction with the first aspect, one implementation method also includes: Based on the results of the attribution analysis and / or the information of the graded early warning, a cost-benefit analysis report for individual farmers is generated. The report includes at least one of the following: profit and loss comparison for this batch, benchmarking of indicators with similar farmers, and suggestions for business improvement.

[0028] This approach extends the system's analytical capabilities from professional managers to frontline farmers, empowering them to optimize feeding programs and make slaughter decisions based on data in a visual and understandable way. Compared to the traditional model of "company technicians making regular field visits and providing verbal guidance," this solution significantly reduces farmers' reliance on professional financial knowledge and technical guidance through automated data analysis and report generation. At the same time, it allows the company's technical resources to be focused on high-value, complex cases rather than routine data interpretation.

[0029] Compared with existing technologies, the beneficial effects of this invention are as follows: it unifies real-time profit and loss perception, cross-cycle knowledge transfer, accurate attribution and tracing, and adaptive early warning into a closed-loop system. Managers can obtain interpretable profit and loss conclusions during batch processing: they not only know whether they are currently profitable, but also the specific reasons for profit or loss, and whether immediate intervention is needed. Compared with existing technologies, this solution has significantly better prediction accuracy and early warning effectiveness in scenarios such as variety rotation and seasonal fluctuations through cross-batch similarity retrieval and knowledge transfer. Attached Figure Description

[0030] Figure 1 This is a flowchart of the management early warning method based on aquaculture profit attribution analysis proposed in this invention. Detailed Implementation

[0031] 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.

[0032] Example 1: Please see Figure 1This invention provides the following technical solution: a management early warning method based on aquaculture profit attribution analysis, comprising: Real-time acquisition of multi-source cost data and market price data for each breeding batch; Based on the breeding characteristic parameters of the current batch, at least one historical batch similar to the current batch is retrieved from the knowledge base storing historical batch data, and the cost evolution pattern of the similar batch is extracted. The cost evolution pattern is integrated with the actual cost data of the current batch, and combined with the market price data to generate profit and loss prediction information for the current batch. Perform cost attribution analysis on the current batch to identify key cost factors and / or management decisions that lead to profit / loss deviations. Based at least on the historical cost index distribution of the similar batches, a dynamic early warning threshold is determined, and a tiered early warning is triggered based on the profit and loss prediction information and the dynamic early warning threshold.

[0033] As an optional implementation of the present invention, this solution constructs a complete closed-loop management mechanism of "real-time perception - cross-cycle migration - accurate attribution - adaptive early warning".

[0034] In this embodiment, "real-time acquisition" does not involve a one-time data collection at the beginning or end of a batch, but rather involves continuously collecting and updating data from multiple heterogeneous data sources during the breeding batch. The data is then processed through unified timestamp alignment and data format standardization to form a structured event stream for subsequent steps to call.

[0035] Specifically, the sources of multi-source cost data include, but are not limited to: the feeding record interface of the automatic feeding system (timestamp, weight, and feed category code for each feeding), the veterinary drug and consumable warehouse management system (drug issuance time, name, quantity, and pen used), the attendance and payroll system (labor costs are entered after being allocated by pen or batch), and the registration of dead pig events from the inspection terminal (dead pig time, quantity, and cause classification). Market price data is obtained through API access to third-party market data platforms, such as the National Live Pig Exit Price Monitoring System of the Ministry of Agriculture and Rural Affairs and the spot price quotations for corn and soybean meal from the China Feed Industry Information Network. The update frequency is synchronized with the market data platform, usually once a day or more.

[0036] It should be noted that the level of digitalization varies among different livestock farming enterprises. For large-scale livestock groups that have fully deployed ERP and IoT devices, all four types of cost data mentioned above can be accessed in real time. For small and medium-sized farms that have not yet deployed automatic feeding systems, the system can still perform profit and loss attribution analysis by only accessing drug delivery records and mortality event records as cost data sources, although the accuracy of the attribution will decrease accordingly as the number of data sources decreases. Compared with existing cost management systems that either rely entirely on manual summarization and reconciliation after batches or can only access a single type of cost data and lack the ability to integrate and process multi-source heterogeneous data, the data access capability of this technical solution is more flexible.

[0037] "Breeding characteristic parameters" are a set of descriptive fields initialized when a batch is created. These fields characterize the key attributes of the current batch and include at least the breed identifier (e.g., "Duroc-Landrace-Large White Crossbred" or "PIC Breed"), the batch's starting season (based on the meteorological season of the batch creation date, e.g., December-February is winter), the feeding cycle (planned number of days to market, e.g., 150-180 days for fattening pigs), the initial stock quantity (the number of pigs in the pen at the time of batch creation), the main feed type (e.g., "corn-soybean meal type" or "wheat-soybean meal type"), and the geographical identifier (the administrative division code or geographical region to which the breeding site belongs, e.g., East China, South China, Northeast China). These parameters constitute the feature space for subsequent similar batch searches.

[0038] The "historical batch knowledge base" is the core data asset of this system. After each breeding batch concludes, the system automatically extracts and persistently stores the complete data archive for that batch, including: basic batch information (the aforementioned breeding characteristic parameters), complete time-series cost data (daily or weekly records of average feed cost per head, average medication cost per head, average labor cost per head, cumulative mortality rate, etc.), the final batch profit and loss result (total revenue minus total cost), and key management decision events triggered during the batch (such as feed change times, vaccination times, disease treatment records, etc.). The knowledge base can be implemented using a relational database (such as MySQL, PostgreSQL) or a time-series database (such as InfluxDB, TDengine), supporting similarity retrieval based on feature vectors.

[0039] "Cost evolution patterns" refer to the patterns of cost indicators extracted from similar historical batches over time, which can take the form of multi-dimensional time series curves. For example, the cost evolution pattern of a typical fattening pig batch may include: a step-like upward curve of average daily feed cost per head with increasing age (corresponding to feed formula switching during the nursery, growth, and fattening stages); an S-shaped growth curve of average cumulative medication cost per head (slow in the early stage, rapidly increasing in the middle stage due to concentrated immunization, and stabilizing in the later stage); and a piecewise linear curve of cumulative mortality rate (with a higher slope during the brooding and regrouping stress periods, and a lower slope during the stable period). It should be noted that "cost evolution patterns" are not limited to the specific curve forms mentioned above; any data representation that can reflect the trend of historical batch costs over time is applicable, such as statistical distributions, regression equations, or piecewise linear functions.

[0040] "Integration" refers to combining historical patterns with current realities to generate more reliable predictions. In practice, for each prediction point in time, the system calculates two values: a predicted value extrapolated from historical patterns (weighted by cost trajectories of similar batches) and a trend extrapolation value based on existing data from the current batch (obtained through regression or smoothing of actual cost data from the current batch). These two values ​​are then integrated using a weighted average or Kalman filter. The weights are dynamically adjusted based on the number of days the current batch has been completed: in the early stages of the batch (e.g., less than 20% of the total feeding cycle), historical patterns have a higher weight (e.g., 0.7-0.9) because the current data is insufficient to establish a reliable trend; as the batch progresses and more current data accumulates, the weight of the current trend gradually increases (e.g., after the batch reaches 60%, the current trend weight increases to 0.6-0.8). This dynamic weighting mechanism ensures a reasonable balance between "historical dependence" and "current trust" in the prediction at different stages of the batch.

[0041] "Attribution analysis" refers to decomposing the deviation between the current batch's profit / loss forecast and the target profit value into various cost links and / or management decision-making behaviors, quantifying the contribution of each link to the deviation. One implementation method is to use a link-by-link deviation analysis: comparing the actual value of each cost link with the benchmark value of that link in similar historical batches, and multiplying the deviation by the proportion of that link in the total cost to obtain the contribution of that link. Another implementation method is to use the Shapley value decomposition method, treating each cost link as a participant in a cooperative game, and calculating the marginal contribution of each link to the total profit / loss deviation. This method is more accurate when there are interaction effects between links (such as an increase in feed costs leading to an increase in medicine costs). Both methods are within the scope of protection of this embodiment.

[0042] Regarding the "dynamic early warning threshold," compared to existing technologies (the ranch farming risk warning method disclosed in Chinese invention patent CN112633568B uses a static threshold), which relies on fixed mapping rules and cannot dynamically adjust sensitivity according to market conditions, historical data distribution, and farming stages, thus easily leading to false alarms or missed alarms, the dynamic early warning threshold in this solution is automatically calculated from the historical cost index distribution of similar batches and is periodically updated as the current batch progresses.

[0043] This implementation method unifies real-time profit and loss perception, cross-cycle knowledge transfer, accurate attribution and tracing, and adaptive early warning into a closed-loop system. Managers can obtain interpretable profit and loss conclusions during batch processing: they not only know whether they are currently profitable, but also the specific reasons for profit or loss, and whether immediate intervention is needed. Compared with existing technologies, this solution has significantly better prediction accuracy and early warning effectiveness in scenarios such as product rotation and seasonal fluctuations through cross-batch similarity retrieval and knowledge transfer.

[0044] In some possible embodiments, the multi-source cost data includes at least two of the following: feed consumption flow, drug and consumable outbound records, labor cost entry data, and dead feed event records; The breeding characteristic parameters include at least three of the following: breed identification, batch start season, feeding cycle, initial stock quantity, main feed type, and geographical identification.

[0045] As an optional implementation of this invention, for multi-source cost data, in a typical deployment scenario, the system only needs to access at least two types of data: feed consumption logs and mortality / elimination event records to function. Feed consumption logs are typically generated by automated feeding systems or manual weighing records, including the feed category code, weight (kg), timestamp, and pen ID for each feed delivery. Mortality / elimination event records originate from inspection terminals or veterinary workstations, including the time of death / elimination, number of animals, weight, and cause classification (e.g., disease, crushing, weak offspring). These two types of data cover feed costs (typically 60%-75%), which constitute the largest proportion of breeding costs, and mortality / elimination losses, which have the greatest impact on profitability. Therefore, even with only these two types of data accessed, the system can still perform valuable profit and loss attribution analysis.

[0046] For breeding characteristic parameters, at least three are sufficient to support effective similar batch retrieval. In a typical deployment scenario, the system defaults to selecting breed identifier, batch start season, and regional identifier as the minimum feature set—these three parameters are enough to divide batches in the knowledge base into similar groups with reference value. For example, historical batches of "Duroc-Landrace-Large White crossbred + winter + East China" usually have high comparability in terms of feed consumption patterns and mortality rates. Taking the pig industry as an example, winter batches of piglets have higher energy costs and increased respiratory disease incidence due to the need for insulation, resulting in a systematic difference in cost structure compared to summer batches; feed raw material prices, climate conditions, and mainstream breeding models in East China also differ significantly from those in Southwest or Northeast China. If retrieval is only performed by breed identifier without considering the seasonal and regional dimensions, a large number of incomparable batches will be mixed in, leading to a significant decrease in the accuracy of subsequent cost evolution pattern migration.

[0047] As livestock enterprises increase their digitalization, parameters such as feeding cycle, initial stock size, and main feed categories can be gradually added. For example, two batches of the same breed but with significantly different initial stock sizes (e.g., 500 vs. 5000) will have systematic differences in per-head fixed costs (e.g., labor, utilities, depreciation) due to economies of scale. Therefore, the initial stock size is an important differentiating dimension. Similarly, differences in main feed categories (corn-soybean meal vs. wheat-soybean meal) will lead to differences in baseline feed costs—wheat-soybean meal formulations typically have slightly lower feed conversion efficiency than corn-soybean meal formulations, but also lower raw material costs.

[0048] This implementation method ensures that the data source and feature dimensions are sufficient to support subsequent retrieval and prediction steps.

[0049] In some possible embodiments, retrieving at least one historical batch similar to the current batch from the historical batch knowledge base includes: Calculate the similarity between the current batch's aquaculture feature vector and the feature vectors of historical batches, and select the top K historical batches with the highest similarity, where K is a preset positive integer.

[0050] As an optional implementation of this invention, the breeding characteristic parameters of the current batch are first encoded into a numerical feature vector. Taking the breeding characteristic parameters, including breed identification, batch start season, feeding cycle, initial stock quantity, main feed category, and regional identification, as an example: the breed identification and main feed category adopt one-hot encoding, for example, "Dugler-Landrace-Large White Crossbred" is encoded as [1,0,0,...], and "PIC breeding system" is encoded as [0,1,0,...]; the batch start season adopts sequential encoding (spring=1, summer=2, autumn=3, winter=4); the feeding cycle and initial stock quantity directly use the original values ​​(e.g., 180 days, 2000 heads); the regional identification adopts the numerical encoding of administrative division code or the one-hot encoding of geographical partition. All numerical dimensions are Z-score standardized or Min-Max normalized before similarity calculation to eliminate the influence of different units of measurement. For example, the range of the feeding cycle (100-200 days) differs from the initial stock size (500-10000 heads) by two orders of magnitude. If normalization is not performed, the difference in the feeding cycle will be completely overshadowed by the difference in the stock size.

[0051] Cosine similarity can be used for similarity calculation. Taking cosine similarity as an example, the similarity between two batches is equal to the inner product of their normalized feature vectors divided by the product of their respective moduli, with a value between 0 and 1. The closer to 1, the more similar the batches. The formula is: similarity(A,B) = (A·B) / (|A|×|B|). For example, if the feature vector of the current batch A is normalized to [0.85, 0.30, 0.22, 0.15, 0.28, 0.18], and the historical batch B is [0.82, 0.33, 0.25, 0.18, 0.25, 0.20], then similarity(A,B) = 0.96, indicating a high degree of similarity.

[0052] The default value for K can be set to 5—this value has been experimentally verified to ensure sufficient reference information while avoiding noise interference from too many low-similarity batches. Taking a large-scale pig farm with 2000 pigs as an example, if the historical batch knowledge base stores about 60 fattening batches within 3 years, and about 15 of these are Duroc-Landrace-Large White crossbreds from winter, when K=5, the 5 most similar batches can be selected as references. This ensures statistical stability (5 samples are sufficient to calculate meaningful mean and standard deviation) while eliminating interference from batches with very low similarity. For cold start scenarios (such as newly commissioned farms) where the total number of historical batches is less than K, the system directly uses all available batches and marks the output with a message "Reference sample size is too small (N=X), confidence level is limited," for managers to refer to when making decisions.

[0053] In other possible embodiments, similarity calculation can also employ a Mahalanobis distance-based metric. Mahalanobis distance considers the correlation between feature dimensions and is more accurate than Euclidean distance in scenarios where collinearity exists across feature vector dimensions. For example, the feeding cycle and initial stock quantity may be positively correlated in large-scale farms (more stock, more standardized batch management, and more stable feeding cycles). In this case, Mahalanobis distance can automatically eliminate the bias of this correlation in similarity judgment. Furthermore, the K value can not be a fixed preset value but can be dynamically determined by setting a similarity threshold (e.g., selecting only historical batches with a similarity greater than 0.7), so that the retrieval results are not directly affected by the size of the knowledge base—when the knowledge base grows from 60 batches to 600 batches, the K value automatically expands from 5 to potentially reach 20-30, fully utilizing the continuously accumulating historical data to improve reference quality. Both of these alternative solutions fall within the scope of protection of this embodiment.

[0054] This implementation replaces manual screening or simple rule matching (such as two-dimensional cross-screening based solely on variety and season) with vectorized similarity calculation, ensuring the objectivity and accuracy of the search results and providing high-quality input for the subsequent migration of cost evolution patterns, thus achieving true cross-batch knowledge transfer.

[0055] In some possible embodiments, the fusion of cost evolution patterns with actual cost data already incurred in the current batch includes: The cost time-series trajectory of each similar batch is weighted by the similarity of each similar batch. The weighted result is then fused with the actual cost trajectory of the current batch to generate a corrected cost prediction curve.

[0056] As an optional implementation of this invention, the weighted estimation steps are as follows: First, the similarity of K similar batches is normalized so that the sum of all weights is 1. For example, the original similarity of three similar batches are 0.92, 0.78, and 0.55, respectively, and their normalized weights are 0.41, 0.35, and 0.24. Then, for each time point on the prediction timeline (e.g., day N), the cost index values ​​of each similar batch on day N are weighted and summed using the normalized weights to obtain the historical pattern prediction value.

[0057] Taking a specific scenario as an example: The current batch is a Duroc-Landrace-Large White three-way crossbred winter batch, currently on day 60 (total feeding cycle 180 days). The system retrieved three similar batches. For the prediction of the average daily feed cost per head on day 90: Batch 1 (similarity 0.92) has a cost of 5.8 yuan / head / day on day 90, Batch 2 (similarity 0.78) has a cost of 5.5 yuan / head / day on day 90, and Batch 3 (similarity 0.55) has a cost of 5.2 yuan / head / day on day 90. The weighted estimate = 5.8 × 0.41 + 5.5 × 0.35 + 5.2 × 0.24 = 5.55 yuan / head / day. The higher the similarity of the batch, the greater its contribution to the prediction, which aligns with intuition—the more similar the historical batch is to the current batch, the more valuable its cost evolution pattern is as a reference.

[0058] The fusion of the weighted result and the actual cost trajectory of the current batch can be achieved using exponential smoothing. The fusion formula is: Corrected forecast value = α × Actual trend value of the current batch + (1-α) × Historical pattern forecast value. Where α is the smoothing coefficient, its value is dynamically set according to the proportion of the current batch's completed days to the total feeding cycle—α = min(0.9, current completed days / total feeding cycle). For example, for a batch with a 180-day feeding cycle: on day 18, α = 0.10, the corrected forecast value is 90% historical pattern and 10% current actual, mainly relying on historical experience; on day 60, α = 0.33, the two contribute approximately 3:7; on day 120, α = 0.67, the current actual data dominates; after day 162, α is locked at 0.90, the current actual data is absolutely dominant, and historical patterns are only used as a fine-tuning reference.

[0059] The design principle of this dynamic weighting mechanism is as follows: In the early stages of a batch (such as the first 30 days), the sample size of cost data for the current batch is too small. If over-reliance is placed on the current actual data for extrapolation, it is easily affected by random fluctuations (such as abnormal material feeding records caused by equipment failure on a certain day), causing the prediction curve to deviate significantly from the true trend. As the batch progresses, the statistical significance of the current data gradually increases, and the reliance on historical patterns should be gradually reduced. This fusion strategy of "learning from history and converging to the present" ensures that the prediction has a reasonable balance of "historical dependence - current trust" at different stages of the batch.

[0060] In other possible embodiments, the fusion strategy can also employ the Kalman filtering method. Historical predictions are used as prior estimates for the state prediction equation, while the actual observations of the current batch are used as measurements for the observation equation. The weights of prediction and observation are automatically balanced using Kalman gain. The Kalman gain is calculated based on the ratio of the prediction error covariance to the observation noise covariance. When observation noise is high (e.g., a sporadic, concentrated outbreak of dead-end events causing abnormal fluctuations in cost data on a particular day), the Kalman gain automatically decreases, indicating that the system places more trust in historical patterns. When the observation data is stable, the Kalman gain increases, indicating that the system places more trust in the current reality. This approach is more robust than the fixed-coefficient exponential smoothing method when cost data exhibits significant random fluctuations, but it also has higher computational complexity.

[0061] This implementation ensures that the prediction has a reasonable historical dependency-current trust balance at different stages of the batch, avoiding prediction bias caused by simple equal-weighted migration.

[0062] In some possible embodiments, the attribution analysis of the cost of the current batch includes: Based on the preset mapping rules between cost events and management decision-making behaviors, each cost transaction that has occurred in the current batch is attributed to the corresponding management decision-making node. The management decision-making node includes at least one of the following: feeding operation node, medication operation node, environmental control operation node, or dead animal disposal operation node.

[0063] As an optional implementation of this invention, the preset mapping rule serves as a bridge connecting "cost events" and "management decision-making behaviors." This mapping rule is established based on key decision nodes in the Standard Operating Procedures (SOPs) for aquaculture, associating each cost transaction with the management decision-making behavior that triggers that cost.

[0064] The specific mapping method is as follows: (1) Feed consumption flow is mapped to feeding operation nodes. For example, the change in feed consumption in the feed consumption flow before and after the formula change is mapped to the "feed change decision" node. Taking a batch of fattening pigs as an example, the system detected on day 42 that the feed category code in the feed consumption flow changed from "F-302 (early growth feed)" to "F-303 (late growth feed)". At the same time, the average daily feed intake per head fluctuated from 2.1 kg to 1.8-2.3 kg in the three days after the change, indicating that the pig herd was undergoing a feed change transition period. The system attributed the feed consumption fluctuation during this period to the "feed change decision on day 42" node and recorded the standard deviation of feed intake and recovery days during the transition period for subsequent evaluation of the execution quality of the feed change decision.

[0065] (2) Drug delivery records are mapped to medication operation nodes. The timestamp of the drug delivery record is matched with the time of the veterinary prescription (the time window is usually set to ±24 hours) and mapped to the "medication decision" node, which can be further distinguished into "preventive medication" and "therapeutic medication". For example, a batch of florfenicol injection (batch number 20240115, quantity 20 vials) was delivered on the 35th day. The system matches the prescription record issued by the veterinarian on the 34th day, "Preventive medication was administered to the entire herd due to respiratory symptoms in the pigs", and attributes this drug cost to "preventive medication decision for respiratory diseases on the 34th day".

[0066] (3) Power surge events of environmental control equipment (such as fans, water curtains, and heaters) are mapped to environmental control operation nodes. For example, on day 28, environmental sensors recorded that the indoor temperature suddenly rose from 22°C to 28°C, and at the same time, the fan power jumped from 1.2kW to 3.5kW, indicating that the administrator had started cooling measures. The system attributed this operation to "Day 28 High Temperature Emergency Ventilation Decision".

[0067] (4) The timestamp of the dead pig event is matched with the inspection record and mapped to the dead pig disposal operation node. For example, the inspection record on day 55 shows "1 weak piglet was found in pen A-3, weighing 12kg, and has been isolated", and the dead piglet record on day 56 shows that the pig died. The system attributes the dead piglet loss to "weak piglet identification and isolation decision on day 55" and records the time interval from identification to death to evaluate the timeliness of the disposal decision.

[0068] In a typical application scenario, a batch of fattening pigs recorded a significantly higher-than-average drug delivery record on day 42 (the average drug cost per head jumped from 0.3 yuan to 1.8 yuan that day). Mapping rules, through time window matching, linked this cost to the "respiratory disease treatment medication decision" on day 40. Attribution analysis further showed that this medication decision contributed 37% to the batch's total cost deviation and had an impact of approximately -4.2 yuan on the expected profit per head. The system's output attribution report clearly marked this causal chain—"Respiratory disease treatment medication decision on day 40 → Increase in average drug cost per head of 1.5 yuan → Impact on expected profit per head of -4.2 yuan, contribution 37%"—allowing managers to clearly identify that "the medication decision on day 40 was the primary factor leading to cost overruns."

[0069] In other possible embodiments, the mapping between cost events and management decision-making behaviors can be automatically discovered through association mining algorithms, rather than relying on preset static rules. Specifically, after accumulating sufficient historical data (e.g., more than 30 completed batches), the system uses Granger causality tests or time-series-based causal discovery algorithms (such as the PCMCI algorithm) to automatically identify the statistical causal relationship between cost anomalies and management decision-making events, and automatically adds causal relationships with a confidence level exceeding a preset threshold (e.g., p < 0.05) to the mapping rule base. For example, the system may automatically discover that "the mortality rate on days 5-7 after feed change is significantly positively correlated with the fluctuation of feed intake during the feed change transition period," and add this association to the mapping rule, thereby identifying the causal chain of "improper management during the feed change transition period → fluctuation of feed intake → increased mortality rate." This approach enables the mapping rules to have self-evolutionary capabilities, allowing them to discover new association patterns not covered by manually preset rules.

[0070] By adopting this implementation method, the attribution granularity is refined from the batch level to the operational level. Managers can accurately identify specific decision-making errors or abnormal events, achieving a leap from "knowing that a loss has occurred" to "knowing why a loss occurred and which decision resulted in a loss." Compared to existing systems that can only provide a rough conclusion such as "total cost is too high," the decision-making behavior-level attribution provided by this solution offers an actionable basis for managers' precise intervention.

[0071] In some possible embodiments, the attribution analysis further includes spatial dimension attribution: When a farm contains multiple pens, each cost transaction is further attributed to the specific pen identifier in which the cost occurred; the pen identifier is obtained through the pen ID reported by the IoT device, the pen field associated with the operation record, or the pen information in the inspection record.

[0072] As an optional implementation of this invention, the attribution capability in the spatial dimension is further enhanced, enabling attribution analysis to answer not only "which decision led to the loss" but also "in which pen." Specifically, the three methods for obtaining pen identification are applicable to farms with different levels of digitization, ensuring the feasibility of this technical solution in various types of farms, from highly automated to semi-manually managed.

[0073] Method 1: Using pen IDs reported by IoT devices. This method is suitable for highly digitized farms that have deployed IoT devices such as smart feeders and smart environmental sensors. These devices automatically include a unique identifier for their pen (such as the pen code "Bld-A03" bound during device registration) with each data report.

[0074] Method 2: Linking Pen Fields Through Operation Records. This method is suitable for farms that use electronic work orders or mobile applications to record daily operations. When entering operations such as medication or feeding adjustments, the farmer manually selects the corresponding pen through the pen selection drop-down menu or QR code scanning function on the mobile application. For example, after a veterinarian completes vaccination in pen A03, they select "pen A03" when filling out the work order on the mobile app, and the system automatically links the vaccine cost to A03. This method requires manual intervention, but because the operation occurs within the workflow (recorded conveniently after work is completed), the additional burden is small, and the accuracy is high (the probability of error is low because the operator is physically present in the pen).

[0075] Method 3: Using pen information from inspection records. This method is suitable for farms still managed using paper or semi-electronic methods. When registering mortality events, inspectors note the pen number on the inspection form, which is then identified via OCR or manually entered into the system. For example, a paper inspection form might record "A03-2025 / 03 / 15-1 dead - weak piglet - 12kg". After OCR recognition, the pen identifier "A03" can be extracted and associated with the mortality cost. This method is suitable for scenarios with the lowest level of digitization, but its accuracy is affected by the OCR recognition rate and the quality of manual data entry.

[0076] In a typical multi-pen breeding scenario, a fattening farm has 12 pens (A01-A12). The overall performance of this batch was slightly profitable (profit of 15 yuan per head), but spatial attribution revealed that pens A03 and A07 suffered losses of 42 yuan / head and 28 yuan / head, respectively. Further attribution analysis revealed that the feed conversion ratio (FCR) of pen A03 was 3.2 (batch average 2.8), which was related to a measurement deviation in the automatic feeder of that pen between day 25 and day 35. The system log showed that the feeder underwent a firmware upgrade on day 25, after which the feed calibration parameters were incorrectly reset to the default value, resulting in the actual feed exceeding the set value by about 15% (set daily feed of 120 kg, actual feed of about 138 kg). The mortality rate of pen A07 was 8% (batch average 3%), which was related to the fact that this pen was located downstream of the exhaust vent (only 3 meters away from the exhaust fan). During a cold wave on day 50 (outdoor temperature dropped sharply from 8°C to -5°C), it was significantly affected by direct cold winds, resulting in a concentrated outbreak of mortality in this pen from day 50 to day 55 (4 deaths in 5 days, while other pens only had 0-1 deaths during the same period).

[0077] Based on the spatial attribution results above, managers can specifically calibrate and roll back the firmware of the feeders in pen A03, and modify the insulation facilities of pen A07 (such as adding wind deflectors or adjusting the position of air inlets), without having to take indiscriminate measures for all 12 pens. This precise "targeted treatment" reduces management costs and improves efficiency compared to general prevention and treatment of the entire herd.

[0078] This approach enables detailed cost attribution across spatial dimensions, allowing for independent analysis and comparative display of profits and losses in different enclosures. This helps managers identify problematic enclosures and implement targeted improvements during batch processing, preventing "egalitarianism" from masking individual differences.

[0079] In some possible embodiments, determining the dynamic early warning threshold based at least on the historical cost index distribution of the similar batches includes: Obtain the historical distribution of similar cost indicators for the same batches, and calculate the mean and standard deviation of the distribution; The initial warning threshold is based on the mean plus or minus N times the standard deviation, where N is a configurable parameter; As the current batch progresses, the cost indicator data generated in the current batch is incorporated into the distribution for incremental updates, and the early warning threshold benchmark is periodically updated.

[0080] As an optional implementation of the present invention, this embodiment refines the complete calculation process of the dynamic early warning threshold. During the calculation, K batches similar to the current batch are first retrieved from the historical batch knowledge base, and the complete time series of the same cost indicators of these batches are extracted.

[0081] Taking the feed conversion ratio (FCR) as an example, this is a core cost indicator for measuring breeding efficiency, defined as the cumulative feed consumption divided by the cumulative weight gain. The system extracts the FCR data of all similar batches throughout the entire breeding cycle, forming a sample set. Let the observed FCR values ​​of K similar batches on day d be {fcr_1(d), fcr_2(d), ..., fcr_K(d)}, and calculate the mean μ(d) and standard deviation σ(d) of this set. The initial warning threshold is based on [μ(d) - N×σ(d), μ(d) + N×σ(d)], that is, the upper limit U(d) = μ(d) + N×σ(d), and the lower limit L(d) = μ(d) - N×σ(d).

[0082] N is a configurable parameter, with a default value of 1.5. This value statistically corresponds to an approximately 86.6% confidence interval (assuming the data approximately follows a normal distribution), striking a good balance between being neither overly sensitive (frequent false alarms leading to managerial desensitization) nor overly insensitive (missed alarms causing missed intervention windows). Specifically: N=1.0 indicates a sensitive warning (approximately 68% confidence interval, suitable for high-risk species or newly established farms requiring strict cost control, where managers tend to "prefer false alarms to missed alarms"); N=2.0 indicates a conservative warning (approximately 95% confidence interval, suitable for stable operating farms with high tolerance for cost fluctuations, where managers tend to "prefer missed alarms to false alarms" to reduce unnecessary attentional distractions); N=3.0 indicates an extremely conservative warning (approximately 99.7% confidence interval, only alerting for extreme anomalies).

[0083] Taking a Duroc-Large White three-way crossbred pig farm's winter batch as an example, the system retrieved 5 similar batches. On day 60, the historical feed conversion ratios (FCRs) for the 5 batches were 2.58, 2.63, 2.70, 2.75, and 2.84, respectively. The mean μ = 2.70, and the standard deviation σ = 0.10. Taking N = 1.5, the upper limit U = 2.70 + 1.5 × 0.10 = 2.85, and the lower limit L = 2.70 - 1.5 × 0.10 = 2.55. An alert is triggered when the FCR of the current batch on day 60 exceeds the range [2.55, 2.85].

[0084] "Incremental update" refers to continuously incorporating the cost indicator data generated in the current batch into the historical distribution during the current batch's process, and periodically recalculating the mean and standard deviation. The update cycle is set to 7 days by default (i.e., once a week), but can be adjusted to 3 days (short cycles such as poultry, slaughter time 40-50 days) or 14 days (long cycles such as breeding pigs, over one year) depending on the length of the batch's breeding cycle. Taking a 7-day update cycle as an example, on day 60, the sample used to calculate the threshold is still pure historical data (5 batches); on day 70, the sample expands to "5 historical batches + data from days 1-70 of the current batch"; on day 77, it is "5 historical batches + data from days 1-77 of the current batch", and so on.

[0085] The advantage of incremental updates lies in the fact that as data from the current batch accumulates, the threshold benchmark gradually converges from "pure historical experience" to a comprehensive judgment of "historical experience + current reality," becoming increasingly sensitive to the personalized characteristics of the current batch. For example, the initial feed conversion ratio threshold upper limit for a certain batch was 2.85 on day 60 (based on the historical distribution of 5 similar winter batches). By day 120, the 120-day data for the current batch has been incorporated into the distribution, and the threshold upper limit has converged to 2.76. This means that the system increasingly "understands" the cost characteristics of this specific batch, and the warning boundary is adjusted accordingly with greater precision.

[0086] It's important to note that the choice of N value essentially involves a trade-off between the false positive rate and the false negative rate. A larger N value results in a lower false positive rate but a higher risk of false negatives; conversely, a smaller N value has the opposite effect. This trade-off is an inherent characteristic of Statistical Process Control (SPC). This embodiment empowers users to flexibly choose N based on their management needs and risk preferences by making N a configurable parameter, rather than forcing a single, universal N value.

[0087] In other possible embodiments, the calculation of the dynamic warning threshold can be performed without relying on a parametric method (mean ± N standard deviations), but rather using a non-parametric method—directly taking a specified quantile of the historical distribution of similar batches as the threshold boundary. For example, the 5th percentile of the historical distribution could be used as the lower limit and the 95th percentile as the upper limit. This method does not assume that the data follows a normal distribution and is more robust when the cost indicator distribution is severely skewed (e.g., the failure rate is usually right-skewed—most batch failure rates are concentrated between 2-5%, but a few batches may surge to over 15% due to disease outbreaks). Taking the failure rate as an example, if the failure rates of 5 similar batches are 2.1%, 2.8%, 3.2%, 3.5%, and 14.5% respectively (one batch had an abnormally high failure rate due to a PRRS outbreak), with a mean of 5.22% and a standard deviation of 5.23%, and if a parameterized method is used with N=1.5, the upper limit is as high as 13.07%, which almost loses its warning significance (because the failure rate of normal batches is much lower than this); if a non-parametric method is used with the 95th percentile (approximately 8.7%), the upper limit is more reasonable. This non-parametric alternative solution falls within the protection scope of this embodiment.

[0088] This implementation method constructs a way to dynamically calculate the dynamic early warning threshold based on the historical distribution of similar batches, and an adaptive boundary that can automatically converge as the batch progresses. Compared with the existing technology, this solution solves the problem of large-scale failure of fixed thresholds in scenarios such as variety rotation, seasonal fluctuations, and new farm commissioning.

[0089] In some possible embodiments, the triggering of tiered early warnings based on profit and loss forecast information and dynamic early warning thresholds includes: When the cost indicator exceeds the preset range of the dynamic early warning threshold, the corresponding level of early warning is triggered; the level includes at least a first-level early warning and a second-level early warning, which correspond to different ranges of excess.

[0090] As an optional implementation of the present invention, this embodiment establishes a graded early warning response mechanism, which triggers different levels of response for deviations of different severity, avoiding the waste of managers' attention resources or the delay in response to critical events caused by "one-size-fits-all" early warnings.

[0091] Taking the dynamic early warning threshold for feed conversion ratio (FCR) as an example: Upper limit U = 2.76, lower limit L = 2.46. Level 1 Warning (Slight Deviation): Triggered when the actual feed conversion ratio (FCR) exceeds the upper limit but does not exceed 10% (i.e., between 2.76 and 3.04), or falls below the lower limit but does not exceed 10% (i.e., between 2.21 and 2.46). The system pushes a notification to the batch manager's mobile terminal via the App, indicating "FCR slightly deviated (currently 2.89, upper limit 2.76, exceeding by 4.7%), suggesting attention to feeding program and feed intake records." No attribution analysis details are provided, and immediate response is not mandatory. The notification is a silent notification (red dot notification within the App, without sound or vibration).

[0092] Level 2 Warning (Moderate Deviation): Triggered when the actual feed conversion ratio exceeds the upper limit by 10% to 30% (i.e., between 3.04 and 3.59) or falls below the lower limit by 10% to 30%. The system simultaneously pushes a notification to the batch manager, veterinarian, and technical farm manager, along with the possible causes identified by attribution analysis. For example: "Moderate deviation in feed conversion ratio (currently 3.28, upper limit 2.76, exceeding by 18.8%). Attribution analysis shows: significant fluctuations in feed intake during the feed change transition period on day XX (standard deviation 2.3 times higher than the historical average), current feed conversion efficiency is 8.5% lower than the same period of similar batches. It is recommended to check the feeder metering accuracy and feed change plan within 24 hours." The notification is sent via App push and SMS, ensuring that managers are aware of the issue even if they haven't opened the App.

[0093] Level 3 Warning (Severe Deviation): Triggered when the actual feed conversion ratio exceeds the upper limit by more than 30% (i.e., exceeds 3.59) or falls below the lower limit by more than 30%. The system automatically generates an emergency intervention plan and pushes it to all authorized terminals (including enterprise management), while simultaneously reporting the warning information to the enterprise ERP or management dashboard. The push content includes: the name of the threshold indicator, the current value, the dynamic threshold benchmark, the percentage of deviation, the management decision-making node with the highest contribution identified by attribution analysis and its contribution ranking, and the intervention measures automatically recommended by the system based on intervention effect data of similar historical batches. For example: "[Level 3 Warning] Feed conversion ratio is severely deviated (currently 3.82, threshold upper limit 2.76, exceeding by 38.4%). Primary attribution: medication decision for respiratory disease treatment on day 42 (contribution 37%), secondary attribution: feeder metering deviation on days 25-35 (contribution 22%). Recommended intervention: ① Immediately calibrate the feeder in pen A03; ② Assess whether subsequent feed formulation needs to be adjusted to compensate for early losses; ③ Refer to similar batch 2023W-08 (which triggered a Level 3 warning during the same period and reduced losses by 62% per head by culling 7 days earlier)." The notification method is App push + SMS + system pop-up (mandatory pop-up in the management dashboard, requires confirmation of read).

[0094] The differentiated design of early warnings at each level reflects the principle of information overload management: minor deviations are only notified, moderate deviations are attributed, and severe deviations are addressed with solutions. Early warning information remains visible until the warning is cleared (it is permanently displayed in the warning center within the app). After the warning is cleared (cost indicators fall back to within the threshold and remain stable for more than one update cycle), it is automatically archived to the batch history for subsequent auditing and management review.

[0095] By adopting this implementation method, a hierarchical response mechanism is established, allowing managers to allocate attention according to priority: minor deviations require attention, moderate deviations require intervention within a specified period, and severe deviations require immediate response. This avoids information overload and response delays, and upgrades the warning from "telling you there is a problem" to "telling you what the problem is, why the problem occurred, and suggesting how to solve it," truly realizing a closed loop from alarm to decision support.

[0096] In some possible embodiments, it also includes: Receive user-configured management intervention scenario parameters, and calculate and compare the expected profit and loss under each scenario based on the fusion result of the cost evolution law and the actual cost data that has occurred in the current batch. The scenario parameters include at least one of the following: adjustment of expected slaughter date, feed unit price assumption, and mortality rate assumption.

[0097] As an optional implementation of the present invention, this embodiment expands the multi-scenario simulation function on the basis of benchmark profit and loss prediction, enabling managers to evaluate the expected effects of different management decisions within a "what-if" framework, and providing quantitative support for data-driven business decisions.

[0098] Specifically, managers can create multiple "what-if" scenarios on the system interface. Each scenario simulates different management decision effects by adjusting one or more parameters. Scenario parameters can be set in the following ways: (1) Adjustment of Expected Slaughter Date: The manager specifies a new expected slaughter date (earlier or later). The system recalculates the expected total cost, expected total revenue, and expected profit per head under this slaughter date based on the established fusion model. For example, if the current batch's baseline forecast shows an average profit of -28 yuan (loss) at slaughter (day 180), and the manager configures scenario A "slaughter 7 days earlier" (slaughter on day 173), the system recalculates—earlier slaughter means that the feed cost (approximately 38 yuan per head) and mortality risk (historical mortality rate of approximately 1.2% in the last week) will no longer occur, but the slaughter weight will decrease from 115 kg to approximately 110 kg (calculated based on an average daily weight gain of 750 g). After considering both feed savings and weight loss, the system outputs the expected profit per head for scenario A.

[0099] (2) Feed unit price assumption: The manager assumes that the price of feed raw materials changes (e.g., corn price drops from 2800 yuan / ton to 2660 yuan / ton, a decrease of 5%), and the system transmits this price change to the feed cost prediction curve. It should be noted that the change in feed unit price not only affects future feed costs, but also indirectly affects the prediction through the historical pattern weight in the cross-cycle fusion model - if historically a 5% decrease in feed price is usually accompanied by a short-term improvement in feed conversion efficiency (due to increased room for formula adjustment), this historical pattern will also be reflected in the prediction.

[0100] (3) Mortality rate assumption: The manager assumes that by strengthening the management of pen patrol and heat preservation, the predicted mortality rate for the remaining breeding period will be reduced from 4% to 3%. The system will recalculate the increase in the number of animals sold and the corresponding increase in total income resulting from the reduction in mortality.

[0101] The profit and loss calculations for each scenario reuse the cross-cycle fusion model established in section 4, ensuring that multi-scenario forecasts and benchmark forecasts use the same set of model parameters, resulting in consistent comparison results. The system independently calculates the expected profit and loss for each scenario and displays it in the form of a comparison table or bar chart—one row per scenario, listing the expected slaughter weight, expected total revenue, expected total cost, expected profit per head, and the difference from the benchmark scenario.

[0102] Taking a specific scenario as an example: A certain Duroc-Large Three-Way Crossbred winter batch is currently on day 90. The baseline forecast is that the average profit per head at slaughter will be -28 yuan (a loss) on day 180. The manager creates three scenarios: Scenario A "Slaughter 7 days earlier": Expected profit per head -12 yuan (compared to benchmark +16 yuan). The logic is to avoid the high feed costs in the last week (average daily feed cost per head 6.2 yuan × 7 days ≈ 43 yuan) and mortality risk. Although the slaughter weight is reduced by about 5 kg, resulting in a decrease in income of about 75 yuan (calculated at 15 yuan / kg), the savings in feed and mortality exceed the weight loss.

[0103] Scenario B "Feed price reduction of 5%": Expected profit per head +5 yuan (compared to the benchmark of +33 yuan). The logic is that feed costs account for about 70% of the total cost, and a 5% price reduction means that the feed cost per head will be reduced by about 25 yuan (based on an average feed cost of about 500 yuan per head for the remaining 90 days).

[0104] Scenario C "Morbidity rate drops to 3%": Expected profit per head +18 yuan (compared to the benchmark +46 yuan). The logic is that a 1 percentage point reduction in mortality rate means one more head can be slaughtered for every 100 heads (based on a slaughter weight of 115kg and a unit price of 15 yuan / kg, the revenue will increase by about 1725 yuan, which is about 17.25 yuan per head). In addition, the savings from reduced mortality rate mean that the invested costs (feed and medicine) are no longer sunk.

[0105] Managers can intuitively determine that, under the current circumstances, "reducing the mortality rate" is the most profitable way to turn losses into profits—the additional investment required for strengthening pen patrols and heat preservation management (such as increasing night shift patrol personnel and installing heat lamps) is far less than the benefits brought by reducing mortality. Meanwhile, Scenario B shows that even if feed prices decrease by 5%, the profit per head will only increase by 5 yuan, indicating that the main reason for the current losses is not feed prices, but internal management efficiency. This provides managers with a clear direction for decision-making.

[0106] In other possible embodiments, scenario parameters may also include: adjustments to vaccine immunization programs (such as adding or removing a certain vaccine, affecting drug costs and mortality rates), adjustments to stocking density (affecting feed conversion ratio and mortality rates), and adjustments to slaughter weight targets (affecting the feeding cycle and feed conversion ratio). Managers can freely combine multiple parameters to create composite scenarios (such as "slaughter 7 days earlier + feed price reduction of 5%)," and the system calculates the composite effect of each parameter based on a fusion model. The scenario simulation function is essentially a reuse and extension of an established cross-cycle migration model, without adding additional model training or deployment costs.

[0107] This implementation method reuses the established cross-cycle migration model to provide managers with multiple profit and loss comparisons, supporting data-driven business decisions rather than intuitive judgments. Furthermore, all scenarios share the same set of fusion coefficients to ensure the scientific nature and consistency of the comparisons.

[0108] In some possible embodiments, it also includes: Based on the results of the attribution analysis and / or the information of the graded early warning, a cost-benefit analysis report for individual farmers is generated. The report includes at least one of the following: profit and loss comparison for this batch, benchmarking of indicators with similar farmers, and suggestions for business improvement.

[0109] As an optional implementation of this invention, the system's attribution analysis and early warning capabilities are extended from enterprise management to end-user farmers, making it particularly suitable for "company + farmer" or "contract farming" models. In this model, the farming enterprise (company) provides piglets, feed, medicine, and technical guidance, while individual farmers provide the farming site and daily labor. Profits are ultimately distributed according to an agreed-upon settlement method (such as a guaranteed minimum price plus performance bonuses). Farmers typically lack financial analysis capabilities and do not directly access ERP systems; therefore, the system needs to transform professional attribution results into understandable and visual reports for farmers, enhancing the adaptability of this embodiment.

[0110] For example, the report is pushed to users via mobile applications (such as WeChat mini programs or standalone apps) and consists of three parts: Part 1: Profit and Loss Comparison for This Batch. A longitudinal comparison is made between the current batch's key indicators (average daily weight gain, feed conversion ratio, average medication cost per head, and mortality rate) and the previous batch, using line graphs or bar charts to illustrate the improvement or decline trends. For example: "This batch (2025W-03) saw an average daily weight gain of 785g, a 4.4% increase compared to the previous batch (2025W-01, 752g); the feed conversion ratio was 2.65, a 4.7% improvement compared to the previous batch (2.78); the average medication cost per head was 18.5 yuan, a 17.0% decrease compared to the previous batch (22.3 yuan); and the mortality rate was 3.2%, a 0.9 percentage point decrease compared to the previous batch (4.1%). Overall assessment: This batch's management performance is better than the previous batch, and the performance bonus is expected to increase by approximately 1200 yuan." This longitudinal comparison helps farmers see their progress or decline, establishing positive incentives.

[0111] Part Two: Benchmarking Against Similar Farmers. This section compares the key indicators of this farmer with those of other farmers within the same company, of the same breed, in the same season, and of similar size. All comparative data is anonymized, displaying only the farmer's quantile and ranking range within the overall distribution, without revealing the specific identities and data of other farmers. For example: "Your feed conversion ratio (2.65) is better than 72% of similar farmers (out of 87 participating farmers), placing you in the top 30%; your average daily weight gain per head (785g) is better than 58% of similar farmers, placing you in the upper-middle range; your mortality rate (3.2%) is better than 81% of similar farmers, placing you in the top 20%." The purpose of this benchmarking is to help farmers understand their relative position within the group and to stimulate a competitive spirit—"Why can others achieve a feed conversion ratio of 2.4 with the same piglets, the same feed, and the same technical guidance?" Part Three: Suggestions for Operational Improvement. Based on the management decision nodes with the highest contribution identified by attribution analysis, and combined with practical data from top performers among similar farmers, specific and actionable suggestions are generated. For example, if attribution analysis shows that the current batch experienced significant fluctuations in feed intake during the feed transition period (the main reason for the increased feed conversion ratio), the system suggests: "During the feed transition period on day 45 of the current batch, the average daily feed intake fluctuated significantly (standard deviation 0.35 kg, compared to an average of 0.12 kg for top performers among similar farmers). It is recommended that the next batch adopt a 5-day gradual transition method during feed change—with daily new and old feed ratios of 80:20, 60:40, 40:60, 20:80, and 0:100, respectively, which can reduce daily weight gain loss caused by feed change stress. Reference data: For similar farmers using this method, the average standard deviation of average daily feed intake during the feed transition period was 0.14 kg, and the feed conversion ratio was on average 0.15 lower than those who did not use this method." The report is presented visually via a mobile application—using intuitive charts such as bar charts, line graphs, and radar charts, supplemented by concise text descriptions, avoiding the use of professional financial or statistical terms such as "marginal contribution per head" or "feedback ratio variance analysis." Farmers can understand the report's content without a financial or data analysis background and adjust their daily farming operations accordingly.

[0112] In other possible embodiments, the report may also include: generating a personalized "next batch optimization list" for farmers based on the profit and loss forecast and attribution results of the current batch—translating the top 3 management improvement points identified by attribution analysis into specific action items, such as "① Strictly follow the 5-day gradual transition method when changing feed next time, and record feed intake daily; ② Check whether the waterers are blocked during at least 2 pen inspections per week (the current batch experienced 3 instances of reduced feed intake due to insufficient water); ③ Complete the inspection of insulation facilities 48 hours before the cold wave warning for the winter batch." Farmers check off each item on their mobile devices to confirm, forming a management closed loop of "analysis → suggestion → implementation → verification".

[0113] This approach extends the system's analytical capabilities from professional managers to frontline farmers, empowering them to optimize feeding programs and make slaughter decisions based on data in a visual and understandable way. Compared to the traditional model of "company technicians making regular field visits and providing verbal guidance," this solution significantly reduces farmers' reliance on professional financial knowledge and technical guidance through automated data analysis and report generation. At the same time, it allows the company's technical resources to be focused on high-value, complex cases rather than routine data interpretation.

[0114] Example 2: This invention provides the following technical solutions: This invention also provides the following technical solutions: An electronic device, comprising a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, perform the steps as described in Example 1.

[0115] As an optional implementation of the present invention, the electronic device can be a non-mobile electronic device such as a server, industrial control computer, edge computing device, desktop computer, or laptop computer, or a mobile electronic device such as a mobile phone, tablet computer, or PDA. The electronic device can run operating systems such as Windows, Linux, Android, and iOS.

[0116] In a typical deployment, the system is deployed on the farm's local server or private cloud, connecting via LAN or the internet to data sources such as IoT devices (smart feeders, environmental sensors, etc.), feeding systems, and warehouse management systems (ERP / WMS). Managers access the system's attribution analysis, early warning, and reporting functions through a web browser or mobile app. The advantage of local deployment is that data remains within the enterprise's intranet, meeting the farm's privacy and security requirements for core operational data. The processor can be an Intel Xeon or AMD EPYC server CPU, and the storage includes at least 16GB of RAM and terabytes of SSD / HDD storage.

[0117] In another deployment method, the system is deployed on a public cloud platform (such as Alibaba Cloud, Huawei Cloud, and Tencent Cloud), with multiple farms sharing the same system instance. Data is transmitted through a secure channel (HTTPS / TLS encryption), and the data of each farm is logically isolated from each other (achieved through a multi-tenant architecture). The advantages of cloud deployment are that enterprises do not need to maintain server hardware themselves, it has strong elastic scalability, and software upgrades and maintenance are uniformly handled by the service provider.

[0118] Example 3: This invention provides the following technical solutions: This invention also provides the following technical solutions: A readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of Example 1.

[0119] As an optional implementation of this invention, in specific implementation, the storage medium should be a readable non-transitory storage medium, including computer-readable non-transitory storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk. The program or instructions can be stored in the form of source code, object code, or executable code, and the processor implements the management and early warning method of this application by reading and executing this code.

[0120] Storage media can be standalone physical media (such as USB flash drives or optical discs) used for the physical distribution and offline installation of software products; or they can be storage chips (such as eMMC or SSDs) embedded in servers or edge computing devices for pre-installation and factory deployment of systems. The organization of programs or instructions on the storage media can include: operating system bootloaders, runtime environments (such as Java Virtual Machines or Python interpreters), application code, configuration files, and pre-trained model parameter files (such as feature weights of similarity calculation models, historical statistical data of cross-period fusion models, etc.).

[0121] The working principle and usage process of this invention are as follows: When a breeding batch is established, the system initializes the breeding characteristic parameters of the current batch (breed identifier, batch start season, feeding cycle, initial stock quantity, main feed category and regional identifier), and begins to continuously collect multi-source cost data (feed consumption flow, medicine and consumables outbound records, labor cost data, mortality event records) and external market real-time price data (obtained through third-party market data API) from multiple data sources.

[0122] During the batch process, the system uses the current batch's aquaculture characteristic parameters as query conditions, encodes them into numerical feature vectors, calculates the similarity with each historical batch from the historical batch knowledge base, selects the top K historical batches with the highest similarity, and extracts their cost evolution patterns (multi-dimensional curves of cost indicators changing over time). The extracted historical cost evolution patterns are then fused with the actual cost data already incurred in the current batch—weighted estimation of the cost time-series trajectories of each similar batch is performed using similarity as the weight. A corrected cost prediction curve is generated by fusing it with the current actual cost trajectory through a dynamic smoothing coefficient. Finally, market price data is combined to generate profit and loss prediction information for the current batch (expected profit or loss per head).

[0123] Simultaneously, the system performs cost attribution analysis on the current batch. Based on preset mapping rules between cost events and management decision-making behaviors, each cost transaction is attributed to its corresponding management decision-making node (feeding operation node, medication operation node, environmental control operation node, or dead animal disposal operation node), quantifying the contribution of each node to the profit and loss deviation. In multi-pen scenarios, spatial dimension attribution is further used to attribute costs to specific pens, identifying problem pens and assisting in targeted improvements.

[0124] The system also dynamically calculates early warning thresholds based on the historical cost indicator distribution of similar batches. This involves obtaining the historical distribution of similar cost indicators from similar batches, calculating the mean and standard deviation, and using the mean plus or minus N times the standard deviation as the initial early warning threshold benchmark (N is a configurable parameter). As the current batch progresses, the system incorporates current data into the distribution for incremental updates, periodically updating the threshold benchmark. When the actual cost indicator exceeds the preset dynamic threshold range, a corresponding level of tiered early warning is triggered (Level 1: Mild Deviation → Level 2: Moderate Deviation → Level 3: Severe Deviation). Each level of early warning includes attribution information and intervention suggestions of varying levels of detail, and is pushed to the responsible parties at different levels.

[0125] In addition, the system supports managers in configuring multi-scenario simulations (adjusting slaughter dates, feed price assumptions, mortality rate assumptions, etc.), calculating the expected profit and loss for each scenario based on the established cross-cycle fusion model, and displaying the results comparatively. The system also generates cost-benefit analysis reports for individual farmers based on attribution analysis and early warning information, including profit and loss comparisons for this batch, benchmarking against similar farmers, and suggestions for operational improvement.

[0126] The entire process realizes a complete closed loop from data collection, cross-cycle knowledge transfer, profit and loss prediction, accurate attribution, adaptive early warning, multi-scenario decision simulation to farmer empowerment reports. This upgrades aquaculture management from a post-event summary model that "only knows the profit and loss after the batch is over and can only give a rough conclusion" to an in-process control model that "real-time perception of profit and loss during the process, accurate location of the cause of loss, adaptive early warning and provision of decision support".

[0127] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A management early warning method based on aquaculture profit attribution analysis, wherein, include: Real-time acquisition of multi-source cost data and market price data for each breeding batch; Based on the breeding characteristic parameters of the current batch, at least one historical batch similar to the current batch is retrieved from the knowledge base storing historical batch data, and the cost evolution pattern of the similar batch is extracted. The cost evolution pattern is integrated with the actual cost data of the current batch, and combined with the market price data to generate profit and loss prediction information for the current batch. Perform cost attribution analysis on the current batch to identify key cost factors and / or management decisions that lead to profit / loss deviations. Based at least on the historical cost index distribution of the similar batches, a dynamic early warning threshold is determined, and a tiered early warning is triggered based on the profit and loss prediction information and the dynamic early warning threshold.

2. The method according to claim 1, wherein, The multi-source cost data includes at least two of the following: feed consumption flow, drug and consumable outbound records, labor cost data, and dead feed event records. The breeding characteristic parameters include at least three of the following: breed identification, batch start season, feeding cycle, initial stock quantity, main feed type, and geographical identification.

3. The method according to claim 1, wherein, The step of retrieving at least one historical batch similar to the current batch from the historical batch knowledge base includes: Calculate the similarity between the current batch's aquaculture feature vector and the feature vectors of historical batches, and select the top K historical batches with the highest similarity, where K is a preset positive integer.

4. The method according to claim 1, wherein, The process of integrating cost evolution patterns with actual cost data already incurred in the current batch includes: The cost time-series trajectory of each similar batch is weighted by the similarity of each similar batch. The weighted result is then fused with the actual cost trajectory of the current batch to generate a corrected cost prediction curve.

5. The method according to claim 1, wherein, The attribution analysis of the current batch cost includes: Based on the preset mapping rules between cost events and management decision-making behaviors, each cost transaction that has occurred in the current batch is attributed to the corresponding management decision-making node. The management decision-making node includes at least one of the following: feeding operation node, medication operation node, environmental control operation node, or dead animal disposal operation node.

6. The method according to claim 1, wherein, The attribution analysis also includes spatial dimension attribution: When a farm contains multiple pens, each cost transaction is further attributed to the specific pen identifier in which the cost occurred; the pen identifier is obtained through the pen ID reported by the IoT device, the pen field associated with the operation record, or the pen information in the inspection record.

7. The method according to claim 1, wherein, The determination of the dynamic early warning threshold based at least on the historical cost index distribution of the similar batches includes: Obtain the historical distribution of similar cost indicators for the same batches, and calculate the mean and standard deviation of the distribution; The initial warning threshold is based on the mean plus or minus N times the standard deviation, where N is a configurable parameter; As the current batch progresses, the cost indicator data generated in the current batch is incorporated into the distribution for incremental updates, and the early warning threshold benchmark is periodically updated.

8. The method according to claim 1, wherein, The method of triggering tiered early warnings based on profit and loss forecast information and dynamic early warning thresholds includes: When the cost indicator exceeds the preset range of the dynamic early warning threshold, the corresponding level of early warning is triggered; the level includes at least a first-level early warning and a second-level early warning, which correspond to different ranges of excess.

9. The method according to claim 1, wherein, Also includes: Receive user-configured management intervention scenario parameters, and calculate and compare the expected profit and loss under each scenario based on the fusion result of the cost evolution law and the actual cost data that has occurred in the current batch. The scenario parameters include at least one of the following: adjustment of expected slaughter date, feed unit price assumption, and mortality rate assumption.

10. The method according to claim 1, wherein, Also includes: Based on the results of the attribution analysis and / or the information of the graded early warning, a cost-benefit analysis report for individual farmers is generated. The report includes at least one of the following: profit and loss comparison for this batch, benchmarking of indicators with similar farmers, and suggestions for business improvement.

Citation Information

Patent Citations

  • Methods, equipment and media for risk warning in ranching

    CN112633568B