The content of the invention
The present invention is existing to solve by providing a kind of Pet feeding method and system analyzed based on Internet of Things big data
Due to a lack of the experience of nursing during Pet feeding, it is impossible to control optimum feeding scheme and cause house pet hungry or unsound ask
Topic.
To solve the above problems, the present invention is employed the following technical solutions and is achieved:
On the one hand, the Pet feeding method analyzed based on Internet of Things big data that the present invention is provided, including:
Step S1:The collection species of house pet, sex, the age, palmic rate, blood pressure, body temperature, activity, feeding type, feed
Appetite, present image, Current body mass constitute influence factor matrix X, and upload onto the server;Wherein, feeding type and feeding amount
Constitute decision variable;
Step S2:Utilize between Elman neural networks influence factor's matrix X and pet health index in server
Complex nonlinear relation, obtain Pet feeding model;
Step S3:Pet feeding model is optimized using SPEA-II algorithms, obtain decision variable one group is optimum
Solution;
Step S4:Using this group of optimal solution of decision variable as house pet recommendation decision-making X*User is issued to by server
Terminal unit shown;
Step S5:The recommendation decision-making X that user shows according to terminal unit*Feeding house pet.
On the other hand, the Pet feeding system analyzed based on Internet of Things big data that the present invention is provided, including:
Data acquisition unit, for gather the species of house pet, sex, the age, palmic rate, blood pressure, body temperature, activity,
Feeding type, feeding amount, present image, Current body mass constitute influence factor matrix X, and upload onto the server;Wherein, feeding class
Type and feeding amount constitute decision variable;
Pet feeding model sets up unit, for utilizing Elman neural network influence factor matrix X in server
With the complex nonlinear relation between pet health index, Pet feeding model is obtained;
Decision variable optimal solution acquiring unit, for being optimized to Pet feeding model using SPEA-II algorithms, is obtained
One group of optimal solution of decision variable, and as the recommendation decision-making X of house pet*;
Recommend decision-making issuance unit, for passing through server by the recommendation decision-making X of house pet*It is issued to the terminal unit of user
Shown.
Compared with prior art, the Pet feeding method and system analyzed based on Internet of Things big data that the present invention is provided
Advantage is:Using complicated non-between Elman neural networks influence factor's matrix X and pet health index in server
Linear relationship, obtains the dynamic model of Pet feeding, recycles SPEA-II algorithm optimization Pet feeding models, it is determined that house pet
Feeding amount, the optimal value of food type, and feeding pet amount, the optimal value of food type composition feeding pet scheme is immediately anti-
Feed user, allows user to understand the present situation of house pet whenever and wherever possible, is that house pet has built more preferable living environment.
Specific embodiment
Fig. 1 shows the flow process of the Pet feeding method analyzed based on Internet of Things big data according to embodiments of the present invention.
As shown in figure 1, the Pet feeding method analyzed based on Internet of Things big data of the present invention, including:
Step S1:The collection species of house pet, sex, the age, palmic rate, blood pressure, body temperature, activity, feeding type, feed
Appetite, present image, Current body mass constitute influence factor matrix X, and upload onto the server;Wherein, feeding type and feeding amount
Constitute decision variable.
Health degree y to house pet is obtained by statistics1The maximum variable is affected to be:Pet breeds x1, age x2, heart beating
Frequency x3, blood pressure x4, activity x5, body temperature x6, present image x7, sex x8, Current body mass x9, feeding amount x10, food type x11,
Totally 11 variables;Wherein, palmic rate x3, blood pressure x4, activity x5, body temperature x6By corresponding sensor measurement data;Current figure
As x7Gathered by photographic head, pet breeds x1, age x2, sex x8, Current body mass x9For build-in attribute, by user input;Feeding
Amount x10, food type x11Constitute decision variable.
The body temperature x of house pet6Obtained by temperature sensor collection;Palmic rate x of house pet3Gathered by heart rate sensor
Obtain;The blood pressure x of house pet4Obtained by blood pressure sensor collection;The activity x of house pet5Obtained by pedometer collection;Utilize
Sample circuit is attached respectively with temperature sensor, heart rate sensor, blood pressure sensor, pedometer, weight sensor, and will
The body temperature of the house pet that temperature sensor, heart rate sensor, blood pressure sensor, pedometer, weight sensor are collected respectively, heart beating
Frequency, blood pressure, activity, Current body mass are converted into digital signal.
Facial characteristics of the house pet at current time are obtained by photographic head collection, and photographic head converts image information into numeral
Signal.
In the present invention, server is preferably Cloud Server.
Step S2:Utilize between Elman neural networks influence factor's matrix X and pet health index in server
Complex nonlinear relation, obtain Pet feeding model.
X is setk=[xk1,xk2,L,xkM] (k=1,2, L, S) be input vector, N be training sample number,
For the g time iteration when between input layer M and hidden layer I
Weighted vector, WJPWeighted vector when () is the g time iteration g between hidden layer J and output layer P, WJCWhen () is the g time iteration g
Weighted vector Y between hidden layer J and undertaking layer Ck(g)=[yk1(g),yk2(g),L,ykP(g)] (k=1,2, L, S) be the g time
The reality output of network, d during iterationk=[dk1,dk2,L,dkP] (k=1,2, L, S) be desired output, iterationses g be 500.
Using the complexity between Elman neural networks influence factor's matrix X and pet health index in server
Non-linear relation, obtains the process of Pet feeding model, including:
Step S21:Initialization, if iterationses g initial values are 0, is assigned to respectively WMI(0)、WJP(0)、WJC(0) one (0,1)
Interval random value;
Step S22:Stochastic inputs sample Xk;
Step S23:To input sample Xk, reality output Y of every layer of neuron of forward calculation Elman neutral netk(g);
Step S24:According to desired output dkWith reality output Yk(g), calculation error E (g);
Step S25:Whether error in judgement E (g) is less than default error amount;If greater than or be equal to, into step S26,
It is less than as crossed, then into step S29;
Step S26:Whether iterationses g+1 is judged more than maximum iteration time, if it is greater, then into step S29, it is no
Then, into step S27;
Step S27:To input sample XkThe partial gradient δ of every layer of neuron of backwards calculation Elman neutral net;
Step S28:Modified weight amount Δ W is calculated, and corrects weights;G=g+1 is made, step S23 is jumped to;
Wherein, Δ Wij=η δij, η is the learning efficiency;Wij(g+1)=Wij(g)+ΔWij(g);
Step S29:Judge whether the training for completing all samples;If it is, completing modeling;If not, jumping to step
S22。
In the design of Elman neutral nets, the number of hidden nodes number be the pass for determining Elman neural network models quality
Key, is also the difficult point in the design of Elman neutral nets, determines the nodes of hidden layer using trial and error procedure here.
In formula, p is hidden neuron nodes, and n is input layer number, and m is output layer neuron number, and k is 1-10
Between constant.The arrange parameter of Elman neutral nets is as shown in table 2 below.
Table 2Elman neutral net arrange parameters
By said process, Elman neural network predictions effect is obtained as Figure 2-3.The base that intelligent pet is fed
Plinth is the foundation of model, and model accuracy directly affects output result.By analyzing Fig. 2-3, the pre- maximum survey of health index
Error is -3.9%, and model prediction accuracy is high, meets modeling demand.
Step S3:Using SPEA-II algorithms (Strength Pareto EvolutioanryAlgorithm-II, intensity
Evolution algorithm-II) Pet feeding model is optimized, obtain one group of optimal solution of decision variable.
Obtain one group of optimal solution of decision variable, that is, obtain the irrigation amount of house pet, dose, one group of Fertilizer Type
Optimal value.
The step of being optimized to Pet feeding model using SPEA-II algorithms is included:
Step S31:Each individual fitness F (i)=R (i)+D (i) in population in calculating Pet feeding model, wherein,
R (i) and D (i) are two factors for affecting F (i) size.
Concept is arranged according to Pareto, R (i) is obtained:
In formula, Q is filing collection, and P is evolution colony, the population that iteration updates, initial population P (0) is selected,
Intersect, mutation operation obtains second filial generation population P (1), second filial generation population P (1) is selected, intersected, mutation operation obtains the
Three generations population P (2), by that analogy.
D (i) is to affect F (i) while considering that domination is individual and is arranged individual information, and F (i) is obtained using neighbour's mechanism
Obtain more scientific evaluation:
In formula, M is the individual amount of filing collection Q,It is individual i to the Euclidean distance between its k-th adjacent body;
In order to calculateNeed to calculate individuality i to evolution colony P and file to collect the distance between other all individualities in Q, and according to
Increasing is arranged.
Step S32:Environmental selection is carried out to the individuality of population, new filing collection Q is obtainedt+1, t is current iteration number of times;Its
In, step S32 includes:
Step S321:Individuality of the fitness less than 1 is chosen in population and is put into filing collection Qt+1In:
Step S322:If filing collection Qt+1In individual amount and M it is equal, i.e., | Qt+1|=M, directly using filing collection
Qt+1;If filing collection Qt+1In individual amount be less than M, i.e., | Qt+1| < M, then in previous generation population PtAnd QtMiddle selection (M- | Q
|) individual fitness less than 1 individuality be put into it is described filing collection Qt+1In;If filing collection Qt+1In individual amount be more than M, i.e., |
Qt+1| > M, then individual i is selected successively from filing collection Q according to construction processt+1Middle deletion:
Wherein,Represent individuality i with filing collection Qt+1In k-th individuality Euclidean distance, exist when there is at least one individuality
It is neighbouring with its front l it is individual there is identical minimum euclidean distance, and it is neighbouring from its k-th it is individual with it is different apart from when,
Delete an individuality with minimum euclidean distance.
Step S323:Judge whether iterationses reach the default upper limit;If reached, output filing collection Qt+1Value;Such as
Fruit is not up to, and carries out step S33;
Step S33:Initial population is selected, is intersected, mutation operation updated after new population Pt+1;
Step S34:By population Pt+1With filing collection Qt+1Step S31, circulation step S31 and step S32 are substituted into, until iteration
Till number of times reaches the default upper limit, and export the value of current Q.
For initial population P (0), filing integrate Q (0) as sky, individuality of the fitness less than 1 is selected from initial population P (0)
In being put into filing collection Q (0), judge whether iterationses reach the default upper limit, if reached, directly output filing collects Q's (0)
Value, if not up to, is selected, is intersected, mutation operation to initial population P (0), new population P (1) is obtained, from population P
(1) choose individuality of the fitness less than 1 in be put in filing collection Q (1), by that analogy, until iterationses are reached on default
It is limited to stop, the value of the current filing collection Q of output.It should be noted that P and Q are the set of continuous renewal.
Step S4:Using this group of optimal solution of decision variable as house pet recommendation decision-making X*User is issued to by server
Terminal unit shown.
Various kinds of sensors gathered a secondary data per 2 hours and uploads onto the server, and server connects data and by Pet feeding
Model provides feeding amount and the food type that house pet is currently recommended.
Step S5:The recommendation decision-making feeding of pets that user shows according to terminal unit.
User can on the terminal device open intelligent pet and feed interface (as shown in Figure 4), the interface display house pet
Brief information, the brief information of house pet includes image, the current health index of house pet, and user can arrange the ideal of house pet at interface
Health index, by server the feeding type and feeding amount of recommendation are issued.
The current health index of house pet is obtained by being optimized to Pet feeding model based on SPEA-II algorithms, house pet
Current health index is corresponding with the one of decision variable group of optimal solution.
The Pet feeding method analyzed based on Internet of Things big data that the present invention is provided, first, using sensor, photographic head
Physical signs parameter, house pet image, feeding amount, the food type of house pet are gathered Deng hardware;Then, the data for collecting are uploaded
Stored to server, in server using Elman neural networks influence factor's matrix X and pet health index it
Between complex nonlinear relation, obtain Pet feeding model, Pet feeding model is optimized using SPEA-II algorithms, obtain
To one group of optimal value of each decision variable, and this group of optimal solution is issued to into PC the or APP terminals of user as recommendation decision-making, most
Afterwards, user can be according to the feeding amount and food type for recommending decision-making to determine house pet.The method can determine the Pet feeding of optimum
Scheme, is that house pet has built more preferable living environment.
Corresponding with said method, the present invention also provides a kind of Pet feeding system analyzed based on Internet of Things big data.
The Pet feeding system analyzed based on Internet of Things big data that the present invention is provided, including:
Data acquisition unit, for gather the species of house pet, sex, the age, palmic rate, blood pressure, body temperature, activity,
Feeding type, feeding amount, present image, Current body mass constitute influence factor matrix X, and upload onto the server;Wherein, feeding class
Type and feeding amount constitute decision variable.The detailed process of data acquisition unit gathered data refers to above-mentioned steps S1.
Pet feeding model sets up unit, for utilizing Elman neural network influence factor matrix X in server
With the complex nonlinear relation between pet health index, Pet feeding model is obtained.Pet feeding model sets up unit foundation
The detailed process of Pet feeding model refers to above-mentioned steps S2.
Decision variable optimal solution acquiring unit, for being optimized to Pet feeding model using SPEA-II algorithms, is obtained
One group of optimal solution of decision variable, and as the recommendation decision-making X of house pet*.Decision variable optimal solution acquiring unit obtains decision-making and becomes
The optimal solution detailed process of amount refers to above-mentioned steps S3.
Recommend decision-making issuance unit, for passing through server by the recommendation decision-making X of house pet*It is issued to the terminal unit of user
Shown.
The recommendation decision-making X that user shows according to terminal unit*Feeding is carried out to house pet.
It should be pointed out that described above is not limitation of the present invention, the present invention is also not limited to the example above,
Change, modified, addition or replacement that those skilled in the art are made in the essential scope of the present invention, also should
Belong to protection scope of the present invention.