An algorithm plug-in scheduling method and a monitoring method for livestock intelligent monitoring

By using a unified visual reasoning and shared feature pool mechanism for monitoring video streams from livestock farms, the problems of repetitive computation and low resource utilization in traditional methods are solved, achieving efficient and accurate intelligent monitoring and early warning of livestock.

CN123142004APending Publication Date: 2026-11-20MUMU INTELLIGENT TECHNOLOGY (HANGZHOU) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611586197.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-14
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In livestock farms, traditional intelligent monitoring methods suffer from problems such as repetitive calculations, low resource utilization, high algorithm expansion costs, and difficulty in uniformly summarizing algorithm results, leading to insufficient equipment resources, increased inference latency, and decreased system stability.

Method used

By performing unified visual reasoning on the input monitoring video stream, a plugin requirement graph is generated. The reasoning results are stored in a shared feature pool, and the parallel scheduling algorithm plugins read features from the shared feature pool for calculation. This optimizes the scheduling order of the algorithm plugins and achieves the sharing and unified aggregation of results.

Benefits of technology

It reduces redundant calculations, improves computational efficiency, facilitates the addition of new algorithms, realizes unified aggregation of algorithm results and dynamic risk scoring and early warning, and improves the accuracy and stability of early warning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123142004A_ABST
    Figure CN123142004A_ABST
Patent Text Reader

Abstract

The application discloses an algorithm plug-in scheduling method and a monitoring method for livestock intelligent monitoring. The algorithm plug-in scheduling method comprises the following steps: S1, constructing an algorithm plug-in set having a demand for input monitoring video streams, and generating a plug-in demand graph; S2, frame extraction is performed on the monitoring video streams, visual reasoning is performed on a frame image extracted according to the plug-in demand graph, and a reasoning result is stored in a shared feature pool; S3, algorithm plug-ins in the algorithm plug-in set are scheduled in parallel to read features required by the algorithm plug-ins from the shared feature pool for calculation, and corresponding results are output; and S4, steps S2 to S3 are repeatedly executed. The application performs unified visual reasoning on input monitoring video streams, the reasoning result is shared and used by multiple algorithm plug-ins, repeated calculation is reduced, calculation efficiency is improved, new algorithms are conveniently extended, and algorithm results are uniformly summarized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent monitoring technology, and in particular to an algorithm plugin scheduling method and monitoring method for intelligent monitoring of livestock. Background Technology

[0002] As large-scale farms develop towards digitalization and intelligence, livestock behavior recognition technology based on video surveillance is gradually being applied to breeding scenarios such as pigsties, cattle sheds, and sheep sheds. Farms typically deploy cameras above the pens, in passageways, or on the roofs of the pens to collect behavioral information such as animal activity, feeding, gathering, dispersal, and changes in body size within the pens via video streams, and then use edge computing devices or servers for intelligent analysis.

[0003] In actual production, livestock enterprises are concerned not only with whether individual behaviors are identified, but also with whether multiple behavioral indicators can be operated stably and cost-effectively over the long term. For example, the same video feed from a camera can typically be used to analyze livestock herd activity, as well as multiple algorithmic tasks such as feeding intensity, aggregation and dispersion, growth uniformity, pen inventory, and pen weight estimation. Traditional methods process the video stream independently for each algorithmic task, separately pulling the video stream, decoding, extracting frames, and performing animal detection and image segmentation. When multiple algorithmic tasks need to be run simultaneously on a single IPC video stream, the following drawbacks exist: (1) Repetitive calculation of basic visual reasoning results: Multiple algorithms usually require basic results such as animal detection, target localization, contour segmentation, key point recognition, and field area judgment; if each algorithm performs basic model reasoning separately, it will cause NPU / GPU resources to be occupied repeatedly. (2) High cost of adding new algorithms: Adding new algorithms requires re-adaptation to the video access, frame extraction, detection, inference, result storage and interface output process, resulting in a long algorithm launch cycle and high system transformation cost; (3) Insufficient utilization of edge resources: In edge deployment scenarios, edge devices usually need to access multiple IPC video streams at the same time and run multiple algorithm plugins on each video stream. The NPU, GPU, CPU, memory and video decoding resources of edge devices all have upper limits. If the traditional single algorithm task independent deployment method is adopted, when the number of algorithm tasks or the number of camera channels increases, the device is prone to problems such as insufficient computing power, increased inference latency, complex resource scheduling and decreased system stability. (4) Lack of unified summary of algorithm results: Different algorithm tasks output results independently, making it difficult to form multi-dimensional indicators under the unified time, space and column dimensions, and also making it difficult to carry out comprehensive early warning, horizontal comparison and production review.

[0004] Therefore, there is a need for an algorithm plugin scheduling method and a monitoring method for intelligent livestock monitoring on edge devices in farms. This method would enable multiple algorithm plugins to share the same video stream based on a single access, decoding, and basic visual inference process. This would reduce redundant calculations, improve edge computing power utilization, facilitate the addition of new algorithms, and allow for unified aggregation of algorithm results. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides an algorithm plugin scheduling method and a monitoring method for intelligent livestock monitoring. This method performs unified visual reasoning on the input monitoring video stream, and the reasoning results are shared by multiple algorithm plugins, reducing redundant calculations, improving computational efficiency, facilitating the addition of new algorithms, and uniformly summarizing algorithm results.

