Method and device for determining feed formula, electronic equipment and storage medium

By combining linear and genetic algorithms, feed formulations that meet the target constraints are generated, solving the problem of poor reliability in feed formulation optimization under large-scale farming and complex nutritional structures in existing technologies, and achieving more reliable and economical feed formulation optimization.

CN114239933BActive Publication Date: 2026-06-23SICHUAN NEW HOPE ANIMAL NUTRITION TECH CO LTD +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SICHUAN NEW HOPE ANIMAL NUTRITION TECH CO LTD
Filing Date
2021-12-02
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing feed formulation software cannot calculate the optimal feed formulation that satisfies all constraints when dealing with large-scale farming and complex nutrient structures, resulting in poor reliability of optimization methods and preventing their widespread application.

Method used

By combining a pre-defined linear algorithm and a genetic algorithm, and through iterative methods using the simplex method, interior point method, and genetic algorithm, a feed formulation that meets the target constraints is generated, thus avoiding the linear algorithm from getting trapped in local optima and optimizing the feed formulation.

Benefits of technology

This improves the reliability and economic benefits of feed formulation optimization results, ensuring the generation of optimal feed formulations under large-scale farming and complex nutritional structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114239933B_ABST
    Figure CN114239933B_ABST
Patent Text Reader

Abstract

The application discloses a feed formula determination method and device, electronic equipment and storage medium. According to a plurality of feed information and animal growth required nutrient structure information, a target constraint condition is determined, and a preset first linear algorithm and a second linear algorithm are used to generate first feed formula information and second feed formula information that satisfy the target constraint condition according to the feed information, so as to preliminarily obtain the feed formula through the linear algorithm. And the preset genetic algorithm is used to combine and iterate the first feed formula information and the second feed formula information until the preset iteration termination condition, and third feed formula information is obtained, so that the genetic algorithm is used to effectively avoid the situation that the linear algorithm falls into a local optimal solution and cannot obtain a global optimal solution, the nonlinear space solution of linear programming processing is made up, and the reliability of the feed formula optimization result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of animal husbandry, and in particular to a method, apparatus, electronic device and storage medium for determining feed formulation. Background Technology

[0002] Scientific animal husbandry refers to the process of raising animals by following breeding experience and objective laws, and rationally and effectively adjusting feed formulas according to the growth and reproduction characteristics of animals at different weight stages to meet the requirements for fattening and promoting growth. Due to the environmental characteristics of different regions, the experience and technical specifications referenced in the feeding process may be adjusted, and feed formulas must also be improved and optimized based on the actual environmental characteristics. To improve the economic benefits of animal husbandry on farms, low-cost feed formulas should be selected while meeting the nutritional needs of animal growth.

[0003] Currently, feed formulation software such as Bestmix and Brill exists in the feed industry. However, the feed ratio models used by existing feed formulation software can only handle feed ratios for small-scale farming and simple nutritional structures. For large-scale farming with complex nutritional structures and numerous constraints, as well as some special constraints, current feed ratio models are unable to calculate the optimal feed formulation that satisfies all constraints. This results in poor reliability of current feed formulation optimization methods and prevents their widespread application. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and storage medium for determining feed formulations, in order to solve the technical problem of poor reliability in current feed formulation optimization methods.

[0005] To address the aforementioned technical problems, embodiments of this application provide a method for determining feed formulations, comprising:

[0006] Based on various feed information and nutritional structure information required for animal growth, target constraints are determined, including feed nutrition constraints and feed cost constraints.

[0007] Using a preset first linear algorithm, first feed formulation information that satisfies the target constraints is generated based on feed information;

[0008] Using a pre-defined second linear algorithm, second feed formulation information is generated based on feed information to meet the target constraints.

[0009] Using a preset genetic algorithm, the first feed formula information and the second feed formula information are combined and iterated until the preset iteration termination condition is met, so as to obtain the third feed formula information.

