The invention provides a pet feeding method and system based on an internet of things, wherein the pet feeding method based on the internet of things comprises the following steps that types, sexes, ages, heart rates, respiratory rates, body temperature, active values, feeding types, feeding amounts, current images and current weight of pets are collected to form an influencing factor matrix X, and the influencing factor matrix X is uploaded to a server, wherein the feeding types and the feeding amounts form decision variables; an Elman neural network is used in the server to establish a complex nonlinear relationship between the influencing factor matrix X and pet health indexes to obtain pet feeding models; an MOPSO (Modified Bacteria Foraging Optimization) algorithm is used for optimizing the pet feeding models to obtain a set of optimal solutions of the decision variables; the set of the optimal solutions of the decision variables is taken as recommended decisions X<*> of the pets, and the recommended decisions X<*> of the pets are issued to terminal equipment of a user to be displayed through the server; the user feeds the pets according to the recommended decisions X<*> displayed by the terminal equipment. By using the pet feeding method and system based on the internet of things disclosed by the invention, an optimal pet feeding scheme can be determined to build better living environments for the pets.