[0006] To solve the above problems, the present invention adopts the following technical solution: The present invention provides an algorithm plugin scheduling method for intelligent monitoring of livestock, comprising the following steps: S1: Construct a set of algorithm plugins that require input monitoring video streams and generate a plugin requirement graph; S2: Extract frames from the surveillance video stream, perform visual reasoning on the extracted frame based on the plugin requirement map, and store the reasoning results in the shared feature pool. S3: The algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool, perform calculations, and output the corresponding results; S4: Repeat steps S2 to S3.

[0007] As a preferred method, the plugin requirement graph for generating the algorithm plugin set is as follows: take the union of the features required by all algorithm plugins in the algorithm plugin set, and the resulting set is the plugin requirement graph.

[0008] Preferably, the features required by the algorithm plugin include one or more of the following: video base layer features, object detection layer features, contour segmentation layer features, key part layer features, spatial relationship layer features, and time series layer features.

[0009] Preferably, step S3 includes the following steps: S31: The sum of the computing resources required by all algorithm plugins in the statistical algorithm plugin set. If the sum of the computing resources required is less than or equal to the currently available computing resources, then all algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool for calculation and output the corresponding results; otherwise, proceed to step S32. S32: Calculate the scheduling priority weight of each algorithm plugin in the algorithm plugin set based on the plugin's running benefits, current business urgency, historical anomaly contribution, current image quality processability, and tolerable latency. S33: Algorithm plugins are scheduled in parallel in descending order of scheduling priority weights to read the features they need from the shared feature pool, perform calculations, and output the corresponding results; the sum of the computing resources required by all algorithm plugins scheduled in parallel is less than or equal to the currently available computing resources.

[0010] Preferably, step S33 includes the following steps: S331: Sort the algorithm plugin set in descending order of scheduling priority weight; S332: The first n algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool for calculation, and the sum of the computing resources required by the first n algorithm plugins is less than or equal to the currently available computing resources; S333: When an algorithm plugin completes its calculation and the remaining computing resources are greater than or equal to the computing resources required by the next algorithm plugin in the algorithm plugin set, the next algorithm plugin is scheduled to read the features it needs from the shared feature pool for calculation. This process is repeated until all algorithm plugins in the algorithm plugin set have completed their calculations and the corresponding results are output.

[0011] Preferably, the time for scheduling algorithm plugins for one frame of image is recorded as one scheduling cycle, and the scheduling priority weight of the k-th algorithm plugin in the algorithm plugin set during the t-th scheduling cycle is... The calculation formula is as follows: , in, The running benefit of the k-th algorithm plugin in the t-th scheduling cycle is... Let k be the current business urgency of the algorithm plugin in the t-th scheduling cycle. The historical anomaly contribution of the k-th algorithm plugin in the t-th scheduling cycle. Let be the current image quality processability of the k-th algorithm plugin in the t-th scheduling cycle. Let be the tolerable latency of the k-th algorithm plugin in the t-th scheduling cycle. It is a constant.

[0012] The present invention provides a monitoring method for intelligent monitoring of livestock, comprising the following steps: Each livestock pen is monitored by video. The monitoring video stream is sent to the processor. The processor uses the above-mentioned algorithm plugin scheduling method for intelligent livestock monitoring to schedule the algorithm plugin to calculate the input monitoring video stream and obtain the output result of the algorithm plugin. For each frame of image extracted from the surveillance video stream, after all the algorithm plugins in the algorithm plugin set have completed their calculations, the corresponding risk score is calculated based on the output value of the algorithm plugins. The comprehensive risk score for each monitoring video stream is calculated every time interval g. The comprehensive risk score is the average of the risk scores corresponding to the monitoring video streams within the time interval g. Based on the comprehensive risk score, it is determined whether the livestock in the livestock pen corresponding to the monitoring video stream is abnormal. If abnormal, an alert is issued.

[0013] Preferably, the time for scheduling the algorithm plugin for one frame of image is recorded as one scheduling cycle, and the corresponding risk score is calculated based on the output value of the algorithm plugin in the t-th scheduling cycle. The calculation formula is as follows: , in, Let m be the feedback calibration factor for the t-th scheduling period, and m be the number of algorithm plugins in the algorithm plugin set. The standardized deviation of the output of the k-th algorithm plugin in the t-th scheduling cycle. Let be the time persistence factor of the k-th algorithm plugin in the t-th scheduling cycle. Let be the spatial lateral anomaly factor of the k-th algorithm plugin in the t-th scheduling cycle. To achieve multi-indicator coordinating anomaly degree, , It is a constant.

[0014] As a preferred option, multi-indicator collaborative anomaly degree The calculation formula is as follows: , in, The standardized deviation of the output of the p-th algorithm plugin in the t-th scheduling cycle. The standardized deviation of the output of the q-th algorithm plugin in the t-th scheduling cycle. Let p be the business association strength between the p-th algorithm plugin and the q-th algorithm plugin. Let be the degree of abnormal coordination between the outputs of the p-th algorithm plugin and the q-th algorithm plugin.

