Method and device for integrating data of measuring growth performance of breeding pigs
By constructing ontology and multimodal data sets in the field of growth performance measurement of breeding pigs, the problem of difficulty in sharing and mining and utilization of growth performance measurement data of breeding pigs is solved, and the unified integration and sharing application of data is realized, and the accuracy and reliability of genetic evaluation of breeding pigs is improved.
Patent Information
- Application Number
- CN202411866434.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In the prior art, the growth performance measurement data of breeding pigs is difficult to effectively share and mine and utilize, resulting in information islands and reducing the accuracy and reliability of breeding pig genetic assessment.
By constructing the ontology of the growth performance measurement field of breeding pigs, identifying the data formats of different measurement equipment, collecting multi-source heterogeneous data, and using different strategies to collect data to form a unified multimodal data set.
The unified integration of growth performance measurement data of breeding pigs in different pig farms, different equipment and different formats has been achieved, which has promoted the interconnection and sharing of data, and improved the accuracy and reliability of genetic evaluation of breeding pigs.
Smart Images

Figure CN119323005B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural intelligent information processing, and in particular to a method and device for integrating breeding pig growth performance measurement data. Background Art
[0002] The measurement of breeding pig growth performance can provide data support for combined breeding and genetic evaluation, and is of great significance for promoting genetic improvement, optimizing breeding programs, and improving breeding efficiency.
[0003] In recent years, many breeding pig farms or testing centers have introduced various intelligent testing equipment to carry out the testing of breeding pig growth performance. These intelligent testing equipment involve many equipment manufacturers or brands. Testing equipment of different brands provides strong support for the personalized testing of breeding pig farms, but there are huge differences in technical standards between different brands of testing equipment. Even the same brand of testing equipment is different in data format, measurement unit, interface protocol, data transmission, security certification, etc., which makes it difficult to effectively share and mine the test results between pig farms, forming information islands, resulting in technical problems such as low accuracy and reliability of genetic evaluation of breeding pigs. Summary of the invention
[0004] The present invention provides a method and device for integrating breeding pig growth performance measurement data, which are used to solve the defect that breeding pig growth performance measurement data in the prior art is difficult to effectively share and mine and utilize. The method and device can integrate breeding pig growth performance measurement data from different pig farms, different equipment and different formats, and realize the interconnection, unified integration and shared application of breeding pig performance measurement data.
[0005] In a first aspect, the present invention provides a method for integrating data of growth performance measurement of breeding pigs, comprising:
[0006] Based on the subject word dictionary of pig growth performance measurement, the ontology of pig growth performance measurement domain is constructed;
[0007] Classify the measuring equipment according to their type, brand and model, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of breeding pigs from multiple measuring equipment in multiple pig farms;
[0008] Based on the sow growth performance measurement domain ontology, different strategies are used to collect and process the sow growth performance measurement data in different data formats;
[0009] Taking the identification of breeding pigs as the main line, the structured data, text data, image data, and video slice data that have been collected and processed are associated to obtain multimodal data of all breeding pigs;
[0010] After quality control of the growth performance measurement data of breeding pigs based on their multimodal data, the key growth performance indicator values of each type of pig are calculated respectively, and the calculated key growth performance indicator values are associated with the pig identification to obtain the multimodal fusion data of each type of pig.
[0011] In some embodiments, the classifying the measuring devices according to the type, brand and model of the measuring devices and identifying the data format of each type of measuring device includes:
[0012] Classify the measuring devices according to their types, brands and models, and obtain the response formats of the data interfaces of each type of measuring devices;
[0013] Call the data interface of the measuring device or run the subject crawler to obtain sample data of each type of measuring device;
[0014] Finding whether the acquired sample data contains metadata, and if so, determining the structure of the sample data according to the metadata;
[0015] According to the structure and content of the sample data obtained, the data format of each type of measurement equipment is determined according to the situation.
[0016] In some embodiments, for structured and semi-structured sow growth performance measurement data collected by different measurement devices, the data collection and processing of the sow growth performance measurement data in different data formats using different strategies respectively includes:
[0017] Use the parser to convert semi-structured sow growth performance measurement data into structured data;
[0018] The type, brand and model of the equipment are combined as the joint primary key to classify the measuring equipment, and a metadata model for structured data is built for each type of measuring equipment.
[0019] Determine the target data fields for the sow growth performance measurement data and configure the source data fields for each metadata model respectively;
[0020] Construct a mapping formula between source data fields and target data fields for each metadata model;
[0021] The mapping formula between the source data field and the target data field is parsed, and the value of the source data field is substituted into the mapping formula for calculation and evaluation to obtain the value of the target data field.
[0022] In some embodiments, the parsing of the mapping formula between the source data field and the target data field, and substituting the value of the source data field into the mapping formula for calculation and evaluation to obtain the value of the target data field includes:
[0023] Use regular expressions to identify all variables and custom functions in the mapping formula, substitute the values of the source data fields corresponding to the variables into the mapping formula, and calculate the value of each custom function;
[0024] Identifying constants and symbols in the mapping formula, and storing the constants and symbols in an array in the order in which they appear in the mapping formula;
[0025] Traversing the elements in the array, and converting the mapping formula into an equivalent expression without brackets;
[0026] Calculate the value of the target data field according to the non-bracketed operation formula;
[0027] The symbols refer to arithmetic operators of addition, subtraction, multiplication, and division, as well as left brackets and right brackets; left and right brackets appear in pairs in the mapping formula and can be nested multiple times indefinitely.
[0028] In some embodiments, traversing the elements in the array and converting the mapping formula into an equivalent formula without brackets includes:
[0029] a1. Initialize an empty first stack to store the symbols in the mapping formula, and the symbol at the top of the stack has the highest priority;
[0030] a2. Traverse the elements in the array in sequence. If the current element is a number, the number string corresponding to the current element is added to the result string; if the current element is a symbol, perform the following operations according to the situation:
[0031] If the current element is a left bracket, the left bracket is directly pushed into the first stack;
[0032] If the current element is a right bracket, pop the top element of the first stack until a left bracket is encountered;
[0033] If the current element is an arithmetic operator and the priority of the arithmetic operator is higher than the symbol at the top of the first stack, the arithmetic operator is pushed into the first stack; otherwise, the symbol at the top of the first stack is popped from the stack and added to the end of the result string until the priority of the symbol at the top of the first stack is lower than the current symbol, and the current symbol is pushed into the stack;
[0034] a3. Repeat step a2 until all elements in the array are traversed to obtain a bracket-free expression;
[0035] Calculating the value of the target data field according to the bracket-free calculation formula includes:
[0036] b1. Initialize an empty second stack to store operands and operation results;
[0037] b2. Scan each term of the expression without brackets from left to right and perform the following operations according to the situation:
[0038] If the current item is a digital string, it is pushed into the second stack;
[0039] If the current item is an arithmetic operator, pop two operands from the top of the second stack in sequence, perform operations on the two operands according to the arithmetic operator, and push the operation results into the second stack;
[0040] b3. Repeat step b2 until the last term of the non-bracket expression is scanned, pop out the unique value in the second stack, and obtain the value of the target data field.
[0041] In some embodiments, for the unstructured text data collected by different measuring devices, the data collection and processing of the sow growth performance measurement data in different data formats using different strategies respectively includes:
[0042] Use machine learning algorithms to identify key named entities in text data;
[0043] Select feature words from key named entities and represent each text as a feature vector consisting of the feature words;
[0044] Use rule-based or machine learning methods to perform concept mapping, mapping the identified key named entities and keywords to the concepts defined in the domain ontology of pig growth performance measurement;
[0045] Entity relationship extraction is performed using a pattern matching-based method or a neural network-based relationship extraction model to determine the entity relationship described in the text, and the entity relationship described in the text is mapped to the corresponding entity relationship in the ontology of the breeding pig growth performance measurement domain;
[0046] Associating the key named entities and entity relationships extracted from the text data with the pig identification of the breeding pigs;
[0047] For the unstructured image data collected by different measuring devices, different strategies are used to collect and process the growth performance measurement data of sows in different data formats, including:
[0048] Using the trained deep learning-based pig identification model, identify the breeding pigs in each image one by one;
[0049] Associating the file attribute information of each image with the pig identification of the identified breeding pig;
[0050] For the unstructured video data collected by different measuring devices, different strategies are used to collect and process the growth performance measurement data of sows in different data formats, including:
[0051] Using a deep learning-based pig behavior recognition model, the moment when predefined pig behaviors occur is detected from the video;
[0052] Slicing the video according to the moments of predefined pig behaviors to obtain sliced videos;
[0053] Identify the pig identification and behavior information of the breeding pigs in the sliced video;
[0054] The attribute information and behavior information of each slice video are associated with the pig identification of the breeding pig.
[0055] In some embodiments, the quality control of the sow growth performance measurement data based on the sow multimodal data includes:
[0056] The weight measurement records of each pig within the predefined measurement time period are sorted from early to late according to the start time of measurement, and stored in a triple list; wherein each triple list includes: the measured weight value of the breeding pig, the start time of measurement and the end time of measurement;
[0057] Convert the start measurement time of each measurement record in the list into an integer value and store it in the array;
[0058] Use a univariate linear regression model to fit each measured weight value in the array and list, and calculate the residual between the model fitting value and the measured weight value;
[0059] If the residual corresponding to the target measured weight value in the list is greater than the specified threshold, the target measured weight value is determined as a primary screening abnormal record;
[0060] According to the start measurement time and the end measurement time corresponding to the primary screening abnormality record, the video slice corresponding to the start measurement time and the end measurement time is queried;
[0061] The queried video slice is identified using a pig behavior recognition model based on deep learning. If a predefined abnormal weight situation is detected in the video slice, the target measured weight value is marked as an abnormal weight record.
[0062] In a second aspect, the present invention also provides a device for integrating data of measuring growth performance of breeding pigs, comprising:
[0063] Domain ontology construction module, used to construct the domain ontology of sow growth performance measurement based on the subject word dictionary of sow growth performance measurement;
[0064] A data acquisition module is used to classify the measuring equipment according to the type, brand and model of the measuring equipment, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of breeding pigs from multiple measuring equipment in multiple pig farms;
[0065] A processing module, used for collecting and processing the sow growth performance measurement data in different data formats by using different strategies based on the sow growth performance measurement domain ontology;
[0066] The association module is used to associate the collected and processed structured data, text data, image data, and video slice data based on the pig identification of the breeding pigs, so as to obtain the multimodal data of all the breeding pigs;
[0067] The fusion module is used to perform quality control on the growth performance measurement data of breeding pigs based on the multimodal data of breeding pigs, calculate the key indicator values of growth performance of each type of pig respectively, and associate the calculated key indicator values of growth performance with the pig identification to obtain multimodal fusion data of each type of pig.
[0068] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements any of the above-mentioned methods for integrating breeding pig growth performance measurement data.
[0069] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for integrating breeding pig growth performance measurement data.
[0070] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned methods for integrating breeding pig growth performance measurement data.
[0071] The method and device for integrating the growth performance measurement data of breeding pigs provided by the present invention can form a large and unified breeding pig growth performance measurement data set by integrating multi-source heterogeneous data, which can provide data support for large-scale breeding pig genetic evaluation and joint breeding, and help to improve the accuracy and reliability of breeding pig genetic evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0073] Figure 1 It is a schematic flow chart of the method for integrating data on the growth performance measurement of breeding pigs provided by the present invention.
[0074] Figure 2 It is a structural schematic diagram of a breeding pig growth performance measurement data integration device provided by the present invention.
[0075] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0076] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0077] Figure 1 FIG. 1 is a flow chart of the method for integrating the growth performance measurement data of the breeding pig provided by the present invention, such as Figure 1 As shown, the method includes the following:
[0078] Step 101: Based on the subject word dictionary of sow growth performance measurement, construct a sow growth performance measurement domain ontology for semantic fusion of data.
[0079] Specifically, the subject word dictionary is pre-constructed, including one or more of: a dictionary of measurement item names, a dictionary of measurement traits, a dictionary of equipment types, a dictionary of equipment brands, a dictionary of equipment models, a dictionary of pig farm names, a dictionary of pig breeding companies, a dictionary of measurement center names, a dictionary of pig information, a dictionary of commonly used identification items, a dictionary of measurement units, and a dictionary of commonly used keywords.
[0080] In some embodiments, the domain ontology of sow growth performance determination can be constructed by combining expert knowledge or using an automated ontology construction tool.
[0081] Equipment types include: one or more of: intelligent feeding stations, three-dimensional body scanners, ultrasonic measuring instruments, automatic weighing systems, electronic scales, body condition scoring tools, and environmental monitoring equipment.
[0082] Step 102: Classify the measuring equipment according to their type, brand and model, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of breeding pigs from multiple measuring equipment in multiple pig farms.
[0083] Specifically, the formats of pig growth performance measurement data include structured data, semi-structured data and unstructured data.
[0084] The data interface or thematic crawler can be used to obtain the breeding pig growth performance measurement data from multiple measurement devices in multiple pig farms.
[0085] The data interface includes one or more of a web service interface, a remote procedure call (RPC) call interface, a dedicated application programming interface (API) and a data import interface.
[0086] When obtaining measurement data, the data exchange format includes one or more of plain text, XML, JSON, and multimedia files. The data exchange format is the specification and standard followed when transmitting and exchanging data between different computer systems.
[0087] The data for measuring the growth performance of breeding pigs include one or more of the following: pig weight records, feeding records, back fat thickness, feed intake, feed weighing, feeding images, feeding videos, pig house environment data, body shape and appearance description, and test reports.
[0088] There are multiple source channels for pig farms, including: national core pig breeding farms, breeding pig quality inspection and testing center of the Ministry of Agriculture and Rural Affairs, provincial core pig breeding farms, core boar stations, breeding pig breeding bases, and corporate breeding pig farms.
[0089] In some embodiments, the classifying the measuring devices according to the type, brand and model of the measuring devices and identifying the data format of each type of measuring device includes:
[0090] Classify the measuring devices according to their types, brands and models, and obtain the response formats of the data interfaces of each type of measuring devices;
[0091] Call the data interface of the measuring device or run the subject crawler to obtain sample data of each type of measuring device;
[0092] Finding whether the acquired sample data contains metadata, and if so, determining the structure of the sample data according to the metadata;
[0093] According to the structure and content of the sample data obtained, the data format of each type of measurement equipment is determined according to the situation.
[0094] Specifically, the steps for identifying the data format of the measurement data collected by each type of measurement equipment are as follows:
[0095] (1) Classify the measuring devices according to their type, brand and model, and obtain the response format of the data interface of each type of measuring device, such as JSON, XML, CSV or HTML;
[0096] (2) Call the data interface of the measuring device or run the subject crawler to obtain sample data for each type of measuring device;
[0097] (3) Find out whether the acquired sample data contains metadata (such as labels, annotations, or descriptive information). If so, determine the structure of the sample data based on the metadata.
[0098] (4) Determine the data format for each type of measurement equipment based on the structure and content of the sample data obtained, including:
[0099] If the response data format of the measurement device data interface is JSON, XML, or CSV, the measurement data is structured.
[0100] Analyze the structure of the sample data. If the sample data is presented in the form of clear key-value pairs, the acquired data is structured.
[0101] If the sample data is free text or contains multiple media types (such as images, audio and video), the acquired data is unstructured.
[0102] If the sample data conforms to a predefined pattern (such as JSON Schema, XML Schema, or regular expression), the acquired data is structured or semi-structured.
[0103] Check whether the sample data contains a nested structure. If so, the acquired data is semi-structured.
[0104] Step 103: Based on the sow growth performance measurement domain ontology, different strategies are used to aggregate and process the sow growth performance measurement data in different data formats.
[0105] In some embodiments, for structured and semi-structured sow growth performance measurement data collected by different measurement devices, the data collection and processing of the sow growth performance measurement data in different data formats using different strategies respectively includes:
[0106] Use the parser to convert semi-structured sow growth performance measurement data into structured data;
[0107] The type, brand and model of the equipment are combined as the joint primary key to classify the measuring equipment, and a data model for structured data is constructed for each type of measuring equipment;
[0108] Determine the target data fields for the sow growth performance measurement data and configure the source data fields for each metadata model respectively;
[0109] Construct a mapping formula between the source data field and the target data field for each metadata model; the construction method includes manual configuration, or automatic configuration by algorithm and then manual modification.
[0110] The mapping formula between the source data field and the target data field is parsed, and the value of the source data field is substituted into the mapping formula for calculation and evaluation to obtain the value of the target data field.
[0111] Specifically, for structured or semi-structured data, the data aggregation and processing goal is to integrate the growth performance measurement data of sows from different measurement equipment into structured data in a unified format. The specific strategies include:
[0112] (1) Convert the format of the acquired data. If the acquired data is semi-structured data, use a parser (such as a JSON parser, XML parser, or CSV parser) to convert it into structured data.
[0113] (2) Combine the three items of “device type + device brand + device model” as a joint primary key to classify the measurement equipment, and build a metadata model for structured data for each type of measurement equipment.
[0114] (3) Determine the target data fields for the breeding pig growth performance measurement data and configure the source data fields for each metadata model.
[0115] Specifically, the metadata model of each type of measuring device may be retrieved according to the type of measuring device, and a corresponding target data field may be configured for the retrieved metadata model.
[0116] In some embodiments, based on the versatility of the fields and the convenience of use, the fields in the target data are divided into two categories: identification items and measurement items. Among them, the identification item fields are relatively fixed and can be predefined by experts, including: one or more of the electronic ear tag number, pig identification number, measurement equipment number, and pig farm number. The measurement item fields can be dynamically increased or decreased by the user, including: one or more of the feeding start time, feeding end time, pig weight, feed intake, rice trough initial weight, trough final weight, and feeding time.
[0117] The pig identification number is globally unique. Preferably, the pig identification number consists of 15 digits and is encoded according to relevant encoding rules.
[0118] (4) Construct a mapping relationship (mapping formula) between the source data field and the target data field for each metadata model.
[0119] The mapping formula supports custom functions and complex arithmetic expressions with multiple layers of left and right brackets. Left and right brackets appear in pairs in the mapping formula and can be nested multiple times.
[0120] Specifically, the mapping relationship between the source data field and the target data field may be one-to-one (1:1) or many-to-one (N:1). When the mapping relationship is N:1, it means that the value of the target data field is obtained by calculating the values of multiple source data fields.
[0121] (5) The mapping formula between the source data field and the target data field is parsed, and the value of the source data field is substituted into the mapping formula and then evaluated to obtain the value of the target data field.
[0122] For example, for an enterprise's automatic feeding equipment, the following mapping relationship can be established. Among them, Datediff and Dateadd are both custom functions, which are used to calculate the interval between two dates and add a specified time interval to a date respectively. The mapping formula between the source data field and the target data field is shown in Table 1.
[0123] Table 1 Mapping formula between source data fields and target data fields
[0124]
[0125] Through the above mapping relationship, the value of the field "mrfid" in the source data can be mapped to the value of the field "electronic ear tag number" in the target data, the value of the field "naddress" in the source data can be mapped to the value of the field "measurement equipment number" in the target data, and the value of the field "ningestion" in the source data can be mapped to the value of the field "feed intake" in the target data. For the target data field with a mapping relationship of N:1, it can be calculated by parsing the mapping formula.
[0126] In some embodiments, in order to improve the parsing efficiency of complex arithmetic expressions with multiple layers of nested brackets, increase the operation speed, save storage space, and facilitate computer program implementation, the mapping formula between the source data field and the target data field is parsed, and the value of the source data field is substituted into the mapping formula for operation and evaluation to obtain the value of the target data field, including:
[0127] Use regular expressions to identify all variables and custom functions in the mapping formula, substitute the values of the source data fields corresponding to the variables into the mapping formula, and calculate the value of each custom function;
[0128] Identifying constants and symbols in the mapping formula, and storing the constants and symbols in an array in the order in which they appear in the mapping formula;
[0129] Traversing the elements in the array, and converting the mapping formula into an equivalent expression without brackets;
[0130] Calculate the value of the target data field according to the non-bracketed operation formula;
[0131] The symbols refer to arithmetic operators of addition, subtraction, multiplication, and division, as well as left brackets and right brackets; left and right brackets appear in pairs in the mapping formula and can be nested multiple times indefinitely.
[0132] Specifically, for the numeric fields in the target data, the mapping formula (denoted as λ) supports operations between numbers, symbols, and custom functions. Symbols include +, -, , ÷ and two symbols (,). The left and right brackets in the expression can be nested infinitely. The specific parsing and calculation strategies are as follows:
[0133] 1) Use regular expressions to identify all variables and custom functions in the mapping formula λ, substitute the values of the source data fields corresponding to the variables into the mapping formula λ, and calculate the value of each custom function.
[0134] After this step, the mapping formula λ only contains constants, as well as +, -, Operations between , ÷, and ().
[0135] 2) Identify the constants, +, -, , ÷, (,) symbols, and store them in array A in the order they appear in the mapping formula λ.
[0136] 3) Traverse the elements in array A and transform the mapping formula λ into an equivalent expression without brackets, recorded as .
[0137] 4) According to the above bracket-free expression , calculate the value of the mapping formula λ.
[0138] For example: Mapping formula λ=((4+5) 6-5)÷2+3 2, then after equivalent transformation into a bracket-free expression, its representation is: =4 5 + 6 5 - 2 ÷ 3 2 +, Elements 4, 5, +, 6, ,5,-,2,÷,3,2, , + are separated by spaces, or other symbols (such as "|"). After the above equivalent transformation, the calculation formula will no longer contain the (,) symbol, which can facilitate computer parsing, efficient execution and reduce storage space usage.
[0139] In some embodiments, traversing the elements in the array and converting the mapping formula into an equivalent formula without brackets includes:
[0140] a1. Initialize an empty first stack to store the symbols in the mapping formula, and the symbol at the top of the stack has the highest priority;
[0141] a2. Traverse the elements in the array in sequence. If the current element is a number, the number string corresponding to the current element is added to the result string; if the current element is a symbol, perform the following operations according to the situation:
[0142] If the current element is a left bracket, the left bracket is directly pushed into the first stack;
[0143] If the current element is a right bracket, pop the top element of the first stack until a left bracket is encountered;
[0144] If the current element is an arithmetic operator and the priority of the arithmetic operator is higher than the symbol at the top of the first stack, the arithmetic operator is pushed into the first stack; otherwise, the symbol at the top of the first stack is popped from the stack and added to the end of the result string until the priority of the symbol at the top of the first stack is lower than the current symbol, and the current symbol is pushed into the stack;
[0145] a3. Repeat step a2 until all elements in the array are traversed to obtain a bracket-free expression.
[0146] Specifically, the mapping formula λ is converted into a bracket-free expression The specific implementation steps include:
[0147] a1. Initialize an empty stack Stack1 to store operator symbols. The operator at the top of the stack has the highest priority.
[0148] a2. Traverse the elements in array A one by one. If the current element is a number, the number string corresponding to the current element is added to the result string; if the current element is an operator, perform the following operations according to the situation:
[0149] If the current element is the "(" symbol, it is pushed directly into stack Stack1.
[0150] If the current element is the ")" symbol, pop the top element of Stack1 until the symbol "()" is encountered.
[0151] If the current element is an arithmetic operator and its precedence is higher than the operator at the top of the operator stack, the operator is pushed into stack Stack1; otherwise, the operator at the top of Stack1 is popped from the stack and added to the end of the result string until the precedence of the operator at the top of the stack is lower than the current operator, and the current operator is pushed into the stack.
[0152] a3. Repeat step a2 until all elements in array A are traversed to obtain the expression without brackets. .
[0153] In some embodiments, calculating the value of the target data field according to the bracket-free operation formula includes:
[0154] b1. Initialize an empty second stack to store operands and operation results;
[0155] b2. Scan each term of the expression without brackets from left to right and perform the following operations according to the situation:
[0156] If the current item is a digital string, it is pushed into the second stack;
[0157] If the current item is an arithmetic operator, pop two operands from the top of the second stack in sequence, perform operations on the two operands according to the arithmetic operator, and push the operation results into the second stack;
[0158] b3. Repeat step b2 until the last term of the non-bracket expression is scanned, pop out the unique value in the second stack, and obtain the value of the target data field.
[0159] Specifically, the specific steps to calculate the value of the target data field according to the unbracketed expression are as follows:
[0160] b1. Initialize an empty stack Stack2 to store operands and calculation results.
[0161] b2. Scan the arithmetic expression from left to right For each item, perform the following operations according to the situation:
[0162] If the current item is a numeric string, it is pushed into stack Stack2.
[0163] If the current item is an operator, two operands a and b are popped from the top of Stack2 and operated with the operator (i.e. b[+|-| |÷]a), and push the result into the operand stack.
[0164] b3. Repeat the above step b2 until the arithmetic expression is scanned. , at this time, there is only one element in stack Stack2, which is popped out to be the value of the mapping formula λ.
[0165] In some embodiments, for the unstructured text data collected by different measuring devices, the data collection and processing of the sow growth performance measurement data in different data formats using different strategies respectively includes:
[0166] Use machine learning algorithms to identify key named entities in text data;
[0167] Select feature words from key named entities and represent each text as a feature vector consisting of the feature words;
[0168] Use rule-based or machine learning methods to perform concept mapping, mapping the identified key named entities and keywords to the concepts defined in the domain ontology of pig growth performance measurement;
[0169] Entity relationship extraction is performed using a pattern matching-based method or a neural network-based relationship extraction model to determine the entity relationship described in the text, and the entity relationship described in the text is mapped to the corresponding entity relationship in the ontology of the breeding pig growth performance measurement domain;
[0170] The key named entities and entity relationships extracted from the text data are associated with the pig identification of the breeding pigs.
[0171] Specifically, for unstructured text data, the data aggregation and processing goal is to semantically associate the text data collected by different measurement devices and associate it with individual pigs. The specific strategies include:
[0172] (1) Preprocess the text data, including: removing irrelevant characters (such as HTML / XML tags, special characters), removing blank characters (such as blanks at the beginning and end of a line and consecutive spaces), character encoding conversion, unifying upper and lower case, text segmentation, removing stop words, and synonym replacement.
[0173] (2) Use machine learning algorithms to identify key named entities in the text, including: pig breed, great-grandparent name, grandparent name, parent name, measurement equipment name, measurement item name and index value, key trait name and index value.
[0174] (3) Use any one of the following methods: information gain method, text frequency method, chi-square test method, and mutual information method to select feature words from key named entities, and use the improved TF-IDF model to represent each text as a feature vector composed of the feature words, denoted as:
[0175]
[0176] in, Indicates A vector of texts, Indicates In the text The weight of a feature word, M represents the number of feature words.
[0177] The calculation method of the weight of the feature vector includes:
[0178]
[0179] in, For the In the text The weight of the feature words; For the text, Characteristic word In text The weighted frequencies in Characteristic word The inverse text frequency, is the normalization constant, is the number of logical blocks of the current text, Characteristic word In text No. The actual number of occurrences in a text block, For the The position weight of a text block, For Text Middle The length of the text block, The text collection contains characteristic words The number of web pages, N The total number of texts.
[0180] (4) Use rule-based or machine learning methods to perform concept mapping, map the identified named entities and keywords to the concepts defined in the ontology of the breeding pig growth performance measurement domain, that is, calculate the similarity of concepts from the perspective of concept name, attribute, and instance to obtain the semantic similarity between concepts, and establish associations between named entities with similarity greater than a certain threshold and ontology concepts.
[0181] (5) Use a pattern matching-based method or a neural network-based entity relationship extraction model to extract entity relationships, determine the entity relationships described in the text, and map them to the corresponding entities (individual pigs), attributes, and entity relationships in the domain ontology of breeding pig growth performance measurement.
[0182] (6) Associate the key named entities and entity relationships extracted from the text data with the pig identification of the breeding pigs.
[0183] In some embodiments, for unstructured image data collected by different measuring devices, the data collection and processing of the sow growth performance measurement data in different data formats using different strategies respectively includes:
[0184] Using the trained deep learning-based pig identification model, identify the breeding pigs in each image one by one;
[0185] The file attribute information of each image is associated with the pig identification of the identified breeding pig.
[0186] Specifically, for unstructured image data, the data aggregation and processing goal is to associate the pig information and image attribute information in the image with the actual pig individual ID. The specific strategies include:
[0187] (1) Preprocess the original data set, including random cropping, random offset, and mosaic data enhancement.
[0188] (2) A certain number of image data are randomly selected from the original data set for manual annotation, and images with too high similarity are removed to construct a training set.
[0189] In some embodiments, when the number of images is large, a simple random sampling method may be used to extract 20%-30% of the data; otherwise, a sampling method with replacement may be used to sample the data.
[0190] (3) Constructing a pig individual identification model based on deep learning, and using the constructed training set to train the model.
[0191] In some embodiments, the pig individual recognition model based on deep learning can be constructed by introducing spatial attention, channel attention and self-attention mechanisms on the basis of the classic deep learning model. For example, the coordinate attention mechanism can be introduced on the basis of the classic model YOLOv5 or YOLOv7 to construct the model.
[0192] (4) Using the trained deep learning-based pig recognition model, identify the pigs in each image one by one, mark the individual pigs in the image with red anchor boxes, and associate the current image file attribute information with the actual individual pig ID.
[0193] Image file attribute information includes: image generation time, measurement equipment information, measurement site information, measurement purpose, longitude and latitude information, and image EXIF information.
[0194] In some embodiments, for unstructured video data collected by different measuring devices, the data collection and processing of the sow growth performance measurement data in different data formats using different strategies respectively includes:
[0195] Using a deep learning-based pig behavior recognition model, the moment when predefined pig behaviors occur is detected from the video;
[0196] Slicing the video according to the moments of predefined pig behaviors to obtain sliced videos;
[0197] Identify the pig identification and behavior information of the breeding pigs in the sliced video;
[0198] The attribute information and behavior information of each slice video are associated with the pig identification of the breeding pig.
[0199] Specifically, for unstructured video data, the data aggregation and processing goal is to associate the individual pigs and their behavior information at a certain moment in the video with the actual individual pig ID. The specific strategies include:
[0200] (1) Using a deep learning-based pig behavior recognition model, the moment when predefined pig behaviors occur is detected from the video.
[0201] Predefined pig behaviors include: eating, resting, walking, and standing still.
[0202] (2) Slice the original video file according to the moment when the predefined pig behavior occurs in the video. The sliced video refers to the video clip t seconds before and after the moment when the pig behavior occurs.
[0203] (3) Identify the individual ID and behavior information of pigs in the sliced video.
[0204] (4) Associating the sliced video attribute information and pig behavior information with the actual pig individual ID.
[0205] The slice video attribute information includes: video start time, video end time, event occurrence time, measurement equipment information, measurement site information, measurement purpose, video resolution, video frame rate, and longitude and latitude information.
[0206] Step 104: With the identification of the breeding pigs as the main line, the structured data, text data, image data, and video slice data that have been collected and processed are associated to obtain multimodal data of all breeding pigs.
[0207] Step 105: After quality control of the growth performance measurement data of the breeding pigs based on the multimodal data of the breeding pigs, the key growth performance indicator values of each type of pig are calculated respectively, and the calculated key growth performance indicator values are associated with the pig identification to obtain multimodal fusion data of each type of pig.
[0208] Specifically, quality control of pig measurement data based on pig multimodal data refers to the use of rule-based and / or machine learning algorithms, combined with pig image data and video slice data, to perform a series of data processing operations on the collected structured measurement data, including: invalid data deletion, outlier detection, missing value filling, data correction and logical verification.
[0209] The structured measurement data collected include: measurement and recording data of pig weight, feed intake, feeding time and feeding speed.
[0210] Invalid data include: measurement data without pig ID, measurement data with a measurement start time greater than an end time, measurement data with feed intake ≤ 0, and measurement data with pig weight ≤ 0.
[0211] In some embodiments, the step of performing quality control on the growth performance measurement data of the sows based on the multimodal data of the sows, wherein the step of performing quality control on the pig weight data comprises:
[0212] The weight measurement records of each pig within the predefined measurement time period are sorted from early to late according to the start time of measurement, and stored in a triple list; wherein each triple list includes: the measured weight value of the breeding pig, the start time of measurement and the end time of measurement;
[0213] Convert the start measurement time of each measurement record in the list into an integer value and store it in the array;
[0214] Use a univariate linear regression model to fit each measured weight value in the array and list, and calculate the residual between the model fitting value and the measured weight value;
[0215] If the residual corresponding to the target measured weight value in the list is greater than the specified threshold, the target measured weight value is determined as an abnormal record of the initial screening;
[0216] According to the start measurement time and the end measurement time corresponding to the primary screening abnormality record, the video slice corresponding to the start measurement time and the end measurement time is queried;
[0217] The queried video slice is identified using a pig behavior recognition model based on deep learning. If a predefined abnormal weight situation is detected in the video slice, the target measured weight value is marked as an abnormal weight record.
[0218] Specifically, the specific steps for detecting abnormal weight values of pigs include:
[0219] (1) Sort the weight measurement records of each pig within the predefined measurement time period from early to late according to the start time, and store them in a triple list ListW, recorded as ,in, is the triplet of the i-th weight measurement record, is the start time of the i-th measurement record, is the end time of the measurement of the ith measurement record, is the weight value of the ith measurement record, and n is the number of measurement records.
[0220] (2) Convert the start measurement time of each measurement record in ListW to an integer value, that is, calculate the number of minutes between the measurement time of each element in ListW and the earliest measurement time in ListW, and store the calculated difference in array ST.
[0221] (3) Use a univariate linear regression model to fit the measured weight value of each element in the array ST and the list ListW, and calculate the residual between the model fitting value and the measured weight value.
[0222] (4) If the residual corresponding to the i-th element in the ListW list is greater than the specified threshold, the i-th element in the ListW list is determined as the initial screening abnormal record.
[0223] The threshold is determined based on the residual distribution. In some embodiments, the threshold may be 20% of the fitting value.
[0224] (5) Based on the start and end times of the initial screening abnormality records, the video slice corresponding to the measurement time period is queried.
[0225] (6) The queried video slices are identified using a pig behavior recognition model based on deep learning. If a predefined abnormal weight situation is detected in the video slice, the weight record corresponding to the initial screening abnormal point is marked as an abnormal weight record.
[0226] Among them, abnormal weight situations are predefined, including: weighing multiple pigs at the same time, incorrect measurement posture, interference during weighing, and unstable standing during weighing.
[0227] In some embodiments, the specific steps of filling missing values of pig weight include:
[0228] (1) Perform relevant processing on pig weight, including deleting invalid data and eliminating outliers.
[0229] (2) Extract all weight measurement records of each pig during the measurement period, take the date of the start time of each measurement record as the measurement date of the record, classify all weight measurement records of each pig during the measurement period according to the measurement date, and calculate the average weight value of each pig on each measurement date.
[0230] (3) The moving average model was used to fit the weight value of each pig on each natural day during the measurement period. If there was no weight measurement value on a certain natural day, the model fitting value was used as the pig weight value on that day.
[0231] Similarly, data quality control can be performed on the measured data such as feed intake, feeding time, feeding speed, etc., which will not be described in detail here.
[0232] Specifically, key growth performance indicators include: average daily weight gain, average daily feed intake, feed utilization rate, age at target weight, target backfat thickness, and appearance score (weight, body length, chest circumference, hip circumference, and leg circumference). In addition, the values of the key indicators are automatically calculated by substituting the relevant structured measurement data that have been collected into the predefined formula. The predefined formula supports custom functions and complex arithmetic expressions with multiple layers of left and right brackets. The field configuration, storage, parsing, and evaluation process in the formula are similar to the calculation process of the mapping formula described above. For example, feed utilization rate refers to the percentage of the sum of the weight gain and feed intake of pigs during the measurement period, that is, feed utilization rate (%) = (pig weight gain / sum of feed intake) × 100%.
[0233] The method for integrating the growth performance measurement data of breeding pigs provided by the present invention can form a large and unified breeding pig growth performance measurement data set by integrating multi-source heterogeneous data, which can provide data support for large-scale breeding pig genetic evaluation and joint breeding, and help to improve the accuracy and reliability of breeding pig genetic evaluation.
[0234] In some embodiments, it also includes:
[0235] Based on the ontology of the breeding pig growth performance measurement domain and the multimodal fusion data of pigs, a breeding pig growth performance measurement knowledge graph is constructed to visualize the breeding pig growth performance measurement information and conduct knowledge reasoning.
[0236] Specifically, the entities of each pig, the relationships between entities, and the attribute information of entities are extracted from the multimodal fusion data of pigs to construct a knowledge graph for the growth performance measurement of breeding pigs.
[0237] According to the knowledge graph, the growth performance measurement information of each pig is displayed visually, including: pig ID, breed, date of birth, gender, pig farm, pen number, ear tag number, company, pedigree information (great-grandparent name, grandparent name, parent name, etc.), body shape and appearance, growth performance measurement records, key growth performance indicators, pig house environment, image data, and video slice data.
[0238] Use rule-based or ontology-based reasoning algorithms to reason about the data in the knowledge graph and complete the missing attributes in the knowledge graph based on the reasoning results.
[0239] Based on the information in the knowledge graph, a detailed portrait is created for each pig, and a timeline, radar chart, and mind map are used to visualize the basic information, growth performance, body shape, appearance, and living habits of each pig at different times.
[0240] The present invention can promote the sharing and application of breeding pig growth performance measurement data on a large scale, establish detailed portraits of pigs based on the knowledge graph, and display them in a visual way, thereby providing support for large-scale breeding pig growth performance measurement and genetic evaluation, joint breeding and other work.
[0241] The following is a description of the breeding pig growth performance measurement data integration device provided by the present invention. The breeding pig growth performance measurement data integration device described below and the breeding pig growth performance measurement data integration method described above can be referenced to each other.
[0242] Figure 2 Schematic diagram of the structure of the data integration device for measuring the growth performance of breeding pigs provided by the present invention. Figure 2 As shown, the present invention provides a device for integrating data of measuring growth performance of breeding pigs, comprising:
[0243] The domain ontology construction module 201 is used to construct the domain ontology of the sow growth performance measurement based on the subject word dictionary of the sow growth performance measurement;
[0244] The data acquisition module 202 is used to classify the measuring equipment according to the type, brand and model of the measuring equipment, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of the breeding pigs from multiple measuring equipment in multiple pig farms;
[0245] The processing module 203 is used to collect and process the sow growth performance measurement data in different data formats by using different strategies based on the sow growth performance measurement domain ontology;
[0246] The association module 204 is used to associate the structured data, text data, image data, and video slice data that have been collected and processed based on the pig identification of the breeding pigs, so as to obtain multimodal data of all breeding pigs;
[0247] The fusion module 205 is used to perform quality control on the growth performance measurement data of the breeding pigs based on the multimodal data of the breeding pigs, calculate the key growth performance indicator values of each type of pig respectively, and associate the calculated key growth performance indicator values with the pig identification to obtain the multimodal fusion data of each type of pig.
[0248] Specifically, the above-mentioned breeding pig growth performance measurement data integration device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.
[0249] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communications interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the method for integrating the growth performance measurement data of the sow, and the method includes:
[0250] Based on the subject word dictionary of pig growth performance measurement, the ontology of pig growth performance measurement domain is constructed;
[0251] Classify the measuring equipment according to their type, brand and model, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of breeding pigs from multiple measuring equipment in multiple pig farms;
[0252] Based on the sow growth performance measurement domain ontology, different strategies are used to collect and process the sow growth performance measurement data in different data formats;
[0253] Taking the identification of breeding pigs as the main line, the structured data, text data, image data, and video slice data that have been collected and processed are associated to obtain multimodal data of all breeding pigs;
[0254] After quality control of the growth performance measurement data of breeding pigs based on their multimodal data, the key growth performance indicator values of each type of pig are calculated respectively, and the calculated key growth performance indicator values are associated with the pig identification to obtain the multimodal fusion data of each type of pig.
[0255] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0256] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the method for integrating the growth performance measurement data of the sow provided by the above methods, the method comprising:
[0257] Based on the subject word dictionary of pig growth performance measurement, the ontology of pig growth performance measurement domain is constructed;
[0258] Classify the measuring equipment according to their type, brand and model, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of breeding pigs from multiple measuring equipment in multiple pig farms;
[0259] Based on the sow growth performance measurement domain ontology, different strategies are used to collect and process the sow growth performance measurement data in different data formats;
[0260] Taking the identification of breeding pigs as the main line, the structured data, text data, image data, and video slice data that have been collected and processed are associated to obtain multimodal data of all breeding pigs;
[0261] After quality control of the growth performance measurement data of breeding pigs based on their multimodal data, the key growth performance indicator values of each type of pig are calculated respectively, and the calculated key growth performance indicator values are associated with the pig identification to obtain the multimodal fusion data of each type of pig.
[0262] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the method for integrating the growth performance measurement data of sows provided by the above methods, the method comprising:
[0263] Based on the subject word dictionary of pig growth performance measurement, the ontology of pig growth performance measurement domain is constructed;
[0264] Classify the measuring equipment according to their type, brand and model, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of breeding pigs from multiple measuring equipment in multiple pig farms;
[0265] Based on the sow growth performance measurement domain ontology, different strategies are used to collect and process the sow growth performance measurement data in different data formats;
[0266] Taking the identification of breeding pigs as the main line, the structured data, text data, image data, and video slice data that have been collected and processed are associated to obtain multimodal data of all breeding pigs;
[0267] After quality control of the growth performance measurement data of breeding pigs based on their multimodal data, the key growth performance indicator values of each type of pig are calculated respectively, and the calculated key growth performance indicator values are associated with the pig identification to obtain the multimodal fusion data of each type of pig.
[0268] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0269] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0270] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for integrating data of measuring growth performance of breeding pigs, characterized in that: include: Based on the subject word dictionary of pig growth performance measurement, the ontology of pig growth performance measurement domain is constructed; Classify the measuring equipment according to their type, brand and model, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of breeding pigs from multiple measuring equipment in multiple pig farms; Based on the sow growth performance measurement domain ontology, different strategies are used to collect and process the sow growth performance measurement data in different data formats; Taking the identification of breeding pigs as the main line, the structured data, text data, image data, and video slice data that have been collected and processed are associated to obtain multimodal data of all breeding pigs; After quality control of the growth performance measurement data of the breeding pigs based on the multimodal data of the breeding pigs, the key index values of the growth performance of each type of pig are calculated respectively, and the calculated key index values of the growth performance are associated with the pig identification to obtain the multimodal fusion data of each type of pig; The measuring devices are classified according to their type, brand and model, and the data format of each type of measuring device is identified, including: Classify the measuring devices according to their types, brands and models, and obtain the response formats of the data interfaces of each type of measuring devices; Call the data interface of the measuring device or run the subject crawler to obtain sample data of each type of measuring device; Finding whether the acquired sample data contains metadata, and if so, determining the structure of the sample data according to the metadata; Determine the data format for each type of measurement equipment according to the structure and content of the sample data obtained; The method of performing quality control on the growth performance measurement data of the sows based on the multimodal data of the sows comprises: The weight measurement records of each pig within the predefined measurement time period are sorted from early to late according to the start time of measurement, and stored in a triple list; wherein each triple list includes: the measured weight value of the breeding pig, the start time of measurement and the end time of measurement; Convert the start measurement time of each measurement record in the list into an integer value and store it in the array; Use a univariate linear regression model to fit each measured weight value in the array and list, and calculate the residual between the model fitting value and the measured weight value; If the residual corresponding to the target measured weight value in the list is greater than the specified threshold, the target measured weight value is determined as a primary screening abnormal record; According to the start measurement time and the end measurement time corresponding to the primary screening abnormality record, the video slice corresponding to the start measurement time and the end measurement time is queried; The queried video slice is identified using a pig behavior recognition model based on deep learning. If a predefined abnormal weight situation is detected in the video slice, the target measured weight value is marked as an abnormal weight record.
2. The method for integrating the growth performance measurement data of breeding pigs according to claim 1, characterized in that: For the structured and semi-structured sow growth performance measurement data collected by different measurement equipment, different strategies are used to collect and process the sow growth performance measurement data in different data formats, including: Use the parser to convert semi-structured sow growth performance measurement data into structured data; The type, brand and model of the equipment are combined as the joint primary key to classify the measuring equipment, and a metadata model for structured data is built for each type of measuring equipment. Determine the target data fields for the sow growth performance measurement data and configure the source data fields for each metadata model respectively; Construct a mapping formula between source data fields and target data fields for each metadata model; The mapping formula between the source data field and the target data field is parsed, and the value of the source data field is substituted into the mapping formula for calculation and evaluation to obtain the value of the target data field.
3. The method for integrating the growth performance measurement data of breeding pigs according to claim 2, characterized in that: The mapping formula between the source data field and the target data field is parsed, and the value of the source data field is substituted into the mapping formula for calculation and evaluation to obtain the value of the target data field, including: Use regular expressions to identify all variables and custom functions in the mapping formula, substitute the values of the source data fields corresponding to the variables into the mapping formula, and calculate the value of each custom function; Identifying constants and symbols in the mapping formula, and storing the constants and symbols in an array in the order in which they appear in the mapping formula; Traversing the elements in the array, and converting the mapping formula into an equivalent expression without brackets; Calculate the value of the target data field according to the non-bracketed operation formula; The symbols refer to arithmetic operators of addition, subtraction, multiplication, and division, as well as left brackets and right brackets; left and right brackets appear in pairs in the mapping formula and can be nested multiple times indefinitely.
4. The method for integrating the growth performance measurement data of breeding pigs according to claim 3, characterized in that: The traversing the elements in the array and converting the mapping formula into an equivalent formula without brackets includes: a1. Initialize an empty first stack to store the symbols in the mapping formula, and the symbol at the top of the stack has the highest priority; a2. Traverse the elements in the array in sequence. If the current element is a number, the number string corresponding to the current element is added to the result string; if the current element is a symbol, perform the following operations according to the situation: If the current element is a left bracket, the left bracket is directly pushed into the first stack; If the current element is a right bracket, pop the top element of the first stack until a left bracket is encountered; If the current element is an arithmetic operator and the priority of the arithmetic operator is higher than the symbol at the top of the first stack, the arithmetic operator is pushed into the first stack; otherwise, the symbol at the top of the first stack is popped from the stack and added to the end of the result string until the priority of the symbol at the top of the first stack is lower than the current symbol, and the current symbol is pushed into the stack; a3. Repeat step a2 until all elements in the array are traversed to obtain a bracket-free expression; Calculating the value of the target data field according to the bracket-free calculation formula includes: b1. Initialize an empty second stack to store operands and operation results; b2. Scan each term of the expression without brackets from left to right and perform the following operations according to the situation: If the current item is a digital string, it is pushed into the second stack; If the current item is an arithmetic operator, two operands are popped out from the top of the second stack in sequence, and the two operands are operated according to the arithmetic operator, and the operation result is pushed into the second stack; b3. Repeat step b2 until the last term of the non-bracket expression is scanned, pop out the unique value in the second stack, and obtain the value of the target data field.
5. The method for integrating the growth performance measurement data of breeding pigs according to claim 1, characterized in that: For the unstructured text data collected by different measuring devices, different strategies are used to collect and process the growth performance measurement data of sows in different data formats, including: Use machine learning algorithms to identify key named entities in text data; Select feature words from key named entities and represent each text as a feature vector consisting of the feature words; Use rule-based or machine learning methods to perform concept mapping, mapping the identified key named entities and keywords to the concepts defined in the domain ontology of pig growth performance measurement; Entity relationship extraction is performed using a pattern matching-based method or a neural network-based relationship extraction model to determine the entity relationship described in the text, and the entity relationship described in the text is mapped to the corresponding entity relationship in the ontology of the sow growth performance measurement domain; Associating the key named entities and entity relationships extracted from the text data with the pig identification of the breeding pigs; For the unstructured image data collected by different measuring devices, different strategies are used to collect and process the growth performance measurement data of sows in different data formats, including: Using the trained deep learning-based pig identification model, identify the breeding pigs in each image one by one; Associating the pig information and image file attribute information in each image with the pig identification of the identified breeding pig; For the unstructured video data collected by different measuring devices, different strategies are used to collect and process the growth performance measurement data of sows in different data formats, including: Using a deep learning-based pig behavior recognition model, the moment when predefined pig behaviors occur is detected from the video; Slicing the video according to the moments of predefined pig behaviors to obtain sliced videos; Identify the pig identification and behavior information of the breeding pigs in the sliced video; The attribute information and behavior information of each slice video are associated with the pig identification of the breeding pig.
6. A device for integrating data of measuring growth performance of breeding pigs, characterized in that: The device is used to implement the method for integrating the data of the growth performance measurement of the breeding pigs according to any one of claims 1 to 5, and comprises: Domain ontology construction module, used to construct the domain ontology of sow growth performance measurement based on the subject word dictionary of sow growth performance measurement; A data acquisition module is used to classify the measuring equipment according to the type, brand and model of the measuring equipment, identify the data format of each type of measuring equipment, and obtain the growth performance measurement data of breeding pigs from multiple measuring equipment in multiple pig farms; A processing module, used for collecting and processing the sow growth performance measurement data in different data formats by using different strategies based on the sow growth performance measurement domain ontology; The association module is used to associate the collected and processed structured data, text data, image data, and video slice data based on the pig identification of the breeding pigs, so as to obtain the multimodal data of all the breeding pigs; The fusion module is used to perform quality control on the growth performance measurement data of breeding pigs based on the multimodal data of breeding pigs, calculate the key indicator values of growth performance of each type of pig respectively, and associate the calculated key indicator values of growth performance with the pig identification to obtain multimodal fusion data of each type of pig.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for integrating the growth performance measurement data of the breeding pig as described in any one of claims 1 to 5 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for integrating breeding pig growth performance measurement data as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Boar growth performance measurement data quality control method, system, equipment and terminal
CN115168342A
Local breeding pig improvement system and method based on big data
CN117853258A