[0010] This embodiment determines target constraints based on various feed information and the nutritional structure information required for animal growth. It then uses a preset first linear algorithm and a second linear algorithm to generate first and second feed formulation information that satisfy the target constraints, respectively, based on the feed information. This allows for the initial obtaining of the feed formulation through linear algorithms. Finally, a preset genetic algorithm is used to iteratively combine the first and second feed formulation information until a preset iteration termination condition is met, resulting in third feed formulation information. This approach effectively avoids the situation where linear algorithms get trapped in local optima, preventing the attainment of a global optimum. It compensates for the nonlinearity of the solution space in linear programming, thereby improving the reliability of the feed formulation optimization results.

[0011] In one embodiment, the first linear algorithm is the simplex method. Using a preset first linear algorithm, based on feed information, first feed formulation information that satisfies the target constraints is generated, including:

[0012] Using the simplex method, based on feed information, the fourth feed formulation information that satisfies the feed nutritional constraints is determined. The fourth feed formulation is the feasibility basis of the simplex method.

[0013] Based on feasible basis, a non-basicization operation is performed on feed cost constraints to obtain a simplex matrix;

[0014] If the test number of the simplex matrix is ​​not non-negative, then the basic and non-basic variables of the feasible basis are replaced, and the feed cost constraint is debased until the test number of the simplex matrix is ​​non-negative, thus obtaining the optimal solution, which is the first feed formulation information.

[0015] This embodiment uses the simplex method to determine the first feed formulation information, thereby transforming the linear programming problem into a standard form and reducing the probability that the linear programming problem cannot handle solutions in nonlinear spaces.

[0016] In one embodiment, a preset second linear algorithm is used to generate second feed formulation information that satisfies the target constraints based on feed information, including:

[0017] Using the preset interior point method, the feed nutrition constraints are iterated based on feed information to obtain the iteration results;

[0018] Based on the iteration results, the parameters of the feed cost constraint are updated until the preset utility function reaches the preset convergence condition, thus obtaining the second feed formulation information.

[0019] This embodiment uses the interior point method and introduces a utility function to determine the second feed formulation information, thereby transforming the constrained optimization problem into an unconstrained problem and improving the computational efficiency of the second feed formulation information determination process.

[0020] In one embodiment, feed nutrient constraints include nutrient content constraints, nutrient conversion rate constraints, and feed dosage constraints; based on various feed information and the nutrient structure information required for animal growth, target constraints are determined, including:

[0021] Based on the content of each nutrient index in the feed information and the total content of each nutrient index in the nutrient structure information, the nutrient index content constraints between each feed and the nutrient structure are determined.

[0022] Based on the nutrient content of each feed in the feed information and the preset nutrient conversion coefficient and nutrient constraint value, the nutrient conversion rate constraint conditions of each feed are determined.

[0023] Based on the feed types in the feed information, determine the feed usage constraints;

[0024] Based on the feed types and unit prices of each feed in the feed information, determine the feed cost constraints.

[0025] This embodiment establishes constraints by establishing the relationship between feed information and nutritional structure information, ensuring that the feed formula meets the nutritional needs of animals while reducing feed costs and improving economic efficiency.

[0026] In one embodiment, before determining the target constraints based on feed information and nutrient structure information, the method further includes:

[0027] Based on a pre-defined feed nutrition matrix, the nutrient content of each feed item in the feed information is determined. The feed nutrition matrix is ​​as follows:

[0028]

[0029] Q ij Let a be a feed nutrient matrix relating feed type i to nutrient index j. ij denoted as the percentage of the j-th nutrient index contained in the i-th type of feed.

[0030] This embodiment constructs a matrix relating feed to nutritional indicators, enabling the rapid acquisition of feed nutritional indicator values ​​when determining feed formulations, thereby improving computational efficiency.

[0031] In one embodiment, a preset genetic algorithm is used to iteratively combine the first feed formulation information and the second feed formulation information until a preset iteration termination condition is met, to obtain the third feed formulation information, including:

[0032] The first feed formulation information and the second feed formulation information are used as chromosomes for the genetic population;

[0033] Genetic algorithms are used to iterate the evolution of the genetic population.

[0034] Calculate the target fitness of all chromosomes in the genetic population during evolutionary iteration, based on feed cost constraints.

[0035] When the number of evolutionary iterations reaches the preset number of evolutionary iterations, the iteration stops, and the feed formula information corresponding to the chromosome with the lowest target fitness is used as the third feed formula information.