[0015] As a preferred method, the method for determining whether livestock in the corresponding livestock pen of the monitoring video stream are abnormal based on the comprehensive risk score is as follows: Compare the comprehensive risk score with the dynamic early warning threshold. If the comprehensive risk score is greater than or equal to the dynamic early warning threshold, then the livestock in the corresponding livestock pen of the monitoring video stream is judged to be abnormal. The dynamic early warning threshold is calculated based on the false alarm rate, effective early warning rate, and early warning density of multiple consecutive early warning statistical windows before the current early warning statistical window, and the interval time g is defined as an early warning statistical window.

[0016] The beneficial effects of this invention are: (1) Unified visual reasoning is performed on the input monitoring video stream, and the reasoning results are shared by multiple algorithm plugins, reducing redundant calculations and improving computational efficiency. (2) The running order of the algorithm plugins is adaptively and dynamically adjusted based on the plugin's operating benefits, current business urgency, historical anomaly contribution, current image quality processability, and tolerable delay, to adapt to the actual needs of the farm. (3) Features in the shared feature pool are shared by multiple algorithm plugins, facilitating the addition of new algorithms. (4) After all algorithm plugins output results in each scheduling cycle, they enter the next scheduling cycle, facilitating the formation of multi-dimensional indicators under unified time, space, and column dimensions. (5) The dynamic risk scoring and early warning method based on output standardization deviation, temporal persistence factor, spatial horizontal anomaly factor, multi-indicator collaborative anomaly degree, and feedback calibration factor can more accurately identify anomalies with business significance compared to the traditional fixed weight early warning method. (6) The early warning triggering conditions are dynamically adjusted according to the recent false alarm rate, effective early warning rate, and recent early warning density, reducing invalid early warnings and improving early warning stability. Attached Figure Description

[0017] Figure 1 This is a flowchart of this embodiment; Figure 2 It is a diagram showing the head and tail positions of pigs inside the pigsty. Figure 3 It is a heat map of the pigs in the pigsty. Detailed Implementation

[0018] The technical solution of the present invention will be further described in detail below through embodiments and in conjunction with the accompanying drawings.

[0019] Example: This example illustrates an algorithm plugin scheduling method for intelligent livestock monitoring, such as... Figure 1 As shown, it includes the following steps: S1: Construct a set of algorithm plugins that require input monitoring video streams and generate a plugin requirement graph; S2: Extract frames from the surveillance video stream, perform visual reasoning on the extracted frame based on the plugin requirement map, and store the reasoning results in the shared feature pool. S3: The algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool, perform calculations, and output the corresponding results; S4: Repeat steps S2 to S3.

[0020] Edge devices access video streams from multiple IPC cameras within the farm. Let the set of video streams be: ,in, Let i represent the i-th video stream, 1≤i≤N, where N represents the total number of connected video streams; This method establishes a spatial mapping relationship for each video stream: , in, This represents the farm corresponding to the i-th video stream. This represents the building corresponding to the i-th video stream. This represents the video channel corresponding to the i-th video stream. This represents the field corresponding to the i-th video stream. If one camera stream covers multiple fields, then... It can represent the set of fields corresponding to the i-th video stream.

[0021] After the video stream enters the unified video processing queue, frames are extracted based on the sampling period, algorithm running frequency, and resource scheduling results.

[0022] The features required by the algorithm plugin include one or more of the following: video base layer features, object detection layer features, contour segmentation layer features, key part layer features, spatial relationship layer features, and time series layer features.

[0023] The basic features of the video layer include video frames, timestamps, channel numbers, field areas, picture quality scores, valid picture markers, and decoding status; The features of the target detection layer include livestock detection boxes, target confidence, target category, target center point, and target quantity; The features of the contour segmentation layer include animal contour mask, contour area, body projection area, target boundary, and target occupied area; Key features include head position, tail position, key body points, orientation information, and the relationship between the head and the feed trough area; for example, a map showing the head and tail positions of pigs in a pigsty. Figure 2 As shown; Spatial relationship layer features include distance between targets within the pen, density distribution, target clustering results, space occupancy ratio, feed trough area occupancy ratio, and heat map; for example, a heat map of the pig herd within a pigsty. Figure 3 As shown; The time series layer features include short-term target trajectory, inter-frame variation, continuous feeding duration, hourly index cache, daily baseline cache, and multi-day historical sequences.

[0024] The computational cost varies depending on the feature level. Typically, features at the object detection level, contour segmentation level, and key part level require deep model inference, resulting in higher computational costs; while features at the spatial relationship level and time series level have lower computational costs. Therefore, this method does not generate all feature levels at once, but dynamically determines which features to generate based on the needs of the algorithm plugin.

