Livestock product quality safety state intelligent evaluation method and system
By synchronously collecting parameters from multiple points in the cold chain of livestock products, constructing an offset rate trend sequence and classifying and labeling it, the problems of data lag and slow evaluation in existing technologies are solved, and real-time intelligent evaluation of livestock product quality is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 青岛市农产品质量安全中心(青岛市农业投入品鉴定中心)
- Filing Date
- 2026-01-16
- Publication Date
- 2026-05-01
AI Technical Summary
The existing livestock product quality assessment process suffers from intermittent and delayed data collection, making it difficult to reflect dynamic quality changes in real time and neglecting the synergistic relationship between indicators. This results in long assessment cycles, slow response, and insufficient risk warnings.
By simultaneously collecting temperature, humidity, pH value, and bacterial content data during cold chain transportation, processing, and sorting, a monitoring data matrix is constructed, the offset rate trend is calculated, abnormal trajectory segments are marked, graded labels are assigned, and the grade distribution ratio is calculated to form an intelligent evaluation result.
It enables real-time identification of the quality status of livestock products, improving the continuity, sensitivity, and timeliness of the assessment, and allowing for rapid determination of quality risks.
Smart Images

Figure CN121961331A_ABST
Abstract
Description
A method and system for intelligent assessment of the quality and safety status of livestock products Technical Field
[0001] This invention relates to the field of quality assessment technology, and in particular to an intelligent assessment method and system for the quality and safety status of livestock products. Background Technology
[0002] The field of quality assessment technology primarily focuses on the quantitative determination and risk identification of the quality status of various products or objects during production, distribution, and use. This includes the construction of a quality indicator system, data collection and processing, setting assessment rules and thresholds, determining indicator weights, comprehensive scoring and grading, and the formation of anomaly identification and traceability basis. Typically, key quality indicators are selected based on national or industry standards, and an indicator library is established. Raw data such as physicochemical, microbiological, and residue indicators are obtained through experimental testing or on-site sampling. Exceeding standards are assessed, and a quality and safety status evaluation conclusion and corresponding record forms or reports are output. Specifically, the livestock product quality and safety status assessment method refers to the process and rule system for determining the quality and safety status of livestock products such as meat, eggs, and dairy products during the breeding, slaughtering, processing, storage, transportation, and sales stages. It is usually based on relevant food safety standards and inspection procedures. First, assessment indicators such as veterinary drug residues, pesticide residues, heavy metal content, microbial quantity, and physicochemical quality indicators are determined. Then, laboratory testing methods are used to obtain and compare the values of each indicator, and the indicators are individually assessed for compliance with standard limits. The livestock product quality and safety assessment results and corresponding batch traceability information records are output.
[0003] Current livestock product quality assessment processes rely on laboratory testing and on-site sampling to obtain physicochemical, microbiological, and residue data. Data collection is highly intermittent and delayed, making it difficult to reflect the dynamic quality changes of livestock products during circulation. Furthermore, the compliance determination of each indicator in the assessment process adopts an item-by-item comparison method, ignoring the synergistic changes between indicators and failing to identify multidimensional abnormal change paths. In addition, the evaluation results are mostly output in the form of reports or records, failing to form an intelligent assessment mechanism for real-time risk identification. This results in a long assessment cycle, slow response, and insufficient risk warning, making it difficult to meet the needs of rapid assessment of livestock product quality and safety in the context of high-frequency circulation. Summary of the Invention
[0004] To address the technical problems existing in the prior art, this invention provides an intelligent assessment method for the quality and safety status of livestock products, comprising the following steps: To achieve the above objective, this invention adopts the following technical solution: An intelligent assessment method for the quality and safety status of livestock products, comprising the following steps: S1: Collecting temperature, humidity, pH, and bacterial content data at spatial points within the same time period in the cold chain transportation and storage area, post-slaughter processing area, and fresh produce sorting area of livestock products; reordering the data using timestamps as the primary key and performing a unified format conversion operation to construct a livestock product quality monitoring data matrix; S2: Statistically analyzing the temporal distribution of temperature, humidity, pH, and bacterial content in the livestock product quality monitoring data matrix; calculating the offset rate value of each type of indicator and summarizing and sorting the data to form a multi-indicator offset rate trend sequence for livestock products. S3: Based on the offset rate values of each time period in the trend sequence of the multi-indicator offset rate of livestock products, the continuous time nodes of each indicator are sliced into intervals, abnormal trajectory segments are marked, and the offset rate difference between the starting point and the ending point is calculated to construct the livestock product offset abnormal path difference interval; S4: According to the livestock product offset abnormal path difference interval, the offset rate difference is divided into level I, level II and level III, and the proportion of each level label in all labels is calculated to form the livestock product offset level distribution ratio; S5: According to the proportion values of level I and level II in the livestock product offset level distribution ratio, the proportions of level I and level II are summed as the cumulative abnormal proportion value, and the status is classified and summarized to construct the intelligent assessment result of livestock product quality and safety status.
[0005] As a further aspect of the present invention, the livestock product quality monitoring data matrix includes multi-point temperature and humidity values, multi-point pH values, multi-point bacterial concentration data, and a unified time index structure; the livestock product multi-index offset rate trend sequence includes temperature offset rate sequence, humidity offset rate sequence, pH offset rate sequence, and bacterial content offset rate sequence; the livestock product offset abnormal path difference range includes abnormal start time, abnormal end time, maximum offset difference, and number of consecutive abnormal cycles; the livestock product offset level distribution ratio includes the proportion of level I, level II, and level III data; and the intelligent assessment result of livestock product quality and safety status includes quality status classification results and cumulative abnormality ratio value.
[0006] As a further aspect of the present invention, the abnormal trajectory segment specifically refers to the corresponding time period in which the offset direction does not reverse and the offset rate value continuously increases beyond a preset threshold boundary for three cycles.
[0007] As a further aspect of the present invention, during the graded labeling process, offset rate differences between 0.05 and 0.1 are set as Grade I, offset rate differences greater than 0.1 are set as Grade II, and the rest are classified as Grade III; during the state classification and summary process, if the cumulative abnormality ratio is less than 0.2, it corresponds to a normal state; if the cumulative abnormality ratio is between 0.2 and 0.5, it corresponds to a warning state; and if the cumulative abnormality ratio is greater than 0.5, it corresponds to a risk state.
[0008] As a further embodiment of the present invention, the steps for acquiring the livestock product quality monitoring data matrix are as follows: S111: Temperature and humidity sensors, pH electrode detection units, and colony concentration imagers are deployed in the livestock product cold chain transportation and storage area, post-slaughter processing area, and fresh sorting area to synchronously collect data at various spatial points within a time period, obtaining temperature, humidity, pH, and bacterial content, and generating a raw environmental monitoring data set; S112: Based on the timestamp information in the raw environmental monitoring data set, the temperature, humidity, pH, and bacterial content are rearranged according to time index, and parameter values under the same timestamp are merged into a single recording unit to obtain a time-aligned parameter sequence set; S113: Based on all recording units in the time-aligned parameter sequence set, the parameter values are uniformly converted, and the temperature, humidity, pH, and bacterial content are integrated into a single row of data frames in the matrix structure according to the timestamp order to generate a livestock product quality monitoring data matrix.
[0009] As a further aspect of the present invention, the step of obtaining the trend sequence of multi-indicator offset rate of livestock products is as follows: S211: Read the temperature value, humidity value, pH value and bacterial content in the livestock product quality monitoring data matrix, aggregate each parameter according to the time dimension according to the timestamp index, form a continuous data column sorted by time for each type of parameter, and generate an indicator time distribution sequence group; S212: Based on the continuous data column of each type of parameter in the indicator time distribution sequence group, retrieve the corresponding preset reference value parameter set, perform difference calculation on the monitoring value and the corresponding preset reference value at each time node, divide the difference by the preset reference value, perform normalized offset rate conversion, and obtain a single-point parameter offset rate matrix; S213: According to all the offset rate records in the single-point parameter offset rate matrix, aggregate the various types of offset rates at the same time point into a single row data frame according to the timestamp order, construct a multi-dimensional trend structure according to the time series, and generate a trend sequence of multi-indicator offset rate of livestock products.
[0010] As a further aspect of the present invention, the step of obtaining the difference interval of the abnormal path of livestock product deviation is as follows: S311: Based on the various deviation rate values in the trend sequence of the deviation rate of the multi-indicator of livestock products, extract the corresponding time series according to the indicator classification, perform interval slicing on the continuous time nodes of each type of indicator, construct each group of continuous segments into an independent segment, and generate a set of continuous segments of indicators; S312: According to the set of continuous segments of indicators, judge the direction consistency of the change trend of the deviation rate value within the segment. If the deviation direction of all adjacent points does not reverse and the continuous growth exceeds the preset threshold boundary for three cycles, then mark the time interval corresponding to the segment as an abnormal segment and obtain the abnormal trajectory interval set; S313: According to the start point and end point of each time segment in the abnormal trajectory interval set, extract the corresponding deviation rate value, perform the difference calculation operation between the two, summarize the difference results of all abnormal segments and map them to the corresponding time interval to establish the difference interval of the abnormal path of livestock product deviation.
[0011] As a further embodiment of the present invention, the step of obtaining the livestock product offset level distribution ratio is as follows: S411: Based on the offset rate difference of each segment in the livestock product offset abnormal path difference range, set the classification judgment conditions according to the numerical range. If the difference value is between 0.05 and 0.1, it is set as Level I; if it is greater than 0.1, it is set as Level II; and the rest are set as Level III, generating an offset level label set; S412: Based on all the level labels in the offset level label set, count the number of Level I, Level II, and Level III in the total number of labels, construct a vector structure of the corresponding counts for each level, and obtain the level label frequency distribution vector; S413: Based on the count values of each level in the level label frequency distribution vector and the total number of labels, perform percentage calculations to obtain the proportion values of Level I, Level II, and Level III in the total number of labels, summarize the corresponding proportions of each level, and generate the livestock product offset level distribution ratio.
[0012] As a further aspect of the present invention, the steps for obtaining the intelligent assessment results of livestock product quality and safety status are as follows: S511: Based on the proportion values corresponding to Level I and Level II in the livestock product offset level distribution ratio, extract the proportion values of the two respectively and perform addition operations to obtain the cumulative proportion value of Level I and Level II in the time period, and generate a cumulative abnormality ratio parameter; S512: For the numerical content in the cumulative abnormality ratio parameter, perform interval judgment operations in sequence. If the value is less than 0.2, it is marked as normal; if it is between 0.2 and 0.5, it is marked as a warning; if it is greater than 0.5, it is marked as risk. Establish corresponding classification status labels to obtain a quality and safety status label set; S513: Based on all status labels in the quality and safety status label set, perform aggregation processing according to the corresponding time index, and classify and summarize each status segment according to the label type. Construct a complete mapping on the time axis to establish the intelligent assessment results of livestock product quality and safety status.
[0013] An intelligent assessment system for the quality and safety status of livestock products includes: a quality data construction module for performing S1: collecting temperature, humidity, pH, and bacterial content data at spatial points within the same time period in the cold chain transportation and storage area, post-slaughter processing area, and fresh produce sorting area; reordering the data using timestamps as the primary key and performing a unified format conversion operation to construct a livestock product quality monitoring data matrix; an offset trend calculation module for performing S2: statistically analyzing the temporal distribution of temperature, humidity, pH, and bacterial content data in the livestock product quality monitoring data matrix; calculating the offset rate value for each type of indicator; summarizing and sorting the data to form a multi-indicator offset rate trend sequence for livestock products; and an abnormal path identification module for performing S3: based on the offset rate values of each time period in the multi-indicator offset rate trend sequence for livestock products... For each indicator, continuous time nodes are sliced into intervals, abnormal trajectory segments are marked, and the offset rate difference between the starting point and the ending point is calculated to construct the livestock product offset abnormal path difference interval. The risk level labeling module is used to execute S4: according to the livestock product offset abnormal path difference interval, the offset rate difference is subjected to interval classification labeling operation, divided into level I, level II and level III, and the number proportion of each level label in all labels is calculated to form the livestock product offset level distribution ratio. The safety status assessment module is used to execute S5: according to the proportion values of level I and level II in the livestock product offset level distribution ratio, the proportions of level I and level II are summed as the cumulative abnormal proportion value, and the status is classified and summarized to construct the intelligent assessment result of livestock product quality and safety status.
[0014] Compared with existing technologies, the advantages and positive effects of this invention are as follows: By synchronously collecting parameters from multiple points in key links of cold chain transportation, processing and sorting of livestock products, and combining the trend changes of indicator deviation rate for dynamic segmented analysis, the invention achieves tracking and difference calculation of continuous deviation phenomena. Based on the classification of deviation intensity and the statistical analysis of quantity proportions, the invention completes the classification and collection of the overall quality status of livestock products. The quality status level is determined based on the deviation level distribution structure, thereby achieving real-time identification of livestock product quality fluctuations and effectively improving the continuity, sensitivity and timeliness of livestock product quality assessment. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 is a schematic diagram of the steps of the present invention; Figure 2 is a flowchart of the livestock product quality monitoring data matrix acquisition of the present invention; Figure 3 is a flowchart of the trend sequence of multi-indicator offset rate of livestock products acquisition of the present invention; Figure 4 is a flowchart of the difference range of the offset abnormal path of livestock products acquisition of the present invention; Figure 5 is a flowchart of the distribution ratio of the offset level of livestock products acquisition of the present invention; Figure 6 is a flowchart of the intelligent assessment result of the quality and safety status of livestock products acquisition of the present invention; Figure 7 is a system module diagram of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0018] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0019] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.
[0020] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0021] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0022] Please refer to Figure 1. This embodiment of the invention provides an intelligent assessment method for the quality and safety status of livestock products, including the following steps: S1: Temperature and humidity sensors, pH electrode detection units, and colony concentration imagers are deployed in the cold chain transportation and storage area, post-slaughter processing area, and fresh sorting area of livestock products to collect temperature, humidity, pH, and bacterial content at spatial points within the same time period. The data is reordered using timestamps as the primary key, and a unified format conversion operation is performed on the four types of original parameter data to construct a livestock product quality monitoring data matrix; S2: The time distribution of temperature, humidity, pH, and bacterial content in the livestock product quality monitoring data matrix is statistically analyzed, and the offset rate of each type of indicator is calculated (combining the pre-set reference values for each parameter indicator, the difference between the parameter data of each monitoring point and the corresponding reference value is calculated and divided by the reference value), and the data is summarized and sorted according to the time index structure to form a trend sequence of offset rates for multiple indicators of livestock products; S3: Based on the offset rate values of each time period in the trend sequence of offset rates for multiple indicators of livestock products, the continuous time nodes of each indicator are sliced into intervals. If the offset direction is not reversed, the offset rate is calculated. Furthermore, if the offset rate value continuously increases beyond the preset threshold boundary for three consecutive cycles, the corresponding time period is marked as an abnormal trajectory segment, and the offset rate difference between the starting point and the ending point is calculated to construct the livestock product offset abnormal path difference interval; S4: Based on the livestock product offset abnormal path difference interval, an interval classification labeling operation is performed on the offset rate difference. The offset rate difference between 0.05 and 0.1 is set as Level I, the offset rate difference greater than 0.1 is set as Level II, and the rest are classified as Level III. The proportion of each level label in all labels is calculated to form the livestock product offset level distribution ratio; S5: Based on the proportion values of Level I and Level II in the livestock product offset level distribution ratio, the proportion values of Level I and Level II are summed to obtain the cumulative abnormal ratio value. If the cumulative abnormal ratio value is less than 0.2, it corresponds to the "normal" state; if the cumulative abnormal ratio value is between 0.2 and 0.5, it corresponds to the "warning" state; if the cumulative abnormal ratio value is greater than 0.5, it corresponds to the "risk" state. The state classification is summarized to construct the intelligent assessment result of livestock product quality and safety status.
[0023] The livestock product quality monitoring data matrix includes multi-point temperature and humidity values, multi-point pH values, multi-point bacterial concentration data, and a unified time index structure. The livestock product multi-indicator offset rate trend series includes temperature offset rate series, humidity offset rate series, pH offset rate series, and bacterial content offset rate series. The livestock product offset anomaly path difference range includes the anomaly start time, anomaly end time, maximum offset difference, and number of consecutive anomaly cycles. The livestock product offset level distribution ratio includes the proportion of Level I, Level II, and Level III data. The intelligent assessment results of livestock product quality and safety status include quality status classification results and cumulative anomaly ratio values.
[0024] Please refer to Figure 2. The specific steps of S1 are as follows: S111: Temperature and humidity sensors, pH electrode detection units, and colony concentration imagers are deployed in the cold chain transportation and storage area, post-slaughter processing area, and fresh sorting area for livestock products. The data of each spatial point is collected synchronously within the time period to obtain temperature, humidity, pH and bacterial content, and generate the original environmental monitoring data set. In the cold fresh beef storage and processing workshop of the large cold chain logistics center, temperature and humidity sensors (using high-precision digital temperature and humidity sensors, such as the SHT31 model, with a temperature measurement range of -40 degrees Celsius to 125 degrees Celsius and a humidity measurement range of 0 to 100% relative humidity), pH electrode detection units (for example, using food-grade penetrating glass electrodes with a response time set to less than 30 seconds) and colony concentration imagers (using automated detection equipment based on high-resolution CCD industrial cameras and microscopic imaging optical path coupling) are deployed. These sensors are installed in the center of the refrigerated compartment of the cold chain transport vehicle, in the hook array area of the post-slaughter aging room, and at key nodes of the fresh produce sorting line, forming a spatial monitoring network covering the entire process. This provides underlying physical data support for subsequent end-to-end livestock product quality status assessment. Within a set time period (e.g., triggering a synchronous acquisition command every 5 minutes), read commands are sent to each sensor via the underlying fieldbus protocol. For the operation of the colony concentration imager, the device performs macro photography on the surface of the beef to acquire high-resolution microscopic image data. This image data needs to be preprocessed and converted into specific bacterial content values using feature extraction algorithms. For colony image processing, a U-Net convolutional neural network structure is used for colony counting: the input layer receives an RGB three-channel image with a resolution of 512 by 512 pixels; the network contains a 4-layer downsampling encoder, each layer consisting of two convolutional layers with 3 by 3 kernels, followed by batch normalization and ReLU activation function, and downsampling through a 2 by 2 max pooling layer; the corresponding 4-layer upsampling decoder fuses the feature maps of the encoder through skip connections, and the final output layer generates a probability density map through a 1 by 1 convolution and a sigmoid activation function, and sums up all pixel values of the density map to obtain the specific bacterial content value (in CFU per square centimeter).
[0025] During the data collection process, if the temperature and humidity sensor reads a temperature of 2 degrees Celsius, a humidity of 85%, a pH value of 5.6, and the colony imager analyzes a bacterial count of 3000 CFU per square centimeter at a certain point, these data will be timestamped to the millisecond level and temporarily stored in local buffer memory. Through this high-frequency synchronous acquisition, a massive amount of raw signals, including temperature, humidity, pH, and bacterial count, are obtained, ultimately generating an unfiltered raw environmental monitoring data set.
[0026] S112: Based on the timestamp information in the original environmental monitoring data set, the temperature, humidity, pH, and bacterial content values are time-indexed and rearranged separately. Parameter values with the same timestamp are grouped into a single record unit to obtain a time-aligned parameter sequence set. First, the original environmental monitoring data set is retrieved, and the timestamp information attached to each data record is identified. Due to differences in sampling response speed and data transmission delay between different sensors (such as temperature and humidity sensors and colony imagers) (for example, temperature data may arrive at 10:00:01, while bacterial data after image analysis is generated at 10:00:03), direct merging would lead to dimensional misalignment, thus affecting the accuracy of quality status assessment. Therefore, the execution process adopts an index rearrangement strategy based on a time sliding window. A baseline time axis is set, with the sampling period (e.g., 5 minutes) as the scale, to establish standardized time anchor points. For each standard time anchor point, all records within a set tolerance range (e.g., ±30 seconds) before and after that time point are retrieved from the original data set. For parameters of the same type, if multiple values exist within the tolerance range, linear interpolation is used to calculate the estimated value at the anchor point; if only a single value exists, it is directly aligned to that anchor point. Next, a merge operation is performed to group temperature, humidity, pH, and bacterial counts under the same timestamp index into a single record unit. For example, a single record unit with the timestamp corrected to "January 6, 2025, 10:00:00" contains a temperature of 2.1 degrees Celsius, a humidity of 85.5%, a pH of 5.62, and a bacterial count of 3050 CFU per square centimeter. By performing this rearrangement and merging process on the data across the entire time period, the impact of time jitter is eliminated, resulting in a set of time-aligned parameter sequences that strictly correspond in the time dimension.
[0027] S113: Based on all record units in the time-aligned parameter sequence set, the parameter values are uniformly formatted and converted. Temperature, humidity, pH values, and bacterial content are integrated into single-row data frames in a matrix structure according to timestamp order, generating a livestock product quality monitoring data matrix. Based on the time-aligned parameter sequence set, the physical dimensions and data types of each parameter value are first checked, and a uniform format conversion is performed. Specifically, all temperature values are uniformly retained as floating-point data to one decimal place, humidity values are converted to decimal form without a percentage sign (e.g., 0.85), pH values are retained to two decimal places, and bacterial content is converted to logarithmic form for subsequent matrix operations. Subsequently, in ascending order of timestamps, the parameter values of the four key dimensions (temperature, humidity, pH, and bacterial content) at the same time are sequentially filled into the row vector of the matrix. Each row represents a time sample, and each column represents a monitoring indicator. To ensure data validity, data cleaning logic is introduced in this process: if a row of data contains null values, it is filled with the arithmetic mean of the two adjacent rows. Assuming that during the data construction process, the first row of data corresponds to 10:00 AM, with a numerical vector of [2.1, 0.85, 5.62, 3.48]; the second row of data corresponds to 10:05 AM, with a numerical vector of [2.2, 0.86, 5.63, 3.49]. Following this logic, hundreds or thousands of single-row data frames from different time points are stacked vertically, ultimately generating a structured and standardized livestock product quality monitoring data matrix in memory. This matrix fully maps the environmental and quality change trajectory throughout the cold chain process, forming the core data foundation for quality status assessment.
[0028] Please refer to Figure 3. The specific steps of S2 are as follows: S211: Read the temperature, humidity, pH, and bacterial content values from the livestock product quality monitoring data matrix. Aggregate each parameter according to the time dimension based on the timestamp index, forming a continuous data column sorted by time for each type of parameter, generating an index time distribution sequence group; load the livestock product quality monitoring data matrix, and extract the four types of data—temperature, humidity, pH, and bacterial content—according to the column index. For each type of parameter, unbind its row relationship with other parameters, but strictly retain its original timestamp index, thus decomposing the two-dimensional matrix into four independent one-dimensional time series. Taking the temperature parameter as an example, extract all the values in the first column of the matrix in chronological order to form a continuous temperature data column sorted by time, such as [2.1, 2.2, 2.3, ..., 4.0]. Similarly, generate continuous data columns for humidity, pH, and bacterial content respectively. This aggregation process transforms discrete single-point monitoring data into a streaming data structure that reflects the dynamic changes of a single indicator over time, laying the foundation for subsequent trend analysis and ultimately generating a time distribution sequence group of indicators containing four independent sequences.
[0029] S212: Based on the continuous data columns of each parameter type in the time distribution sequence of the indicators, retrieve the corresponding preset reference value parameter set. Calculate the difference between the monitored value and the corresponding preset reference value at each time point, divide the difference by the preset reference value, and perform normalized offset rate conversion to obtain a single-point parameter offset rate matrix. First, based on the attributes of the monitored object (e.g., "chilled fresh beef"), retrieve the corresponding preset reference value parameter set from the preset database. These reference values are the optimal quality parameters determined based on national food safety standards (e.g., GB / T17238-2022) and numerous previous accelerated degradation experiments, serving as a baseline for judging whether the quality status has deteriorated. For example, the optimal storage temperature reference value for chilled fresh beef is set to 0 degrees Celsius, the humidity reference value to 85% (i.e., 0.85), the optimal pH reference value to 5.60, and the safe baseline for bacterial content to 3.0 log CFU. After obtaining the reference values, perform normalized offset rate conversion on the monitored value at each time point. The specific execution logic is as follows: First, the real-time monitoring value at a certain time point is subtracted from the corresponding preset reference value to obtain the absolute deviation; then, the absolute deviation is compared with the preset reference value (i.e., division operation), and the absolute value is taken as the result.
[0030] As shown in Table 1, the parameter settings and calculation process for some implementation data are listed: Table 1 Comparison Table of Parameter Offset Rate for Monitoring Points; Taking the temperature values in Table 1 as an example, the calculation process is as follows: The real-time temperature value of 2.0 degrees Celsius and the preset reference value of 4.0 degrees Celsius (4.0 is selected as the upper limit for refrigeration) are obtained. The difference between the two is -2.0, the absolute value is taken, and divided by the reference value of 4.0, resulting in 0.5. Taking the pH value as an example: the difference between the real-time value of 6.16 and the reference value of 5.60 is 0.56, divided by 5.60, resulting in 0.1. Through this point-by-point calculation, all the original data with inconsistent physical dimensions are transformed into dimensionless offset rate values, ultimately obtaining a single-point parameter offset rate matrix.
[0031] S213: Based on all offset rate records in the single-point parameter offset rate matrix, aggregate various offset rates at the same time point into single-row data frames according to the timestamp order. Construct a multi-dimensional trend structure according to the time series to generate a multi-indicator offset rate trend sequence for livestock products. Traverse all records in the single-point parameter offset rate matrix and re-aggregate the temperature offset rate, humidity offset rate, pH offset rate, and bacterial content offset rate at the same time point according to the original timestamp order. For example, at 10:00 AM, the aggregated single-row data frame is [temperature offset rate 0.5, humidity offset rate 0.02, pH offset rate 0.1, bacterial offset rate 0.1]. Arrange these single-row data frames sequentially according to the time series to construct a multi-dimensional trend structure. This structure not only includes the fluctuation of a single indicator but also preserves the correlation between different indicators at the same time. Through this construction, a multi-indicator offset rate trend sequence for livestock products is generated. This sequence intuitively shows the dynamic trajectory of various quality indicators deviating from the ideal state over time, providing continuous trend evidence for dynamically tracking the quality status assessment of livestock products.
[0032] Please refer to Figure 4. The specific steps of S3 are as follows: S311: Based on the various offset rate values in the multi-indicator offset rate trend sequence of livestock products, extract the corresponding time series according to the indicator classification, and perform interval slicing on the continuous time nodes of each type of indicator. Construct each group of continuous segments into an independent fragment to generate a set of continuous indicator segments. Based on the multi-indicator offset rate trend sequence of livestock products, firstly, extract the corresponding one-dimensional offset rate time series according to the indicator classification (such as temperature, pH, etc.). Then, perform sliding window slicing or fixed period segmentation on the sequence of each type of indicator. Set the time window length of the slice to 30 minutes (including 6 sampling points of 5 minutes each). Cut the continuous time nodes according to this window length. For example, divide the 1st to 6th sampling points and their corresponding offset rate values into the first segment, the 7th to 12th sampling points into the second segment, and so on. This slicing process decomposes the long-term macro trend into multiple micro-level local change processes. Each segment represents the quality fluctuation characteristics within a short period of time, thereby generating a set of continuous indicator segments.
[0033] S312: Based on the set of continuous segments of the indicator, the trend of the offset rate value within the segment is judged for directional consistency. If the offset direction of all adjacent points does not reverse and the continuous increase exceeds the preset threshold boundary for three cycles, the time interval corresponding to the segment is marked as an abnormal segment, resulting in an abnormal trajectory interval set. Each segment in the set of continuous segments of the indicator is scanned one by one, and the trend of the offset rate value within the segment is judged for directional consistency. The specific logic is as follows: compare the offset rate values of adjacent time points within the segment. If the value of the later time point is strictly greater than or equal to the value of the previous time point, it is determined to be an increasing direction. If, within a segment, the offset direction of all adjacent points does not reverse (i.e., it remains monotonically increasing or monotonically decreasing), and the span of the continuous increase trend exceeds the preset threshold boundary for three cycles (i.e., the offset rate continues to rise within three consecutive sampling cycles), then this pattern is identified as a potential quality deterioration signal. Among them, the "preset threshold boundary for three cycles" is a key parameter determined based on microbial growth kinetic experiments: experimental data shows that when environmental parameters continue to deteriorate for more than 15 minutes (i.e., three 5-minute cycles), the probability of bacterial reproduction entering the logarithmic growth phase increases significantly, thereby leading to a decrease in the quality status assessment level of livestock products. Once the above conditions are met, the time interval corresponding to the segment (e.g., 10:00 to 10:15) is immediately marked as an abnormal segment, and the abnormal trajectory interval set is finally obtained.
[0034] S313: Based on the start and end points of each time segment in the abnormal trajectory interval set, extract the corresponding offset rate values, perform the difference calculation operation between the two, summarize the difference results of all abnormal segments and map them to the corresponding time intervals to establish the difference interval of the abnormal path of livestock product deviation; traverse the abnormal trajectory interval set, and for each time segment marked as abnormal, extract the offset rate value corresponding to its start time point and the offset rate value corresponding to its end time point. Then, perform the difference calculation operation between the two, that is, subtract the offset rate of the start point from the offset rate of the end point to obtain the net increase in the abnormal process. For example, if the pH offset rate of the start point of an abnormal segment is 0.05 and the pH offset rate of the end point is 0.12, then the difference result obtained by subtraction is 0.07. This difference result directly reflects the severity of the deterioration of quality indicators during this time period. The calculation results of all abnormal segments are summarized and mapped one by one with specific time intervals (e.g., interval [10:00-10:15], difference 0.07), thereby establishing the difference interval of abnormal paths of livestock product deviation, providing a quantitative basis for subsequent hierarchical assessment.
[0035] Please refer to Figure 5. The specific steps of S4 are as follows: S411: Based on the offset rate difference of each segment in the livestock product offset abnormal path difference range, set the classification judgment conditions according to the numerical range. If the difference value is between 0.05 and 0.1, it is set as Level I; if it is greater than 0.1, it is set as Level II; and the rest are set as Level III, generating an offset level label set; read the offset rate difference of each segment in the livestock product offset abnormal path difference range, and execute the classification judgment conditions according to the pre-set numerical range. These classification thresholds (0.05 and 0.1) are set based on the sensitivity analysis of the livestock product shelf life prediction model: when the offset rate difference is between 0.05 and 0.1, it indicates that the quality has slight fluctuations but is controllable; greater than 0.1 indicates that there is a significant risk of spoilage. The specific execution process is as follows: The difference in a certain segment is determined. If the value is between 0.05 (inclusive) and 0.1 (inclusive), it is classified as Level I (minor anomaly); if the value is strictly greater than 0.1, it is classified as Level II (serious anomaly); for other cases (i.e., the difference is less than 0.05), it is classified as Level III (negligible or minor fluctuation). For example, the calculated difference of 0.07 falls within the 0.05 to 0.1 range and is therefore marked as Level I. By executing this logic on all abnormal segments, an offset level label set containing a series of level identifiers is generated, achieving the preliminary classification of factors affecting the quality status assessment.
[0036] S412: Based on all level labels in the offset level label set, count the number of Level I, Level II, and Level III labels in the total number of labels, construct a vector structure for the corresponding counts of each level, and obtain the level label frequency distribution vector; Based on the offset level label set, first count the total number of labels. Then, count the occurrence times of Level I, Level II, and Level III labels respectively. Assuming the total number of labels is 100, with 20 labels for Level I, 10 labels for Level II, and 70 labels for Level III, arrange these three counts in sequence to construct a three-dimensional vector structure, i.e., [20, 10, 70]. This vector intuitively describes the frequency distribution of abnormal events of different severity throughout the entire monitoring period, thus obtaining the level label frequency distribution vector.
[0037] S413: Based on the count values of each level in the level tag frequency distribution vector and the total number of tags, perform percentage calculations to obtain the proportions of Level I, Level II, and Level III in the total number of tags, summarize the corresponding proportions of each level, and generate the livestock product offset level distribution ratio; based on the count values of each level in the level tag frequency distribution vector and the total number of tags, perform percentage calculation operations. Specifically, the textual logic is: divide the count value of a certain level by the total number of tags to obtain the proportion value of that level.
[0038] As shown in Table 2, a specific example of the ratio calculation in this step is presented: Table 2 Calculation Table of Anomaly Level Distribution Ratio; In Table 2, substituting the count value of 20 for Grade I with the total number of 100 yields a percentage of 0.2; substituting the count value of 10 for Grade II with the total number of 100 yields a percentage of 0.1; similarly, the percentage for Grade III is 0.7. Summarizing these three percentages generates the distribution ratio of livestock product offset grades. This ratio accurately depicts the proportion of time during which the entire batch of livestock products experiences different levels of quality risk during storage and transportation, serving as the direct statistical basis for the final livestock product quality status assessment conclusion.
[0039] Please refer to Figure 6. The specific steps of S5 are as follows: S511: Based on the proportion values corresponding to Level I and Level II in the distribution ratio of livestock product deviation levels, extract the proportion values of the two respectively and perform an addition operation to obtain the cumulative proportion value of Level I and Level II in the time period, generating a cumulative abnormality proportion parameter; extract the proportion values corresponding to Level I (minor abnormality) and Level II (serious abnormality) from the distribution ratio of livestock product deviation levels. Given that both types of abnormalities have a negative impact on the final quality status assessment of the product, the addition operation is performed to combine the two. Substitute the proportion value of Level I (0.2) and the proportion value of Level II (0.1) obtained in the previous steps into the addition logic to calculate the result 0.3. This result 0.3 represents the cumulative value of the total time proportion of livestock products in a non-ideal stable state throughout the entire monitoring period. The advantage of this operation logic is that by linearly superimposing the abnormality proportions of different severity levels, it can comprehensively reflect the cumulative loss effect of environmental fluctuations on product quality, thereby generating a cumulative abnormality proportion parameter.
[0040] S512: For the numerical content of the cumulative anomaly ratio parameter, perform interval judgment operations sequentially. If the value is less than 0.2, it is marked as normal; if it is between 0.2 and 0.5, it is marked as a warning; if it is greater than 0.5, it is marked as risk. Establish corresponding classification status labels to obtain a quality and safety status label set. For the numerical content of the cumulative anomaly ratio parameter (e.g., 0.3 calculated above), perform interval judgment operations sequentially. The judgment logic is based on the preset risk thresholds: 0.2 and 0.5. The setting of these two thresholds is derived from large-scale sensory evaluation and physicochemical index correlation analysis experiments. The experimental results show that when the cumulative anomaly ratio is below 0.2, there is no significant difference in the sensory quality of the product; when it is between 0.2 and 0.5, the shelf life is shortened by about 30%; when it exceeds 0.5, the spoilage rate increases exponentially. The specific judgment process is as follows: if the value is strictly less than 0.2, it is marked as "normal," meaning the livestock product quality status is assessed as excellent; if the value is between 0.2 (inclusive) and 0.5 (inclusive), it is marked as "warning," indicating that the livestock product quality status assessment has entered a stage requiring attention; if the value is strictly greater than 0.5, it is marked as "risk," meaning the livestock product quality status assessment is judged as unqualified. In the aforementioned example, the cumulative abnormality ratio parameter is 0.3, which falls within the closed interval of 0.2 to 0.5, therefore the corresponding classification status label is established as "warning." Through this process, a quality and safety status label set is obtained.
[0041] S513: Based on all status labels in the quality and safety status label set, aggregate them according to their corresponding time indices, and classify and summarize each status segment according to label type. Construct a complete mapping on the time axis to establish an intelligent assessment result for the quality and safety status of livestock products. Based on all status labels generated in the quality and safety status label set (such as "early warning"), aggregate them according to their corresponding time indices. If the monitoring period is long, there may be multiple status labels corresponding to different time periods. Classify and summarize each status segment according to label type. For example, mark and connect all time periods marked as "early warning" on the time axis to construct a complete status mapping map. Finally, based on the latest status label or the worst status label for the entire time period, establish an intelligent assessment result for the quality and safety status of livestock products. Taking a cumulative abnormality ratio parameter of 0.3 as an example, this result indicates that although the current batch of livestock products has not completely deteriorated, it has accumulated a considerable degree of environmental stress. It is recommended to shorten the expected sales period or downgrade the product, thus providing managers with scientifically based decision support and completing closed-loop management from data collection to final quality status assessment.
[0042] Please refer to Figure 7. A smart assessment system for the quality and safety status of livestock products includes: a quality data construction module for performing S1: collecting temperature, humidity, pH, and bacterial content data of spatial points in the cold chain transportation and storage area, post-slaughter processing area, and fresh produce sorting area within the same time period; reordering the data using timestamps as the primary key and performing a unified format conversion operation to construct a livestock product quality monitoring data matrix; an offset trend calculation module for performing S2: statistically analyzing the time distribution of temperature, humidity, pH, and bacterial content data in the livestock product quality monitoring data matrix; calculating the offset rate value of each type of indicator and summarizing and sorting the data to form a multi-indicator offset rate trend sequence for livestock products; and an abnormal path identification module for performing S3: based on the offset rate trend sequence of livestock products for each time period... The migration rate value is calculated by slicing continuous time nodes for each indicator, marking abnormal trajectory segments, and calculating the difference in the offset rate between the starting and ending points to construct the abnormal path difference range for livestock products. The risk level labeling module performs S4: based on the abnormal path difference range for livestock products, it performs interval-level labeling on the offset rate difference, dividing it into Level I, Level II, and Level III, and calculates the proportion of each level label in all labels to form the livestock product offset level distribution ratio. The safety status assessment module performs S5: based on the proportion values of Level I and Level II in the livestock product offset level distribution ratio, it sums the proportions of Level I and Level II as the cumulative abnormal proportion value, performs status classification and summary, and constructs the intelligent assessment result of livestock product quality and safety status.
[0043] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the described technical solutions.
Claims
1. A method for intelligently assessing the quality and safety status of livestock products, characterized in that, Includes the following steps: S1: Collect temperature, humidity, pH, and bacterial content data from spatial locations within the same time period in the cold chain transportation and storage area, post-slaughter processing area, and fresh produce sorting area for livestock products. Reorder the data using timestamps as the primary key and perform a unified format conversion operation to construct a livestock product quality monitoring data matrix. S2: Statistically analyze the temporal distribution of temperature, humidity, pH, and bacterial content in the livestock product quality monitoring data matrix. Calculate the offset rate value for each type of indicator and summarize and sort them to form a multi-indicator offset rate trend sequence for livestock products. S3: Based on the offset rate values for each time period in the multi-indicator offset rate trend sequence for livestock products, slice the continuous time nodes of each indicator into intervals, mark abnormal trajectory segments, and calculate the offset rate difference between the starting and ending points to construct an abnormal offset path difference interval for livestock products. S4: Based on the difference range of the abnormal path of the livestock product deviation, perform interval classification labeling operation on the deviation rate difference to divide it into level I, level II and level III, calculate the proportion of each level label in all labels, and form the livestock product deviation level distribution ratio; S5: Based on the proportion values of level I and level II in the livestock product deviation level distribution ratio, sum the proportions of level I and level II as the cumulative abnormal ratio value, perform status classification and summary, and construct the intelligent assessment result of livestock product quality and safety status.
2. The intelligent assessment method for the quality and safety status of livestock products according to claim 1, characterized in that: The livestock product quality monitoring data matrix includes multi-point temperature and humidity values, multi-point pH values, multi-point bacterial concentration data, and a unified time index structure. The livestock product multi-indicator offset rate trend sequence includes temperature offset rate sequence, humidity offset rate sequence, pH offset rate sequence, and bacterial content offset rate sequence. The livestock product offset anomaly path difference range includes the anomaly start time, anomaly end time, maximum offset difference, and number of consecutive anomaly cycles. The livestock product offset level distribution ratio includes the proportion of Level I, Level II, and Level III data. The intelligent assessment result of livestock product quality and safety status includes quality status classification results and cumulative anomaly ratio values.
3. The intelligent assessment method for the quality and safety status of livestock products according to claim 1, characterized in that: The abnormal trajectory segment specifically refers to the corresponding time period in which the offset direction does not reverse and the offset rate value continuously increases beyond a preset threshold boundary for three cycles.
4. The intelligent assessment method for the quality and safety status of livestock products according to claim 1, characterized in that: During the tiered labeling process, offset rate differences between 0.05 and 0.1 are classified as Level I, offset rate differences greater than 0.1 are classified as Level II, and the rest are classified as Level III. During the status classification and summary process, if the cumulative abnormality ratio is less than 0.2, it corresponds to a normal state; if the cumulative abnormality ratio is between 0.2 and 0.5, it corresponds to a warning state; and if the cumulative abnormality ratio is greater than 0.5, it corresponds to a risk state.
5. The intelligent assessment method for the quality and safety status of livestock products according to claim 1, characterized in that, The steps for acquiring the livestock product quality monitoring data matrix are as follows: S111: Temperature and humidity sensors, pH electrode detection units, and colony concentration imagers are deployed in the livestock product cold chain transportation and storage area, post-slaughter processing area, and fresh sorting area to synchronously collect data at various spatial points within a time period, obtaining temperature, humidity, pH, and bacterial content, and generating a raw environmental monitoring data set; S112: Based on the timestamp information in the raw environmental monitoring data set, the temperature, humidity, pH, and bacterial content are rearranged according to time index, and parameter values under the same timestamp are merged into a single recording unit to obtain a time-aligned parameter sequence set; S113: Based on all recording units in the time-aligned parameter sequence set, the parameter values are uniformly converted, and the temperature, humidity, pH, and bacterial content are integrated into a single row of data frames in the matrix structure according to the timestamp order to generate a livestock product quality monitoring data matrix.
6. The intelligent assessment method for the quality and safety status of livestock products according to claim 1, characterized in that, The steps for obtaining the multi-index offset rate trend sequence of livestock products are as follows: S211: Read the temperature value, humidity value, pH value and bacterial content in the livestock product quality monitoring data matrix, aggregate each parameter according to the time dimension based on the timestamp index, form a continuous data column sorted by time for each type of parameter, and generate an index time distribution sequence group; S212: Based on the continuous data column of each type of parameter in the index time distribution sequence group, retrieve the corresponding preset reference value parameter set, perform difference calculation on the monitoring value at each time node and the corresponding preset reference value, divide the difference by the preset reference value, perform normalized offset rate conversion, and obtain a single-point parameter offset rate matrix; S213: Based on all the offset rate records in the single-point parameter offset rate matrix, aggregate the various offset rates at the same time point into a single-row data frame according to the timestamp order, construct a multi-dimensional trend structure according to the time series, and generate a multi-index offset rate trend sequence for livestock products.
7. The intelligent assessment method for the quality and safety status of livestock products according to claim 1, characterized in that, The steps for obtaining the difference interval of the abnormal path of livestock product deviation are as follows: S311: Based on the various deviation rate values in the trend sequence of the multi-indicator deviation rate of livestock products, extract the corresponding time series according to the indicator classification, perform interval slicing on the continuous time nodes of each type of indicator, construct each group of continuous segments into an independent segment, and generate a set of continuous segments of indicators; S312: According to the set of continuous segments of indicators, judge the direction consistency of the change trend of the deviation rate value within the segment. If the deviation direction of all adjacent points does not reverse and the continuous increase exceeds the preset threshold boundary for three cycles, then mark the time interval corresponding to the segment as an abnormal segment and obtain the abnormal trajectory interval set; S313: According to the start point and end point of each time segment in the abnormal trajectory interval set, extract the corresponding deviation rate value, perform the difference calculation operation between the two, summarize the difference results of all abnormal segments and map them to the corresponding time interval to establish the difference interval of the abnormal path of livestock product deviation.
8. The intelligent assessment method for the quality and safety status of livestock products according to claim 1, characterized in that, The steps for obtaining the livestock product offset level distribution ratio are as follows: S411: Based on the offset rate difference of each segment in the livestock product offset abnormal path difference range, set the classification judgment conditions according to the numerical range. If the difference value is between 0.05 and 0.1, it is set as Level I; if it is greater than 0.1, it is set as Level II; and the rest are set as Level III, generating an offset level label set; S412: Based on all level labels in the offset level label set, count the number of Level I, Level II, and Level III in the total number of labels, construct a vector structure of the corresponding counts for each level, and obtain the level label frequency distribution vector; S413: Based on the level count values in the level label frequency distribution vector and the total number of labels, perform percentage calculations to obtain the proportion values of Level I, Level II, and Level III in the total number of labels, summarize the corresponding proportions of each level, and generate the livestock product offset level distribution ratio.
9. The intelligent assessment method for the quality and safety status of livestock products according to claim 1, characterized in that, The steps for obtaining the intelligent assessment results of livestock product quality and safety status are as follows: S511: Based on the proportion values of Level I and Level II in the livestock product offset level distribution ratio, extract the proportion values of the two respectively and perform addition operations to obtain the cumulative proportion value of Level I and Level II in the time period, and generate a cumulative abnormality ratio parameter; S512: For the numerical content in the cumulative abnormality ratio parameter, perform interval judgment operations in sequence. If the value is less than 0.2, it is marked as normal; if it is between 0.2 and 0.5, it is marked as a warning; if it is greater than 0.5, it is marked as risk. Establish corresponding classification status labels to obtain a quality and safety status label set; S513: Based on all status labels in the quality and safety status label set, perform aggregation processing according to the corresponding time index, and classify and summarize each status segment according to the label type. Construct a complete mapping on the time axis to establish the intelligent assessment results of livestock product quality and safety status.
10. An intelligent assessment system for the quality and safety status of livestock products, characterized in that, The system is used to implement the intelligent assessment method for the quality and safety status of livestock products as described in any one of claims 1-9, comprising: a quality data construction module for executing S1: collecting temperature, humidity, pH, and bacterial content of spatial points in the cold chain transportation and storage area, post-slaughter processing area, and fresh sorting area of livestock products within the same time period, reordering them with timestamps as the primary key and performing a unified format conversion operation to construct a livestock product quality monitoring data matrix; an offset trend calculation module for executing S2: statistically analyzing the time distribution of temperature, humidity, pH, and bacterial content in the livestock product quality monitoring data matrix, calculating the offset rate of each type of indicator and summarizing and sorting them to form a multi-indicator offset rate trend sequence of livestock products; and an abnormal path identification module for executing S3: based on the multi-indicator offset rate trend sequence of livestock products... The system calculates the offset rate values for each time period, segments the continuous time nodes of each indicator into intervals, marks abnormal trajectory segments, and calculates the offset rate difference between the starting and ending points to construct the livestock product offset abnormal path difference interval. The risk level labeling module performs S4: based on the livestock product offset abnormal path difference interval, it performs interval classification labeling operation on the offset rate difference, dividing it into Level I, Level II, and Level III, and calculates the proportion of each level label in all labels to form the livestock product offset level distribution ratio. The safety status assessment module performs S5: based on the proportion values of Level I and Level II in the livestock product offset level distribution ratio, it sums the proportions of Level I and Level II as the cumulative abnormal proportion value, performs status classification and summary, and constructs the intelligent assessment result of livestock product quality and safety status.