[0036] This embodiment calculates the target fitness by using feed cost constraints and sets a preset number of evolutionary iterations, thereby improving the iteration speed of the genetic algorithm.

[0037] In one embodiment, a genetic algorithm is used to perform evolutionary iterations on the genetic population, including:

[0038] Based on feed cost constraints, determine the overall fitness of the genetic population and the individual fitness of each chromosome within the genetic population;

[0039] The relative fitness of each chromosome is determined based on the total fitness and individual fitness.

[0040] New chromosomes are generated based on relative fitness;

[0041] Crossover is performed on all chromosomes in a genetic population to generate offspring chromosomes;

[0042] The offspring chromosomes are mutated to obtain mutated chromosomes.

[0043] This embodiment determines new chromosomes through fitness to improve the selection operation of the genetic algorithm, enabling the genetic algorithm to be applied to the optimization of feed formulation. By combining crossover and mutation operations, the possibility of feed formulation is increased, which is conducive to optimizing the final feed formulation.

[0044] Secondly, embodiments of this application provide a feed formulation determination apparatus, comprising:

[0045] The determination module is used to determine target constraints based on various feed information and the nutritional structure information required for animal growth. The target constraints include feed nutrition constraints and feed cost constraints.

[0046] The first generation module is used to generate first feed formula information that satisfies the target constraints based on feed information using a preset first linear algorithm.

[0047] The second generation module is used to generate second feed formula information that meets the target constraints based on the feed information using a preset second linear algorithm.

[0048] The iterative module is used to combine and iterate the first feed formula information and the second feed formula information using a preset genetic algorithm until a preset iteration termination condition is met, so as to obtain the third feed formula information.

[0049] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor. The memory stores a computer program, and the processor runs the computer program to enable the electronic device to perform the feed formulation determination method as described in the first aspect.

[0050] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for determining a feed formulation as described in the first aspect.

[0051] It should be noted that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0052] Figure 1 A schematic flowchart illustrating the method for determining feed formulations provided in this application embodiment;

[0053] Figure 2 A schematic diagram of the structure of the feed formulation determination device provided in the embodiments of this application;

[0054] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0056] As documented in the background section, current feed formulation models are unable to calculate the optimal feed formula that satisfies all constraints due to the large scale of aquaculture, complex nutritional structure, and some special constraints. This results in poor reliability of current feed formulation optimization methods, preventing their widespread application.

[0057] To address this, this application provides a method, apparatus, computer device, and storage medium for determining feed formulations. Based on various feed information and nutritional structure information required for animal growth, target constraints are determined. A first linear algorithm and a second linear algorithm are used to generate first and second feed formulation information that satisfy the target constraints, respectively, based on the feed information, to initially obtain the feed formulation through linear algorithms. A preset genetic algorithm is then used to iteratively combine the first and second feed formulation information until a preset iteration termination condition is met, resulting in third feed formulation information. This approach effectively avoids the situation where linear algorithms get trapped in local optima, preventing the attainment of a global optimum, thus compensating for the nonlinear spatial solutions processed by linear programming and improving the reliability of feed formulation optimization results.

[0058] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a method for determining a feed formulation according to an embodiment of this application. The method for determining a feed formulation according to this application can be applied to computer devices, including but not limited to smartphones, tablets, laptops, supercomputers, physical servers, and cloud servers. Figure 1 As shown, the method for determining the feed formulation includes steps S101 to S104, which are detailed below:

[0059] Step S101: Based on various feed information and the nutritional structure information required for animal growth, determine the target constraints, which include feed nutrition constraints and feed cost constraints.

[0060] In this step, feed information refers to the food information in the animal's diet. For example, a chicken's diet includes corn, rice, millet, and carrots. Feed information includes, but is not limited to, the types of food and the content of various nutritional indicators corresponding to each type of food. For example, corn contains 8.5% protein, 4.3% fat, 73.2% carbohydrates, 0.022% calcium, 0.21% phosphorus, and 0.0016% iron. Nutritional structure information refers to the values ​​of various nutritional indicators required for animal growth. For example, the nutritional structure information for breeding boars includes that the digestible energy per kilogram of feed should not be less than 12.5 to 13.5 megajoules, and that protein accounts for more than 18% of the daily diet.