[0025] This method encapsulates each algorithm plugin as an independent plugin. Let the set of algorithm plugins be: K is the number of plugins in the algorithm plugin set; Each algorithm plugin includes not only the algorithm name and output fields, but also its requirement declaration for features. The k-th algorithm plugin... It can be represented as: , Where 1≤k≤K, This represents the set of features required as input for the k-th algorithm plugin; This represents the output field of the k-th algorithm plugin; This represents the running frequency of the k-th algorithm plugin; This represents the maximum acceptable output latency for the k-th algorithm plugin; This indicates the timeliness level of the k-th algorithm plugin; This represents the warning rules or business value configuration of the k-th algorithm plugin.

[0026] The method for generating the plugin demand graph of the algorithm plugin set is as follows: take the union of the features required by all algorithm plugins in the algorithm plugin set, and the resulting set is the plugin demand graph.

[0027] In aquaculture applications, algorithm plugins include the following: The activity plugin mainly relies on features from the target detection layer, spatial relationship layer, and time series layer. It can calculate activity based on changes in the target center point, inter-frame changes, activity heatmaps, etc. The feeding intensity plugin mainly relies on target detection layer features, key part layer features, spatial relationship layer features, and time series layer features. It can calculate feeding intensity and feeding rhythm based on the relationship between head position and feed trough area, number of feeding targets, and feeding duration. The clustering and dispersion plugin mainly relies on the features of the target detection layer, the spatial relationship layer, and the time series layer. It can calculate the clustering and dispersion index based on the distance to the target center point, spatial density, clustering results, and the proportion of occupied area. The growth uniformity plugin mainly relies on contour segmentation layer features and time series layer features, and can calculate growth uniformity based on contour area mean, area standard deviation, coefficient of variation and historical trend. The inventory plugin for livestock storage mainly relies on the features of the target detection layer and can output inventory results for livestock storage based on the number of livestock targets and the detection confidence. The column weight estimation plugin mainly relies on contour segmentation layer features, spatial relationship layer features, and time series layer features. It can output weight estimation results based on animal contour area, body shape features, and calibration parameters.

[0028] The set of algorithm plugins constructed in step S1 includes one or more of the following: activity level plugin, feeding intensity plugin, clustering degree plugin, growth uniformity plugin, field inventory plugin, and field weight estimation plugin. This method can decompose the visual feature requirements of different algorithm plugins into reusable common inference results and store them in a shared feature pool, enabling multiple algorithm plugins in the same video to share basic visual capabilities instead of repeating inferences on their own.

[0029] The shared feature pool not only stores public inference results, but also their validity period, quality score, source model version, and feature availability status.

[0030] Visual reasoning is performed on the t-th frame of the i-th surveillance video stream, and the d-th shared feature term in the obtained common reasoning result is... Represented as: , in, This represents the d-th feature obtained by visual reasoning on the t-th frame of the i-th video stream; express Quality rating; express Validity period; express The status markers can include states such as available, expired, low quality, missing, and requiring inference.

[0031] When an algorithm plugin requests a feature as input, it first queries the shared feature pool. If the feature exists in the pool and its quality score is greater than a set threshold and its validity period is greater than 0, it directly reads the feature from the pool for calculation. Otherwise, it decides to immediately supplement the inference, postpone execution, or return a low-confidence result based on the current available computing resources. This mechanism further enhances the system's robustness and prevents the algorithm plugin from using expired, low-quality, or erroneous intermediate results.

[0032] Step S3 includes the following steps: S31: The sum of the computational resources required by all algorithm plugins in the statistical algorithm plugin set. If the sum of the computational resources required is less than or equal to the currently available computational resources, then all algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool for computation and output the corresponding results; otherwise, proceed to step S32.

[0033] S32: Calculate the scheduling priority weight of each algorithm plugin in the algorithm plugin set based on the plugin's operating benefits, current business urgency, historical anomaly contribution, current image quality processability, and tolerable latency.

[0034] The time for scheduling algorithm plugins for a single frame of image is defined as one scheduling cycle. The scheduling priority weight of the k-th algorithm plugin within the set of algorithm plugins in the t-th scheduling cycle is... The calculation formula is as follows: , in, The running benefit of the k-th algorithm plugin in the t-th scheduling cycle is... Let k be the current business urgency of the algorithm plugin in the t-th scheduling cycle. The historical anomaly contribution of the k-th algorithm plugin in the t-th scheduling cycle. Let be the current image quality processing capability of the k-th algorithm plugin in the t-th scheduling cycle (i.e., the processing capability of the k-th algorithm plugin for the image quality of the t-th frame). This represents the tolerable latency (preset value) of the k-th algorithm plugin in the t-th scheduling cycle. It is a constant.

[0035] Operating revenue The calculation formula is as follows: , , in, This is the historical output sequence of the k-th algorithm plugin in the t-th scheduling cycle. for variance This represents the output value of the k-th algorithm plugin in the (t-1)-th scheduling cycle. for Standardized deviation relative to historical baseline , The normalization coefficient is... for The mean, for standard deviation It is a constant.

[0036] Operating revenue This is used to measure the amount of new information that the algorithm plugin can bring to the system during this run. If the recent results of an algorithm plugin are stable and do not change significantly, the benefit is low; if the current video or historical metrics show significant fluctuations, the benefit is high. When historical output fluctuations increase, or the output of the previous scheduling cycle deviates significantly from the historical baseline, Increasing this value allows the corresponding algorithm plugin to obtain a higher scheduling priority.

