A parameter collection and analysis system for breeding chickens
By combining RFID and QR code identification devices with an encoding correction unit, the identification codes and parameter information of breeding chickens are automatically verified, which solves the problem of data dispersion caused by human experience in breeding chicken farming and realizes the accuracy and dynamic reflection of parameter collection.
Patent Information
- Application Number
- CN202511071730.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-01
AI Technical Summary
In breeding chicken farming, parameter collection relies on manual experience, resulting in discrete data that is prone to missing key information and makes it difficult to reflect the dynamic changes in the farming environment.
By employing RFID technology and QR code identification equipment, combined with an encoding correction unit and a parameter acquisition unit, the identification codes and parameter information of breeding chickens are automatically verified through code comparison and parameter matching, thereby improving the accuracy of data collection.
It has automated and improved the accuracy of parameter collection during the breeding process of chickens, reduced data omissions, and enhanced the dynamic response capability of environmental parameters.
Smart Images

Figure CN120562446B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent management technology for aquaculture, and in particular relates to a parameter acquisition and analysis system for the breeding process of chickens. Background Technology
[0002] Breeder chicken farming differs significantly from conventional commercial egg-laying or broiler chicken farming, primarily in terms of breeding objectives, physiological needs, management precision, and economic benefits. Breeder chicken production has a long cycle, requiring close data recording throughout the entire rearing process.
[0003] Currently, the chicken breeding industry generally relies on manual experience for data collection. Basic environmental parameters such as temperature and humidity are recorded manually at regular intervals. However, the data is discrete and prone to missing key information (such as ammonia concentration and light intensity), making it difficult to reflect the dynamic changes in the breeding environment. Summary of the Invention
[0004] The purpose of this invention is to provide a parameter acquisition and analysis system for the breeding chicken process, which improves the accuracy of parameter acquisition during the breeding chicken process.
[0005] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:
[0006] This invention provides a parameter acquisition and analysis system for the breeding process of chickens, comprising:
[0007] The cage identification and retrieval unit is used to obtain the identification information of the cage for breeding chickens in the same cage.
[0008] The identification information retrieval and storage unit of the breeding cage obtains a set of codes consisting of the identification codes of each breeding chicken in the breeding cage, as well as the identification codes of each breeding chicken and the corresponding parameter information of each type of monitoring item obtained in each round of parameter collection.
[0009] The breeding chicken collection and identification unit is used to collect identification codes and parameters for each breeding chicken, and obtain the identification code of each breeding chicken and the corresponding parameter information of each type of monitoring item in this round of parameter collection in the breeding cage;
[0010] The coding correction unit is used to compare the identification code of each breeding chicken in this round of parameter acquisition with the coding set of the breeding cage to obtain the identification code to be corrected.
[0011] The corrected identification code for the breeder chicken is obtained by matching the difference between the parameter information of each type of monitoring item in this round and previous rounds of parameter collection, based on the identification code to be corrected and other identification codes.
[0012] Furthermore, the step of obtaining the identification information of the breeding cage includes,
[0013] Each breeding cage is equipped with an RFID tag or QR code that stores the identification information of the breeding cage;
[0014] The identification and retrieval unit can obtain the identification information of the breeding cage by approaching the RFID tag of the breeding cage or scanning the QR code of the breeding cage.
[0015] Furthermore, the steps of identifying and encoding each breeding chicken and collecting parameters include:
[0016] An RFID leg band was attached to the ankle of each breeding chicken;
[0017] The breeder chicken identification unit approaches the RFID leg band of the breeder chicken to obtain the breeder chicken's identification code.
[0018] Further, the step of comparing the identification code of each breeding chicken in this round of parameter collection with the code set of the breeding cage to obtain the identification code to be corrected includes,
[0019] The duplicate identification codes in this round of parameter collection will be used as the identification codes to be corrected;
[0020] Identification codes that do not exist in the encoding set during this round of parameter acquisition will be used as identification codes to be corrected.
[0021] Further, the step of comparing the identification code of each breeding chicken in this round of parameter collection with the code set of the breeding cage to obtain the identification code to be corrected includes,
[0022] The identification codes that exist in the code set in previous rounds of parameter acquisition but do not exist in the code set in the current round of parameter acquisition will be identified codes to be corrected.
[0023] Further, the step of obtaining the corrected identification code for the breeder chickens by matching the differences between the parameter information of each type of monitoring item in this round and previous rounds of parameter acquisition based on the identification code to be corrected and other identification codes includes,
[0024] The parameter information of each type of monitoring item in this round of parameter collection will be used as the monitoring parameter information of the identification code to be corrected.
[0025] The parameter information of each identification code in the code set for each type of monitoring project in each round of parameter acquisition is used as the monitoring parameter information of each identification code in each round of parameter acquisition.
[0026] The monitoring parameter information of each identification code in each round of parameter acquisition is summarized to obtain the typical monitoring parameter information of each identification code in each round of parameter acquisition;
[0027] Multiple correction schemes are generated by arranging the identification codes to be corrected;
[0028] Calculate the mismatch degree for each correction scheme;
[0029] The correction scheme with the highest mismatch degree was selected as the corrected identification code for the breeder chickens.
[0030] Further, the step of summarizing the monitoring parameter information of each identification code in each round of parameter acquisition to obtain typical monitoring parameter information of each identification code in each round of parameter acquisition includes,
[0031] Perform the following steps for each identification code:
[0032] Several monitoring parameters were randomly selected from the multiple monitoring parameters collected in each round of parameter acquisition as typical monitoring parameters.
[0033] The sum of the differences in parameter information for each type of monitoring item among the monitoring parameter information is used as the monitoring dispersion among the monitoring parameter information.
[0034] For each monitoring parameter information other than the typical monitoring parameter information, classify it into the same parameter information group along with the typical monitoring parameter information with the smallest monitoring dispersion.
[0035] The monitoring parameter information with the smallest monitoring dispersion among each combination of parameter information and any identification code to be corrected is taken as the typical monitoring parameter information to be reselected, thereby obtaining several typical monitoring parameter information of the identification code in each round of parameter acquisition.
[0036] The typical monitoring parameter information of each identification code in each round of parameter collection is obtained by summarizing.
[0037] Furthermore, the step of summarizing the monitoring parameter information of each identification code in each round of parameter acquisition to obtain typical monitoring parameter information of each identification code in each round of parameter acquisition also includes,
[0038] Determine whether the information of the reselected typical monitoring parameters has changed;
[0039] If not, the reselected typical monitoring parameter information will be used as several typical monitoring parameter information in the previous rounds of parameter acquisition for this identification code;
[0040] If so, the parameter information combination is reclassified based on the reselected typical monitoring parameter information, and the typical monitoring parameter information is reselected again until the reselected typical monitoring parameter information no longer changes.
[0041] Further, the step of calculating the mismatch degree of each correction scheme includes,
[0042] For each revised scheme, perform the following steps respectively.
[0043] The sum of the monitoring dispersion between the monitoring parameter information of each identification code to be corrected in this round of parameter acquisition and the typical monitoring parameter information of the corresponding corrected identification code in each round of parameter acquisition is taken as the mismatch degree of the correction scheme.
[0044] The mismatch degree of each modified scheme is obtained by summing them up.
[0045] Furthermore, it also includes,
[0046] The corrected identification code for each breeder chicken and the corresponding parameter information for each type of monitoring item obtained in this round of parameter collection are stored in the storage unit.
[0047] This invention improves the accuracy of breeding parameter collection during the breeding process by analyzing the collection records of breeding chickens in the same cage and automatically analyzing and verifying the identification codes of the breeding chickens.
[0048] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0049] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the 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.
[0050] Figure 1 This is a schematic diagram of the functional units and information flow of a parameter acquisition and analysis system for breeding chickens according to an embodiment of the present invention.
[0051] Figure 2 This is a schematic diagram of the operation steps of the breeding cage identification and retrieval unit, the breeding chicken collection and identification unit and the coding correction unit in one embodiment of the present invention;
[0052] Figure 3 This is a flowchart illustrating step S4 of the present invention in one embodiment;
[0053] Figure 4 This is a flowchart illustrating step S5 of the present invention in one embodiment;
[0054] Figure 5 This is a flowchart illustrating step S53 of the present invention in one embodiment.
[0055] Figure 6This is a flowchart illustrating step S55 of the present invention in one embodiment.
[0056] The attached diagram lists the components represented by each number as follows:
[0057] 1-Cage identification and retrieval unit, 2-Breeding chicken collection and identification unit, 3-Encoding correction unit, 4-Storage unit. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0059] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0060] Please see Figures 1 to 2 As shown, this invention provides a parameter acquisition and analysis system for the breeding chicken raising process. Functionally, it includes a cage identification and retrieval unit 1, a breeding chicken acquisition and identification unit 2, an encoding correction unit 3, and a storage unit 4. The cage identification and retrieval unit 1 is used to acquire cage information, the breeding chicken acquisition and identification unit 2 acquires breeding chicken information, the encoding correction unit 3 corrects the identification codes to be corrected, and the storage unit 4 stores the information.
[0061] The cage identification and retrieval unit 1 in this solution can be an RFID identification device or a barcode scanner. Each cage is equipped with an RFID tag or QR code storing its identification information. The cage identification and retrieval unit approaches the RFID tag of the cage or scans the QR code to obtain the cage's identification information. During operation, step S1 is first executed to obtain the identification information of the breeding chickens in the same cage. Next, step S2 is executed to obtain the code set consisting of the identification codes of each breeding chicken in the cage from the cage's identification information retrieval and storage unit 4, as well as the identification code of each breeding chicken obtained in each round of parameter collection and the corresponding parameter information for each type of monitoring item. The types of monitoring items include weight, body length, body height, body width, weekly egg production, and daily feed intake.
[0062] In this scheme, the breeder chicken identification unit 2 can be an RFID identification device. An RFID leg band is placed on the ankle of each breeder chicken. The breeder chicken identification unit 2 approaches the RFID leg band of the breeder chicken to obtain its identification code. During operation, step S3 can be executed to collect the identification code and parameters for each breeder chicken, obtaining the identification code of each breeder chicken in this round of parameter collection for the breeding cage, as well as the corresponding parameter information for each type of monitoring item.
[0063] Please see Figure 2 and Figure 3 As shown, because the breeding chickens are raised in concentrated cages, the identification unit 2 is prone to errors in collecting the RFID leg band identification codes of the breeding chickens. To correct these errors, the code correction unit 3 can first execute step S4 during operation to compare the identification code of each breeding chicken in the current round of parameter collection with the code set of the cage to obtain the identification code to be corrected. Specifically, step S41 can be executed to use the repeated identification codes in the current round of parameter collection as the identification codes to be corrected. Alternatively, step S42 can be executed to use the identification codes that do not exist in the code set in the current round of parameter collection as the identification codes to be corrected. Another option is to execute step S43 to use the identification codes that exist in the code set in previous rounds of parameter collection but do not exist in the code set in the current round of parameter collection as the identification codes to be corrected. Of course, steps S41 to S42 can be combined.
[0064] Please see Figure 2 and Figure 4 As shown, after analyzing the identification code to be corrected, the next step, S5, is to match the difference between the identification code to be corrected and the parameter information of each type of monitoring item in the current and previous rounds of parameter collection to obtain the corrected identification code for the breeder chicken. Specifically, firstly, step S51 is to use the parameter information of each type of monitoring item in the current round of parameter collection for the identification code to be corrected as the monitoring parameter information for the identification code to be corrected. Next, step S52 is to use the parameter information of each type of monitoring item in the previous rounds of parameter collection for each identification code in the code set as the monitoring parameter information for each identification code in the previous rounds of parameter collection. Next, step S53 is to summarize the monitoring parameter information of each identification code in the previous rounds of parameter collection to obtain the typical monitoring parameter information for each identification code in the previous rounds of parameter collection.
[0065] Please see Figure 5As shown, in the process of calculating typical monitoring parameter information, for each identification code, step S531 can be executed first to randomly select several monitoring parameter information from multiple monitoring parameter information in the previous rounds of parameter acquisition as typical monitoring parameter information; of course, it can also be directly specified by the staff. Next, step S532 can be executed to use the cumulative value of the difference between the parameter information of each type of monitoring item between the monitoring parameter information as the monitoring dispersion between the monitoring parameter information. Next, step S533 can be executed to classify each monitoring parameter information other than the typical monitoring parameter information into the same parameter information combination with the typical monitoring parameter information with the smallest monitoring dispersion. Next, step S534 can be executed to use the monitoring parameter information with the smallest monitoring dispersion with any identification code to be corrected in each parameter information combination as the reselected typical monitoring parameter information, thus obtaining several typical monitoring parameter information of the identification code in the previous rounds of parameter acquisition.
[0066] Of course, the typical monitoring parameter information at this time may not be completely typical, so it needs to be verified. First, step S535 can be executed to determine whether the reselected typical monitoring parameter information has changed. If the above judgment result is negative, it means that the typical monitoring parameter information at this time is typical. Therefore, step S536 can be executed to use the reselected typical monitoring parameter information as several typical monitoring parameter information of this identification code in the previous rounds of parameter acquisition, and finally summarize the typical monitoring parameter information of each identification code in the previous rounds of parameter acquisition. If the above judgment result is positive, it means that the typical monitoring parameter information at this time is not sufficiently typical. Therefore, steps S532 to S535 can be executed to reclassify the parameter information combination according to the reselected typical monitoring parameter information, and reselect typical monitoring parameter information again, until the reselected typical monitoring parameter information no longer changes. Of course, the iteration can be stopped if the set number of iterations is exceeded to avoid excessive iteration, which would lead to a sharp increase in the amount of calculation and insufficient increase in calculation accuracy.
[0067] To supplement the explanation of the implementation process of steps S531 to S536 above, source code for some functional modules is provided, with comparative explanations in the comments. To avoid data leakage involving trade secrets, data that does not affect the implementation of the solution has been anonymized; the same applies below.
[0068] / / Monitoring data structure
[0069] struct MonitoringData {
[0070] std::string chickenId; / / Breeding chicken identification code
[0071] double weight; / / weight (kg)
[0072] double bodyLength; / / Body length (cm)
[0073] double bodyHeight; / / body height (cm)
[0074] double bodyWidth; / / Body width (cm)
[0075] int eggProduction; / / Number of eggs produced (in eggs)
[0076] double foodIntake; / / Food intake (g)
[0077] / / Calculate the Manhattan distance between two data points
[0078] double distanceTo(const MonitoringData& other) const {
[0079] return std::abs(weight - other.weight) +
[0080] std::abs(bodyLength - other.bodyLength) +
[0081] std::abs(bodyHeight - other.bodyHeight) +
[0082] std::abs(bodyWidth - other.bodyWidth) +
[0083] std::abs(eggProduction - other.eggProduction) +
[0084] std::abs(foodIntake - other.foodIntake);
[0085] }
[0086] };
[0087] / / Classification result structure
[0088] struct Cluster {
[0089] MonitoringData medoid; / / Classification center point
[0090] std::vector <monitoringdata>members; / / Category members
[0091] double totalDissimilarity; / / Total within-class dispersion
[0092] / / Update category center point
[0093] bool updateMedoid() {
[0094] double minDissimilarity = std::numeric_limits <double>::max();
[0095] MonitoringData newMedoid = medoid;
[0096] / / Iterate through all members to find a new center point that minimizes the intra-class dispersion.
[0097] for (const auto& candidate : members) {
[0098] double currentDissimilarity = 0.0;
[0099] for (const auto& member : members) {
[0100] currentDissimilarity += candidate.distanceTo(member);
[0101] }
[0102] if (currentDissimilarity < minDissimilarity) {
[0103] minDissimilarity = currentDissimilarity;
[0104] newMedoid = candidate;
[0105] }
[0106] }
[0107] / / Check if the center point has changed
[0108] if (newMedoid.chickenId == medoid.chickenId) {
[0109] return false;
[0110] }
[0111] medoid = newMedoid;
[0112] totalDissimilarity = minDissimilarity;
[0113] return true;
[0114] }
[0115] };
[0116] class ChickenDataAnalyzer {
[0117] private:
[0118] / / Randomly select k initial center points
[0119] std::vector <monitoringdata>selectRandomMedoids(
[0120] const std::vector <monitoringdata>& allData,
[0121] int k,
[0122] std::mt19937& rng) {
[0123] std::vector <monitoringdata>medoids;
[0124] std::vector <int>indices(allData.size());
[0125] std::iota(indices.begin(), indices.end(), 0);
[0126] std::shuffle(indices.begin(), indices.end(), rng);
[0127] for (int i = 0; i < k && i < (int)allData.size(); ++i) {
[0128] medoids.push_back(allData[indices[i]]);
[0129] }
[0130] return medoids;
[0131] }
[0132] / / Assign data points to the nearest center point
[0133] void assignToClusters(
[0134] const std::vector <monitoringdata>& allData,
[0135] std::vector <cluster>& clusters) {
[0136] for (auto& cluster : clusters) {
[0137] cluster.members.clear();
[0138] }
[0139] for (const auto& data : allData) {
[0140] double minDistance = std::numeric_limits <double>::max();
[0141] int bestCluster = 0;
[0142] / / Find the nearest center point
[0143] for (int i = 0; i < (int)clusters.size(); ++i) {
[0144] double distance = data.distanceTo(clusters[i].medoid);
[0145] if (distance < minDistance) {
[0146] minDistance = distance;
[0147] bestCluster = i;
[0148] }
[0149] }
[0150] clusters[bestCluster].members.push_back(data);
[0151] }
[0152] }
[0153] public:
[0154] / / Perform k-medoids classification analysis
[0155] std::vector <cluster>performKMedoidsClustering(
[0156] const std::vector <monitoringdata>& historical data,
[0157] int k = 3, / / Number of categories
[0158] int maxIterations = 100) { / / Maximum number of iterations
[0159] if (historicalData.empty()) return {};
[0160] / / Initialize the random number generator
[0161] std::random_device rd;
[0162] std::mt19937 rng(rd());
[0163] / / Step 1: Randomly select the initial center point
[0164] std::vector <cluster>clusters
[0165] auto initialMedoids = selectRandomMedoids(historicalData, k,rng);
[0166] for (const auto& medoid : initialMedoids) {
[0167] clusters.push_back({medoid, {}, 0.0});
[0168] }
[0169] / / Step 2: Iterative optimization of classification
[0170] bool changed.
[0171] int iteration = 0;
[0172] do {
[0173] changed = false;
[0174] / / Assign data points to the nearest category
[0175] assignToClusters(historicalData, clusters);
[0176] / / Update the center point of each category
[0177] for (auto& cluster : clusters) {
[0178] if (cluster.updateMedoid()) {
[0179] changed = true)
[0180] }
[0181] }
[0182] iteration++;
[0183] } while (changed && iteration < maxIterations);
[0184] / / Calculate the final within-class scatter
[0185] for (auto& cluster : clusters) {
[0186] cluster.totalDissimilarity = 0.0;
[0187] for (const auto& member : cluster.members) {
[0188] cluster.totalDissimilarity += member.distanceTo(cluster.medoid);
[0189] }
[0190] }
[0191] return clusters;
[0192] }
[0193] / / Obtain typical monitoring parameter information (select the center point for each category)
[0194] std::vector <monitoringdata>getTypicalMonitoringData(
[0195] const std::vector <monitoringdata>& historicalData) {
[0196] / / Use the elbow rule to determine the optimal number of categories k (simplified version, the actual version should be more complex).
[0197] int bestK = determineOptimalK(historicalData);
[0198] / / Perform classification analysis
[0199] auto clusters = performKMedoidsClustering(historicalData,bestK);
[0200] / / Extract the center points of each category as typical data
[0201] std::vector <monitoringdata>typicalData;
[0202] for (const auto& cluster : clusters) {
[0203] typicalData.push_back(cluster.medoid);
[0204] }
[0205] return typicalData;
[0206] }
[0207] private:
[0208] / / Simplified version of the elbow rule to determine the optimal k value
[0209] int determineOptimalK(const std::vector <monitoringdata>& data) {
[0210] if (data.size() <= 3) return 1;
[0211] if (data.size() <= 10) return 2;
[0212] return 3; / / Simplified processing; in practice, the inflection points of the SSE curves for different k values should be calculated.
[0213] }
[0214] };
[0215] / / Example usage
[0216] int main() {
[0217] / / Prepare test data (historical monitoring data of a certain breeder chicken)
[0218] std::vector <monitoringdata>historicalData = {
[0219] {"CHK001", 3.2, 25.5, 30.1, 15.3, 5, 120.0},
[0220] {"CHK001", 3.3, 25.7, 30.3, 15.4, 6, 125.0},
[0221] {"CHK001", 3.1, 25.3, 30.0, 15.2, 5, 118.0},
[0222] {"CHK001", 3.0, 25.1, 29.8, 15.1, 4, 115.0},
[0223] {"CHK001", 3.4, 25.8, 30.5, 15.5, 6, 123.0},
[0224] {"CHK001", 3.2, 25.4, 30.2, 15.3, 5, 119.0},
[0225] {"CHK001", 3.3, 25.6, 30.4, 15.4, 6, 124.0}
[0226] };
[0227] / / Create an analyzer and obtain typical data
[0228] ChickenDataAnalyzer analyzer;
[0229] auto typicalData = analyzer.getTypicalMonitoringData(historicalData);
[0230] / / Output results
[0231] std::cout << "Typical monitoring parameter information for breeder chicken CHK001:" << std::endl;
[0232] for (const auto& data : typicalData) {
[0233] std::cout << "Weight:" << data.weight << "kg, "
[0234] << "Body Length:" << data.bodyLength << "cm, "
[0235] << "Egg production:" << data.eggProduction << "eggs, "
[0236] << "Dispersion:" << analyzer.performKMedoidsClustering(historicalData)[0].totalDissimilarity
[0237] << std::endl;
[0238] }
[0239] return 0;
[0240] }
[0241] This code implements intelligent classification and analysis of breeder chicken monitoring data. The core algorithm automatically identifies typical patterns in historical data. First, it randomly initializes classification centers, then iteratively optimizes the classification assignment (based on Manhattan distance), then dynamically adjusts the center points (selecting the actual data points that minimize intra-class dispersion), and finally performs convergence judgment (until the center points stabilize). The system outputs the center points of each class as typical monitoring parameters, which are more resistant to outlier interference than simple averages. Test cases demonstrate how to extract the most representative biometric patterns from seven sets of historical data, which can be used for subsequent breeder chicken identification and health status assessment. In practical applications, the optimal number of classifications can be automatically determined by adding the elbow rule or silhouette coefficient.
[0242] Please continue reading. Figure 4 and Figure 6 As shown, after obtaining the typical monitoring parameter information of each identification code in each round of parameter acquisition, step S54 can be executed to generate multiple correction schemes for the identification codes to be corrected. Next, step S55 can be executed to calculate the mismatch degree of each correction scheme. Specifically, for each correction scheme, steps S551 to S552 can be executed to calculate the cumulative value of the monitoring dispersion between the monitoring parameter information of each identification code to be corrected in this round of parameter acquisition and the typical monitoring parameter information of the corresponding corrected identification code in each round of parameter acquisition, as the mismatch degree of that correction scheme. Finally, the mismatch degree of each correction scheme is summed.
[0243] To provide supplementary explanation of the implementation process of steps S551 to S552 above, source code of some functional modules is provided, with comparative explanations in the comments.
[0244] / / Monitoring data structure
[0245] struct MonitoringData {
[0246] std::string chickenId; / / Breeding chicken identification code
[0247] double weight; / / weight (kg)
[0248] double bodyLength; / / Body length (cm)
[0249] double bodyHeight; / / body height (cm)
[0250] double bodyWidth; / / Body width (cm)
[0251] int eggProduction; / / Number of eggs produced (in eggs)
[0252] double foodIntake; / / Food intake (g)
[0253] / / Calculate the Manhattan distance to another set of data (monitoring dispersion)
[0254] double calculateDiscrepancy(const MonitoringData& other) const {
[0255] return std::abs(weight - other.weight) +
[0256] std::abs(bodyLength - other.bodyLength) +
[0257] std::abs(bodyHeight - other.bodyHeight) +
[0258] std::abs(bodyWidth - other.bodyWidth) +
[0259] std::abs(eggProduction - other.eggProduction) +
[0260] std::abs(foodIntake - other.foodIntake);
[0261] }
[0262] };
[0263] / / Modified scheme structure
[0264] struct CorrectionSolution {
[0265] struct CorrectionPair {
[0266] std::string originalId; / / Encoding to be corrected
[0267] std::string correctedId; / / Corrected encoding
[0268] double singleDiscrepancy; / / Single set of corrected dispersion
[0269] };
[0270] std::vector <correctionpair>corrections; / / All correction pairs
[0271] double totalMismatch; / / Total mismatch of the scheme
[0272] / / Add correction pairs and update total mismatch
[0273] void addCorrection(const std::string& original,
[0274] const std::string& corrected,
[0275] double discrepancy) {
[0276] corrections.push_back({original, corrected, discrepancy});
[0277] totalMismatch += discrepancy;
[0278] }
[0279] };
[0280] class MismatchCalculator {
[0281] public:
[0282] / / Calculate the total mismatch of all modified schemes
[0283] std::vector <correctionsolution>calculateAllMismatches(
[0284] const std::unordered_map<std::string, MonitoringData> ¤tData, / / Data collected in this round
[0285] const std::unordered_map<std::string, MonitoringData> &typicalHistoryData, / / Typical historical data
[0286] const std::vector <std::vector<std::pair<std::string, std::string> >>& allSolutions / / All possible solutions
[0287] ) {
[0288] std::vector <correctionsolution>evaluated Solutions;
[0289] / / Iterate through each revision scheme
[0290] for (const auto& solution : allSolutions) {
[0291] CorrectionSolution currentSolution;
[0292] currentSolution.totalMismatch = 0.0;
[0293] / / Check each correction pair in the correction scheme
[0294] for (const auto& [wrongId, correctId] : solution) {
[0295] / / Verify the validity of the encoding
[0296] if (currentData.find(wrongId) == currentData.end()) {
[0297] std::cerr << "Warning: Encoding to be corrected" << wrongId << "Does not exist in the current data" << std::endl;
[0298] continue?
[0299] }
[0300] if (typicalHistoryData.find(correctId) ==typicalHistoryData.end()) {
[0301] std::cerr << "Warning: Correct target encoding" << correctId << "No historical typical data" << std::endl;
[0302] continue?
[0303] }
[0304] / / Calculate the corrected dispersion of a single set
[0305] const auto& current = currentData.at(wrongId);
[0306] const auto& history = typicalHistoryData.at(correctId);
[0307] double discrepancy = current.calculateDiscrepancy(history);
[0308] / / Add to current scheme
[0309] currentSolution.addCorrection(wrongId, correctId,discrepancy);
[0310] }
[0311] / / Only retain valid correction schemes
[0312] if (!currentSolution.corrections.empty()) {
[0313] evaluatedSolutions.push_back(currentSolution);
[0314] }
[0315] }
[0316] Return evaluated Solutions;
[0317] }
[0318] / / Select the optimal correction scheme (lowest mismatch)
[0319] CorrectionSolution selectBestSolution(
[0320] const std::vector <correctionsolution>& solutions) {
[0321] if (solutions.empty()) {
[0322] throw std::runtime_error("No valid fix is available");
[0323] }
[0324] / / Find the solution with the lowest total mismatch.
[0325] auto bestSolution = std::min_element(
[0326] solutions.begin(),
[0327] solutions.end(),
[0328] [](const CorrectionSolution& a, const CorrectionSolution&b) {
[0329] return a.totalMismatch < b.totalMismatch;
[0330] } );
[0332] return *bestSolution;
[0333] }
[0334] / / Output details of the correction scheme
[0335] void printSolution(const CorrectionSolution& solution) {
[0336] std::cout << "Total mismatch of the corrected solution: " << solution.totalMismatch << "\nDetailed correction pair:\n";
[0337] for (const auto& pair : solution.corrections) {
[0338] std::cout << pair.originalId << " -> " < <pair.correctedId
[0339] << " (Discrepancy: " << pair.singleDiscrepancy <<")\n";
[0340] }
[0341] std::cout << std::endl;
[0342] }
[0343] };
[0344] / / Example usage
[0345] int main() {
[0346] / / Prepare test data
[0347] std::unordered_map<std::string, MonitoringData> currentData = {
[0348] {"W001", {"W001", 3.2, 25.5, 30.1, 15.3, 5, 120.0}}, / / Encoding to be corrected
[0349] {"W002", {"W002", 2.9, 24.8, 29.5, 14.9, 4, 115.0}} / / Encoding to be corrected
[0350] };
[0351] / / Historical typical data (assuming it has been obtained through cluster analysis)
[0352] std::unordered_map<std::string, MonitoringData> typicalHistoryData = {
[0353] {"C001", {"C001", 3.1, 25.3, 30.0, 15.2, 5, 118.0}},
[0354] {"C002", {"C002", 2.8, 24.7, 29.3, 14.8, 4, 113.0}},
[0355] {"C003", {"C003", 3.0, 25.0, 29.8, 15.0, 5, 117.0}}
[0356] };
[0357] / / Define multiple possible correction schemes (in practical applications, these should be generated using an algorithm).
[0358] std::vector <std::vector<std::pair<std::string, std::string> >>allSolutions = {
[0359] { {"W001", "C001"}, {"W002", "C002"}}, / / Solution-1
[0360] { {"W001", "C003"}, {"W002", "C002"}}, / / Solution-2
[0361] { {"W001", "C001"}, {"W002", "C003"}} / / Solution-3
[0362] };
[0363] / / Calculate the mismatch degree of each scheme
[0364] MismatchCalculator calculator;
[0365] auto evaluatedSolutions = calculator.calculateAllMismatches(
[0366] currentData, typicalHistoryData, allSolutions);
[0367] / / Output evaluation results
[0368] std::cout << "==== Evaluation results of all modification schemes====\n";
[0369] for (const auto& solution : evaluatedSolutions) {
[0370] calculator.printSolution(solution);
[0371] }
[0372] / / Select the optimal solution
[0373] auto bestSolution = calculator.selectBestSolution(evaluatedSolutions);
[0374] std::cout << "==== Optimal Correction Solution====\n";
[0375] calculator.printSolution(bestSolution);
[0376] return 0;
[0377] }
[0378] This code implements the function of calculating the mismatch degree of the breeder chicken identification coding correction scheme. The core function first calculates the dispersion, using Manhattan distance to quantify the difference between the data to be corrected and historical typical data. Next, it evaluates the schemes, accumulating the dispersion of all correction pairs in the correction schemes to obtain the total mismatch degree. Finally, it performs optimal selection, automatically filtering the correction scheme with the lowest total mismatch degree. The system ensures the scientific validity of the correction scheme through multi-dimensional biometric comparison (weight, body size, egg production, etc.). Test cases demonstrate three possible correction schemes and their mismatch degree calculation results, ultimately outputting the optimal matching scheme.
[0379] Please continue reading. Figure 4 As shown, after obtaining the mismatch degree of each correction scheme, step S56 can be executed to select the correction scheme with the highest mismatch degree as the identification code of the breeder chicken after correction.
[0380] Please continue reading. Figure 2 As shown, after correcting the identification code to be corrected, the corrected identification code of each breeder chicken and the corresponding parameter information of each type of monitoring item obtained in this round of parameter collection can be stored in storage unit 4.
[0381] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.
[0382] It should also be noted that each block in the block diagram and / or flowchart, as well as combinations of blocks in the block diagram and / or flowchart, can be implemented using hardware that performs the corresponding function or action, such as circuits or ASICs (Application Specific Integrated Circuits), or using a combination of hardware and software, such as firmware.
[0383] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art will understand and implement other variations of the disclosed embodiments by reviewing the accompanying drawings, disclosure, and appended claims in carrying out the claimed invention. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple components. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0384] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.< / correctionsolution> < / correctionsolution> < / correctionsolution> < / correctionpair> < / monitoringdata> < / monitoringdata> < / monitoringdata> < / monitoringdata> < / monitoringdata> < / cluster> < / monitoringdata> < / cluster> < / double> < / cluster> < / monitoringdata> < / int> < / monitoringdata> < / monitoringdata> < / monitoringdata> < / double> < / monitoringdata>
Claims
1. A parameter acquisition and analysis system for the breeding process of chickens, characterized in that, include, The cage identification and retrieval unit is used to obtain the identification information of the cage for breeding chickens in the same cage. Based on the identification information of the breeding cage, the storage unit is retrieved to obtain the code set consisting of the identification code of each breeding chicken in the breeding cage, as well as the identification code of each breeding chicken and the parameter information of each type of monitoring item obtained in the parameter collection of each round. The breeding chicken collection and identification unit is used to collect identification codes and parameters for each breeding chicken, and obtain the identification code of each breeding chicken and the corresponding parameter information of each type of monitoring item in this round of parameter collection in the breeding cage; The coding correction unit is used to compare the identification code of each breeding chicken in this round of parameter acquisition with the coding set of the breeding cage to obtain the identification code to be corrected. The parameter information of each type of monitoring item in this round of parameter collection will be used as the monitoring parameter information of the identification code to be corrected. The parameter information of each identification code in the code set for each type of monitoring project in each round of parameter acquisition is used as the monitoring parameter information of each identification code in each round of parameter acquisition. The monitoring parameter information of each identification code in each round of parameter acquisition is summarized to obtain the typical monitoring parameter information of each identification code in each round of parameter acquisition; Multiple correction schemes are generated by arranging the identification codes to be corrected; Calculate the mismatch degree for each correction scheme; The correction scheme with the highest mismatch degree was selected as the corrected identification code for the breeder chickens.
2. The parameter acquisition and analysis system for breeding chickens according to claim 1, characterized in that, The step of obtaining the identification information of the breeding cage, include, Each breeding cage is equipped with an RFID tag or QR code that stores the identification information of the breeding cage; The identification and retrieval unit can obtain the identification information of the breeding cage by approaching the RFID tag of the breeding cage or scanning the QR code of the breeding cage.
3. The parameter acquisition and analysis system for the breeding chicken raising process according to claim 1, characterized in that, The steps for identifying and encoding each breeding chicken include: An RFID leg band was attached to the ankle of each breeding chicken; The breeder chicken identification unit approaches the RFID leg band of the breeder chicken to obtain the breeder chicken's identification code.
4. The parameter acquisition and analysis system for the breeding chicken raising process according to claim 1, characterized in that, The step of comparing the identification code of each breeding chicken in this round of parameter collection with the code set of the breeding cage to obtain the identification code to be corrected includes, The duplicate identification codes in this round of parameter collection will be used as the identification codes to be corrected; Identification codes that do not exist in the encoding set during this round of parameter acquisition will be used as identification codes to be corrected.
5. The parameter acquisition and analysis system for the breeding chicken raising process according to claim 1, characterized in that, The step of comparing the identification code of each breeding chicken in this round of parameter collection with the code set of the breeding cage to obtain the identification code to be corrected include, The identification codes that exist in the code set in previous rounds of parameter acquisition but do not exist in the code set in the current round of parameter acquisition will be identified codes to be corrected.
6. The parameter acquisition and analysis system for the breeding chicken raising process according to claim 1, characterized in that, The step of summarizing the monitoring parameter information of each identification code in each round of parameter acquisition to obtain typical monitoring parameter information of each identification code in each round of parameter acquisition includes, Perform the following steps for each identification code: Several monitoring parameters were randomly selected from the multiple monitoring parameters collected in each round of parameter acquisition as typical monitoring parameters. The sum of the differences in parameter information for each type of monitoring item among the monitoring parameter information is used as the monitoring dispersion among the monitoring parameter information. For each monitoring parameter information other than the typical monitoring parameter information, classify it into the same parameter information group along with the typical monitoring parameter information with the smallest monitoring dispersion. The monitoring parameter information with the smallest monitoring dispersion among each combination of parameter information and any identification code to be corrected is taken as the typical monitoring parameter information to be reselected, thereby obtaining several typical monitoring parameter information of the identification code in each round of parameter acquisition. The typical monitoring parameter information of each identification code in each round of parameter collection is obtained by summarizing.
7. The parameter acquisition and analysis system for the breeding chicken raising process according to claim 6, characterized in that, The step of summarizing the monitoring parameter information of each identification code in each round of parameter acquisition to obtain typical monitoring parameter information of each identification code in each round of parameter acquisition also includes, Determine whether the information of the reselected typical monitoring parameters has changed; If not, the reselected typical monitoring parameter information will be used as several typical monitoring parameter information in the previous rounds of parameter acquisition for this identification code; If so, the parameter information combination is reclassified based on the reselected typical monitoring parameter information, and the typical monitoring parameter information is reselected again until the reselected typical monitoring parameter information no longer changes.
8. The parameter acquisition and analysis system for the breeding chicken raising process according to claim 1, characterized in that, The step of calculating the mismatch degree of each correction scheme, include, For each revised scheme, perform the following steps respectively. The sum of the monitoring dispersion between the monitoring parameter information of each identification code to be corrected in this round of parameter acquisition and the typical monitoring parameter information of the corresponding corrected identification code in each round of parameter acquisition is taken as the mismatch degree of the correction scheme. The mismatch degree of each modified scheme is obtained by summing them up.
9. The parameter acquisition and analysis system for the breeding chicken raising process according to claim 1, characterized in that, It also includes, The corrected identification code for each breeder chicken and the corresponding parameter information for each type of monitoring item obtained in this round of parameter collection are stored in the storage unit.
Citation Information
Patent Citations
Method and system for precisely adjusting and controlling feeding amount in breeding hen breeding
CN118941044A
Intelligent feeding condition management method and system for laying hens
CN119477201A
