Method and system for dynamically optimizing pet feed ratio based on raw material sampling
Through artificial intelligence big data technology, real-time monitoring and layered sampling, nutrition models are established, and pet feed formulas are dynamically adjusted, which solves the problem of unstable feed nutrition distribution ratio, ensures that pets obtain balanced nutrition, and improves health level and production efficiency.
Patent Information
- Application Number
- CN202411265156.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The nutritional distribution ratio of pet feed is unstable, which causes pets to fail to obtain balanced nutrition, affecting health and growth.
Using the intelligent big data classification method based on artificial intelligence, we use real-time monitoring of raw material data, perform stratified sampling and detailed component analysis, establish original nutrition models, and dynamically adjust feed formulas to ensure the stability and balance of nutrients.
The stability and balance of nutritional components of each batch of feed are achieved, avoiding overnutrition or insufficient nutrition, improving pet health level, and quickly responding to changes in raw materials and pet needs, improving production efficiency.
Smart Images

Figure CN118779765B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sampling optimization, in particular to a method and system for dynamically optimizing pet feed ratios based on raw material sampling. Background Art
[0002] As the number of pets increases, pet health and nutritional needs are increasingly valued. The health and growth of pets are closely related to the nutrients they ingest, so the formulation design of pet feed has become a key area of research and development. In actual production, due to the diversity of raw materials and differences in sources, there are often significant differences in the nutritional components of feed, which will affect the scientificity and rationality of the feed ratio, which may result in pets not getting the balanced nutrition they need at different growth stages. Due to the instability of the nutritional components of the raw materials, it is difficult to accurately adjust the feed ratio, which may lead to insufficient or excessive amounts of certain nutrients, thus affecting the health and growth of pets. It is urgent to provide more accurate and stable support for the distribution ratio of each group of pet feed through advanced data analysis and optimization technology. Summary of the invention
[0003] (1) Technical issues to be resolved
[0004] The purpose of the present invention is to provide a method and system for dynamically optimizing the proportion of pet feed based on raw material sampling, so as to solve the problem of unstable proportion of nutritional components of pet feed.
[0005] (2) Technical solution
[0006] To achieve the above objectives, on the one hand, the present invention provides a method for intelligent classification of big data based on artificial intelligence, the method comprising:
[0007] S1. According to the real-time monitoring data of different batches of raw materials, the monitoring data is analyzed to obtain a raw material information set, and the raw material information set is input into the raw material quality classification model to calculate and obtain a standard sample batch;
[0008] S2, crushing and mixing the raw materials of the standard sample batch and performing averaging to obtain a first sample set, and performing stratified sampling on the first sample set according to the origin of the raw materials to obtain a second sample set, wherein the second sample set includes x hierarchical element sequences;
[0009] S3, obtaining a characterization element vector set through the hierarchical element sequence, performing data standardization processing on the characterization element vector set and obtaining a sample element set through component analysis;
[0010] S4, collecting basic information of the target pet according to the preset data collection frequency to build a target growth database, wherein the basic information of the target pet includes the target pet's age, weight data, and body temperature data, and performing feature classification processing on the target growth database and the preset growth indicators to obtain target feature indicators;
[0011] S5. Fitting the sample element set based on the preset essential nutrient requirement information to establish an original nutrition model, and constructing a component optimization strategy based on the target characteristic index and the original nutrition model.
[0012] Furthermore, the method of inputting the raw material information set into the raw material quality classification model to calculate and obtain the standard sample batch includes:
[0013] The raw material information set includes field information of batch information, particle size information, raw material type information, raw material flora information, and impurity content information. The index of each field in the raw material information set is obtained to obtain a first raw material scoring index sequence. , obtain the indicators related to the preset standard raw materials to obtain the second raw material scoring indicator sequence , the second raw material scoring index includes indexes of at least two fields in the raw material information set;
[0014] Determine a difference coefficient sequence of field indicators based on the first raw material scoring indicator sequence and the second raw material scoring indicator sequence; The calculation formula is:
[0015] ;
[0016] in, is the difference distance of the i-th indicator, is the variation function value of the ith indicator based on the difference distance, is the experimental variation function value of the field indicator, is the difference coefficient of the i-th field indicator, ;
[0017] The comprehensive score of each batch of samples is determined according to the difference coefficient of the field indicators. The larger the difference coefficient of the field indicators, the smaller the comprehensive score. The sample batch with the highest comprehensive score is selected as the standard sample batch.
[0018] Furthermore, the method for obtaining a characterization element vector set through the hierarchical element sequence includes:
[0019] The hierarchical element sequence is obtained by a vectorization algorithm to obtain a hierarchical vector set, and the vectorized features of each matching element in the preset matching element sequence are obtained. Based on the vectorized features, a regression vector model is used to perform vector feature fitting on the hierarchical vector set to obtain a fitting vector set, and the first d vectors of the fitting vector set are extracted to form a fitting feature matrix. ; The fitting feature matrix for:
[0020] ;
[0021] Among them, each row in the fitting feature matrix corresponds to a fitting feature vector, and each column corresponds to an element feature;
[0022] Calculate the fitting feature matrix The eigenvalues of the eigenvectors in are sorted from large to small, and the eigenvectors corresponding to the first k eigenvalues are selected to construct the principal component matrix. The hierarchical vector set is mapped to the eigenspace corresponding to the principal component matrix through the kernel method to obtain the characterization element vector set.
[0023] Furthermore, the method of obtaining a hierarchical vector set from the hierarchical element sequence through a vectorization algorithm includes:
[0024] The hierarchical elements in the hierarchical element sequence are feature encoded, and fine-grained feature extraction is performed on the feature-encoded hierarchical elements through fine-grained feature operators to obtain features of each hierarchical element, and the features of each hierarchical element are interacted and merged to obtain vectorized features covering preset dimensions, and the vectorized features covering preset dimensions are input into a convolution module to capture the hierarchical vectors of the hierarchical element sequence.
[0025] Furthermore, the method of constructing a component optimization strategy using the target characteristic index and the original nutrition model includes:
[0026] Obtain the target label based on the target feature index and then obtain the splitting rule; take the sample element set as the data set, normalize the data set and divide it into a test set and a training set according to a preset ratio; obtain the information gain of all features in the test set according to the information entropy calculation formula, select the feature with the largest information gain to construct a root node, and divide the test set based on the feature of the root node to obtain w subsets; for non-root nodes, calculate the information gain of the current subset, select the feature with the largest current information gain but lower than the preset threshold as the child node of the current parent node obtained by calculating the splitting rule, and continuously split the nodes downward to construct a decision tree model until the depth of the current decision tree model is greater than the preset depth threshold;
[0027] The training set is input into a decision tree model to obtain an optimized decision tree model through a Boosting algorithm, and a component optimization strategy is determined based on the optimized decision tree model.
[0028] Based on the same inventive concept, on the other hand, the present invention also provides a system for dynamically optimizing pet feed ratio based on raw material sampling, the system comprising: a sample determination module, a hierarchical classification module, an element extraction module, a target information extraction module, and an optimization strategy module, and each module is sequentially connected in communication;
[0029] A sample determination module is used to analyze the real-time monitoring data of different batches of raw materials to obtain a raw material information set, and input the raw material information set into a raw material quality classification model to calculate and obtain a standard sample batch;
[0030] A hierarchical classification module is used to crush and mix the raw materials of the standard sample batch and obtain a first sample set through averaging, and to perform stratified sampling on the first sample set according to the origin of the raw materials to obtain a second sample set, wherein the second sample set includes x hierarchical element sequences;
[0031] An element extraction module, used to obtain a characterization element vector set through the hierarchical element sequence, perform data standardization processing on the characterization element vector set, and obtain a sample element set through component analysis;
[0032] A target information extraction module collects basic information of a target pet according to a preset data collection frequency to build a target growth database, wherein the basic information of the target pet includes the target pet's age, weight data, and body temperature data, and performs feature classification processing on the target growth database and preset growth indicators to obtain target feature indicators;
[0033] The optimization strategy module is used to fit the sample element set based on the preset essential nutritional component requirement information to establish an original nutritional model, and to construct a component optimization strategy based on the target characteristic index and the original nutritional model.
[0034] Furthermore, the sample determination module includes:
[0035] An index determination module is used for obtaining the index of each field in the raw material information set including batch information, particle size information, raw material type information, raw material flora information, and impurity content information to obtain the first raw material scoring index sequence. , obtain the indicators related to the preset standard raw materials to obtain the second raw material scoring indicator sequence , the second raw material scoring index includes indexes of at least two fields in the raw material information set;
[0036] The difference calculation module is used to determine the difference coefficient sequence of the field index based on the first raw material scoring index sequence and the second raw material scoring index sequence; the difference coefficient sequence The calculation formula is:
[0037] ;
[0038] in, is the difference distance of the i-th indicator, is the variation function value of the ith indicator based on the difference distance, is the experimental variation function value of the field indicator, is the difference coefficient of the i-th field indicator, ;
[0039] The comprehensive scoring module is used to determine the comprehensive score of each batch of samples according to the difference coefficient of the field indicators. The larger the difference coefficient of the field indicators, the smaller the comprehensive score. The sample batch with the highest comprehensive score is selected as the standard sample batch.
[0040] Furthermore, the element extraction module includes:
[0041] A matrix construction module is used to obtain a hierarchical vector set by a vectorization algorithm for the hierarchical element sequence, obtain the vectorized features of each matching element in the preset matching element sequence, perform vector feature fitting on the hierarchical vector set using a regression vector model based on the vectorized features to obtain a fitting vector set, and extract the first d vectors of the fitting vector set to form a fitting feature matrix ; The fitting feature matrix for:
[0042] ;
[0043] Among them, each row in the fitting feature matrix corresponds to a fitting feature vector, and each column corresponds to an element feature;
[0044] Element characterization module, calculates the fitting feature matrix The eigenvalues of the eigenvectors in are sorted from large to small, and the eigenvectors corresponding to the first k eigenvalues are selected to construct the principal component matrix. The hierarchical vector set is mapped to the eigenspace corresponding to the principal component matrix through the kernel method to obtain the characterization element vector set.
[0045] Furthermore, the system further comprises:
[0046] A vector acquisition module is used to perform feature encoding on the hierarchical elements in the hierarchical element sequence, and perform fine-grained feature extraction on the feature-encoded hierarchical elements through fine-grained feature operators to obtain features of each hierarchical element, and obtain vectorized features covering preset dimensions by feature interaction and feature merging of the features of each hierarchical element, and input the vectorized features covering the preset dimensions into a convolution module to capture the hierarchical vectors of the hierarchical element sequence.
[0047] Furthermore, the optimization strategy module includes:
[0048] A decision tree construction module is used to obtain a target label based on a target feature index and then obtain a splitting rule; the sample element set is used as a data set, the data set is normalized and divided into a test set and a training set according to a preset ratio; the information gain of all features in the test set is obtained according to an information entropy calculation formula, the feature with the largest information gain is selected to construct a root node, and the test set is segmented based on the feature of the root node to obtain w subsets; for non-root nodes, the information gain of the current subset is calculated, and the feature with the largest current information gain but lower than a preset threshold is selected as the child node of the current parent node obtained by calculating the splitting rule, and the node is continuously split downward to construct a decision tree model until the depth of the current decision tree model is greater than the preset depth threshold;
[0049] The decision tree optimization module is used to input the training set into the decision tree model to obtain an optimized decision tree model through the Boosting algorithm, and determine the component optimization strategy based on the optimized decision tree model.
[0050] (3) Beneficial effects
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] 1. Through stratified sampling of raw materials and detailed nutrient analysis, the proportion of each batch of feed is monitored and adjusted in real time. This precise control ensures that the nutritional content of each batch of products is more stable and balanced, helping to avoid over- or under-nutrition, thereby improving the overall health of pets.
[0053] 2. Based on the real-time collected raw material data and the nutritional needs of pets, the feed formula is dynamically adjusted to quickly respond to fluctuations in raw material quality and changes in individual pet needs, thereby ensuring the effectiveness and pertinence of the feed.
[0054] 3. Dynamically adjust and optimize the formula to reduce the adjustment time of the production line, accelerate the transformation process from raw materials to finished products, and improve overall production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1This is a flowchart of a method for dynamically optimizing pet feed ratio based on raw material sampling according to Embodiment 1 of the present invention;
[0056] Figure 2 This is a schematic diagram of the module composition of a system for dynamically optimizing pet feed ratios based on raw material sampling according to Example 2 of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0058] Before giving examples, it is necessary to explain the application scenarios of the present invention: the method and system can solve the problem of product optimization and classification in supply chain management.
[0059] Example 1: Figure 1 As shown, this embodiment provides a method for dynamically optimizing pet feed ratio based on raw material sampling, the method comprising:
[0060] S1. According to the real-time monitoring data of different batches of raw materials, the monitoring data is analyzed to obtain a raw material information set, and the raw material information set is input into a raw material quality classification model to calculate and obtain a standard sample batch.
[0061] S2. The raw materials of the standard sample batch are crushed, stirred and averaged to obtain a first sample set. The first sample set is stratified sampled according to the origin of the raw materials to obtain a second sample set, and the second sample set includes x hierarchical element sequences.
[0062] S3. Obtain a characterization element vector set through the hierarchical element sequence, perform data standardization on the characterization element vector set, and obtain a sample element set through component analysis.
[0063] S4. Collect basic information of the target pet according to a preset data collection frequency to build a target growth database, wherein the target pet basic information includes the target pet's age, weight data, and body temperature data, and perform feature classification processing on the target growth database and preset growth indicators to obtain target feature indicators.
[0064] S5. Fitting the sample element set based on the preset essential nutrient requirement information to establish an original nutrition model, and constructing a component optimization strategy based on the target characteristic index and the original nutrition model.
[0065] The raw materials of the standard sample batch are crushed and stirred to ensure uniformity and then processed by averaging to obtain a first sample set, which contains the raw material samples after uniform processing.
[0066] The first sample set is stratified and sampled according to the origin of the raw materials to obtain the second sample set. The second sample set includes x hierarchical element sequences, each sequence representing sample characteristics at different levels.
[0067] By analyzing the hierarchical element sequence in the second sample set, a set of characterizing element vectors is obtained, each of which describes the characteristics of the sample and includes the composition of the raw materials.
[0068] The method of inputting the raw material information set into the raw material quality classification model to calculate and obtain the standard sample batch comprises:
[0069] The raw material information set includes field information of batch information, particle size information, raw material type information, raw material flora information, and impurity content information. The index of each field in the raw material information set is obtained to obtain a first raw material scoring index sequence. , obtain the indicators related to the preset standard raw materials to obtain the second raw material scoring indicator sequence The second raw material scoring index includes indicators of at least two fields in the raw material information set.
[0070] Determine the difference coefficient sequence of field indicators based on the first raw material scoring indicator sequence and the second raw material scoring indicator sequence. The calculation formula is:
[0071] .
[0072] in, is the difference distance of the i-th indicator, is the variation function value of the ith indicator based on the difference distance, is the experimental variation function value of the field indicator, is the difference coefficient of the i-th field indicator, .
[0073] The comprehensive score of each batch of samples is determined according to the difference coefficient of the field indicators. The larger the difference coefficient of the field indicators, the smaller the comprehensive score. The sample batch with the highest comprehensive score is selected as the standard sample batch.
[0074] The method for obtaining a characterization element vector set through the hierarchical element sequence comprises:
[0075] The hierarchical element sequence is obtained by a vectorization algorithm to obtain a hierarchical vector set, and the vectorized features of each matching element in the preset matching element sequence are obtained. Based on the vectorized features, a regression vector model is used to perform vector feature fitting on the hierarchical vector set to obtain a fitting vector set, and the first d vectors of the fitting vector set are extracted to form a fitting feature matrix. The fitting feature matrix for:
[0076] .
[0077] Among them, each row in the fitting feature matrix corresponds to a fitting feature vector, and each column corresponds to an element feature.
[0078] Calculate the fitting feature matrix The eigenvalues of the eigenvectors in the fitting matrix are sorted from large to small, and the eigenvectors corresponding to the first k eigenvalues are selected to construct the principal component matrix, and the hierarchical vector set is mapped to the eigenspace corresponding to the principal component matrix by the kernel method to obtain the characterization element vector set. By calculating the eigenvalues of the eigenvectors in the fitting matrix, the eigenvectors corresponding to the first k eigenvalues are selected from large to small to construct the principal component matrix. The eigenvectors define a specific direction in the data space and represent the trend of data distribution. The eigenvalues represent the variance of the data along the direction of the eigenvector. The larger the eigenvalue, the larger the variance in this direction. Therefore, the greater the change of the data in this direction and the more information, the eigenvectors corresponding to the first k eigenvalues correspond to the information of the main fitting eigenvector data in the fitting matrix. Therefore, the principal component matrix is a dimensionality reduction matrix containing the main features and data information of the fitting matrix; the kernel method is a method of using a kernel function to calculate the inner product of the vectors in the hierarchical vector set and then mapping the vectors to the feature space.
[0079] The method for obtaining a hierarchical vector set by using a vectorization algorithm for the hierarchical element sequence includes:
[0080] The hierarchical elements in the hierarchical element sequence are feature encoded, and fine-grained feature extraction is performed on the feature-encoded hierarchical elements through fine-grained feature operators to obtain features of each hierarchical element, and the features of each hierarchical element are interacted and merged to obtain vectorized features covering preset dimensions, and the vectorized features covering preset dimensions are input into a convolution module to capture the hierarchical vectors of the hierarchical element sequence.
[0081] Each hierarchical element in the hierarchical element sequence is feature encoded, and then these codes are deeply extracted using fine-grained feature operators to obtain detailed features of each hierarchical element. These features are combined through feature interaction technology to form vectorized features covering preset dimensions. These vectorized features are input into the convolution module to capture and analyze the hierarchical vectors in the hierarchical element sequence, so as to better understand and process the complex structure and hierarchical relationship of the sequence.
[0082] The purpose of feature encoding for each hierarchical element in the hierarchical element sequence is to convert the original data into a standardized format that can be processed by the machine learning model, which helps to extract the key features in the hierarchical elements and simplify the data into numerical form for more efficient processing and analysis by the model. At the same time, it improves data quality and supports more complex feature interactions, thereby improving the accuracy and performance of the model.
[0083] The method of constructing a component optimization strategy using the target characteristic index and the original nutrition model comprises:
[0084] Based on the target feature index, the target label is obtained and then the splitting rule is obtained. The sample element set is used as a data set, the data set is normalized and divided into a test set and a training set according to a preset ratio. The information gain of all features in the test set is obtained according to the information entropy calculation formula, the feature with the largest information gain is selected to construct a root node, and the test set is segmented based on the feature of the root node to obtain w subsets. For non-root nodes, the information gain of the current subset is calculated, and the feature with the largest current information gain but lower than the preset threshold is selected as the child node of the current parent node obtained after calculation by the splitting rule, and the node is continuously split downward to construct a decision tree model until the depth of the current decision tree model is greater than the preset depth threshold.
[0085] The training set is input into a decision tree model to obtain an optimized decision tree model through a Boosting algorithm, and a component optimization strategy is determined based on the optimized decision tree model.
[0086] The method and system for dynamically optimizing the proportion of pet feed based on raw material sampling adjusts the proportion of protein, carbohydrates and fat in pet feed by establishing a decision tree to adapt to the nutritional needs of pets at different ages. The advantage of this method is that the decision tree can automatically analyze and learn the nutritional demand patterns extracted from historical data, so as to accurately predict and adjust the feed ingredients to meet the specific needs of pets. The decision tree dynamically optimizes the proportion of each component by splitting at each node according to input features (such as the age and weight of the pet), ensuring that the nutritional content of the feed can be adjusted at any time according to actual conditions, thereby improving the personalization and nutritional balance of the product.
[0087] Embodiment 2: Based on the same inventive concept, Figure 2As shown, this embodiment also provides a system for dynamically optimizing pet feed ratios based on raw material sampling, the system comprising: a sample determination module, a hierarchical classification module, an element extraction module, a target information extraction module, and an optimization strategy module, and each module is sequentially communicated with each other.
[0088] The sample determination module is used to analyze the real-time monitoring data of different batches of raw materials to obtain a raw material information set, and input the raw material information set into the raw material quality classification model to calculate and obtain a standard sample batch.
[0089] The hierarchical classification module is used to crush, mix and average the raw materials of the standard sample batch to obtain a first sample set, and stratify the first sample set according to the origin of the raw materials to obtain a second sample set, wherein the second sample set includes x hierarchical element sequences.
[0090] The element extraction module is used to obtain a characterization element vector set through the hierarchical element sequence, perform data standardization processing on the characterization element vector set, and obtain a sample element set through component analysis.
[0091] The target information extraction module collects the basic information of the target pet according to the preset data collection frequency to build a target growth database. The target pet basic information includes the target pet's age, weight data, and body temperature data. The target growth database and the preset growth indicators are respectively subjected to feature classification processing to obtain target feature indicators.
[0092] The optimization strategy module is used to fit the sample element set based on the preset essential nutritional component requirement information to establish an original nutritional model, and to construct a component optimization strategy based on the target characteristic index and the original nutritional model.
[0093] The sample determination module also includes:
[0094] An index determination module is used for obtaining the index of each field in the raw material information set including batch information, particle size information, raw material type information, raw material flora information, and impurity content information to obtain the first raw material scoring index sequence. , obtain the indicators related to the preset standard raw materials to obtain the second raw material scoring indicator sequence The second raw material scoring index includes indicators of at least two fields in the raw material information set.
[0095] The difference calculation module is used to determine the difference coefficient sequence of the field index based on the first raw material scoring index sequence and the second raw material scoring index sequence. The calculation formula is:
[0096] .
[0097] in, is the difference distance of the i-th indicator, is the variation function value of the i-th indicator based on the difference distance, is the experimental variation function value of the field indicator, is the difference coefficient of the i-th field indicator, .
[0098] The comprehensive scoring module is used to determine the comprehensive score of each batch of samples according to the difference coefficient of the field indicators. The larger the difference coefficient of the field indicators, the smaller the comprehensive score. The sample batch with the highest comprehensive score is selected as the standard sample batch.
[0099] The element extraction module also includes:
[0100] A matrix construction module is used to obtain a hierarchical vector set by a vectorization algorithm for the hierarchical element sequence, obtain the vectorized features of each matching element in the preset matching element sequence, perform vector feature fitting on the hierarchical vector set using a regression vector model based on the vectorized features to obtain a fitting vector set, and extract the first d vectors of the fitting vector set to form a fitting feature matrix The fitting feature matrix for:
[0101] .
[0102] Among them, each row in the fitting feature matrix corresponds to a fitting feature vector, and each column corresponds to an element feature.
[0103] Element characterization module, calculates the fitting feature matrix The eigenvalues of the eigenvectors in are sorted from large to small, and the eigenvectors corresponding to the first k eigenvalues are selected to construct the principal component matrix. The hierarchical vector set is mapped to the eigenspace corresponding to the principal component matrix through the kernel method to obtain the characterization element vector set.
[0104] The matrix building module also includes:
[0105] A vector acquisition module is used to perform feature encoding on the hierarchical elements in the hierarchical element sequence, and perform fine-grained feature extraction on the feature-encoded hierarchical elements through fine-grained feature operators to obtain features of each hierarchical element, and obtain vectorized features covering preset dimensions by feature interaction and feature merging of the features of each hierarchical element, and input the vectorized features covering the preset dimensions into a convolution module to capture the hierarchical vectors of the hierarchical element sequence.
[0106] The optimization strategy module also includes:
[0107] A decision tree construction module is used to obtain a target label based on a target feature index and then obtain a splitting rule. The sample element set is used as a data set, and the data set is normalized and divided into a test set and a training set according to a preset ratio. The information gain of all features in the test set is obtained according to the information entropy calculation formula, and the feature with the largest information gain is selected to construct a root node. The test set is segmented based on the feature of the root node to obtain w subsets. For non-root nodes, the information gain of the current subset is calculated, and the feature with the largest current information gain but lower than the preset threshold is selected as the child node of the current parent node obtained after calculation by the splitting rule. The nodes are continuously split downward to construct a decision tree model until the depth of the current decision tree model is greater than the preset depth threshold.
[0108] The decision tree optimization module is used to input the training set into the decision tree model to obtain an optimized decision tree model through the Boosting algorithm, and determine the component optimization strategy based on the optimized decision tree model.
[0109] It should be noted that, regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0110] The present invention is described by specific embodiments, and it should be understood by those skilled in the art that various changes and equivalent substitutions may be made to the present invention without departing from the scope of the present invention. In addition, various modifications may be made to the present invention for specific situations or materials without departing from the scope of the present invention. Therefore, the present invention is not limited to the disclosed specific embodiments, but should include all implementation methods falling within the scope of the claims of the present invention.
Claims
1. A method for dynamically optimizing pet feed ratio based on raw material sampling, characterized in that: The method comprises: S1. According to the real-time monitoring data of different batches of raw materials, the monitoring data is analyzed to obtain a raw material information set, and the raw material information set is input into the raw material quality classification model to calculate and obtain a standard sample batch; The method of inputting the raw material information set into the raw material quality classification model to calculate and obtain the standard sample batch comprises: The raw material information set includes field information of batch information, particle size information, raw material type information, raw material flora information, and impurity content information. The index of each field in the raw material information set is obtained to obtain a first raw material scoring index sequence. , obtain the indicators related to the preset standard raw materials to obtain the second raw material scoring indicator sequence , the second raw material scoring index includes indexes of at least two fields in the raw material information set; Determine a difference coefficient sequence of field indicators based on the first raw material scoring indicator sequence and the second raw material scoring indicator sequence; The calculation formula is: ; in, For the The difference distance of the indicators, For the The index is based on the variance function value of the difference distance. is the experimental variation function value of the field indicator, For the The difference coefficient of the field index is ; The comprehensive score of each batch of samples is determined according to the difference coefficient of the field index. The larger the difference coefficient of the field index, the smaller the comprehensive score. The sample batch with the highest comprehensive score is selected as the standard sample batch; S2. The raw materials of the standard sample batch are crushed, stirred and averaged to obtain a first sample set. The first sample set is stratified and sampled according to the origin of the raw materials to obtain a second sample set. The second sample set includes A sequence of hierarchical elements; S3, obtaining a characterization element vector set through the hierarchical element sequence, performing data standardization processing on the characterization element vector set and obtaining a sample element set through component analysis; The method for obtaining a characterization element vector set through the hierarchical element sequence includes: The hierarchical element sequence is obtained by a vectorization algorithm to obtain a hierarchical vector set, the vectorization features of each matching element in the preset matching element sequence are obtained, the vector feature fitting of the hierarchical vector set is performed using a regression vector model based on the vectorization features to obtain a fitting vector set, and the pre- The vectors form the fitting feature matrix ; The fitting feature matrix for: ; Among them, each row in the fitting feature matrix corresponds to a fitting feature vector, and each column corresponds to an element feature; Calculate the fitting feature matrix The eigenvalues of the eigenvectors in are sorted from large to small, and the eigenvectors corresponding to the first k eigenvalues are selected to construct the principal component matrix. The hierarchical vector set is mapped to the eigenspace corresponding to the principal component matrix by the kernel method to obtain the characterization element vector set; The method for obtaining a hierarchical vector set by using a vectorization algorithm for the hierarchical element sequence includes: Feature encoding is performed on the hierarchical elements in the hierarchical element sequence, and fine-grained feature extraction is performed on the feature-encoded hierarchical elements through fine-grained feature operators to obtain features of each hierarchical element, and the features of each hierarchical element are interacted and feature merged to obtain vectorized features covering preset dimensions, and the vectorized features covering preset dimensions are input into a convolution module to capture the hierarchical vectors of the hierarchical element sequence; S4, collecting basic information of the target pet according to the preset data collection frequency to build a target growth database, wherein the basic information of the target pet includes the target pet's age, weight data, and body temperature data, and performing feature classification processing on the target growth database and the preset growth indicators to obtain target feature indicators; S5, establishing an original nutrition model based on the preset essential nutrient requirement information fitting sample element set, and constructing a component optimization strategy with the target characteristic index and the original nutrition model; Obtain the target label based on the target feature index and then obtain the splitting rule; take the sample element set as the data set, normalize the data set and divide it into a test set and a training set according to a preset ratio; obtain the information gain of all features in the test set according to the information entropy calculation formula, select the feature with the largest information gain to construct a root node, and divide the test set based on the feature of the root node to obtain w subsets; for non-root nodes, calculate the information gain of the current subset, select the feature with the largest current information gain but lower than the preset threshold as the child node of the current parent node obtained by calculating the splitting rule, and continuously split the nodes downward to construct a decision tree model until the depth of the current decision tree model is greater than the preset depth threshold; Inputting the training set into a decision tree model to obtain an optimized decision tree model through a Boosting algorithm, and determining a component optimization strategy based on the optimized decision tree model; Determining the component optimization strategy based on the optimized decision tree model includes: adjusting the ratio of protein, carbohydrate and fat in the pet feed based on the optimized decision tree model.
2. A system for dynamically optimizing pet feed ratios based on raw material sampling, characterized in that: The system includes: a sample determination module, a hierarchical classification module, an element extraction module, a target information extraction module, and an optimization strategy module, and each module is sequentially connected in communication; A sample determination module is used to analyze the real-time monitoring data of different batches of raw materials to obtain a raw material information set, and input the raw material information set into a raw material quality classification model to calculate and obtain a standard sample batch; The sample determination module comprises: An index determination module is used for obtaining the index of each field in the raw material information set including batch information, particle size information, raw material type information, raw material flora information, and impurity content information to obtain the first raw material scoring index sequence. , obtain the indicators related to the preset standard raw materials to obtain the second raw material scoring indicator sequence , the second raw material scoring index includes indexes of at least two fields in the raw material information set; The difference calculation module is used to determine the difference coefficient sequence of the field index based on the first raw material scoring index sequence and the second raw material scoring index sequence; the difference coefficient sequence The calculation formula is: ; in, is the difference distance of the i-th indicator, is the variation function value of the i-th indicator based on the difference distance, is the experimental variation function value of the field indicator, is the difference coefficient of the i-th field indicator, ; Comprehensive scoring module, used to determine the comprehensive score of each batch of samples according to the difference coefficient of field indicators. The larger the difference coefficient of field indicators, the smaller the comprehensive score. The sample batch with the highest comprehensive score is selected as the standard sample batch; A hierarchical classification module is used to crush and mix the raw materials of the standard sample batch and obtain a first sample set through averaging, and to perform stratified sampling on the first sample set according to the origin of the raw materials to obtain a second sample set, wherein the second sample set includes x hierarchical element sequences; An element extraction module, used to obtain a characterization element vector set through the hierarchical element sequence, perform data standardization processing on the characterization element vector set, and obtain a sample element set through component analysis; The element extraction module comprises: A matrix construction module is used to obtain a hierarchical vector set by a vectorization algorithm for the hierarchical element sequence, obtain the vectorized features of each matching element in the preset matching element sequence, perform vector feature fitting on the hierarchical vector set using a regression vector model based on the vectorized features to obtain a fitting vector set, and extract the first d vectors of the fitting vector set to form a fitting feature matrix ; The fitting feature matrix for: ; Among them, each row in the fitting feature matrix corresponds to a fitting feature vector, and each column corresponds to an element feature; Element characterization module, calculates the fitting feature matrix The eigenvalues of the eigenvectors in are sorted from large to small, and the eigenvectors corresponding to the first k eigenvalues are selected to construct the principal component matrix. The hierarchical vector set is mapped to the eigenspace corresponding to the principal component matrix by the kernel method to obtain the characterization element vector set; The system further includes: a vector acquisition module, which is used to perform feature encoding on the hierarchical elements in the hierarchical element sequence, and to perform fine-grained feature extraction on the feature-encoded hierarchical elements through fine-grained feature operators to obtain features of each hierarchical element, and to obtain vectorized features covering preset dimensions by performing feature interaction and feature merging on the features of each hierarchical element, and to input the vectorized features covering the preset dimensions into a convolution module to capture the hierarchical vectors of the hierarchical element sequence; A target information extraction module collects basic information of a target pet according to a preset data collection frequency to build a target growth database, wherein the basic information of the target pet includes the target pet's age, weight data, and body temperature data, and performs feature classification processing on the target growth database and preset growth indicators to obtain target feature indicators; An optimization strategy module is used to fit the sample element set based on the preset essential nutritional component requirement information to establish an original nutritional model, and to construct a component optimization strategy based on the target characteristic index and the original nutritional model; The optimization strategy module includes: A decision tree construction module is used to obtain a target label based on a target feature index and then obtain a splitting rule; the sample element set is used as a data set, the data set is normalized and divided into a test set and a training set according to a preset ratio; the information gain of all features in the test set is obtained according to an information entropy calculation formula, the feature with the largest information gain is selected to construct a root node, and the test set is segmented based on the feature of the root node to obtain w subsets; for non-root nodes, the information gain of the current subset is calculated, and the feature with the largest current information gain but lower than a preset threshold is selected as the child node of the current parent node obtained by calculating the splitting rule, and the node is continuously split downward to construct a decision tree model until the depth of the current decision tree model is greater than the preset depth threshold; A decision tree optimization module, used for inputting the training set into a decision tree model to obtain an optimized decision tree model through a Boosting algorithm, and determining a component optimization strategy based on the optimized decision tree model; Determining the component optimization strategy based on the optimized decision tree model includes: adjusting the ratio of protein, carbohydrate and fat in the pet feed based on the optimized decision tree model.
Citation Information
Patent Citations
Marine nutritional ingredient biosynthetic pathway mining method, device, equipment and medium
CN116072227A
Healthy diet information automatic acquisition device
CN206805539U
Intelligent semantic matching method and apparatus based on deep hierarchical coding
WO2021164200A1