[0037] Current business urgency The calculation formula is as follows: , in, Let k be the expected running cycle of the algorithm plugin. This is the scheduling cycle number of the most recent completed execution of the k-th algorithm plugin.

[0038] When the algorithm plugin has just finished executing The initial value is relatively small; as the number of unexecuted cycles increases, the business urgency gradually rises, and when the interval reaches or exceeds the expected running cycle, When frame drops occur due to insufficient computing resources or the media layer's inability to process the frames (encoding, decoding, and sending), the algorithm plugin may fail to execute.

[0039] When the output value of the k-th algorithm plugin is normal in the (t-1)-th scheduling cycle, the historical anomaly contribution is... The calculation formula is as follows: ; When the output value of the k-th algorithm plugin is abnormal in the (t-1)-th scheduling cycle, the contribution of historical anomalies is... The calculation formula is as follows: ; in, The attenuation coefficient ( ), The historical anomaly contribution of the k-th algorithm plugin in the (t-1)-th scheduling cycle. The anomaly feedback score for the k-th algorithm plugin in the (t-1)-th scheduling cycle; When the output value of the k-th algorithm plugin is abnormal in the (t-1)-th scheduling cycle and the abnormal warning is confirmed to be valid by manual verification, ; When the output value of the k-th algorithm plugin is abnormal in the (t-1)-th scheduling cycle and has not been manually confirmed, ; When the output value of the k-th algorithm plugin is abnormal in the (t-1)-th scheduling cycle and manual confirmation of the abnormality warning is ineffective... .

[0040] When an anomaly alerts generated by the algorithm plugin are manually confirmed as valid, the plugin's historical anomaly contribution score is increased. When anomaly results have not yet been confirmed, a neutral feedback value is used to avoid prematurely increasing or decreasing the contribution score. When anomaly results are confirmed as invalid, the plugin's historical anomaly contribution score is decreased. Historical Anomaly Contribution Score This is used to measure the historical contribution of the k-th algorithm plugin to effective anomaly warnings, and is adaptively updated based on the results of manual review. If no anomaly warning was generated in the previous scheduling cycle, the historical anomaly contribution level of the previous scheduling cycle can be maintained. This allows the scheduling priority to be continuously adjusted based on the actual warning effect of the algorithm plugins, rather than relying on fixed manual weights.

[0041] The initial value of the historical anomaly contribution of the k-th algorithm plugin is... The initial value is set to 0.5, indicating that the algorithm plugin is in an unknown or neutral state. If the initial value is set to 0, the newly added algorithm plugin may be placed in a low scheduling priority for a long time due to a lack of historical feedback; if the initial value is set to 1, the new algorithm plugin may be given an excessively high scheduling priority due to a lack of actual verification. Therefore, a neutral initial value is adopted and gradually adjusted based on subsequent manual review and on-site handling feedback.

[0042] Current image quality processing capability The calculation formula is as follows: , in, Let be the image sharpness of the t-th frame. The brightness suitability of the t-th frame image. Let be the degree of occlusion of the image in frame t. To represent the continuity of the image from frame t-w+1 to frame t, where w is the length of the observation window. , , , All are normalized to [0,1]. Let be the image quality requirement factor for the k-th algorithm plugin.

[0043] Calculate the similarity between adjacent images from frame t-w+1 to frame t, and the direction of pixel motion in the image. . , The larger the value, the higher the image quality requirement of the k-th algorithm plugin, and the greater the processability of the current image quality. The smaller.

[0044] The scheduling priority weights in this method are not preset fixed weights summed, but are dynamically calculated based on the running status. Plugins with higher running benefits, higher current business urgency, higher historical anomaly contribution, lower image quality requirements, and stronger timeliness requirements have higher scheduling priority.

[0045] S33: Algorithm plugins are scheduled in parallel in descending order of scheduling priority weights to read the features they need from the shared feature pool, perform calculations, and output the corresponding results; the sum of the computing resources required by all algorithm plugins scheduled in parallel is less than or equal to the currently available computing resources.

[0046] Step S33 includes the following steps: S331: Sort the algorithm plugin set in descending order of scheduling priority weight; S332: The first n algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool for calculation, and the sum of the computing resources required by the first n algorithm plugins is less than or equal to the currently available computing resources; S333: When an algorithm plugin completes its calculation and the remaining computing resources are greater than or equal to the computing resources required by the next algorithm plugin in the algorithm plugin set, the next algorithm plugin is scheduled to read the features it needs from the shared feature pool for calculation. This process is repeated until all algorithm plugins in the algorithm plugin set have completed their calculations and the corresponding results are output.

