CN114239933A - Method and device for determining feed formula, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114239933A
CN114239933A CN202111462477.8A CN202111462477A CN114239933A CN 114239933 A CN114239933 A CN 114239933A CN 202111462477 A CN202111462477 A CN 202111462477A CN 114239933 A CN114239933 A CN 114239933A
Authority
CN
China
Prior art keywords
feed
information
determining
preset
constraint condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111462477.8A
Other languages
Chinese (zh)
Inventor
刘丁屹
杨帆
王川
任文俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan New Hope Animal Nutrition Technology Co ltd
Shandong New Hope Liuhe Group Co Ltd
New Hope Liuhe Co Ltd
Original Assignee
Sichuan New Hope Animal Nutrition Technology Co ltd
Shandong New Hope Liuhe Group Co Ltd
New Hope Liuhe Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan New Hope Animal Nutrition Technology Co ltd, Shandong New Hope Liuhe Group Co Ltd, New Hope Liuhe Co Ltd filed Critical Sichuan New Hope Animal Nutrition Technology Co ltd
Priority to CN202111462477.8A priority Critical patent/CN114239933A/en
Publication of CN114239933A publication Critical patent/CN114239933A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/02Agriculture; Fishing; Mining

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Marketing (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Development Economics (AREA)
  • Evolutionary Computation (AREA)
  • Game Theory and Decision Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Genetics & Genomics (AREA)
  • Physiology (AREA)
  • Agronomy & Crop Science (AREA)
  • Animal Husbandry (AREA)
  • Marine Sciences & Fisheries (AREA)
  • Mining & Mineral Resources (AREA)
  • Primary Health Care (AREA)

Abstract

The application discloses a method and a device for determining a feed formula, electronic equipment and a storage medium, wherein a target constraint condition is determined according to various feed information and nutritional structure information required by animal growth, and first feed formula information and second feed formula information meeting the target constraint condition are generated according to feed information respectively by utilizing a preset first linear algorithm and a preset second linear algorithm so as to preliminarily obtain the feed formula through the linear algorithm; and performing combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information, thereby effectively avoiding the situation that a global optimal solution cannot be obtained due to the fact that the linear algorithm falls into a local optimal solution by using the genetic algorithm, making up a nonlinear space solution of linear programming processing, and further improving the reliability of a feed formula optimization result.

Description

Method and device for determining feed formula, electronic equipment and storage medium
Technical Field
The application relates to the field of animal breeding, in particular to a method and a device for determining a feed formula, electronic equipment and a storage medium.
Background
Scientific cultivation means that the animal feeding process follows the cultivation experience and objective rule, and the feed formula is reasonably and effectively adjusted according to the growth and breeding characteristics of animals at different weight stages so as to meet the requirements of fattening and promoting the growth of the animals. Due to the environmental characteristics under different regional conditions, the experience and technical specifications referred by the feeding process are adjusted, and the feed formula is also perfected and optimized according to the actual environmental characteristics. In order to improve the economic benefit of animal breeding in a farm, a feed formula with low cost is selected while the nutritional requirements for animal growth are met.
Currently, feed formulation software such as bestimix and bril are available in the feed industry. However, the feed proportioning model adopted by the existing feed proportioning software can only deal with the feed proportioning with small breeding scale and simple nutrition structure, and for a large number of constraint conditions and some special constraint conditions caused by large breeding scale and complex nutrition structure, the current feed proportioning model has the condition that the optimal feed formula meeting all the constraint conditions cannot be calculated, so that the reliability of the existing feed formula optimization mode is poor, and the current feed formula optimization mode cannot be widely applied.
Disclosure of Invention
The application provides a method and a device for determining a feed formula, electronic equipment and a storage medium, and aims to solve the technical problem of poor reliability of the existing feed formula optimization mode.
In order to solve the above technical problem, an embodiment of the present application provides a method for determining a feed formula, including:
determining target constraint conditions according to the information of various feeds and the information of nutritional structures required by animal growth, wherein the target constraint conditions comprise feed nutrition constraint conditions and feed cost constraint conditions;
generating first feed formula information meeting the target constraint condition according to the feed information by using a preset first linear algorithm;
generating second feed formula information meeting the target constraint condition according to the feed information by using a preset second linear algorithm;
and performing combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information.
The method comprises the steps of determining a target constraint condition according to various feed information and nutrition structure information required by animal growth, generating first feed formula information and second feed formula information meeting the target constraint condition according to feed information by utilizing a preset first linear algorithm and a preset second linear algorithm, and obtaining a feed formula preliminarily through the linear algorithm; and performing combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information, thereby effectively avoiding the situation that a global optimal solution cannot be obtained due to the fact that the linear algorithm falls into a local optimal solution by using the genetic algorithm, making up a nonlinear space solution of linear programming processing, and further improving the reliability of a feed formula optimization result.
In an embodiment, the first linear algorithm is a simplex method, and the generating of the first feed formula information meeting the target constraint condition according to the feed information by using a preset first linear algorithm includes:
determining fourth feed formula information when the feed nutrition constraint conditions are met by using a simplex method according to the feed information, wherein the fourth feed formula is a feasible basis of the simplex method;
performing non-basic operation on the feed cost constraint condition based on the feasible basis to obtain a simplex matrix;
and if the inspection number of the simplex matrix is not a nonnegative number, replacing the base variable and the nonbase variable of the feasible base, and performing nonbase operation on the feed cost constraint condition until the inspection number of the simplex matrix is a nonnegative number to obtain an optimal solution, wherein the optimal solution is the first feed formula information.
In the embodiment, the first feed formula information is determined by a simplex method, so that a linear programming problem is converted into a standard form, and the probability that a nonlinear space solution cannot be processed due to the linear programming problem is reduced.
In one embodiment, the generating of the second feed formula information when the target constraint condition is satisfied according to the feed information by using a preset second linear algorithm comprises:
iterating the feed nutrition constraint conditions by using a preset interior point method according to feed information to obtain an iteration result;
and updating parameters of the feed cost constraint condition based on the iteration result until the preset utility function reaches the preset convergence condition to obtain second feed formula information.
In the embodiment, the second feed formula information is determined by an interior point method and introducing a utility function, so that the constraint optimization problem is converted into an unconstrained problem, and the operation efficiency of the second feed formula information determination process is improved.
In one embodiment, the feed nutrient constraint condition comprises a nutrient index content constraint condition, a nutrient index conversion rate constraint condition and a feed dosage constraint condition; determining target constraints based on the information on the plurality of feeds and the information on the nutritional structure required for the growth of the animal, including:
determining a nutritional index content constraint condition between each feed and a nutritional structure based on the nutritional index content of each feed in the feed information and the total content of each nutritional index in the nutritional structure information;
determining a nutritional index conversion rate constraint condition of each feed based on the nutritional index content of each feed in the feed information and a preset nutritional index conversion coefficient and a nutritional index constraint value;
determining a feed usage constraint condition based on the feed type in the feed information;
and determining a feed cost constraint condition based on the feed type and the feed unit price of each feed in the feed information.
According to the embodiment, the constraint condition is established through the relationship between the feed information and the nutrition structure information, so that the feed cost is reduced and the economic benefit is improved while the feed formula meets the nutrition structure required by animals.
In one embodiment, before determining the target constraint condition according to the feed information and the nutritional structure information, the method further comprises:
determining the content of the nutritional index of each feed in the feed information based on a preset feed nutrition matrix, wherein the feed nutrition matrix is as follows:
Figure BDA0003387889960000031
wherein QijIs a feed nutrition matrix between i kinds of feed and j kinds of nutrition indexes, aijThe percentage of the ith feed containing the jth nutrition index is shown.
According to the embodiment, the relation matrix between the feed and the nutritional indexes is constructed, so that the nutritional index value of the feed can be rapidly obtained when the feed formula is determined, and the operation efficiency is improved.
In one embodiment, the combining iteration is performed on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information, and the third feed formula information comprises:
using the first feed formula information and the second feed formula information as chromosomes of a genetic population;
evolution iteration is carried out on the genetic population by utilizing a genetic algorithm;
calculating target fitness of all chromosomes in the genetic population during evolution iteration according to the feed cost constraint condition;
and when the evolution iteration times reach the preset evolution iteration times, stopping the iteration, and taking the feed formula information corresponding to the chromosome with the minimum target fitness as third feed formula information.
According to the embodiment, the target fitness is calculated through the feed cost constraint condition, the preset evolution iteration times are set, and the iteration speed of the genetic algorithm is improved.
In one embodiment, evolutionary iterations are performed on a genetic population using a genetic algorithm, comprising:
determining the total fitness of the genetic population and the individual fitness of each chromosome in the genetic population according to the feed cost constraint condition;
determining the relative fitness of each chromosome according to the total fitness and the individual fitness;
generating a new chromosome according to the relative fitness;
performing cross operation on all chromosomes in the genetic population to generate offspring chromosomes;
and carrying out mutation operation on the offspring chromosome to obtain a variant chromosome.
In the embodiment, the new chromosome is determined through fitness to improve the selection operation of the genetic algorithm, so that the genetic algorithm can be applied to the optimization of the feed formula, and the possibility of the feed formula is improved by combining cross operation and mutation operation, so that the final feed formula is optimized.
In a second aspect, an embodiment of the present application provides a device for determining a feed formula, including:
the determining module is used for determining target constraint conditions according to the information of various feeds and the information of nutritional structures required by animal growth, wherein the target constraint conditions comprise feed nutrition constraint conditions and feed cost constraint conditions;
the first generation module is used for generating first feed formula information meeting the target constraint condition according to the feed information by using a preset first linear algorithm;
the second generation module is used for generating second feed formula information meeting the target constraint condition according to the feed information by using a preset second linear algorithm;
and the iteration module is used for performing combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to make the electronic device execute the method for determining a feed formula according to the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program, which when executed by a processor, implements the method for determining a feed formulation according to the first aspect.
Please refer to the relevant description of the first aspect for the beneficial effects of the second to fourth aspects, which are not repeated herein.
Drawings
FIG. 1 is a schematic flow chart of a method for determining a feed formulation provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a feed formula determination device provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As described in the related background art, for a large number of constraint conditions and some special constraint conditions caused by large breeding scale and complex nutrition structure, the current feed proportioning model has a situation that the optimal feed formula meeting all the constraint conditions cannot be solved, so that the reliability of the current feed formula optimization mode is poor, and the current feed formula optimization mode cannot be widely applied.
To this end, the embodiment of the present application provides a method, an apparatus, a computer device and a storage medium for determining a feed formula, wherein a target constraint condition is determined according to various feed information and nutritional structure information required by animal growth, and a first feed formula information and a second feed formula information which satisfy the target constraint condition are generated according to the feed information respectively by using a preset first linear algorithm and a preset second linear algorithm, so as to preliminarily obtain the feed formula through the linear algorithm; and performing combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information, thereby effectively avoiding the situation that a global optimal solution cannot be obtained due to the fact that the linear algorithm falls into a local optimal solution by using the genetic algorithm, making up a nonlinear space solution of linear programming processing, and further improving the reliability of a feed formula optimization result.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for determining a feed formula according to an embodiment of the present application. The method for determining the feed formula can be applied to computer equipment, and the computer equipment includes but is not limited to computing equipment such as a smart phone, a tablet computer, a notebook computer, a super computer, a physical server and a cloud server. As shown in fig. 1, the method for determining the feed formula includes steps S101 to S104, which are detailed as follows:
step S101, determining target constraint conditions according to various feed information and nutrition structure information required by animal growth, wherein the target constraint conditions comprise feed nutrition constraint conditions and feed cost constraint conditions.
In this step, the feed information is food information in the animal diet structure, for example, the diet structure of chicken includes corn, rice, carrot, etc., the feed information includes but is not limited to the food type and the content of each nutritional index corresponding to the food type, for example, corn contains 8.5% of protein, 4.3% of fat, 73.2% of sugar, 0.022% of calcium, 21% of phosphorus, 0.0016% of iron, etc. The nutritional structure information is various nutritional index values required for animal growth, for example, the nutritional structure information of breeding boars comprises that the digestion energy per kilogram of feed can not be lower than 12.5-13.5 megajoules, protein accounts for more than 18% of the daily ration, and the like.
The target constraint condition is a constraint condition for obtaining a feed formula which meets the animal nutritional requirements and the lowest feed cost, and the feed nutritional constraint condition comprises a nutritional index content constraint condition, a nutritional index conversion rate constraint condition and a feed dosage constraint condition. For example, a boar needs 18% protein, which may be provided by corn, carrot, or both, and assuming that corn costs less than carrot per kilogram of protein, the use of corn can minimize costs, and therefore constraints can be established based on the nutritional index content, unit price, and total nutritional index required by the animal of the feed.
And S102, generating first feed formula information meeting the target constraint condition according to the feed information by using a preset first linear algorithm.
And S103, generating second feed formula information meeting the target constraint condition according to the feed information by using a preset second linear algorithm.
In the above step S102 and step S103, the first linear algorithm and the second linear algorithm include, but are not limited to, a simplex method and an interior point method. The simplex method is characterized in that different basis vectors are set, a feasible basis solution is obtained through linear transformation of a matrix, whether the solution is optimal or not is judged, if not, another group of basis vectors are continuously set, and the steps are repeatedly executed until an optimal solution is found; the interior point method defines the penalty function in the feasible region, and calculates the extreme point of the penalty function in the feasible region, namely, the exploration point when solving the unconstrained problem is always in the feasible region, and the solution of the series unconstrained optimization problem is always a feasible solution, thereby gradually approaching the optimal solution of the original constrained optimization problem in the feasible region.
Two kinds of feed formula information are generated through two linear algorithms, so that the optimal solution of the two linear algorithms is used as the initial value of the genetic algorithm in the follow-up process, and the final feed formula information is optimized through the combined iteration of the two kinds of feed formula information.
And S104, performing combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information.
In this step, the genetic algorithm is a calculation model of the biological evolution process that simulates natural selection and genetic mechanism of the darwinian biological evolution theory, and is a method for searching for an optimal solution by simulating the natural evolution process. In the embodiment, the first feed formula information and the second feed formula information are used as initial values of a genetic algorithm, selection operation is performed on the first feed formula information and the second feed formula information to generate new chromosomes (namely feed formula information) of the genetic algorithm, then, crossover and variation are performed on the chromosomes, and in each evolutionary process, the fitness corresponding to each chromosome is calculated according to a feed cost constraint condition, so that the feed cost corresponding to each feed formula information is obtained, and when the evolutionary iterative process of the genetic algorithm is finished, the chromosome with the lowest fitness is the feed formula information with the lowest cost.
In an embodiment, on the basis of the embodiment shown in fig. 1, the step S101 specifically includes:
determining the nutritional index content constraint condition between each feed and the nutritional structure based on the nutritional index content of each feed in the feed information and the total content of each nutritional index in the nutritional structure information;
determining a nutritional index conversion rate constraint condition of each feed based on the nutritional index content of each feed in the feed information and a preset nutritional index conversion coefficient and a nutritional index constraint value;
determining the feed usage constraint condition based on the feed type in the feed information;
determining the feed cost constraint condition based on the feed type and the feed unit price of each feed in the feed information.
In this embodiment, the nutritional indicator content constraint may be expressed as:
ai1x1+si2x2+…+sijxi=bj
the nutritional indicator conversion constraint may be expressed as:
Figure BDA0003387889960000081
the feed dosage constraints can be expressed as:
x1+x2+…+xi=1
the feed cost constraint can be expressed as:
Zmin=c1x1+c2x2+…+cixi
wherein, aijIs the percentage of the ith kind of feed containing the jth kind of nutritional index, aijIs the percentage of kth nutrition index contained in ith feed, bjIs the total content of the jth nutritional index in the nutritional structure information, ciFeed unit price, n, for the ith feedmIs the nutrient index constraint value, x, between the jth nutrient index and the kth nutrient indexiThe feed dosage of the ith feed is org _ coe, the conversion coefficient of the nutritional index of the jth nutrition index is coe, the conversion coefficient of the nutritional index of the kth nutrition index is ZminIs the lowest feed cost.
Optionally, determining the content of the nutritional index of each feed in the feed information based on a preset feed nutrition matrix, where the feed nutrition matrix is:
Figure BDA0003387889960000082
wherein QijI kinds of feed and j kinds of feedThe feed nutrition matrix between nutritional indices, aijThe percentage of the ith feed containing the jth nutrition index is shown.
In an embodiment, on the basis of the embodiment shown in fig. 1, the step S102 specifically includes:
determining fourth feed formula information when the feed nutrition constraint condition is met by using the simplex method according to the feed information, wherein the fourth feed formula is a feasible basis of the simplex method;
performing non-basic operation on the feed cost constraint condition based on the feasible basis to obtain a simplex matrix;
and if the inspection number of the simplex matrix is not a nonnegative number, replacing the base variable and the nonbase variable of the feasible base, and performing nonbase operation on the feed cost constraint condition until the inspection number of the simplex matrix is a nonnegative number to obtain an optimal solution, wherein the optimal solution is the first feed formula information.
In this embodiment, food in the animal diet structure is combined, fourth feed formula information satisfying the feed nutrition condition is determined, the fourth feed formula information is used as a feasible basis of a simplex method, a simplex matrix (simplex table) is obtained by performing non-basis operation on the feed cost constraint condition with a feasible basis, whether all inspection numbers in inspection rows in the simplex matrix are non-negative numbers is judged, if not, the basis variable and the non-basis variable of the feasible basis are replaced, that is, the feed type and the corresponding feed amount in the fourth feed formula information are replaced, the non-basis operation is performed on the feed cost constraint condition again to obtain a new simplex matrix, if all inspection numbers in the inspection rows of the new simplex matrix are not non-negative numbers, the basis variable and the non-basis variable of the feasible basis are continuously changed until all inspection numbers in the inspection rows of the simplex matrix are non-negative numbers, and correspondingly obtaining the optimal solution of the simplex method, wherein the optimal solution is the first feed formula information. It can be understood that, since the simplex method is to replace the base variable and the non-base variable locally, there is a case where a locally optimal solution is trapped, and a globally optimal solution cannot be obtained.
In an embodiment, on the basis of the embodiment shown in fig. 1, the step S103 specifically includes:
iterating the feed nutrition constraint condition by using a preset interior point method according to the feed information to obtain an iteration result;
and updating parameters of the feed cost constraint condition based on the iteration result until a preset utility function reaches a preset convergence condition to obtain the second feed formula information.
In this embodiment, an interior point method is used for solving, a utility function is introduced to convert a constrained optimization problem into an unconstrained problem, and then the utility function is continuously updated by using an optimization iteration process, so that the algorithm is converged, namely, the optimal solution is obtained.
In an embodiment, on the basis of the embodiment shown in fig. 1, the step S104 specifically includes:
determining a first feed formula information and a second feed formula information as chromosomes of a genetic population;
performing evolutionary iteration on the genetic population by using the genetic algorithm;
calculating target fitness of all chromosomes in the genetic population during evolution iteration according to the feed cost constraint condition;
and when the evolution iteration times reach preset evolution iteration times, stopping iteration, and taking the feed formula information corresponding to the chromosome with the minimum target fitness as the third feed formula information.
In this embodiment, the genetic algorithm is initialized using the first feed formula information and the second feed formula information as initial chromosomes for the genetic population; real number coding is carried out on the feed raw materials in the first feed formula information and the second feed formula information; then carrying out evolution iteration on the genetic population according to the feed cost constraint condition Zmin=c1x1+c2x2+…+cixiCalculating the individual fitness of each chromosome in the genetic population, stopping iteration when the evolution iteration number reaches a preset evolution iteration number, and adding ZminAnd the feed formula information corresponding to the smallest chromosome is used as third feed formula information.
Optionally, the genetic algorithm comprises a selection operation, a crossover operation and a mutation operation. Specifically, determining the total fitness of the genetic population and determining the individual fitness of each chromosome in the genetic population according to the feed cost constraint condition; determining the relative fitness of each chromosome according to the total fitness and the individual fitness; generating a new chromosome according to the relative fitness; performing crossover operations on all the chromosomes in the genetic population to generate offspring chromosomes; and carrying out mutation operation on the offspring chromosome to obtain a variant chromosome.
Illustratively, firstly, selecting operation is carried out, the individual fitness f of each chromosome is calculated, the sum f _ sum of the individual fitness of all chromosomes in a genetic population is calculated, the relative fitness f/f _ sum of each chromosome is calculated, a new generation of elite chromosomes is updated, namely the probability that each chromosome is inherited to a next generation genetic population, and a new chromosome is generated according to a preset selection strategy; then, carrying out cross operation according to the set cross probability, carrying out random pairing on chromosomes in the genetic population, randomly setting the cross point positions, and then mutually exchanging partial genes (including feed types and feed usage amounts) between the paired chromosomes to obtain offspring chromosomes; finally, mutation operation is carried out, the gene mutation position of each chromosome is determined in a random mode, and the original gene value of the mutation point is negated according to the mutation probability.
In order to implement the method for determining the feed formula corresponding to the above method embodiment, the corresponding functions and technical effects are achieved. Referring to fig. 2, fig. 2 is a block diagram illustrating a determining apparatus for a feed formula according to an embodiment of the present disclosure. For convenience of explanation, only the parts related to the present embodiment are shown, and the apparatus for determining a feed formula provided in the embodiments of the present application includes:
a determining module 201, configured to determine target constraints according to multiple feed information and nutritional structure information required by animal growth, where the target constraints include feed nutritional constraints and feed cost constraints;
a first generating module 202, configured to generate, according to the feed information, first feed formula information that meets the target constraint condition by using a preset first linear algorithm;
the second generating module 203 is configured to generate, according to the feed information, second feed formula information that meets the target constraint condition by using a preset second linear algorithm;
the iteration module 204 is configured to perform combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached, so as to obtain third feed formula information.
In one embodiment, the first linear algorithm is simplex, and the first generating module 202 includes:
a first determining unit, configured to determine, according to the feed information, fourth feed formula information when the feed nutrition constraint condition is satisfied by using the simplex method, where the fourth feed formula is a feasible basis of the simplex method;
the non-basification unit is used for carrying out non-basification operation on the feed cost constraint condition based on the feasible basis to obtain a simplex matrix;
and the first iteration unit is used for replacing the basic variable and the non-basic variable of the feasible basis if the inspection number of the simplex matrix is not a non-negative number, and performing non-basic operation on the feed cost constraint condition until the inspection number of the simplex matrix is a non-negative number to obtain an optimal solution, wherein the optimal solution is the first feed formula information.
In an embodiment, the second linear algorithm is an interior point method, and the second generating module 203 includes:
the second iteration unit is used for iterating the feed nutrition constraint condition by utilizing a preset interior point method according to the feed information to obtain an iteration result;
and updating parameters of the feed cost constraint condition based on the iteration result until a preset utility function reaches a preset convergence condition to obtain the second feed formula information.
In one embodiment, the feed nutritional constraints comprise nutritional indicator content constraints, nutritional indicator conversion constraints, and feed dosage constraints; a determination module 201 comprising:
a second determination unit, configured to determine the nutritional indicator content constraint condition between each feed and the nutritional structure based on the nutritional indicator content of each feed in the feed information and the total content of each nutritional indicator in the nutritional structure information;
a third determining unit, configured to determine a nutritional indicator conversion rate constraint condition of each feed based on the nutritional indicator content of each feed in the feed information and a preset nutritional indicator conversion coefficient and a nutritional indicator constraint value;
a fourth determining unit, configured to determine the feed usage constraint condition based on the feed type in the feed information;
a fifth determining unit, configured to determine the feed cost constraint condition based on the feed type and the feed unit price of each feed in the feed information.
Optionally, the determining module 201 further includes:
a sixth determining unit, configured to determine, based on a preset feed nutrition matrix, a nutrition index content of each feed in the feed information, where the feed nutrition matrix is:
Figure BDA0003387889960000121
wherein QijIs the feed nutrition matrix between i feeds and j nutrition indexes, aijThe percentage of the ith feed containing the jth nutrition index is shown.
In one embodiment, the iteration module 204 includes:
as a unit for using the first feed formula information and the second feed formula information as chromosomes of a genetic population;
a third iteration unit, configured to perform evolutionary iteration on the genetic population by using the genetic algorithm;
the calculating unit is used for calculating the target fitness of all chromosomes in the genetic population during evolution iteration according to the feed cost constraint condition;
and the stopping unit is used for stopping iteration when the evolution iteration times reach the preset evolution iteration times, and taking the feed formula information corresponding to the chromosome with the minimum target fitness as the third feed formula information.
In an embodiment, the third iteration unit includes:
a first determining subunit, configured to determine a total fitness of the genetic population according to the feed cost constraint condition, and determine an individual fitness of each chromosome in the genetic population;
a second determining subunit, configured to determine a relative fitness of each chromosome according to the total fitness and the individual fitness;
a generating subunit, configured to generate a new chromosome according to the relative fitness;
a crossover subunit, configured to perform crossover operations on all the chromosomes in the genetic population to generate offspring chromosomes;
and the variation subunit is used for performing variation operation on the offspring chromosome to obtain a variation chromosome.
The above-described apparatus for determining a feed formulation may implement the method for determining a feed formulation of the above-described method embodiment. The alternatives in the above-described method embodiments are also applicable to this embodiment and will not be described in detail here. The rest of the embodiments of the present application may refer to the contents of the above method embodiments, and in this embodiment, details are not described again.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 3, the electronic apparatus 3 of this embodiment includes: at least one processor 30 (only one shown in fig. 3), a memory 31, and a computer program 32 stored in the memory 31 and executable on the at least one processor 30, the processor 30 implementing the steps of any of the above-described method embodiments when executing the computer program 32.
The electronic device 3 may be a computing device such as a smart phone, a tablet computer, a desktop computer, and a cloud server. The electronic device may include, but is not limited to, a processor 30, a memory 31. Those skilled in the art will appreciate that fig. 3 is only an example of the electronic device 3, and does not constitute a limitation to the electronic device 3, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The processor 30 may be a Central Processing Unit (CPU), and the processor 30 may be other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 31 may in some embodiments be an internal storage unit of the electronic device 3, such as a hard disk or a memory of the electronic device 3. The memory 31 may also be an external storage device of the electronic device 3 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the electronic device 3. The memory 31 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 31 may also be used to temporarily store data that has been output or is to be output.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in any of the method embodiments described above.
The embodiments of the present application provide a computer program product, which when running on an electronic device, enables the electronic device to implement the steps in the above method embodiments when executed.
In several embodiments provided herein, it will be understood that each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a terminal device to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are further detailed to explain the objects, technical solutions and advantages of the present application, and it should be understood that the above-mentioned embodiments are only examples of the present application and are not intended to limit the scope of the present application. It should be understood that any modifications, equivalents, improvements and the like, which come within the spirit and principle of the present application, may occur to those skilled in the art and are intended to be included within the scope of the present application.

Claims (10)

1. A method of determining a feed formulation, comprising:
determining target constraint conditions according to various feed information and nutritional structure information required by animal growth, wherein the target constraint conditions comprise feed nutritional constraint conditions and feed cost constraint conditions;
generating first feed formula information meeting the target constraint condition according to the feed information by using a preset first linear algorithm;
generating second feed formula information meeting the target constraint condition according to the feed information by using a preset second linear algorithm;
and performing combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information.
2. The method for determining a feed formulation according to claim 1, wherein the first linear algorithm is simplex, and the generating the first feed formulation information satisfying the target constraint condition according to the feed information by using the preset first linear algorithm comprises:
determining fourth feed formula information when the feed nutrition constraint condition is met by using the simplex method according to the feed information, wherein the fourth feed formula information is a feasible basis of the simplex method;
performing non-basic operation on the feed cost constraint condition based on the feasible basis to obtain a simplex matrix;
and if the inspection number of the simplex matrix is not a nonnegative number, replacing the base variable and the nonbase variable of the feasible base, and performing nonbase operation on the feed cost constraint condition until the inspection number of the simplex matrix is a nonnegative number to obtain an optimal solution, wherein the optimal solution is the first feed formula information.
3. The method for determining a feed formulation according to claim 1, wherein the second linear algorithm is an interior point method, and the generating second feed formulation information satisfying the target constraint condition according to the feed information by using a preset second linear algorithm comprises:
iterating the feed nutrition constraint condition by using a preset interior point method according to the feed information to obtain an iteration result;
and updating parameters of the feed cost constraint condition based on the iteration result until a preset utility function reaches a preset convergence condition to obtain the second feed formula information.
4. A method of determining a feed formulation according to any one of claims 1 to 3 wherein the feed nutritional constraints comprise nutritional indicator content constraints, nutritional indicator conversion constraints and feed dosage constraints; the target constraint condition is determined according to the information of various feeds and the information of the nutritional structure required by the growth of the animals, and comprises the following steps:
determining the nutritional index content constraint condition between each feed and the nutritional structure based on the nutritional index content of each feed in the feed information and the total content of each nutritional index in the nutritional structure information;
determining a nutritional index conversion rate constraint condition of each feed based on the nutritional index content of each feed in the feed information and a preset nutritional index conversion coefficient and a nutritional index constraint value;
determining the feed usage constraint condition based on the feed type in the feed information;
determining the feed cost constraint condition based on the feed type and the feed unit price of each feed in the feed information.
5. The method of determining a feed formulation of claim 4, wherein prior to determining a target constraint based on the feed information and the nutritional structure information, further comprising:
determining the content of the nutritional index of each feed in the feed information based on a preset feed nutrition matrix, wherein the feed nutrition matrix is as follows:
Figure FDA0003387889950000021
wherein QijIs the feed nutrition matrix between i feeds and j nutrition indexes, aijThe percentage of the ith feed containing the jth nutrition index is shown.
6. The method of determining a feed formulation according to any one of claims 1 to 3, wherein the performing a combined iteration of the first feed formulation information and the second feed formulation information using a predetermined genetic algorithm until a predetermined iteration termination condition, resulting in third feed formulation information, comprises:
determining a first feed formula information and a second feed formula information as chromosomes of a genetic population;
performing evolutionary iteration on the genetic population by using the genetic algorithm;
calculating target fitness of all chromosomes in the genetic population during evolution iteration according to the feed cost constraint condition;
and when the evolution iteration times reach preset evolution iteration times, stopping iteration, and taking the feed formula information corresponding to the chromosome with the minimum target fitness as the third feed formula information.
7. The method of determining a feed formulation of claim 6, wherein said performing evolutionary iterations on said genetic population using said genetic algorithm comprises:
determining the total fitness of the genetic population and the individual fitness of each chromosome in the genetic population according to the feed cost constraint condition;
determining the relative fitness of each chromosome according to the total fitness and the individual fitness;
generating a new chromosome according to the relative fitness;
performing crossover operations on all the chromosomes in the genetic population to generate offspring chromosomes;
and carrying out mutation operation on the offspring chromosome to obtain a variant chromosome.
8. A feed formulation determination apparatus, comprising:
the determining module is used for determining target constraint conditions according to various feed information and nutrition structure information required by animal growth, wherein the target constraint conditions comprise feed nutrition constraint conditions and feed cost constraint conditions;
the first generation module is used for generating first feed formula information meeting the target constraint condition according to the feed information by utilizing a preset first linear algorithm;
the second generation module is used for generating second feed formula information meeting the target constraint condition according to the feed information by using a preset second linear algorithm;
and the iteration module is used for performing combined iteration on the first feed formula information and the second feed formula information by using a preset genetic algorithm until a preset iteration termination condition is reached to obtain third feed formula information.
9. An electronic device, comprising a memory for storing a computer program and a processor that runs the computer program to cause the electronic device to perform the method of determining a feed formulation according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, carries out the method of determining a feed formulation according to any one of claims 1 to 7.
CN202111462477.8A 2021-12-02 2021-12-02 Method and device for determining feed formula, electronic equipment and storage medium Pending CN114239933A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111462477.8A CN114239933A (en) 2021-12-02 2021-12-02 Method and device for determining feed formula, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111462477.8A CN114239933A (en) 2021-12-02 2021-12-02 Method and device for determining feed formula, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114239933A true CN114239933A (en) 2022-03-25

Family

ID=80752939

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111462477.8A Pending CN114239933A (en) 2021-12-02 2021-12-02 Method and device for determining feed formula, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114239933A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114557460A (en) * 2022-04-27 2022-05-31 北京喜禽药业有限公司 Big data-based animal feed production method, system and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114557460A (en) * 2022-04-27 2022-05-31 北京喜禽药业有限公司 Big data-based animal feed production method, system and storage medium
CN114557460B (en) * 2022-04-27 2022-07-19 北京喜禽药业有限公司 Big data-based animal feed production method, system and storage medium

Similar Documents

Publication Publication Date Title
Withers et al. Achieving sustainable phosphorus use in food systems through circularisation
Sofi et al. Decision making in agriculture: A linear programming approach
CN111967971B (en) Bank customer data processing method and device
Domínguez-May et al. Effect of ration and size heterogeneity on harvest time: tilapia culture in Yucatan, Mexico
Pourmoayed et al. A hierarchical Markov decision process modeling feeding and marketing decisions of growing pigs
CN116307191B (en) Water resource configuration method, device and equipment based on artificial intelligence algorithm
CN114239933A (en) Method and device for determining feed formula, electronic equipment and storage medium
CN116822732A (en) Price prediction method based on self-supervision feature enhancement and stacking type integrated learning, computer device and computer readable storage medium
CN115409153A (en) Attention LSTM-based animal husbandry index prediction method and prediction system
CN108292385A (en) Genome-based technologies for agricultural production and performance management
CN116881641A (en) Pre-training model adjustment method and device, storage medium and computing equipment
CN106372740B (en) Calculation method and system for pasturing area water-soil grass-livestock balance model
Zhou et al. Research on multi objective optimization model of sustainable agriculture industrial structure based on genetic algorithm
Zhang et al. How Will the Global Food Landscape Accommodate Developing Countries’ Dietary Change under Urbanization?
Junqueira et al. Is single-step genomic REML with the algorithm for proven and young more computationally efficient when less generations of data are present?
CN115486247B (en) Method, storage medium and processor for determining fertilizer proportions
Wijayaningrum et al. Numerical methods for initialization in fodder composition optimization
CN114461619A (en) Energy internet multi-source data fusion method and device, terminal and storage medium
CN112950033B (en) Reservoir dispatching decision method and system based on reservoir dispatching rule synthesis
Hidalgo et al. Changes in genomic predictions when new information is added
CN109344877A (en) A kind of sample data processing method, sample data processing unit and electronic equipment
CN114021950A (en) Power material demand distribution method and device, terminal equipment and storage medium
Godber et al. Mediterranean goat production systems: vulnerability to population growth and climate change
Halachmi Biomass management in recirculating aquaculture systems using queuing networks
Halachmi Mathematical principles of production management and robust layout design: Part I. 250-ton/year recirculating aquaculture system (RAS)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination