A live pig and sheep health state evaluation and intelligent sales system based on blockchain traceability
Patent Information
- Application Number
- CN202610735714.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-09-04
AI Technical Summary
本地模型固定、无法自适应优化,长期使用后评估精度下降
本发明通过服务器根据第一监测参数所对应的畜牧健康知识图谱,动态选取健康评估模型与销售匹配模型,相较于本地固定模型,避免了模型随使用适应性变差的问题,提高了活体猪羊状态监控精确性;
Smart Images

Figure CN122694469A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital technology in animal husbandry, specifically to a blockchain-based system for assessing the health status of live pigs and sheep and for intelligent sales. Background Technology
[0002] With the development of the livestock industry towards large-scale and intensive operations, the demand for digitalization, reliability, and intelligence has significantly increased across the entire chain of live pig and sheep breeding, quarantine, transportation, slaughter, and sales.
[0003] The existing technology has the following drawbacks: Health monitoring relies on manual inspections, single-point temperature measurements, and experience-based judgment. The data is limited in scope and has a strong lag, making it impossible to achieve accurate early warning of diseases. Data on breeding, quarantine, transportation, and sales are stored in a decentralized manner and managed in a centralized manner, making them easy to tamper with, difficult to verify, and with low reliability in traceability. Live animal sales are priced uniformly on a batch basis, without combining health level, growth quality, and traceability credibility to achieve tiered pricing and intelligent matching; The local model is fixed and cannot be adaptively optimized, resulting in a decrease in evaluation accuracy after long-term use.
[0004] Therefore, a blockchain-based traceability system for assessing the health status of live pigs and sheep and for intelligent sales is needed to improve the above-mentioned problems. Summary of the Invention
[0005] The purpose of this invention is to provide a blockchain-based traceability system for assessing the health status of live pigs and sheep and for intelligent sales, in order to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: A blockchain-based system for assessing the health status of live pigs and sheep and for intelligent sales, comprising: Servers and multiple local devices; among them The local device is used to acquire the first monitoring parameters of live pigs and sheep during the breeding stage; The server includes: The model selection module is used to match and select the corresponding health assessment model and sales matching model from the preset livestock health knowledge graph based on the first monitoring parameters; wherein, the health assessment model is a long short-term memory network model, used to assess health status; and the sales matching model is a multilayer perceptron model, used to generate transaction parameters. The blockchain evidence storage module is used to upload the health assessment results output by the health assessment model and the corresponding environmental data and medication and epidemic prevention data to the blockchain network to generate an immutable traceability evidence storage record. The model optimization module is used to optimize the health assessment model and the sales matching model based on the traceability and evidence storage records obtained from the blockchain network and the first monitoring parameters, second monitoring parameters, and third monitoring parameters obtained from the local device. The optimization includes: performing a first optimization on the two models based on the traceability and evidence storage records and the first, second, and third monitoring parameters; and performing a second optimization on the two models after the first optimization by setting mutual constraints based on preset available parameter values, the health parameters output by the health assessment model, and the transaction parameters output by the sales matching model. The intelligent transaction module is used to automatically execute smart contracts based on the transaction parameters output by the sales matching model and the traceability and evidence storage records in the blockchain network, to complete the intelligent listing, demand matching, order generation and transaction locking of live pigs and sheep; The local device is also used to acquire second monitoring parameters of live pigs and sheep during the breeding, quarantine and transportation process, as well as third monitoring parameters after the transaction is completed.
[0007] As a preferred embodiment of the present invention, the local device includes a multimodal monitor, which is used to collect data by being deployed in the pen, and to predict the distribution map of the multi-monitor system for live pigs and sheep based on the data, thereby calculating the first monitoring parameter.
[0008] As a preferred embodiment of the present invention, the model selection module queries the knowledge graph based on the first monitoring parameters to determine the target health characteristic indicators and generates corresponding breeding strategies and sales strategies. The health assessment model is selected from the first decision model library according to the breeding strategy, and the sales matching model is selected from the second decision model library according to the sales strategy.
[0009] As a preferred embodiment of the present invention, the local device further includes a distributed image monitor, used for: Based on the relationship between the reliable monitoring range and the device location, a movement path is planned, and multiple sets of monitoring data are collected to generate image data including body posture, gait, activity level, body surface abnormalities, and mental state characteristics. Furthermore, the server calculates a health score and health level based on the image data and the health assessment model, and the health score and health level are uploaded to the blockchain network by the blockchain evidence storage module as part of the health assessment results.
[0010] As a preferred embodiment of the present invention, the local device further includes a mobile image monitoring device, used for: Identify abnormal areas on the surface of live animals in enclosures or transport vehicles, move to the abnormal areas, and calculate the changing trends of the abnormal area indicators within a preset monitoring period to obtain image parameters. Furthermore, the server calculates the tiered guidance price and matching degree based on the image parameters, the first monitoring parameters, and the sales matching model.
[0011] As a preferred embodiment of the present invention, the secondary optimization performed by the model optimization module specifically includes: Based on the available parameter values and the first and second monitoring parameters, predict health parameters and transaction parameters; Based on the predicted and actual health parameters, and with the setting of transaction parameter constraints, the health assessment model is optimized a second time. Based on the predicted and actual transaction parameters, and with health parameter constraints set, the sales matching model is optimized a second time.
[0012] As a preferred embodiment of the present invention, the blockchain evidence storage module is also used to: upload the quarantine records and transportation environment data in the second monitoring parameters to the blockchain network in real time, forming a traceability chain for the entire process from breeding to trading.
[0013] As a preferred embodiment of the present invention, the server further includes an after-sales traceability module, used for: Based on the third monitoring parameter and the traceability and evidence storage records in the blockchain network, implement after-sales traceability, regulatory verification and risk handling strategies; Specifically, it includes: In response to traceability requests from consumers or regulators, the system retrieves the corresponding traceability records from the blockchain network and verifies their authenticity. In the event of anomalies or disputes, the system determines liability and handles risks based on the immutable records on the blockchain.
[0014] Compared with the prior art, the beneficial effects of the present invention are: This invention uses a server to dynamically select a health assessment model and a sales matching model based on the livestock health knowledge graph corresponding to the first monitoring parameter. Compared with a fixed local model, this avoids the problem of the model becoming less adaptable with use and improves the accuracy of monitoring the status of live pigs and sheep. This invention uses a health assessment model generated by a long short-term memory network and a sales matching model generated by a multilayer perceptron, avoiding the control method's reliance on simple rule responses and improving the reliability of liveness assessment, circulation, and transactions. This invention combines distributed image monitoring, mobile status monitoring, blockchain full-process evidence storage, and model secondary optimization mechanism to achieve full-chain traceability, health assessment, price grading, and automatic execution of transactions for live pigs and sheep breeding, quarantine, transportation, and sales. This reduces the risk of disease spread, live animal loss, and transaction disputes, and improves breeding income and regulatory efficiency. Attached Figure Description
[0015] Figure 1This is a schematic diagram of the system architecture of the present invention; Figure 2 This is a schematic diagram of the internal module interaction and data flow of the system according to the present invention; Figure 3 This is a flowchart of the model optimization and secondary optimization process of the present invention. Detailed Implementation
[0016] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0017] To facilitate understanding of the present invention, a more complete description will be given below with reference to relevant descriptions. Several embodiments of the invention are provided. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0018] Please see Figure 1-3 The present invention provides a technical solution: For an example, please refer to... Figure 1 , 2 He3, a live pig and sheep health status assessment and intelligent sales system based on blockchain traceability, includes a server, multiple local devices and a blockchain network. The local devices are deployed on-site in breeding pens, quarantine channels, and transport vehicles to collect multi-source data. The server acts as the cloud brain, completing model selection, health assessment, transaction decision and model optimization. The blockchain network acts as a trusted evidence storage layer, recording key data throughout the process.
[0019] The local equipment first acquires the initial monitoring parameters of live pigs and sheep during the breeding stage. Specifically, each pig or sheep wears a smart ear tag, and temperature and humidity sensors and ammonia concentration sensors are installed in the pen. The sensors collect data at a set sampling frequency, and the data is filtered and denoised by an edge computing node to form the initial monitoring parameters.
[0020] The parameters include the individual identification of the live animals, age, breed, average body temperature, coefficient of variation of heart rate, cumulative activity level, and temperature and humidity of the enclosure environment.
[0021] After the first monitoring parameter is uploaded to the server, the server's model selection module does not directly use a fixed model, but instead inputs it into a pre-built livestock health knowledge graph.
[0022] The knowledge graph stores the relationships between health characteristic indicators and optimal assessment models under different breeds, ages, and environmental conditions in the form of a graph database. For example, for fattening pigs that are 120 days old, in an environment of 28°C, and whose activity level is 20% lower than normal, the knowledge graph will match early heat stress characteristics and recommend the use of an LSTM health assessment model that focuses on body temperature trend analysis. For adult sheep with normal health indicators, it is recommended to use an LSTM model that focuses on body posture scores.
[0023] At the same time, the knowledge graph will also generate corresponding sales strategies based on current market conditions and historical transaction data, thereby selecting a suitable sales matching model from the MLP model library.
[0024] After the model selection is completed, the distributed image monitor in the local device starts to work. First, it determines the reliable monitoring range of each camera through a self-calibration algorithm, which is the effective distance that can clearly identify the eyes, hooves, and skin texture of a living organism. Based on the location and coverage of all cameras, the movement path of each camera is planned. After all cameras complete the data collection according to the path, the multi-angle images are fused to generate image data including body posture, gait, activity level, body surface abnormalities, and mental state.
[0025] The server inputs the aforementioned image data along with the time-series data from the first monitoring parameter into the selected LSTM health assessment model. Because the model has a memory unit, it can capture the trends of body temperature, activity level, etc., over time, thereby outputting a more accurate health score, health level, abnormal warning, and detailed health parameters than a single frame image.
[0026] The aforementioned health assessment results, environmental data from the same period, and medication and epidemic prevention records were packaged into a data block by the server's blockchain storage module.
[0027] Each block contains a timestamp, a hash value, and the hash value of the previous block, and is uploaded to the consortium blockchain network through a consensus mechanism. Due to the immutable nature of the blockchain, no subsequent step can modify this original health data. Consumers or regulators can obtain complete on-chain traceability information by scanning the QR code on the livestock's ear tag in the future.
[0028] Once the live animal enters the quarantine and transportation process, the local equipment continues to acquire a second set of monitoring parameters, including: the quarantine certificate number, the temperature and humidity of the transport vehicle compartment, vibration acceleration, GPS trajectory, and the live animal's real-time heart rate and activity level.
[0029] At the same time, the system dispatches mobile image monitoring equipment into the enclosures or transport vehicles, enabling autonomous navigation and movement to the vicinity of the abnormal areas initially marked by the distributed image monitors.
[0030] Based on the difference between the current ambient temperature and the body temperature of the living organism, the monitoring cycle is automatically set. During the monitoring cycle, the robot repeatedly photographs abnormal areas, uses image segmentation algorithms to calculate the changing trend of abnormal indicators over time, and records the number of abnormal areas. The refined image parameters, along with the second monitoring parameters, are uploaded to the server.
[0031] The server inputs the first monitoring parameters, image parameters, and historical health records read from the blockchain into the selected MLP sales matching model.
[0032] The multilayer perceptron model, trained on a large amount of historical trading data, can output: tiered guidance price, matching degree, and trading parameters.
[0033] Based on the output of the MLP model and combined with the traceability and evidence storage records on the blockchain, the intelligent trading module automatically completes the following operations on the trading platform: intelligent listing, demand matching, order generation, and smart contract locking. The entire process requires no manual intervention and can usually be completed within minutes from listing to signing.
[0034] After the transaction is completed, the local device acquires third monitoring parameters, including: post-slaughter carcass quality, consumer feedback, and laboratory disease test results. After the parameters are uploaded to the server, the closed-loop optimization process of the model is triggered.
[0035] First optimization: The server uses the first, second, and third monitoring parameters, as well as the full amount of evidence stored on the blockchain, as new training samples to incrementally learn the LSTM health assessment model and the MLP sales matching model, so that the model can gradually adapt to local variety characteristics, seasonal disease patterns, and changes in market preferences.
[0036] Secondary optimization: The server further utilizes available parameter values and the health parameters output by the health assessment model in this transaction, along with the transaction parameters output by the sales matching model, to set mutual constraints. Specifically: If historical data shows that a batch of pigs with a health score of 85 actually has a slaughter yield of only 57%, the system will use the actual transaction parameters as a benchmark to infer a more stringent threshold that the health assessment model should meet. For example, the activity level requirement for superior pigs might be increased from 5000 steps / day to 6500 steps / day, because insufficient activity often leads to less muscle mass and lower meat yield. These constraints are encoded as regularization terms and added to the loss function of the LSTM model for secondary training.
[0037] Conversely, if a batch of pigs has a health score of only 70 points, but is sold by the MLP model at a price 10% higher than the market average, and there are no disputes after the sale, the system will use the actual health parameters as a benchmark to constrain the MLP model: the next time a high premium is output, it must simultaneously satisfy the condition that the number of abnormal areas on the body surface = 0 and the gait score is 75. This constraint is added to the loss function of the MLP model.
[0038] Through bidirectional constraint-based secondary optimization, the two models calibrate each other, forming a positive feedback loop. Experiments show that after 3-5 rounds of secondary optimization, the correlation coefficient between health score and actual quality after slaughter is improved, and the pricing error rate is reduced.
[0039] The server's after-sales traceability module responds to inquiries from consumers or regulators. When the QR code on the meat packaging is scanned, the system calls the blockchain network's query interface to verify the integrity of the hash chain of all evidence records for the live animal, starting from the genesis block, and displays the entire process data from breeding, immunization, quarantine, transportation, trading, and slaughter. If any data is missing or hash verification fails at any stage, the system immediately issues a traceability anomaly alarm.
[0040] In the event of a consumer dispute, regulators can trace back to the specific stage based on the immutable on-chain records, automatically determine the responsible party, and trigger a compensation smart contract.
[0041] In this embodiment, the local device includes a multimodal monitor, specifically a smart ear tag integrating temperature sensing, heart rate monitoring, accelerometer, and GPS positioning. Its working principle is as follows: The server first estimates a multi-monitor distribution map based on the enclosure map and the number of deployed monitors. Specifically, the system performs 3D modeling of the enclosures, identifies key locations such as feeding troughs, water troughs, and rest areas, and then calculates the optimal coverage radius and sampling strategy for each monitor.
[0042] For example, for a pen with 100 pigs, the system will analyze the degree of signal interference between ear tags and dynamically allocate the sampling frequency of each ear tag: the sampling frequency of pigs in the edge area is slightly higher to compensate for the coverage blind spots; The sampling frequency of pigs in the central area is normal. Each multimodal monitor collects data such as body temperature, heart rate, and activity level according to the sampling strategy set in the distribution map. After removing motion artifacts through Kalman filtering, the data forms the first monitoring parameter. The parameter not only contains numerical values but also timestamps and device IDs, providing rich context for subsequent knowledge graph queries.
[0043] The specific process of dynamically selecting models for knowledge graphs includes the following sub-steps: Feature mapping: Transform the key indicators in the first monitoring parameters into query vectors for the knowledge graph; Graph reasoning: The knowledge graph stores various nodes and the edges between them. Through graph traversal algorithms, the target health feature index that best matches the current input is found.
[0044] Strategy generation: Generate breeding and sales strategies based on target health characteristic indicators.
[0045] Model library selection: The server internally maintains multiple candidate LSTM health assessment models and multiple candidate MLP sales matching models. The model selection module selects the corresponding LSTM model based on the farming strategy and the corresponding MLP model based on the sales strategy.
[0046] Through this mechanism, the system can adaptively switch models, avoiding the problem of performance degradation of a single model in complex scenarios.
[0047] Based on the above system, the present invention also provides a method for assessing the health status of live pigs and sheep and for intelligent sales based on blockchain traceability, comprising the following steps: Local devices acquire the first monitoring parameters of live pigs and sheep during the breeding stage; Based on the first monitoring parameters, the server matches and selects the corresponding health assessment model and sales matching model from the preset livestock health knowledge graph. Local devices collect live image data through distributed image monitors, and the server calculates health scores, health levels, and health parameters based on the image data and health assessment models. The server uploads health assessment results, environmental data, and medication and epidemic prevention data to the blockchain network for storage, generating an immutable traceability record. Local equipment acquires secondary monitoring parameters of live animals during breeding, quarantine, and transportation, and mobile image monitoring equipment acquires circulation image parameters. The server calculates the tiered guidance price, matching degree, and transaction parameters based on image parameters, primary monitoring parameters, and sales matching model. Based on transaction parameters and traceability records on the blockchain, the server automatically executes smart contracts to complete smart listing, demand matching, order generation, and transaction locking. After the transaction is completed, the local device acquires and uploads the third monitoring parameters; The server optimizes the health assessment model and sales matching model based on the traceability and evidence records obtained from the blockchain network and the first, second, and third monitoring parameters. The server sets mutual constraints based on available parameter values, health parameters, and transaction parameters, and performs secondary optimization on the two optimized models. The server executes after-sales traceability, regulatory verification, and risk handling strategies based on third-party monitoring parameters and blockchain-stored records.
[0048] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A blockchain-based traceability system for assessing the health status of live pigs and sheep and for intelligent sales, characterized in that, include: Servers and multiple local devices; among them The local device is used to acquire the first monitoring parameters of live pigs and sheep during the breeding stage; The server includes: The model selection module is used to match and select the corresponding health assessment model and sales matching model from the preset livestock health knowledge graph based on the first monitoring parameters; wherein, the health assessment model is a long short-term memory network model, used to assess health status; and the sales matching model is a multilayer perceptron model, used to generate transaction parameters. The blockchain evidence storage module is used to upload the health assessment results output by the health assessment model and the corresponding environmental data and medication and epidemic prevention data to the blockchain network to generate an immutable traceability evidence storage record. The model optimization module is used to optimize the health assessment model and the sales matching model based on the traceability and evidence storage records obtained from the blockchain network and the first monitoring parameters, second monitoring parameters, and third monitoring parameters obtained from the local device. The optimization includes: performing a first optimization on the two models based on the traceability and evidence storage records and the first, second, and third monitoring parameters; and performing a second optimization on the two models after the first optimization by setting mutual constraints based on preset available parameter values, the health parameters output by the health assessment model, and the transaction parameters output by the sales matching model. The intelligent transaction module is used to automatically execute smart contracts based on the transaction parameters output by the sales matching model and the traceability and evidence storage records in the blockchain network, to complete the intelligent listing, demand matching, order generation and transaction locking of live pigs and sheep; The local device is also used to acquire second monitoring parameters of live pigs and sheep during the breeding, quarantine and transportation process, as well as third monitoring parameters after the transaction is completed.
2. The live pig and sheep health status assessment and intelligent sales system based on blockchain traceability as described in claim 1, characterized in that: The local device includes a multimodal monitor, which is used to collect data by being deployed in the pen, and to estimate the distribution map of the multimodal monitors in the live pigs and sheep based on the data, thereby calculating the first monitoring parameter.
3. The live pig and sheep health status assessment and intelligent sales system based on blockchain traceability as described in claim 1, characterized in that: The model selection module queries the knowledge graph based on the first monitoring parameters to determine the target health characteristic indicators and generates corresponding breeding and sales strategies. The health assessment model is selected from the first decision model library according to the breeding strategy, and the sales matching model is selected from the second decision model library according to the sales strategy.
4. The live pig and sheep health status assessment and intelligent sales system based on blockchain traceability as described in claim 1, characterized in that, The local device also includes a distributed image monitor for: Based on the relationship between the reliable monitoring range and the device location, a movement path is planned, and multiple sets of monitoring data are collected to generate image data including body posture, gait, activity level, body surface abnormalities, and mental state characteristics. Furthermore, the server calculates a health score and health level based on the image data and the health assessment model, and the health score and health level are uploaded to the blockchain network by the blockchain evidence storage module as part of the health assessment results.
5. The live pig and sheep health status assessment and intelligent sales system based on blockchain traceability as described in claim 1, characterized in that, The local device also includes a mobile image monitoring device for: Identify abnormal areas on the surface of live animals in enclosures or transport vehicles, move to the abnormal areas, and calculate the changing trends of the abnormal area indicators within a preset monitoring period to obtain image parameters. Furthermore, the server calculates the tiered guidance price and matching degree based on the image parameters, the first monitoring parameters, and the sales matching model.
6. The live pig and sheep health status assessment and intelligent sales system based on blockchain traceability as described in claim 1, characterized in that, The secondary optimization performed by the model optimization module specifically includes: Based on the available parameter values and the first and second monitoring parameters, predict health parameters and transaction parameters; Based on the predicted and actual health parameters, and with the setting of transaction parameter constraints, the health assessment model is optimized a second time. Based on the predicted and actual transaction parameters, and with health parameter constraints set, the sales matching model is optimized a second time.
7. The system according to claim 1, characterized in that, The blockchain evidence storage module is also used to: upload the quarantine records and transportation environment data in the second monitoring parameters to the blockchain network in real time, forming a traceability chain for the entire process from breeding to trading.
8. The system according to claim 1, characterized in that, The server also includes an after-sales traceability module, used for: Based on the third monitoring parameter and the traceability and evidence storage records in the blockchain network, implement after-sales traceability, regulatory verification and risk handling strategies; Specifically, it includes: In response to traceability requests from consumers or regulators, the system retrieves the corresponding traceability records from the blockchain network and verifies their authenticity. In the event of anomalies or disputes, the system determines liability and handles risks based on the immutable records on the blockchain.