[0047] When you need to add a new algorithm plugin, perform the following steps: F1: Reads all the features required by the new algorithm plugin for the input surveillance video stream; F2: If all the features required by the new algorithm plugin belong to the plugin requirement graph, then add the new algorithm plugin to the algorithm plugin set; otherwise, proceed to step F3. F3: Computational resource cost required to calculate features that do not belong to the plugin requirement graph. ; F4: Calculate the unit profit of the newly added algorithm plugin. ; , in, The expected business value or historical effective early warning contribution of the newly added algorithm plugin. It is a constant; F5: If If the threshold is greater than the preset access threshold, the new algorithm plugin will be added to the algorithm plugin set and the new features required by the new algorithm plugin will be added to the plugin requirement graph; otherwise, a message will be displayed indicating that no new algorithm plugin can be added at present and the addition should be postponed.

[0048] This mechanism ensures that new algorithm plugins are not simply configured and deployed, but rather that adaptive access decisions are made based on the satisfaction of shared features, marginal resource costs, and business benefits.

[0049] In this solution, unified visual inference is performed on each input monitoring video stream. The inference results are shared by all algorithm plugins that require that video stream, reducing repetitive visual inference, improving computational efficiency, and facilitating the parallel execution of multiple algorithm plugins on resource-constrained edge devices, thus reducing ineffective computation at the edge. The scheduling priority weight of the algorithm plugins is adaptively and dynamically adjusted based on the plugin's operational benefits, current business urgency, historical anomaly contribution, current image quality processability, and tolerable latency. This allows resource-constrained edge devices to rationally arrange the execution order of algorithm plugins to adapt to the actual needs of the farm scenario.

[0050] This method determines the range of visual inference results generated through a plugin demand graph, controls the reuse of shared features through a shared feature pool, and controls feature quality through validity management. Adding new algorithms has low expansion costs, and new algorithms are integrated through on-demand inference. After all algorithm plugins output results in each scheduling cycle, the next scheduling cycle begins, facilitating the formation of multi-dimensional indicators within a unified time, space, and column dimension.

[0051] This embodiment of a monitoring method for intelligent monitoring of livestock includes the following steps: Each livestock pen is monitored by video, and the video stream is sent to the processor. At each time interval g, the processor processes each video stream as follows: M1: Construct a set of algorithm plugins that require input monitoring video streams and generate a plugin requirement graph; M2: Extract frames from the input surveillance video stream, perform visual reasoning on the extracted frame image based on the plugin requirement map, and store the reasoning result in the shared feature pool. M3: The algorithm plugins in the parallel scheduling algorithm plugin collection read the features they need from the shared feature pool, perform calculations, and output the corresponding results; M4: Calculates the risk score based on the output value of the algorithm plugin; M5: Determine if the interval time g has been reached. If yes, proceed to step M6; otherwise, jump to step M2. M6: Calculate the average risk score within the interval time g as the comprehensive risk score. Based on the comprehensive risk score, determine whether the livestock in the corresponding livestock pen of the monitoring video stream is abnormal. If so, issue an alert.

[0052] The time taken to schedule the algorithm plugin for one frame of image is defined as one scheduling cycle. The risk score is calculated based on the output value of the algorithm plugin in the t-th scheduling cycle. The calculation formula is as follows: , in, Let m be the feedback calibration factor for the t-th scheduling period, and m be the number of algorithm plugins in the algorithm plugin set. The standardized deviation of the output of the k-th algorithm plugin in the t-th scheduling cycle. Let be the time persistence factor of the k-th algorithm plugin in the t-th scheduling cycle. Let be the spatial lateral anomaly factor of the k-th algorithm plugin in the t-th scheduling cycle. To achieve multi-indicator coordinating anomaly degree, , It is a constant.

[0053] Feedback calibration factor The calculation formula is as follows: , in, For calibrating the intensity, Let be the historical early warning effectiveness rate of the monitoring video stream in the t-th scheduling cycle. The effectiveness of early warning for targets.

[0054] If a livestock pen has a high recent early warning effectiveness rate, the system will appropriately increase its overall risk score sensitivity; if there are many false alarms, its overall risk score sensitivity will be decreased. This allows the early warning model to adaptively correct itself based on on-site feedback.

[0055] Output standardized deviation The calculation formula is as follows: , in, This represents the output value of the k-th algorithm plugin in the t-th scheduling cycle. The historical average output of the k-th algorithm plugin in the t-th scheduling cycle. Let be the standard deviation of the historical output sequence of the k-th algorithm plugin in the t-th scheduling cycle. It is a constant.

[0056] Duration factor Time series persistence factor is used to avoid false alarms caused by single-point fluctuations. The calculation formula is as follows: , Where w is the length of the observation window. For the first The standardized deviation of the output of the k-th algorithm plugin in each scheduling cycle. is the output anomaly threshold for the k-th algorithm plugin.

[0057] In this embodiment, the risk score is calculated starting from the wth frame image extracted from the monitoring video stream.

[0058] Spatial lateral anomaly factor This is used to determine whether the livestock pen corresponding to the currently processed monitoring video stream is abnormal relative to other adjacent livestock pens in the same area; it is a spatial lateral anomaly factor. The calculation formula is as follows: , in, This is the average of the output values ​​of the algorithm plugin for the k-th algorithm plugin in the t-th scheduling cycle of all adjacent livestock pen monitoring video streams. The standard deviation of the algorithm plugin output value for the video streams monitoring all adjacent livestock pens in the k-th scheduling cycle is given. It is a constant.