[0061] Objective constraints are the conditions that determine a feed formulation that meets animal nutritional needs while minimizing feed costs. These constraints include nutrient content constraints, nutrient conversion rate constraints, and feed quantity constraints. For example, boars require 18% protein, which can be provided by corn, carrots, or a combination of both. Assuming that corn has a lower cost per kilogram of protein than carrots, using corn will minimize costs. Therefore, constraints can be established based on the nutrient content, unit price, and total nutrient requirements of the feed.

[0062] Step S102: Using a preset first linear algorithm, generate first feed formula information that satisfies the target constraint conditions based on the feed information.

[0063] Step S103: Using a preset second linear algorithm, generate second feed formula information that satisfies the target constraint conditions based on the feed information.

[0064] In steps S102 and S103 above, the first linear algorithm and the second linear algorithm include, but are not limited to, the simplex method and the interior-point method. The simplex method obtains a basic feasible solution by setting different basis vectors and performing linear transformations of the matrix, and then determines whether the solution is optimal. If not, it continues to set another set of basis vectors and repeats the above steps until the optimal solution is found. The interior-point method defines the penalty function within the feasible region and finds the extreme points of the penalty function within the feasible region. That is, the exploration point when solving an unconstrained problem is always within the feasible region, and the resulting series of solutions to the unconstrained optimization problem are always feasible solutions, thus gradually approaching the optimal solution of the original constrained optimization problem within the feasible region.

[0065] Two feed formulations are generated using two linear algorithms. The optimal solutions of the two linear algorithms are then used as the initial values ​​for a genetic algorithm. The two feed formulations are then combined and iterated to optimize the final feed formulation.

[0066] Step S104: Using a preset genetic algorithm, combine and iterate the first feed formula information and the second feed formula information until the preset iteration termination condition is met to obtain the third feed formula information.

[0067] In this step, the genetic algorithm is a computational model that simulates the biological evolutionary process based on natural selection and genetic mechanisms according to Darwin's theory of evolution. It is a method for searching for optimal solutions by simulating the natural evolutionary process. In this embodiment, the first feed formula information and the second feed formula information are used as the initial values ​​of the genetic algorithm. Selection operations are performed on the first feed formula information and the second feed formula information to generate new chromosomes (i.e., feed formula information) for the genetic algorithm. Then, crossover and mutation are performed on the chromosomes. In each evolutionary process, the fitness of each chromosome is calculated according to the feed cost constraint, thereby obtaining the feed cost corresponding to each feed formula information. When the evolutionary iteration process of the genetic algorithm ends, the chromosome with the lowest fitness is the feed formula information with the lowest cost.

[0068] In one embodiment, in Figure 1 Based on the illustrated embodiment, step S101 specifically includes:

[0069] Based on the content of each nutrient index in the feed information and the total content of each nutrient index in the nutrient structure information, determine the nutrient index content constraints between each feed and the nutrient structure.

[0070] Based on the nutritional index content of each feed in the feed information and the preset nutritional index conversion coefficient and nutritional index constraint value, the nutritional index conversion rate constraint conditions of each feed are determined.

[0071] Based on the feed type in the feed information, the feed dosage constraints are determined;

[0072] Based on the feed types and unit prices of each type of feed in the feed information, the feed cost constraints are determined.

[0073] In this embodiment, for example, the nutritional index content constraint can be expressed as:

[0074] a i1 x1+s i2 x2 + ... + s ij x i =b j

[0075] The constraint on the conversion rate of nutritional indicators can be expressed as:

[0076]

[0077] The feed consumption constraint can be expressed as:

[0078] x1+x2+…+x i =1

[0079] The feed cost constraint can be expressed as:

[0080] Z min =c1x1+c2x2+…+c i x i

[0081] Among them, a ij Let a be the percentage of the j-th nutrient index contained in the i-th feed. ij Let b be the percentage of the k-th nutrient in the i-th feed. j c represents the total content of the j-th nutrient indicator in the nutrient structure information. i Let n be the unit price of the i-th type of feed. m Let x be the nutritional indicator constraint value between the j-th nutritional indicator and the k-th nutritional indicator. i Let Z represent the feed dosage of the i-th type of feed, org_coe represent the nutrient conversion coefficient of the j-th nutrient index, coe represent the nutrient conversion coefficient of the k-th nutrient index, and Z represent the nutrient conversion coefficient of the k-th nutrient index. min This is to achieve the lowest feed cost.

