Competitive risk-based dynamic early-warning regulation and control method and system for sow reproduction
By constructing a competitive risk model for sow reproductive abnormalities using the Fine-Gray model, multidimensional physiological characteristics are extracted, cumulative morbidity is calculated, and automated equipment is driven to perform personalized interventions. This solves the problem of accurate early warning and automated intervention for sow reproductive abnormalities, reduces economic losses, and improves production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAZHONG AGRI UNIV
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies for early warning and automated intervention of abnormal sow reproductive events are inaccurate, leading to economic losses. Furthermore, they are difficult to accurately model the risk of multiple competing events and cannot achieve individualized risk assessment and data censoring.
A competitive risk-based early warning and control method for sow reproductive dynamics was adopted. A competitive risk model of abnormal sow reproductive events was constructed using the Fine-Gray model. Multidimensional physiological characteristics were extracted, cumulative morbidity was calculated, and personalized interventions were driven by the automatic feeding system and environmental control equipment.
It enables accurate early warning and automated intervention for abnormal sow reproductive events, reducing economic losses and improving production efficiency and precise equipment control.
Smart Images

Figure CN121961249A_ABST
Abstract
Description
A method and system for early warning and control of sow reproductive dynamics based on competition risk Technical Field
[0001] This invention relates to the field of breeding control technology, and more specifically, to a method and system for early warning and regulation of sow reproductive dynamics based on competition risk. Background Technology
[0002] Sow reproductive performance is a core production indicator for large-scale pig farms, directly impacting their economic benefits. During the sow's reproductive cycle, reproductive abnormalities such as return to estrus (re-emergence after mating without conception) and abortion (fetal death in mid-pregnancy) significantly reduce production efficiency, increase non-productive days (NPD), and cause economic losses such as feed waste and increased labor costs.
[0003] Statistics show that the return-to-estrus rate in large-scale pig farms is generally 10%-20%, and the abortion rate is 2%-5%. A sow returning to estrus results in an average loss of 21 days of production time and approximately 200 yuan in feed costs; an abortion results in a loss of 60-90 days of production time and approximately 1000 yuan in comprehensive costs. For farms with tens of thousands of sows, reproductive abnormalities can cause economic losses of several million yuan annually.
[0004] Currently, large-scale pig farms generally adopt electronic reproductive management systems, equipped with IoT devices such as RFID electronic ear tags, automatic feeding systems, and environmental sensors to record data on sows throughout their entire life cycle, including mating, pregnancy checks, farrowing, and weaning. A key requirement for improving pig farm reproductive management is how to utilize this data and hardware to achieve early warning and automated intervention for reproductive abnormalities. Summary of the Invention
[0005] This invention addresses the technical problems existing in the prior art by providing a method and system for early warning and control of sow reproductive dynamics based on competitive risk, which can overcome the inaccuracy of existing methods for calculating the probability of abnormal reproductive events in sows.
[0006] According to a first aspect of the present invention, a method for early warning and control of sow reproductive dynamics based on competition risk is provided, comprising:
[0007] Obtain the basic data of the sow to be observed at the current observation time t;
[0008] Multiple feature data of the sows under observation at the current observation time t are extracted from the basic data of the sows under observation to form a feature vector;
[0009] Based on the feature vector of the sow to be observed and the regression coefficient matrix of the sow's reproductive abnormality event k, the risk ratio of the sow to be observed at the current time t is calculated. The regression coefficient matrix of the sow's reproductive abnormality event k is obtained by training a competitive risk model. The sow's reproductive abnormality event k is either sow returning to estrus or sow abortion.
[0010] Based on the baseline cumulative risk value of the sow experiencing reproductive abnormality event k at current time t and the risk ratio of the sow to be observed experiencing reproductive abnormality event k at current time t, calculate the cumulative sub-distribution risk value of the sow to be observed experiencing reproductive abnormality event k at current time t.
[0011] The cumulative sub-distribution risk value of the reproductive abnormality event k occurring in the sow under observation at the current time t is converted into the cumulative incidence rate of the reproductive abnormality event k occurring in the sow under observation at the current time t.
[0012] Based on the cumulative incidence rate of reproductive abnormality event k occurring in the sows under observation at the current time t, calculate the incidence rate of the sows under observation from the current observation time t to the future time. The cumulative incidence of newly reported reproductive abnormality events (k);
[0013] Based on the observation time t of the sow to be observed from the current observation time t to the future The cumulative incidence rate of newly added reproductive abnormality event k is used to provide early warning of reproductive abnormality events in sows under observation.
[0014] Based on the above technical solution, the present invention can also be improved as follows.
[0015] Optional,
[0016] The basic data of the sows to be observed includes the sow ID, environmental data within the pigsty, mating data, and pregnancy data. The process involves extracting multiple feature data points of the sows at the current observation time t from the basic data to form a feature vector, including:
[0017] Based on environmental data in the pigsty, mating data and pregnancy data of the sows to be observed, the static characteristics, dynamic characteristics and historical cumulative characteristics of the sows to be observed were extracted.
[0018] Extract static characteristics of the sows to be observed, including:
[0019] Based on the pregnancy data, obtain the parity of the sow under observation at the current observation time t;
[0020] Extract the seasonal stress index at the current observation time t, including:
[0021] The temperature (T) and humidity (RH) inside the pigsty at the current observation time (t) are obtained based on environmental sensors.
[0022] Calculate the temperature and humidity index (THI) at the current observation time t based on temperature T and humidity RH.
[0023] Map the temperature and humidity index (THI) at the current observation time t to the seasonal stress index;
[0024] Extract the historical cumulative features of the current observation time t, including:
[0025] Based on the mating and pregnancy data of the sows under observation, the cumulative number of times the sows returned to estrus, the number of non-productive days in the previous litter, and the deviation in the number of piglets in the previous litter were calculated before the current observation time t.
[0026] Each extracted feature is digitally encoded and mapped to a digital vector. The digital vectors of all features constitute the feature vector X = [parity, seasonal stress index, cumulative number of return to estrus, number of non-productive days in the previous litter, and deviation of litter size in the previous litter].
[0027] Optionally, the step of calculating the temperature and humidity index (THI) at the current observation time t based on temperature T and humidity RH includes:
[0028]
[0029] Mapping the temperature and humidity index (THI) at the current observation time t to a seasonal stress index includes:
[0030] Set up a mapping relationship between the stress index and the range of the temperature and humidity index (THI) for each season;
[0031] Based on the range of values that the temperature and humidity index (THI) falls into at the current observation time t, the seasonal stress index at the current observation time t is determined.
[0032] Optionally, the regression coefficient matrix of the reproductive abnormality event k in the sow is obtained by training a competitive risk model, including:
[0033] By treating sows' return to estrus, abortion, and farrowing as mutually exclusive events, a Fine-Gray model is constructed as a competing risk model. The Fine-Gray model is expressed as follows:
[0034]
[0035] in, Let be the baseline risk of a sow experiencing a reproductive abnormality event k at time t, representing the risk of a standard sow at time t. The risk of the day; This represents the individual feature vector of the sow. Let be the regression coefficient matrix for reproductive abnormality event k in sows. dimensionality and They have the same dimension; Let be the risk function value of a reproductive abnormality event k occurring in an individual sow at time t; This represents the risk multiple of an individual sow to experience reproductive abnormality event k on day t, relative to a standard sow.
[0036] The Fine-Gray model was trained, and the partial likelihood function was used as the optimization objective function of the Fine-Gray model to obtain the regression coefficient matrix of reproductive abnormality event k in sows. .
[0037] Optionally, the expression for the partial likelihood function is:
[0038]
[0039] The symbol represents a product; This indicates that only events involving abnormal reproduction have occurred. Calculations were performed on the sows. To correct the risk set, sows that have experienced other competing events are included; For at any time Time-dependent weights for the occurrence of other competing events; This indicates the time when the reproductive abnormality event occurs in the i-th sow. Based on its own feature vector The calculated sub-distribution risk function value, This indicates the time when the reproductive abnormality event occurs in the i-th sow. Correcting the risk set The jth sow in the middle is based on its own feature vector The calculated sub-distribution risk function value, This indicates that the regression coefficient matrix is The partial likelihood function values of all sows that actually experienced reproductive abnormality event k.
[0040] Optionally, based on the eigenvectors of the sows to be observed and the regression coefficient matrix of the reproductive abnormality event k in the sows, the risk ratio of the sows to be observed experiencing reproductive abnormality event k at the current time t is calculated, including:
[0041] Risk ratio =
[0042] in, Let be the feature vector of the sow to be observed at the current observation time t. This is the regression coefficient matrix for reproductive abnormality event k in sows.
[0043] Optionally, the step of calculating the cumulative sub-distribution risk value of the sow to be observed at the current time t based on the baseline cumulative risk value of the sow experiencing reproductive abnormality event k at the current time t and the risk ratio of the sow to be observed experiencing reproductive abnormality event k at the current time t includes:
[0044]
[0045] in, This represents the baseline cumulative risk value for the occurrence of reproductive abnormality event k in sows at time t. Let be the cumulative sub-distribution risk value of the sow to be observed if a reproductive abnormality event k occurs at the current time t.
[0046] Optionally, the step of converting the cumulative sub-distribution risk value of reproductive abnormality event k occurring in the sow under observation at the current time t into the cumulative incidence rate of reproductive abnormality event k occurring in the sow under observation at the current time t includes:
[0047]
[0048] in, The cumulative incidence rate of reproductive abnormality event k in the sow to be observed at the current time t.
[0049] Optionally, the step involves calculating the cumulative incidence rate of reproductive abnormality events k occurring in the sows under observation from the current observation time t to the future based on the cumulative incidence rate of these events. The newly added cumulative incidence of reproductive abnormality event k includes:
[0050]
[0051] in, This indicates the time the sow is to be observed. The cumulative incidence of reproductive abnormality event k. This indicates that the sows to be observed have reached the [number]th [day / month]. The cumulative incidence of no reproductive abnormalities has not yet occurred. This indicates that the sows to be observed have reached the [number]th [day / month]. The cumulative incidence of reproductive abnormalities occurring daily; This indicates the time from the current observation time t to the future... The cumulative incidence of newly added reproductive abnormality events k, For the prediction window, This indicates that, assuming no reproductive abnormalities have occurred in the sow up to the current observation time t, i.e. The type of future reproductive anomaly event is k, where This refers to the actual time of occurrence of the reproductive anomaly event. This refers to the event type.
[0052] Optionally, the calculation of the sow under observation from the current observation time t to the future... The cumulative incidence of newly added reproductive abnormality event k, which will be followed by:
[0053] Based on the observation time t of the sow to be observed from the current observation time t to the future The cumulative incidence of newly added reproductive abnormality event k is used to determine the risk level of the observed sows at the current observation time t for the occurrence of reproductive abnormality event k.
[0054] Based on the risk level and the feature vector of the sow to be observed at the current observation time t, control commands are generated and sent to the hardware execution layer via a communication bus. The hardware execution layer includes an automatic feeding system and an environmental control device. The control commands are used to drive the automatic feeding system to adjust the feed amount and / or feed formula, and to drive the environmental control device to adjust the temperature and / or humidity parameters in the pigsty.
[0055] The frequency of environmental data collection is dynamically adjusted according to the risk level. When the risk level is high, the frequency of environmental data collection is increased, and when the risk level is low, the frequency of environmental data collection is decreased.
[0056] After the intervention has been implemented for a preset number of days, intervention feedback data of the sows to be observed is obtained. The intervention feedback data includes weight change data and / or backfat change data. If the weight change data is lower than the preset weight threshold or the backfat change data is lower than the preset backfat threshold, the intervention parameters are automatically upgraded and a new control command is generated. The upgraded intervention parameters include at least one of increasing the proportion of energy feed, increasing the amount of vitamin supplementation, and decreasing the ambient temperature setpoint.
[0057] According to a second aspect of the present invention, a sow reproductive dynamics early warning and control system based on competition risk is provided, for implementing a sow reproductive dynamics early warning and control method based on competition risk, comprising:
[0058] The data acquisition module includes an RFID reader, environmental sensors, and an automatic feeding station, used to acquire basic data of the sows to be observed at the current observation time t. The basic data includes the sow ID, environmental data in the pigsty, mating data, and pregnancy data of the sows to be observed.
[0059] An edge gateway, deployed in a pigsty, includes a processor and a memory. The memory stores the regression coefficient matrix of a competitive risk model and a baseline cumulative risk lookup table. The processor extracts feature vectors from the basic data of the sows to be observed, calculates the cumulative incidence of reproductive abnormality event k in the sows to be observed based on the feature vectors and the regression coefficient matrix, and determines the risk level. The regression coefficient matrix is obtained by training a competitive risk model, and the reproductive abnormality event k in the sows is either sow returning to estrus or sow abortion.
[0060] The controller, which is communicatively connected to the processor, is used to generate control instructions based on the risk level and send them to the hardware execution layer via a communication bus.
[0061] The hardware execution layer, which is communicatively connected to the controller, includes an automatic feeding system and an environmental control device. The automatic feeding system is used to adjust the feed amount and / or feed formula according to the control instructions, and the environmental control device is used to adjust the temperature and humidity parameters in the pigsty according to the control instructions.
[0062] The early warning device, which is communicatively connected to the controller, includes an LED display device and a message push module, and is used to output early warning information to the management personnel according to the risk level;
[0063] The central server, which communicates with the edge gateway, is used to train the competition risk model and periodically push updated model parameters to the edge gateway. This invention provides a method and system for early warning and control of sow reproductive dynamics based on competitive risk. It collects basic data of sows at the current observation time t, extracts feature vectors from the collected data, calculates the risk ratio of the individual sow compared to a standard sow based on the feature vectors, then calculates the cumulative incidence rate of each reproductive abnormality event from mating to the current observation time t, and then calculates the conditional probability, i.e., the predicted cumulative incidence rate of the sow from the current observation time t to a future period. Based on the predicted cumulative incidence rate, risk level is predicted. According to the risk level of each reproductive abnormality event in the sow, control commands are generated and sent to the hardware execution layer via a communication bus to drive the automatic feeding system to adjust the feed amount and / or feed formula, and to drive the environmental control equipment to adjust the temperature and humidity parameters in the pigsty. Simultaneously, the data acquisition frequency of environmental sensors is dynamically adjusted according to the risk level; the acquisition frequency is increased to enhance monitoring during high-risk periods and decreased to save power during low-risk periods. After a preset number of days of intervention, feedback data on changes in sow weight and / or backfat are obtained. If the feedback data does not reach a preset threshold, the intervention parameters are automatically upgraded and new control commands are generated, achieving closed-loop adaptive control. In calculating the risk ratio, this invention constructs a competitive risk model by treating each reproductive abnormality event that occurs in sows as mutually exclusive events, resulting in a more accurate calculated risk probability and enabling precise intervention in the sow breeding process. Attached Figure Description
[0064] Figure 1 is a flowchart of a method for early warning and control of sow reproductive dynamics based on competition risk, according to an embodiment of the present invention.
[0065] Figure 2 is a block diagram of a sow reproductive dynamic early warning and control system based on competition risk provided by an embodiment of the present invention. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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. In addition, the technical features of the various embodiments or individual embodiments provided by the present invention can be arbitrarily combined with each other to form feasible technical solutions. Such combinations are not constrained by the order of steps and / or structural composition patterns, but must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0067] Based on the needs in the background art, the present invention aims to solve the following core technical problems:
[0068] 1. Real-time dynamic early warning of reproductive abnormalities: How can a processor calculate the risk of reproductive abnormalities such as return to estrus or abortion within a fixed future time window (e.g., 30 days) at any time after mating of sows, and drive an early warning device to provide real-time alerts?
[0069] 2. Accurate modeling of competing risks of multiple events: Returning to estrus, miscarriage, and normal delivery are mutually exclusive competing events (if one occurs, the others will not occur). How to properly handle this competing relationship during modeling to ensure that the sum of the probabilities of each event is ≤1 and avoid false alarms caused by overestimation of risk?
[0070] 3. The problem of accurately depicting the individual physiological characteristics of sows: The reproductive risk of sows is affected by a variety of physiological factors (parity, estrus cycle, seasonal stress, historical reproductive performance, etc.). How to extract and quantify these characteristics to achieve individualized risk assessment?
[0071] 4. The issue of proper handling of data censoring: Sows may leave the observation period due to death, culling, or other reasons, resulting in censored data. How can censoring be properly handled during modeling to avoid prediction bias?
[0072] 5. The linkage between risk prediction and automated equipment: How to transform risk prediction results into control commands to drive hardware such as automatic feeding systems, environmental control equipment, and early warning devices to perform precise interventions?
[0073] Based on the above problems, the main objectives of this invention are as follows:
[0074] 1. Achieve dynamic risk prediction and hardware linkage: Construct a system that integrates data acquisition sensors, processors, early warning devices, and automated control equipment. At any observation time t after sow mating, the processor calculates the probability of each reproductive abnormality event within a future time window [t, t+Δt] (e.g., the next 30 days) and drives the hardware equipment to perform intervention.
[0075] 2. Establish a mathematical modeling framework for competitive risks: Adopt the Competing Risks Framework to jointly model mutually exclusive events such as relapse, miscarriage, and normal delivery, ensuring that the sum of the probabilities of each event is ≤1. Improve prediction accuracy by executing a modified survival analysis algorithm through a processor.
[0076] 3. Achieve individualized risk assessment based on sow physiological characteristics: Extract multidimensional features reflecting the physiological state of sows (parity, estrus cycle days, seasonal stress indicators, historical reproductive performance, etc.), calculate personalized risks through feature processors, and generate control commands that can drive automated equipment.
[0077] 4. Construct risk-intervention mapping logic: Based on the risk level calculated by the processor, automatically generate equipment control parameters (such as the adjustment range of feeding amount, the set value of ambient temperature, the frequency of early warning push, etc.) to achieve closed-loop control.
[0078] 5. Design an engineering-deployable real-time early warning and control system: Integrate this invention on the existing IoT infrastructure (RFID identification, sensor network, automation equipment) of the pig farm to support daily automatic operation, multi-channel early warning, and visual decision support.
[0079] Figure 1 shows a flowchart of a sow reproductive dynamic early warning and control method based on competition risk according to an embodiment of the present invention. As shown in Figure 1, the method includes the following steps:
[0080] Step 1: Obtain the basic data of the sow to be observed at the current observation time t.
[0081] Understandably, during the pig farming process, each sow in the pigsty wears an RFID tag. An RFID reader is used to read each sow's RFID tag and identify each sow's unique identifier ID. Environmental sensors are installed in the pigsty to monitor environmental parameters in real time, such as temperature, humidity, and ammonia levels. Automatic feeding stations are also provided to feed each sow, allowing for real-time collection and recording of each sow's daily feed intake. Additionally, ultrasound scanners are installed to monitor the sows' pregnancy status.
[0082] The hardware configuration can be found in Table 1:
[0083] Table 1 Hardware Configuration
[0084] Key Equipment Functional Parameters: RFID reader / writer identifies sow IDs (125kHz, reading distance 30-50cm); Electronic ear tag stores sow IDs (ISO 11784 / 11785); Environmental sensors monitor temperature, humidity, and ammonia levels (accuracy ±0.5℃, ±3%RH); Automatic feeding station records feed intake with weighing accuracy ±50g. surface
[0085] At the current observation time t, relevant data of the sows to be observed can be obtained, mainly including the sow ID, environmental data in the pigsty, mating data and pregnancy data of the sows to be observed.
[0086] Step 2: Extract multiple feature data of the sows under observation at the current observation time t from the basic data of the sows under observation, and form a feature vector.
[0087] Understandably, step 1 obtains relevant data of the sows under observation at the current observation time t, and preprocesses the relevant data. Specifically, the mating date is read as the time origin t0, the event occurrence time t = event date - mating date (unit: days) is calculated, and the reproductive abnormality event type of the sows under observation is marked (return to estrus = 1, abortion = 2, farrowing = 3, censoring = 0).
[0088] Exclude records with logical errors (event date < mating date) and exclude outliers (return to estrus time < 10 days or > 60 days).
[0089] Based on the preprocessed data of the sows under observation at the current observation time t, multiple feature data of the sows under observation are extracted to form a feature vector. Specifically, based on the environmental data in the pigsty, the mating data and pregnancy data of the sows under observation, the static features, dynamic features and historical cumulative features of the sows under observation are extracted.
[0090] The static features include the breed of the sow to be observed and its parity at the current observation time t. Extracting the static features of the sow to be observed includes obtaining the parity of the sow at the current observation time t based on the pregnancy data. The extracted static features are shown in Table 2.
[0091] Table 2 Static characteristics
[0092] Characteristic coding method, biological significance, variety-specific heat coding (Longbai / Largebai / Duroc), genetic fertility differences, parity segment coding: primiparous / 2-5 parities / ≥6 parities. Primiparous women have high risk, 2-5 parities are optimal, and higher parities lead to decline. surface
[0093] The seasonal stress index extracted at the current observation time t includes:
[0094] The temperature (T) and humidity (RH) inside the pigsty at the current observation time (t) are obtained based on environmental sensors.
[0095] Calculate the temperature and humidity index (THI) at the current observation time t based on temperature T and humidity RH.
[0096] The temperature and humidity index (THI) at the current observation time t is mapped to the seasonal stress index.
[0097] Specifically, the environmental data inside the pigsty at the current observation time t, including temperature T and humidity RH, is read from the environmental sensors. Based on temperature T and humidity RH, the temperature and humidity index THI is calculated. The formula for calculating temperature and humidity THI is:
[0098] (1)
[0099] This formula is used to calculate the degree of heat stress experienced by sows (the combined effects of temperature and humidity). The input to this formula is: Temperature (°C) Relative humidity (%), output: temperature and humidity index The value (the higher the value, the hotter the sow). In simpler terms, this formula means that 30℃ + 80% humidity is more uncomfortable than 30℃ + 50% humidity in summer; the formula quantifies this "sultry feeling" into a number. For example, in summer: Calculate (Severe stress, high risk of miscarriage); Spring: Calculate (Comfortable, low risk).
[0100] The temperature and humidity index (THI) is mapped to a seasonal stress index, i.e., a seasonal stress level. Specifically, a mapping relationship is established between each seasonal stress index and the range of THI values. The seasonal stress index for the current observation time t is determined based on the range of THI values that fall within the current observation time t.
[0101] For example, when the temperature and humidity index (THI) is less than 72, the seasonal stress level is 0 (comfortable); when 72 ≤ THI < 78, the seasonal stress level is 1 (mild); when 78 ≤ THI < 84, the seasonal stress level is 2 (moderate); and when THI ≥ 84, the seasonal stress level is 3 (severe). If it is summer mating (June-August), the mapped seasonal stress level is increased by 1 on top of the original seasonal stress level.
[0102] Among them, the historical cumulative features extracted at the current observation time t include:
[0103] Based on the mating and pregnancy data of the sows under observation, the cumulative number of times the sows returned to estrus, the number of non-productive days in the previous litter, and the deviation in the number of piglets in the previous litter were calculated before the current observation time t.
[0104] Each extracted feature is digitally encoded and mapped to a digital vector. The digital vectors of all features constitute the feature vector X of the sow under observation at the current observation time t: X = [parity, seasonal stress index, cumulative number of return to estrus, number of non-productive days in the previous litter, and deviation of litter size in the previous litter].
[0105] Specifically, based on the mating and pregnancy data of the sows under observation, the historical cumulative characteristics of the sows at the current observation time t are extracted, mainly including:
[0106] Cumulative number of estrus returns: The processor queries the database to count the total number of estrus returns for this sow before this mating;
[0107] Previous non-productive days (NPD): The formula for NPD is NPD = date of this mating - date of weaning of the previous litter (number of days). The significance of this feature is that an excessively long NPD (>10 days) indicates that estrus is not obvious and the risk of returning to estrus is increased.
[0108] Previous litter size discrepancy: Query previous litter size And query the average number of piglets born per litter for that parity. Calculate the deviation The significance of this feature: negative bias indicates declining reproductive performance and an increased risk of miscarriage.
[0109] Perform Z-score normalization on the extracted continuous features:
[0110] (2)
[0111] in: These are the original eigenvalues. The mean, The standard deviation is denoted as .
[0112] Each feature extracted above is encoded into a numerical vector to form a feature vector. For example: parity = 1 (primiparity), seasonal stress index = 3, historical return to estrus count = 0, previous litter size deviation = 0, mating method = multiple mating. These features are then combined into a feature vector, for example, X1 = 1 (primiparity = 1), X2 = 3 (stress index), X3 = 0 (return to estrus count), X4 = 0 (litter size deviation), X5 = 1 (multiple mating = 1), and the feature vector X = [1, 3, 0, 0, 1].
[0113] Step 3: Based on the feature vector of the sow to be observed and the regression coefficient matrix of the sow's reproductive abnormality event k, calculate the risk ratio of the sow to be observed at the current time t to have reproductive abnormality event k. The regression coefficient matrix of the sow's reproductive abnormality event k is obtained by training a competitive risk model. The sow's reproductive abnormality event k is either sow returning to estrus or sow abortion.
[0114] In this model, the return to estrus, abortion, and farrowing events in sows are treated as mutually exclusive events, and a Fine-Gray model is constructed as a competing risk model. The Fine-Gray model is expressed as follows:
[0115] (3)
[0116] in, : Baseline risk of reproductive abnormality event k occurring in a sow at time t (stored in a lookup table in memory), meaning: the risk of a standard sow (average of all characteristics) experiencing reproductive abnormality event k at time t after mating. The risk of a day, simply put: the risk curve of the average level of sows in the farm; Individual sow feature vector (parity, season, number of times the sow has returned to estrus, etc.); : Regression coefficient matrix (obtained from model training and stored in memory; one feature corresponds to one regression coefficient, meaning: the weight of each feature's influence on risk). Hazard ratio: The risk multiple of a sow relative to a standard sow. Simply put: Individual risk = Average risk × Individual adjustment factor. For example, a primiparous sow (parity = 1, summer, 1 history of returning to estrus): ; (The risk is 5.42 times that of a standard sow). If the risk of a standard sow on day 21 is 5%, then the risk of this sow is... (High risk)
[0117] The Fine-Gray model was trained, and the partial likelihood function was used as the optimization objective function of the Fine-Gray model to obtain the regression coefficient matrix of reproductive abnormality event k in sows. .
[0118] It is understandable that after mating, sows may experience K types of reproductive abnormalities (return to estrus / abortion / parturition / death). Once any one of these events occurs, the others are no longer possible. Therefore, these reproductive abnormalities are mutually exclusive and cannot occur simultaneously. To address this, a competing risk model is designed. In this embodiment of the invention, the Fine-Gray model is constructed as the competing risk model. The Fine-Gray model can be expressed as equation (3) above.
[0119] After constructing the Fine-Gray model, it was trained. First, an event-specific dataset was built, collecting over 1000 mating records. A feature vector X was extracted from each mating record. The Fine-Gray model was then trained based on these feature vectors, using the partial likelihood function as the optimization objective function during training. The expression for the partial likelihood function is:
[0120] (4)
[0121] in, The symbol represents a product; This indicates that only events involving abnormal reproduction have occurred. Calculations were performed on the sows. To correct the risk set, sows that have experienced other competing events are included; For at any time Time-dependent weights for the occurrence of other competing events; This indicates the time when the reproductive abnormality event occurs in the i-th sow. Based on its own feature vector The calculated sub-distribution risk function value, This indicates the time when the reproductive abnormality event occurs in the i-th sow. Correcting the risk set The jth sow in the middle is based on its own feature vector The calculated sub-distribution risk function value, This indicates that the regression coefficient matrix is The partial likelihood function values of all sows that actually experienced reproductive abnormality event k.
[0122] Using the partial likelihood function as the objective function for the Fine-Gray model, solve for the optimal regression coefficient matrix. That is, the weight of each characteristic of the sow on the risk of the occurrence of reproductive abnormality event k.
[0123] It should be noted that, in this embodiment of the invention, the Cox model or a machine learning model (random forest, deep learning) can also be used instead of the Fine-Gray model as the competitive risk model.
[0124] The regression coefficient matrix is obtained through model training. Calculate the risk ratio of the observed sow to experience reproductive abnormality event k at the current time t. The risk ratio represents the multiple of risk of the sow experiencing reproductive abnormality event compared to a standard sow. The formula for calculating the risk ratio is:
[0125] Risk ratio = (5)
[0126] Step 4: Based on the baseline cumulative risk value of the sow experiencing reproductive abnormality event k at current time t and the risk ratio of the sow to be observed experiencing reproductive abnormality event k at current time t, calculate the cumulative sub-distribution risk value of the sow to be observed experiencing reproductive abnormality event k at current time t.
[0127] Understandably, based on the risk ratio of the observed sow to the standard sow for the occurrence of reproductive abnormality event k calculated in the above formula (5), and the baseline cumulative risk value of the sow for the occurrence of reproductive abnormality event k at the current time t, the cumulative sub-distribution risk value of the observed sow from mating to the occurrence of reproductive abnormality event k at the current time t is calculated.
[0128] Among them, the baseline cumulative risk value of the reproductive abnormality event k occurring in the sow at the current observation time t. The baseline cumulative risk value for a sow to experience reproductive abnormality event k at time t can be obtained by looking up a table. Once time t and reproductive abnormality event k are determined, the table can be consulted to obtain the cumulative risk value. ).
[0129] Therefore, the formula for calculating the cumulative subdistribution risk value of the reproductive abnormality event k occurring in the sow under observation from mating to the current time t is:
[0130] (6)
[0131] Equation (6) is used to calculate the cumulative risk of an individual sow, which can be simply understood as: cumulative risk of an individual sow = baseline cumulative risk × individual adjustment coefficient. For example, baseline cumulative risk... (Obtained from table) Individual risk ratio (The risk for this sow is 1.5 times the average), cumulative risk for the individual. .
[0132] Step 5: Convert the cumulative sub-distribution risk value of the reproductive abnormality event k occurring in the sow under observation at the current time t into the cumulative incidence rate of the reproductive abnormality event k occurring in the sow under observation at the current time t.
[0133] Understandably, this step converts the cumulative sub-distribution risk value of the reproductive abnormality event k in the observed sows from mating to the current time t, calculated in step 4, into a probability (cumulative morbidity). The formula for calculating the cumulative morbidity is:
[0134] (7)
[0135] in, Let be the cumulative incidence rate of reproductive abnormality event k occurring in the sow under observation at the current time t. Equation (7) serves to represent the cumulative risk. Convert to probability (A value between 0 and 1), this is a mathematical transformation formula that converts "cumulative risk value" into "percentage probability". It is an exponentially decaying function. Convert negative values to positive probabilities.
[0136] for example, (Result of the previous calculation) This means that the sow's cumulative probability of returning to estrus by day 30 is 20.1%.
[0137] Step 6: Based on the cumulative incidence rate of reproductive abnormality event k occurring in the sow under observation at the current time t, calculate the future incidence rate of the sow under observation from the current observation time t to the future. The cumulative incidence of newly reported reproductive abnormality events k.
[0138] Understandably, according to equation (7), the cumulative incidence rate of reproductive abnormality events k in sows from mating to the current observation time t can be calculated, and the incidence rate of sows under observation from the current observation time t to the future can be calculated. The cumulative incidence rate of newly added reproductive abnormality events k. The calculation formula is:
[0139] (8)
[0140] The core formula of formula (8) is to calculate "the future of the current observation time t". The probability of event k occurring within a day is calculated, enabling dynamic prediction (the next 30 days can be predicted at any time after mating). The parameters in formula (8) have the following meanings: : Current observation time (e.g., 35 days after mating) Forecast window (30 days) Predicted endpoint (35+30=65 days). : molecule, indicating from the first Heaven to the Di The cumulative incidence rate of new cases per day : Denominator, indicating the number of terms up to the specified term. The probability that no abnormal reproductive events have occurred in the past 7 days (normalization factor). Formula (8) can be understood as follows, analogous to weather forecast: "Probability of rain in the next 7 days" = (cumulative probability of rain in 7 days - cumulative probability of rain today) / probability that no rain has occurred today. Here, "Probability of returning to estrus in the next 30 days" = (cumulative probability of returning to estrus in 65 days - cumulative probability of returning to estrus in 35 days) / probability that no abnormal reproductive events have occurred in 35 days.
[0141] For example, on the 35th day after a sow is bred: (There is already a 10% chance of a reversal of the trend). (12% chance of reciprocation) The probability that no event has occurred by 35 days is 1 - (0.10 + 0.05 + 0.05) = 0.8. The probability of returning to estrus in the next 30 days is (0.12 - 0.10) / 0.8 = 0.025 = 2.5% (low risk, no warning required). Another primiparous sow returned to estrus on day 18 after mating (peak estrus period). , The probability of no event occurring is 1 - (0.15 + 0.05 + 0) = 0.80. The probability of a return to estrus in the next 30 days is (0.30 - 0.15) / 0.80 = 18.75% (medium risk, LED yellow warning).
[0142] Step 6 is followed by step 7, which involves analyzing the observation time of the sow from the current observation time t to the future... The cumulative incidence rate of newly added reproductive abnormality event k is used to determine the risk level of the observed sows experiencing reproductive abnormality event k at the current observation time t. Based on the risk level and the feature vector of the observed sows at the current observation time t, control commands are generated and sent to the hardware execution layer via a communication bus. The hardware execution layer includes an automatic feeding system and environmental control equipment. The control commands are used to drive the automatic feeding system to adjust the feed amount and / or feed formula, and to drive the environmental control equipment to adjust the temperature and / or humidity parameters in the pigsty.
[0143] Understandably, through step 7 above, it is possible to calculate what happens after the current observation time t. The cumulative incidence rate of reproductive abnormality event k in the sow to be observed over the days, including the future incidence rate of the sow. The cumulative probability of estrus return, the cumulative probability of miscarriage, and the cumulative probability of delivery within a day.
[0144] According to the sow's future The cumulative probability of estrus return, miscarriage, and delivery over a period of time is used to determine the corresponding risk level.
[0145] Specifically, low-risk, medium-risk, and high-risk thresholds are set for relapse events, miscarriage events, and childbirth events, respectively, and control instructions are generated based on the risk level. Risk thresholds and controller actions are shown in Table 3 below.
[0146] Table 3 Risk thresholds and controller actions for each reproductive anomaly event
[0147] Event Low Risk Medium Risk High Risk Controller Action Return to Estrus <10% 10-20% >20% High Risk → LED Display + SMS Abortion <3% 3-6% >6% High Risk → Feeding Adjustment + Environmental Optimization surface
[0148] Moving the observation time of the sow from the current observation time t to the future... The cumulative incidence rate of reproductive abnormality event k in the observed sows is compared with the corresponding risk thresholds to determine the risk level. Then, control instructions are generated based on the risk level to control the operating parameters of various equipment in the pigsty and to intervene in the sow breeding process in a timely manner.
[0149] Intervention Rule 1: High risk of returning to estrus, Condition: Risk of returning to estrus > 20% and 15-35 days after mating, Action: LED displays red warning, SMS notification to technician / farm manager.
[0150] Intervention Rule 2: High risk of abortion (primiparous sows), conditions: abortion risk >6% and parity = 1 and 30-90 days, action: automatic feeding system: energy feed +10%, vitamin E +200 IU, for 14 days, environmental control: target temperature 20℃, humidity 65%, mild ventilation.
[0151] Intervention Rule 3: High risk of miscarriage (summer), Conditions: miscarriage risk >6% and season = summer, Actions: Start the spray cooling (once every 30 minutes), run the fan at high speed, add electrolytes, and adjust the feeding time to morning and evening.
[0152] The hardware control in this embodiment of the invention includes:
[0153] 1. Automatic feeding system (Modbus RTU protocol): The controller calculates the adjusted feed amount = basic formula × (1 + energy increase ratio), and sends register write instructions via RS485 bus. Device address: mapped according to sow pen location. Control parameters: feed amount (grams), number of days.
[0154] 2. Environmental control equipment (PLC control): Temperature control: write temperature setpoint register; Spray cooling: open solenoid valve and set spray interval; Fan control: PWM duty cycle adjustment (low speed 30%, medium speed 60%, high speed 100%).
[0155] 3. LED warning device (serial communication): Generates display text (top 10 high-risk sows); sends GB2312 encoded strings via UART; high-risk events trigger GPIO to pull up the alarm pin.
[0156] In this embodiment of the invention, a cloud-edge collaborative edge computing architecture is constructed, with the edge gateway deployed inside the pigsty, storing competition risk model parameters locally. , H̃ 0k (t) ). The processor performs risk calculations at the edge (response time <100ms), while the central server is only responsible for model training and pushes new parameters of competing risk models every quarter.
[0157] The advantages of building a cloud-edge collaborative edge computing architecture are mainly reflected in the following aspects: offline availability: it can still run independently when the network is disconnected; data privacy: sow data does not leave the pig farm; bandwidth saving: only statistical summaries are uploaded, saving 98%; elastic expansion: adding new pig sheds only requires the deployment of a gateway, and can be linearly expanded to 100,000 pigs.
[0158] After intervening in the breeding process of sows in the pigsty, the effect of the intervention was evaluated and feedback was collected on the following data: weighbridge: weekly weight change, backfat measuring instrument: backfat change every 2 weeks, feeding station: actual feed intake.
[0159] If weight change is <0.5kg / week or backfat change is <1mm / 2 weeks → "Intervention effect is not good", then the intervention measures will be adaptively upgraded (executed by the controller): energy increase: 10% → 15%, vitamin E: 200IU → 400IU, ambient temperature: 20℃ → 19℃. If the upgraded nutritional / environmental intervention is still ineffective → a veterinary examination warning will be automatically triggered.
[0160] The following specific case illustrates the sow reproductive risk early warning method provided by this invention.
[0161] See Table 4 below for sow records.
[0162] Table 4 Sow Record Data
[0163] Sow ID Breed Parity Mating Date Mating Season History Number of Returns to Estrus Previous Litter Size SW2024-001 Landrace 1 (Primary) 2024-07-15 Summer 0 — SW2024-002 Large White 3 (Multiple) 2024-04-10 Spring 0 1 2 heads (Above Average) SW2024-003 Large White Crossbred 5 (Multiple) 2024-07-20 Summer 29 heads (Below Average) surface
[0164] Case 1: SW2024-001 (Primary delivery + Summer → High risk of miscarriage).
[0165] Feature extraction results: Parity code: [1,0,0] (primiparous); Seasonal stress index: 3 (THI=82, severe stress) + 1 (summer mating) = 4 - Historical cumulative features: None (primiparous).
[0166] The dynamic changes in risk can be seen in Table 5 below.
[0167] Table 5. Dynamic changes in risk of sow SW2024-001
[0168] Time of insemination, days after conception, risk of return to estrus, risk of miscarriage, risk level, system action. July 15th: 0.18%, 5% (medium), LED marker "Attention". July 30th: 15.25%, 5% (high), SMS push to technician. August 5th: 21.32%, 5% (high), entering peak period of return to estrus. August 12th: 28.8%, 9% (high), positive pregnancy test, risk shifts to miscarriage ——— Triggering intervention command. surface
[0169] Intervention instructions generated by the controller:
[0170] Target: SW2024-001 | Section: Pregnancy Quarter A-12
[0171] [Feeding System] Energy feed +10% (2.8→3.1kg / day) [Feeding System] Add Vitamin E 200IU [Environmental Control] Target temperature: 20℃ (currently 26℃ → start cooling) [Environmental Control] Spray interval: 30 minutes [Sensor] Body temperature sampling: 10 minutes → 1 minute (increased frequency) [LED Display] Highlight red display
[0172] Feedback and adjustment (August 26, 14 days after intervention): Weight change: +0.3kg / week (< target 0.5kg) → Judgment: Ineffective, controller automatically upgraded: Energy +10% → +15%, VE200 → 400IU, temperature 20 → 19℃. Follow-up on September 9: Weight +0.6kg / week → Intervention effective, maintenance strategy, final outcome: Normal delivery on October 28, 11 pups born.
[0173] Case 2: SW2024-002 (Business + Spring → Low Risk).
[0174] Feature extraction results: Parity code: [0,1,0] (golden period of multiparity); Seasonal stress index: 1 (spring, THI=68); Previous litter size deviation: +1.5 heads (high-producing sows);
[0175] See Table 6 below for dynamic changes in risk.
[0176] Table 6. Risk Dynamics of Sow SW2024-002
[0177] Time of insemination, days after conception, risk of return to estrus, risk of miscarriage, risk level, system action: April 10th, 0.8%, 2%, low; routine monitoring: April 28th, 18%, 12%, 2%, low; May 8th, 28%, 3%, 3%, low; positive pregnancy test: June 10th, 6%, 10%, 2%, low; passed high-risk period. surface
[0178] Controller Action: Target: SW2024-002 | Location: Pregnancy Quarter B-05
[0179] [Feeding system] Maintain standard formula (no adjustments);
[0180] [Sensor] Body temperature sampling: 30 minutes / time (energy saving mode);
[0181] [LED Display] Green standard display.
[0182] Final outcome: Normal delivery on August 2nd, 13 piglets born (no intervention required, saving resources).
[0183] Case 3: SW2024-003 (History of returning to estrus + summer → high risk of returning to estrus).
[0184] Feature extraction results: Parity code: [0,1,0] (multiparous); Seasonal stress index: 4 (severe summer stress); Cumulative number of return to estrus: 2 (key risk factor); Previous litter size deviation: -2 heads (performance decline signal).
[0185] The dynamic changes in risk can be seen in Table 7 below.
[0186] Table 7. Risk Dynamics of Sow SW2024-003
[0187]
[0188] Early warning effect: The system issued an early warning 22 days in advance. Technicians strengthened their monitoring and observation from August 7th, and promptly detected the symptoms of relapse on August 11th and arranged for re-inoculation.
[0189] System log update:
[0190] Event Log: SW2024-003 returned to estrus on 2024-08-11 (3rd time); Cumulative number of returns to estrus updated: 2→3; Risk forecast for next mating: The probability of returning to estrus will further increase; Recommendation: Consider culling assessment.
[0191] For a summary of case comparisons, please refer to Table 8 below.
[0192] Sow Risk Profiling System Response Resource Input Outcome SW2024-001 Primiparous + Summer → High Risk of Abortion Feeding Adjustment + Environmental Cooling + Sensor Enrichment High Normal Farrowing SW2024-002 Multiparous + Spring → Low Risk Routine Monitoring + Sensor Energy Saving Low Normal Farrowing SW2024-003 History of Return to Estrus + Summer → High Risk of Return to Estrus Early Warning + Enhanced Estrus Detection During Estrus Checks (Timely Detection) surface
[0193] Core value proposition: Precise identification: SW2024-001 and SW2024-003 risk >20%, SW2024-002 risk only 8%; Resource optimization: High-risk pigs are concentrated in one area, while low-risk pigs save costs; Early warning: SW2024-003 estrus return warning is given 22 days in advance to avoid missed detection.
[0194] Referring to Figure 2, a sow reproductive dynamics early warning and control system based on competition risk is shown. This system is used to implement a sow reproductive dynamics early warning and control method based on competition risk. The early warning and control system includes:
[0195] The data acquisition module 20 includes an RFID reader / writer 201, an environmental sensor 202, and an automatic feeding station 203, and is used to acquire basic data of the sow to be observed at the current observation time t. The basic data includes the ID of the sow to be observed, environmental data in the pigsty, mating data and pregnancy data of the sow to be observed.
[0196] An edge gateway 21, deployed in a pigsty, includes a processor 211 and a memory 212. The memory 212 is used to store the regression coefficient matrix of the competitive risk model and the baseline cumulative risk lookup table. The processor 211 is used to extract feature vectors from the basic data of the sows to be observed, calculate the cumulative incidence of reproductive abnormality event k in the sows to be observed based on the feature vectors and the regression coefficient matrix, and determine the risk level. The regression coefficient matrix is obtained by training the competitive risk model, and the reproductive abnormality event k of the sows is either sow returning to estrus or sow abortion.
[0197] Controller 22, which is communicatively connected to processor 211, is used to generate control instructions according to the risk level and send them to the hardware execution layer via a communication bus;
[0198] The hardware execution layer 23 is communicatively connected to the controller 22 and includes an automatic feeding system 231 and an environmental control device 232. The automatic feeding system 231 is used to adjust the feed amount and / or feed formula according to the control command, and the environmental control device 232 is used to adjust the temperature and humidity parameters in the pig house according to the control command.
[0199] The early warning device 24, which is communicatively connected to the controller 22, includes an LED display device 241 and a message push module 242, and is used to output early warning information to the management personnel according to the risk level.
[0200] The central server 25, communicatively connected to the edge gateway 21, is used to train the competition risk model and periodically push updated model parameters to the edge gateway 21. It is understood that the sow reproductive dynamic early warning and control system based on competition risk provided by this invention corresponds to the sow reproductive dynamic early warning and control method based on competition risk provided in the foregoing embodiments. The relevant technical features of the sow reproductive dynamic early warning and control system based on competition risk can be referred to the relevant technical features of the sow reproductive dynamic early warning and control method based on competition risk, and will not be repeated here.
[0201] This invention provides a method and system for early warning and control of sow reproductive dynamics based on competitive risk. First, basic data of the sow at the current observation time t is collected. Feature vectors are extracted from the collected data, and the risk ratio of the individual sow compared to a standard sow is calculated based on the feature vectors. Then, the cumulative incidence rate of each reproductive abnormality event from mating to the current observation time t is calculated, followed by the calculation of conditional probabilities, i.e., the predicted cumulative incidence rate of the sow from the current observation time t to a future period. Risk levels are predicted based on the predicted cumulative incidence rates. Control commands are generated according to the risk levels of each reproductive abnormality event in the sow and sent to the hardware execution layer via a communication bus. This drives the automatic feeding system to adjust the feed amount and / or feed formula, and drives the environmental control equipment to adjust the temperature and humidity parameters in the pigsty. Simultaneously, the data acquisition frequency of the environmental sensors is dynamically adjusted according to the risk level, increasing the acquisition frequency for high risk and decreasing it for low risk. After a preset number of days of intervention, feedback data on changes in the sow's weight and / or backfat are obtained. If the feedback data does not reach a preset threshold, the intervention parameters are automatically upgraded and new control commands are generated, achieving closed-loop adaptive control. In calculating the risk ratio, this invention constructs a competitive risk model by treating each reproductive abnormality event that occurs in sows as mutually exclusive events, resulting in a more accurate calculated risk probability and enabling precise intervention in the sow breeding process.
[0202] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0203] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0204] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0205] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0206] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0207] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0208] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for early warning and control of sow reproductive dynamics based on competition risk, characterized in that, include: Obtain the basic data of the sow to be observed at the current observation time t; Extract multiple feature data of the sows under observation at the current observation time t from the basic data of the sows under observation. Composition of feature vectors; Based on the feature vectors of the sows under observation and the regression coefficient matrix of the reproductive abnormality event k, the risk ratio of the sows under observation experiencing reproductive abnormality event k at the current time t is calculated. The regression coefficient matrix of the reproductive abnormality event k is obtained through training a competitive risk model, and the reproductive abnormality event k is either sow return to estrus or sow abortion. Based on the baseline cumulative risk value of the sows experiencing reproductive abnormality event k at the current time t and the risk ratio of the sows under observation experiencing reproductive abnormality event k at the current time t, the cumulative sub-distribution risk value of the sows under observation experiencing reproductive abnormality event k at the current time t is calculated. This cumulative sub-distribution risk value is then converted into the cumulative morbidity rate of the sows under observation experiencing reproductive abnormality event k at the current time t. Finally, based on the cumulative morbidity rate of the sows under observation experiencing reproductive abnormality event k at the current time t, the risk ratio of the sows under observation from the current observation time t to the future is calculated. The cumulative incidence rate of newly added reproductive abnormality event k; based on the observed sows from the current observation time t to the future. The cumulative incidence rate of newly added reproductive abnormality events (k) is used to provide early warning of reproductive abnormality events in sows under observation.
2. The method for early warning and control of sow reproductive dynamics according to claim 1, characterized in that, The basic data of the sows to be observed includes the sow ID, environmental data within the pigsty, mating data, and pregnancy data. The process involves extracting multiple characteristic data of the sows at the current observation time t from the basic data. The feature vector is composed of: extracting static features, dynamic features, and historical cumulative features of the sows under observation based on environmental data in the pigsty, mating data, and pregnancy data; extracting static features of the sows under observation, including: obtaining the parity of the sows under observation at the current observation time t based on the pregnancy data; extracting the seasonal stress index at the current observation time t, including: obtaining the temperature T and humidity RH in the pigsty at the current observation time t based on environmental sensors; calculating the temperature and humidity index THI at the current observation time t based on temperature T and humidity RH; and setting the current observation time... The temperature and humidity index (THI) at time t is mapped to the seasonal stress index. Historical cumulative features at the current observation time t are extracted, including: based on the mating and pregnancy data of the sows to be observed, the cumulative number of times the sows returned to estrus, the number of non-productive days in the previous litter, and the deviation in the number of piglets in the previous litter before the current observation time t are counted. Each extracted feature is digitally encoded and mapped to a digital vector. The digital vectors of all features constitute the feature vector X = [parity, seasonal stress index, cumulative number of times the sows returned to estrus, the number of non-productive days in the previous litter, and the deviation in the number of piglets in the previous litter] of the sows to be observed at the current observation time t.
3. The method for early warning and control of sow reproductive dynamics according to claim 2, characterized in that, The calculation of the temperature and humidity index (THI) at the current observation time t based on temperature T and humidity RH includes: Mapping the temperature and humidity index (THI) at the current observation time t to a seasonal stress index includes: setting a mapping relationship between each seasonal stress index and the range of values for the temperature and humidity index (THI); and determining the seasonal stress index at the current observation time t based on the range of values that the temperature and humidity index (THI) falls into at the current observation time t.
4. The method for early warning and control of sow reproductive dynamics according to claim 1, characterized in that, The regression coefficient matrix of the sow's reproductive abnormality event k is obtained through training a competitive risk model, including: using the sow's return to estrus, abortion, and farrowing events as mutually exclusive events, constructing a Fine-Gray model as the competitive risk model, wherein the Fine-Gray model is expressed as: in, Let be the baseline risk value for a sow to experience reproductive abnormality event k at time t, representing the risk value of a standard sow at time t. The risk of the day; This represents the individual feature vector of the sow. Let be the regression coefficient matrix for reproductive abnormality event k in sows. dimensionality and They have the same dimension; Let be the risk function value of a reproductive abnormality event k occurring in an individual sow at time t; Let $\frac{ ... 。 5. The method for early warning and control of sow reproductive dynamics according to claim 4, characterized in that, The expression for the partial likelihood function is: in, The symbol represents a product; This indicates that only events involving abnormal reproduction have occurred. Calculations were performed on the sows. To correct the risk set, sows that have experienced other competing events are included; For at any time Time-dependent weights for the occurrence of other competing events; This indicates the time when the reproductive abnormality event occurs in the i-th sow. Based on its own feature vector The calculated sub-distribution risk function value, This indicates the time when the reproductive abnormality event occurs in the i-th sow. Correcting the risk set The jth sow in the middle is based on its own feature vector The calculated sub-distribution risk function value, This indicates that the regression coefficient matrix is The partial likelihood function values of all sows that actually experienced reproductive abnormality event k.
6. The method for early warning and control of sow reproductive dynamics according to claim 4, characterized in that, Based on the eigenvectors of the sows under observation and the regression coefficient matrix of the reproductive abnormality event k, the risk ratio of the sows under observation experiencing reproductive abnormality event k at the current time t is calculated, including: Risk ratio = in, Let be the feature vector of the sow to be observed at the current observation time t. This is the regression coefficient matrix for reproductive abnormality event k in sows.
7. The method for early warning and control of sow reproductive dynamics according to claim 6, characterized in that, The calculation of the cumulative sub-distribution risk value of the sow undergoing reproductive abnormality event k at current time t, based on the baseline cumulative risk value of the sow experiencing reproductive abnormality event k at current time t and the risk ratio of the sow to be observed experiencing reproductive abnormality event k at current time t, includes: in, This represents the baseline cumulative risk value for the occurrence of reproductive abnormality event k in sows at the current observation time t. Let be the cumulative sub-distribution risk value of the sow to be observed if a reproductive abnormality event k occurs at the current time t.
8. The method for early warning and control of sow reproductive dynamics according to claim 7, characterized in that, The process of converting the cumulative sub-distribution risk value of reproductive abnormality event k occurring in the sow under observation at current time t into the cumulative incidence rate of reproductive abnormality event k occurring in the sow under observation at current time t includes: in, The cumulative incidence rate of reproductive abnormality event k in the sow to be observed at the current time t.
9. The method for early warning and control of sow reproductive dynamics according to claim 8, characterized in that, The method calculates the cumulative incidence rate of reproductive abnormality event k occurring in the observed sow at the current time t, from the current observation time t to the future... The newly added cumulative incidence of reproductive abnormality event k includes: in, This indicates the time the sow is to be observed. The cumulative incidence of reproductive abnormality event k. This indicates that the sows to be observed have reached the [number]th [day / month]. The cumulative incidence of no reproductive abnormalities has not yet occurred. This indicates that the sows to be observed have reached the [number]th [day / month]. The cumulative incidence of reproductive abnormalities occurring daily; This indicates the time from the current observation time t to the future... The cumulative incidence of newly added reproductive abnormality events k, For the prediction window, This indicates that, assuming no reproductive abnormalities have occurred in the sow up to the current observation time t, i.e. The type of future reproductive anomaly event is k, where This refers to the actual time of occurrence of the reproductive anomaly event. This refers to the event type.
10. The method for early warning and control of sow reproductive dynamics according to claim 1, characterized in that, The calculation of the sow to be observed from the current observation time t to the future... The newly added cumulative incidence rate of reproductive abnormality event k, followed by: based on the observed sow from the current observation time t to the future... The cumulative incidence of newly added reproductive abnormality events k, The risk level of a reproductive abnormality event k occurring in the sow under observation at the current observation time t is determined. Based on the risk level and the feature vector of the sow under observation at the current observation time t, a control command is generated and sent to the hardware execution layer via a communication bus. The hardware execution layer includes an automatic feeding system and an environmental control device. The control command is used to drive the automatic feeding system to adjust the feed amount and / or feed formula, and to drive the environmental control device to adjust the temperature and / or humidity parameters in the pigsty. Based on the risk level, the frequency of environmental data collection is dynamically adjusted. When the risk level is high, the frequency of environmental data collection is increased; when the risk level is low, the frequency of environmental data collection is decreased. After a preset number of days of intervention, intervention feedback data of the sow under observation is obtained. The intervention feedback data includes weight change data and / or backfat change data. If the weight change data is lower than a preset weight threshold or the backfat change data is lower than a preset backfat threshold, the intervention parameters are automatically upgraded and a new control command is generated. The upgraded intervention parameters include at least one of increasing the proportion of energy feed, increasing vitamin supplementation, and decreasing the environmental temperature setpoint.
11. A sow reproductive dynamic early warning and control system based on competition risk, used to implement the method described in any one of claims 1-10, characterized in that, include: The data acquisition module includes an RFID reader, environmental sensors, and an automatic feeding station, used to acquire basic data of the sows to be observed at the current observation time t. The basic data includes the sow ID, environmental data in the pigsty, mating data, and pregnancy data of the sows to be observed. An edge gateway, deployed within the pigsty, includes a processor and a memory. The memory stores the regression coefficient matrix of a competitive risk model and a baseline cumulative risk lookup table. The processor extracts feature vectors from the baseline data of the sows to be observed, calculates the cumulative incidence rate of reproductive abnormality event k in the sows to be observed based on the feature vectors and the regression coefficient matrix, and determines the risk level. The regression coefficient matrix is obtained through training the competitive risk model, and the reproductive abnormality event k in the sows is either sow return to estrus or sow abortion. A controller, communicatively connected to the processor, generates control commands based on the risk level and sends them to the hardware execution layer via a communication bus. The hardware execution layer, communicatively connected to the controller, includes an automatic feeding system and an environmental control device. The automatic feeding system adjusts the feed amount and / or feed formulation according to the control commands, and the environmental control device adjusts the temperature and humidity parameters within the pigsty according to the control commands. The early warning device, which is communicatively connected to the controller, includes an LED display device and a message push module, and is used to output early warning information to the management personnel according to the risk level; the central server, which is communicatively connected to the edge gateway, is used to perform training of the competitive risk model and periodically push updated model parameters to the edge gateway.