[0059] Multi-indicator co-anomaly The calculation formula is as follows: , in, The standardized deviation of the output of the p-th algorithm plugin in the t-th scheduling cycle; The standardized deviation of the output of the q-th algorithm plugin in the t-th scheduling cycle; The business association strength between the p-th algorithm plugin and the q-th algorithm plugin (with values ​​[0,1]); Let be the degree of abnormal coordination between the outputs of the p-th algorithm plugin and the q-th algorithm plugin.

[0060] This is used to characterize whether the abnormal output states of the p-th and q-th algorithm plugins have synergistic indicative significance in aquaculture operations. If they do, then... ,otherwise, .

[0061] For example, during the feeding period, the pig herd does not show obvious concentrated feeding behavior, and the overall feeding participation is low. This can be manifested by a low proportion of pigs near the feed trough or with their heads facing the feed trough, and a lack of obvious continuous feeding behavior. This phenomenon corresponds to an abnormal output of the feeding intensity plugin, which can be described as a decrease in feeding desire or an unclear concentrated feeding rhythm. At this time, the pig herd will be more obviously dispersed in the pen, and will not form a spatial aggregation state that matches the normal concentrated feeding behavior. This phenomenon corresponds to an abnormal output of the aggregation degree plugin, indicating that the two types of abnormalities have synergistic indicative significance and can be used to enhance the judgment of decreased feeding desire or abnormal concentrated feeding rhythm. Therefore, the synergy value of the output abnormalities of the feeding intensity plugin and the aggregation degree plugin is 1.

[0062] In this embodiment, m=6, and the values ​​of the output anomaly coordination degree between the algorithm plugins are shown in Table 1. Table 1

[0063] In step M6, the method for determining whether the livestock in the corresponding livestock pen of the monitoring video stream are abnormal based on the comprehensive risk score is as follows: Compare the comprehensive risk score with the dynamic early warning threshold. If the comprehensive risk score is greater than or equal to the dynamic early warning threshold, then the livestock in the livestock pen corresponding to the monitoring video stream is determined to be abnormal. Let the interval time g be defined as a warning statistical window, and let j represent the sequence number of the warning statistical window. Let the number of effective scheduling cycles in which the risk score is actually calculated within the j-th warning statistical window be denoted as . Then the comprehensive risk score of the j-th early warning statistical window The calculation formula is: , The risk score is the one corresponding to the t-th scheduling cycle within the j-th early warning statistical window. The dynamic early warning threshold corresponding to the j-th early warning statistics window The calculation formula is: , in, Basic warning threshold, Let W be the false alarm rate of the W consecutive early warning statistical windows preceding the j-th early warning statistical window. The effective early warning rate is the W consecutive early warning statistical windows preceding the j-th early warning statistical window. Let W be the warning density of the W consecutive warning statistical windows preceding the j-th warning statistical window. , , It is a constant.

[0064] The warning level for the j-th warning statistical window is determined based on the comprehensive risk score interval. as follows: , in, , It is a positive number.

[0065] When issuing an alert in step M6, the triggering reason is also output. The triggering reason includes the dominant abnormal indicator, the duration of the abnormality, the comparison results with adjacent fields, the combination of co-abnormalities, and image evidence. For example: "The feeding intensity of field 6 has been lower than the historical baseline for three consecutive cycles, the activity level has decreased synchronously, and it deviates significantly from other fields in the same shed. It is recommended to prioritize field inspection and verification." Through the above method, the alert result is interpretable, and is not just a risk score output.

[0066] In this scheme, the comprehensive risk score is dynamically calculated based on output standardized deviation, temporal persistence factor, spatial horizontal anomaly factor, multi-indicator collaborative anomaly degree, and feedback calibration factor. Compared with the traditional fixed-weight early warning method, it can more accurately identify anomalies with business significance. The early warning triggering conditions are dynamically adjusted according to the recent false alarm rate, effective early warning rate, and recent early warning density to reduce invalid early warnings and improve early warning stability.

Claims

1. A method for scheduling algorithm plugins for intelligent livestock monitoring, characterized in that, Includes the following steps: S1: Construct a set of algorithm plugins that require input monitoring video streams and generate a plugin requirement graph; S2: Extract frames from the surveillance video stream, perform visual reasoning on the extracted frame based on the plugin requirement map, and store the reasoning results in the shared feature pool. S3: The algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool, perform calculations, and output the corresponding results; S4: Repeat steps S2 to S3.

2. The algorithm plug-in scheduling method for intelligent livestock monitoring according to claim 1, characterized in that, The method for generating the plugin demand graph of the algorithm plugin set is as follows: take the union of the features required by all algorithm plugins in the algorithm plugin set, and the resulting set is the plugin demand graph.

3. The algorithm plug-in scheduling method for intelligent livestock monitoring according to claim 2, characterized in that, The features required by the algorithm plugin include one or more of the following: video base layer features, object detection layer features, contour segmentation layer features, key part layer features, spatial relationship layer features, and time series layer features.