[0082] Optionally, based on a preset feed nutrition matrix, the nutrient content of each feed in the feed information is determined, wherein the feed nutrition matrix is:

[0083]

[0084] Q ij Let a be the feed nutrient matrix relating i types of feed to j types of nutrient indicators. ij denoted as the percentage of the j-th nutrient index contained in the i-th type of feed.

[0085] In one embodiment, in Figure 1 Based on the illustrated embodiment, step S102 specifically includes:

[0086] Using the simplex method, based on the feed information, a fourth feed formulation is determined that satisfies the feed nutritional constraints, and the fourth feed formulation is the feasible basis of the simplex method;

[0087] Based on the feasible basis, the feed cost constraint is debased to obtain a simplex matrix.

[0088] If the test number of the simplex matrix is ​​not non-negative, then the basic and non-basic variables of the feasible basis are replaced, and the feed cost constraint is debased until the test number of the simplex matrix is ​​non-negative, thus obtaining the optimal solution, which is the first feed formulation information.

[0089] In this embodiment, the food in the animal's diet is combined to determine the fourth feed formulation information that meets the nutritional requirements. This fourth feed formulation information is used as a feasible basis for the simplex method. The feed cost constraint is debased using this feasible basis to obtain a simplex matrix (simplex table). It is then determined whether all test variables in the test rows of the simplex matrix are non-negative. If not, the basic and non-basic variables of the feasible basis are changed, i.e., the feed types and corresponding feed amounts in the fourth feed formulation information are changed. The feed cost constraint is then debased again to obtain a new simplex matrix. If all test variables in the test rows of the new simplex matrix are not non-negative, the basic and non-basic variables of the feasible basis are changed again until all test variables in the test rows of the new simplex matrix are non-negative. The optimal solution of the simplex method is then obtained, which is the first feed formulation information. It is understandable that because the simplex method involves locally changing basic and non-basic variables, it may get trapped in local optima and fail to obtain the global optimum.

[0090] In one embodiment, in Figure 1 Based on the illustrated embodiment, step S103 specifically includes:

[0091] Using a preset interior point method, the feed nutritional constraints are iterated based on the feed information to obtain the iteration result;

[0092] Based on the iteration results, the parameters of the feed cost constraint are updated until the preset utility function reaches the preset convergence condition, thereby obtaining the second feed formulation information.

[0093] In this embodiment, the interior point method is used to solve the problem. A utility function is introduced to transform the constrained optimization problem into an unconstrained problem. The utility function is then continuously updated through an optimization iteration process to make the algorithm converge, which is the optimal solution.

[0094] In one embodiment, in Figure 1 Based on the illustrated embodiment, step S104 specifically includes:

[0095] The first feed formulation information and the second feed formulation information are used as chromosomes of the genetic population;

[0096] The genetic algorithm is used to perform evolutionary iterations on the genetic population;

[0097] Based on the feed cost constraint, calculate the target fitness of all chromosomes in the genetic population during evolutionary iteration;

[0098] When the number of evolutionary iterations reaches the preset number of evolutionary iterations, the iteration stops, and the feed formula information corresponding to the chromosome with the lowest target fitness is used as the third feed formula information.

[0099] In this embodiment, the first feed formulation information and the second feed formulation information are used as the initial chromosomes of the genetic population to initialize the genetic algorithm; the feed ingredients in the first feed formulation information and the second feed formulation information are encoded with real numbers; then, the genetic population undergoes evolutionary iteration according to the aforementioned feed cost constraint Z. min =c1x1+c2x2+…+c i x i Calculate the fitness of each chromosome in the genetic population. When the number of evolutionary iterations reaches a preset number, stop the iteration and set Z... min The feed formulation information corresponding to the smallest chromosome is used as the third feed formulation information.