4. The algorithm plug-in scheduling method for intelligent livestock monitoring according to claim 1, characterized in that, Step S3 includes the following steps: S31: The sum of the computing resources required by all algorithm plugins in the statistical algorithm plugin set. If the sum of the computing resources required is less than or equal to the currently available computing resources, then all algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool for calculation and output the corresponding results; otherwise, proceed to step S32. S32: Calculate the scheduling priority weight of each algorithm plugin in the algorithm plugin set based on the plugin's running benefits, current business urgency, historical anomaly contribution, current image quality processability, and tolerable latency. S33: Algorithm plugins are scheduled in parallel in descending order of scheduling priority weights to read the features they need from the shared feature pool, perform calculations, and output the corresponding results; the sum of the computing resources required by all algorithm plugins scheduled in parallel is less than or equal to the currently available computing resources.

5. The algorithm plug-in scheduling method for intelligent livestock monitoring according to claim 4, characterized in that, Step S33 includes the following steps: S331: Sort the algorithm plugin set in descending order of scheduling priority weight; S332: The first n algorithm plugins in the parallel scheduling algorithm plugin set read the features they need from the shared feature pool for calculation, and the sum of the computing resources required by the first n algorithm plugins is less than or equal to the currently available computing resources; S333: When an algorithm plugin completes its calculation and the remaining computing resources are greater than or equal to the computing resources required by the next algorithm plugin in the algorithm plugin set, the next algorithm plugin is scheduled to read the features it needs from the shared feature pool for calculation. This process is repeated until all algorithm plugins in the algorithm plugin set have completed their calculations and the corresponding results are output.

6. The algorithm plug-in scheduling method for intelligent livestock monitoring according to claim 4, characterized in that, The time for scheduling algorithm plugins for a single frame of image is defined as one scheduling cycle. The scheduling priority weight of the k-th algorithm plugin within the set of algorithm plugins in the t-th scheduling cycle is... The calculation formula is as follows: , in, The running benefit of the k-th algorithm plugin in the t-th scheduling cycle is... Let k be the current business urgency of the algorithm plugin in the t-th scheduling cycle. The historical anomaly contribution of the k-th algorithm plugin in the t-th scheduling cycle. Let be the current image quality processability of the k-th algorithm plugin in the t-th scheduling cycle. Let be the tolerable latency of the k-th algorithm plugin in the t-th scheduling cycle. It is a constant.

7. A monitoring method for intelligent monitoring of livestock, characterized in that, Includes the following steps: Each livestock pen is monitored by video, and the monitoring video stream is sent to the processor. The processor uses the algorithm plugin scheduling method for intelligent livestock monitoring as described in any one of claims 1-6 to schedule the algorithm plugin to calculate the input monitoring video stream and obtain the output result of the algorithm plugin. For each frame of image extracted from the surveillance video stream, after all the algorithm plugins in the algorithm plugin set have completed their calculations, the corresponding risk score is calculated based on the output value of the algorithm plugins. The comprehensive risk score for each monitoring video stream is calculated every time interval g. The comprehensive risk score is the average of the risk scores corresponding to the monitoring video streams within the time interval g. Based on the comprehensive risk score, it is determined whether the livestock in the livestock pen corresponding to the monitoring video stream is abnormal. If abnormal, an alert is issued.

8. A monitoring method for intelligent monitoring of livestock according to claim 7, characterized in that, The time taken to schedule the algorithm plugin for one frame of image is recorded as one scheduling cycle. The corresponding risk score is calculated based on the output value of the algorithm plugin in the t-th scheduling cycle. The calculation formula is as follows: , in, Let be the feedback calibration factor for the t-th scheduling period, and m be the number of algorithm plugins in the algorithm plugin set. The standardized deviation of the output of the k-th algorithm plugin in the t-th scheduling cycle. Let be the time persistence factor of the k-th algorithm plugin in the t-th scheduling cycle. Let be the spatial lateral anomaly factor of the k-th algorithm plugin in the t-th scheduling cycle. To achieve multi-indicator coordinating anomaly degree, , It is a constant.

9. A monitoring method for intelligent monitoring of livestock according to claim 8, characterized in that, Multi-indicator co-anomaly The calculation formula is as follows: , in, The standardized deviation of the output of the p-th algorithm plugin in the t-th scheduling cycle. The standardized deviation of the output of the q-th algorithm plugin in the t-th scheduling cycle. Let p be the business association strength between the p-th algorithm plugin and the q-th algorithm plugin. Let be the degree of abnormal coordination between the outputs of the p-th algorithm plugin and the q-th algorithm plugin.

10. A monitoring method for intelligent monitoring of livestock according to claim 7, characterized in that, The method for determining whether livestock in the corresponding livestock pen of the surveillance video stream are abnormal based on the comprehensive risk score is as follows: Compare the comprehensive risk score with the dynamic early warning threshold. If the comprehensive risk score is greater than or equal to the dynamic early warning threshold, then the livestock in the corresponding livestock pen of the monitoring video stream is judged to be abnormal. The dynamic early warning threshold is calculated based on the false alarm rate, effective early warning rate, and early warning density of multiple consecutive early warning statistical windows before the current early warning statistical window, and the interval time g is defined as an early warning statistical window.