[0100] Optionally, the genetic algorithm includes selection, crossover, and mutation operations. Specifically, based on the feed cost constraint, the overall fitness of the genetic population and the individual fitness of each chromosome in the genetic population are determined; based on the overall fitness and the individual fitness, the relative fitness of each chromosome is determined; based on the relative fitness, a new chromosome is generated; a crossover operation is performed on all chromosomes in the genetic population to generate offspring chromosomes; and a mutation operation is performed on the offspring chromosomes to obtain mutated chromosomes.

[0101] For example, firstly, a selection operation is performed to calculate the individual fitness f of each chromosome, and the sum of the individual fitness f_sum of all chromosomes in the genetic population. The relative fitness f / f_sum of each chromosome is then calculated, and the next generation of elite chromosomes is updated, which is the probability that each chromosome will be inherited by the next generation of the genetic population. New chromosomes are generated according to a preset selection strategy. Then, a crossover operation is performed according to the set crossover probability. Chromosomes in the genetic population are randomly paired, and the crossover point positions are randomly set. Then, some genes (including feed type and feed amount) between the paired chromosomes are exchanged to obtain offspring chromosomes. Finally, a mutation operation is performed. The gene mutation position of each chromosome is determined in a random manner, and the original gene value of the mutation point is inverted according to the mutation probability.

[0102] To implement the feed formulation determination method corresponding to the above method embodiments, in order to achieve the corresponding functions and technical effects, see [link to relevant documentation]. Figure 2 , Figure 2 This diagram illustrates a structural block diagram of a feed formulation determination device according to an embodiment of this application. For ease of explanation, only the parts relevant to this embodiment are shown. The feed formulation determination device provided in this embodiment includes:

[0103] The determination module 201 is used to determine target constraints based on various feed information and nutritional structure information required for animal growth. The target constraints include feed nutrition constraints and feed cost constraints.

[0104] The first generation module 202 is used to generate first feed formula information that satisfies the target constraint conditions based on the feed information using a preset first linear algorithm.

[0105] The second generation module 203 is used to generate second feed formula information that satisfies the target constraint conditions based on the feed information using a preset second linear algorithm.

[0106] The iteration module 204 is used to combine and iterate the first feed formula information and the second feed formula information using a preset genetic algorithm until a preset iteration termination condition is met, so as to obtain the third feed formula information.

[0107] In one embodiment, the first linear algorithm is the simplex method, and the first generation module 202 includes:

[0108] The first determining unit is used to determine, using the simplex method and based on the feed information, a fourth feed formulation that satisfies the feed nutritional constraints, wherein the fourth feed formulation is the feasibility basis of the simplex method.

[0109] The debasing unit is used to perform a debasing operation on the feed cost constraint based on the feasible basis to obtain a simplex matrix;

[0110] The first iteration unit is configured to replace the basic and non-basic variables of the feasible basis if the test number of the simplex matrix is ​​not non-negative, and to perform a non-basicization operation on the feed cost constraint until the test number of the simplex matrix is ​​non-negative, thereby obtaining the optimal solution, wherein the optimal solution is the first feed formulation information.

[0111] In one embodiment, the second linear algorithm is an interior-point method, and the second generation module 203 includes:

[0112] The second iteration unit is used to iterate the feed nutritional constraints based on the feed information using a preset interior point method to obtain the iteration result.

[0113] Based on the iteration results, the parameters of the feed cost constraint are updated until the preset utility function reaches the preset convergence condition, thereby obtaining the second feed formulation information.

[0114] In one embodiment, the feed nutrient constraints include nutrient content constraints, nutrient conversion rate constraints, and feed dosage constraints; the determining module 201 includes:

[0115] The second determining unit is used to determine the nutrient index content constraint conditions between each feed and the nutrient structure based on the nutrient index content of each feed in the feed information and the total content of each nutrient index in the nutrient structure information.

[0116] The third determining unit is used to determine the nutrient index conversion rate constraint conditions for each feed based on the nutrient index content of each feed in the feed information and the preset nutrient index conversion coefficient and nutrient index constraint value.

[0117] The fourth determining unit is used to determine the feed dosage constraints based on the feed type in the feed information.

[0118] The fifth determining unit is used to determine the feed cost constraints based on the feed types and unit prices of each type of feed in the feed information.

[0119] Optionally, the determining module 201 further includes:

[0120] The sixth determining unit is used to determine the nutrient content of each feed in the feed information based on a preset feed nutrient matrix, wherein the feed nutrient matrix is ​​as follows:

[0121]

[0122] Q ij Let a be the feed nutrient matrix relating i types of feed to j types of nutrient indicators. ij denoted as the percentage of the j-th nutrient index contained in the i-th type of feed.

[0123] In one embodiment, the iteration module 204 includes:

[0124] As a unit, it is used to treat the first feed formulation information and the second feed formulation information as chromosomes of a genetic population;

[0125] The third iteration unit is used to perform evolutionary iteration on the genetic population using the genetic algorithm.

[0126] A computing unit is used to calculate the target fitness of all chromosomes in the genetic population during evolutionary iteration, based on the feed cost constraint.

[0127] The stopping unit is used to stop the iteration when the number of evolutionary iterations reaches a preset number of evolutionary iterations, and to use the feed formula information corresponding to the chromosome with the lowest target fitness as the third feed formula information.

[0128] In one embodiment, the third iteration unit includes:

[0129] The first determining subunit is used to determine the overall fitness of the genetic population and the individual fitness of each chromosome in the genetic population based on the feed cost constraint.

[0130] The second determining subunit is used to determine the relative fitness of each chromosome based on the total fitness and the individual fitness;

[0131] Generate subunits for generating new chromosomes based on the relative fitness;

[0132] A crossover subunit is used to perform a crossover operation on all chromosomes in the genetic population to generate offspring chromosomes;

[0133] The mutation subunit is used to perform mutation operations on the offspring chromosome to obtain a mutated chromosome.

[0134] The feed formulation determination apparatus described above can implement the feed formulation determination method of the above method embodiments. The options in the above method embodiments are also applicable to this embodiment, and will not be detailed here. The remaining contents of this application embodiment can be referred to the contents of the above method embodiments, and will not be repeated in this embodiment.

[0135] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device 3 of this embodiment includes: at least one processor 30 ( Figure 3 (Only one is shown in the diagram) a processor, a memory 31, and a computer program 32 stored in the memory 31 and executable on the at least one processor 30, wherein the processor 30 executes the computer program 32 to implement the steps in any of the above method embodiments.

[0136] The electronic device 3 can be a computing device such as a smartphone, tablet, desktop computer, or cloud server. This electronic device may include, but is not limited to, a processor 30 and a memory 31. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.

[0137] The processor 30 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0138] In some embodiments, the memory 31 may be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. In other embodiments, the memory 31 may be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 3. Furthermore, the memory 31 may include both internal and external storage units of the electronic device 3. The memory 31 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 31 can also be used to temporarily store data that has been output or will be output.

[0139] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above method embodiments.

[0140] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the steps described in the various method embodiments above.

[0141] In the several embodiments provided in this application, it will be understood that each block in the flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.

[0142] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a terminal device to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0143] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application for those skilled in the art.

Claims

1. A method for determining a feed formulation, characterized in that, include: Based on various feed information and nutritional structure information required for animal growth, target constraints are determined, including feed nutrition constraints and feed cost constraints. Using a preset first linear algorithm, first feed formulation information that satisfies the target constraint conditions is generated based on the feed information; Using a preset second linear algorithm, second feed formulation information that satisfies the target constraints is generated based on the feed information; Using a preset genetic algorithm, the first feed formula information and the second feed formula information are combined and iterated until a preset iteration termination condition is met to obtain the third feed formula information. The first linear algorithm is the simplex method. The step of generating first feed formulation information that satisfies the target constraints based on the feed information using the preset first linear algorithm includes: Using the simplex method, based on the feed information, a fourth feed formulation information is determined that satisfies the feed nutritional constraints, and the fourth feed formulation information is the feasible basis of the simplex method; Based on the feasible basis, the feed cost constraint is debased to obtain a simplex matrix. If the test number of the simplex matrix is ​​not non-negative, then the basic and non-basic variables of the feasible basis are replaced, and the feed cost constraint is debased until the test number of the simplex matrix is ​​non-negative, and the optimal solution is obtained. The optimal solution is the first feed formulation information. The second linear algorithm is the interior-point method. The step of generating second feed formulation information that satisfies the target constraints based on the feed information using a preset second linear algorithm includes: Using a preset interior point method, the feed nutritional constraints are iterated based on the feed information to obtain the iteration result; Based on the iteration results, the parameters of the feed cost constraint are updated until the preset utility function reaches the preset convergence condition, thereby obtaining the second feed formulation information.

2. The method for determining feed formulation as described in claim 1, characterized in that, The feed nutrition constraints include nutrient content constraints, nutrient conversion rate constraints, and feed usage constraints. The determination of target constraints based on various feed information and nutritional structure information required for animal growth includes: Based on the content of each nutrient index in the feed information and the total content of each nutrient index in the nutrient structure information, determine the nutrient index content constraints between each feed and the nutrient structure. Based on the nutritional index content of each feed in the feed information and the preset nutritional index conversion coefficient and nutritional index constraint value, the nutritional index conversion rate constraint conditions of each feed are determined. Based on the feed type in the feed information, the feed dosage constraints are determined; Based on the feed types and unit prices of each type of feed in the feed information, the feed cost constraints are determined.

3. The method for determining feed formulation as described in claim 2, characterized in that, Before determining the target constraints based on the feed information and the nutritional structure information, the method further includes: Based on a preset feed nutrition matrix, the nutrient content of each feed item in the feed information is determined. The feed nutrition matrix is ​​as follows: ; in The feed nutrition matrix represents the relationship between feed type i and nutritional indicators j. denoted as the percentage of the j-th nutrient index contained in the i-th type of feed.

4. The method for determining feed formulation as described in claim 1, characterized in that, The process of using a preset genetic algorithm to iteratively combine the first feed formulation information and the second feed formulation information until a preset iteration termination condition is met, to obtain the third feed formulation information, includes: The first feed formulation information and the second feed formulation information are used as chromosomes of the genetic population; The genetic algorithm is used to perform evolutionary iterations on the genetic population; Based on the feed cost constraint, calculate the target fitness of all chromosomes in the genetic population during evolutionary iteration; When the number of evolutionary iterations reaches the preset number of evolutionary iterations, the iteration stops, and the feed formula information corresponding to the chromosome with the lowest target fitness is used as the third feed formula information.

5. The method for determining feed formulation as described in claim 4, characterized in that, The process of using the genetic algorithm to perform evolutionary iterations on the genetic population includes: Based on the feed cost constraints, determine the overall fitness of the genetic population and the individual fitness of each chromosome in the genetic population; The relative fitness of each chromosome is determined based on the total fitness and the individual fitness. Based on the relative fitness, new chromosomes are generated; A crossover operation is performed on all chromosomes in the genetic population to generate offspring chromosomes; The offspring chromosomes are subjected to mutation operations to obtain mutated chromosomes.

6. A feed formulation determination device, characterized in that, include: The determination module is used to determine target constraints based on various feed information and nutritional structure information required for animal growth. The target constraints include feed nutrition constraints and feed cost constraints. The first generation module is used to generate first feed formula information that satisfies the target constraint conditions based on the feed information using a preset first linear algorithm. The second generation module is used to generate second feed formula information that satisfies the target constraint conditions based on the feed information using a preset second linear algorithm. The iterative module is used to combine and iterate the first feed formula information and the second feed formula information using a preset genetic algorithm until a preset iteration termination condition is met, so as to obtain the third feed formula information. The first generation module is further configured to use the simplex method to determine, based on the feed information, a fourth feed formulation information that satisfies the feed nutritional constraints, wherein the fourth feed formulation information is the feasible basis of the simplex method; Based on the feasible basis, the feed cost constraint is debased to obtain a simplex matrix. If the test number of the simplex matrix is ​​not non-negative, then the basic and non-basic variables of the feasible basis are replaced, and the feed cost constraint is debased until the test number of the simplex matrix is ​​non-negative, and the optimal solution is obtained. The optimal solution is the first feed formulation information. The second generation module is also used to iterate the feed nutritional constraints based on the feed information using a preset interior point method to obtain the iteration result; Based on the iteration results, the parameters of the feed cost constraint are updated until the preset utility function reaches the preset convergence condition, thereby obtaining the second feed formulation information.

7. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the method for determining a feed formulation as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method for determining the feed formulation as described in any one of claims 1 to 5.