Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a dining prediction method for students after school, which can solve the problem of dining prediction of students after school.
The technical scheme for realizing the purpose of the invention is as follows: a method for predicting dining of a student after school, comprising the steps of:
step 1: obtaining a set of potential dining students, the set of potential dining students including potential dining students, the potential dining students characterizing students having dining requirements;
step 2: traversing a potential dining student set, counting the historical dining conditions of each student, and calculating the dining influence factor of each student according to the historical dining conditions, wherein the dining influence factor characterizes the influence of the current student on dining of other surrounding classmates;
step 3: traversing a potential dining student set, counting the quantity of student exercise after each meal, comparing the current average quantity of exercise of the students with the historical average quantity of exercise, and judging whether the current food meal accords with the taste of the students according to the comparison result so as to adjust dishes of the subsequent food meal;
step 4: predicting the food meal quantity of the next meal according to the meal influencing factors.
Further, in step 3, whether the current food meal accords with the taste of the student is judged according to the comparison result so as to adjust the dishes of the subsequent food meal, which specifically comprises:
if the average motion quantity of the current student is more than or equal to the historical average motion quantity, the dishes of the current food meal are maintained, and if the average motion quantity of the current student is less than the historical average motion quantity, the dishes of the current food meal are replaced.
Further, in step 4, the predicting the number of food meals of the next meal according to the meal influencing factors specifically includes:
if the meal influencing factor is positive, the food meal quantity is increased, otherwise, the food meal quantity is reduced.
Further, the students with dining requirements are students with dining tendencies within a preset time.
Further, the specific implementation of the step 2 includes the following steps:
step 21: calculating the average student number of historical dining at the current timeAnd current student dining in comparison to +.>An increased or decreased number of students b, wherein the current student has a meal on day i compared to +.>The number of students increasing or decreasing is calculated according to the formula (1):
wherein xi represents the total number of students taking meals on the i day;
step 22: calculating the average influence number of the current students on other surrounding classmates according to a formula (2)
Where n represents the total number of days the current student spends at the current time,
average influence of other students around the current studentCompared with the temporary change meal number threshold y, ifThe current student is taken as an effective influence student, and all effective influence mechanics students are formed into an effective influence mechanics student set,
searching all students having intersections with the current students to obtain an intersection student set of the current students, traversing the intersection student set, searching the students meeting the preset conditions in the history dining and taking the students as the unaffected students of the current students, and calculating the average unaffected student numbers of the current students according to the number of unaffected students on each dayWill->And->As the dining influencing factor for the current student.
Further, the student having an intersection with the current student refers to a student who meets any one of the conditions:
condition one: the same class, adjacent classes, relatives, and the same cell address.
Further, the preset conditions are: there is at least one meal that is not synchronized with the current student in the historical meal that expires at the current time.
Further, after step 4, step 5:
step 5: traversing the effective influence mechanics student set, counting the quantity of motion of the effective influence students, comparing the quantity of motion of the effective influence students with the historical average quantity of motion to judge whether the taste of the current food meal accords with the taste of the effective influence students or not, thereby adjusting the food meal so that the next food meal accords with the taste of the effective influence students,
and taking students with the dining influence factors exceeding the threshold of the number of people in dining as influencing students, and forming the effective influencing mechanics student set by all influencing mechanics students.
The beneficial effects of the invention are as follows: the invention can effectively predict the dining quantity of students after class and predict the dishes of subsequent food dining, and can guide more students to dining in school as much as possible by finding out the dining condition of the influencing students, thereby improving the operation stability of the dining after class and guaranteeing the diet safety of the students. Meanwhile, the problems that the taste of meal is not matched with that of students, the students are attracted to eat before eating, the health of the students is prevented from being influenced due to unreasonable nutrition or problems of the meal, the students cannot be found in time, and the health risk is predicted, so that the students can be prevented and arranged in advance.
Detailed Description
The invention will be further described with reference to the drawings and detailed description below.
As shown in fig. 1, a method for predicting dining of students after school, comprising the steps of:
step 1: and (5) investigation and statistics of students in whole school needing to eat, and rejection of students with clear useless meal demands, so that a potential dining student set is obtained.
In this step, mainly to screen out those students who explicitly inform the school of the useless dining requirement, the students who need to eat do not require the students to eat after each day of class, but rather, the students who have a regular or big probability of eating in the post-class service, that is, the students who have a dining tendency in a preset time, so that specific quantification of the regular or big probability can be limited according to practical situations, for example, the students can be considered to be students who have a regular or big probability of having a useful dining requirement when the number of times of eating exceeds 15 times in a learning period. Some students have no meal requirements during the entire school time for physical reasons or students who do not require post-school services. Even if the students can temporarily take meals in a very small number of times (for example, a certain day), the students belong to unexpected sudden events which cannot be predicted in advance and are temporary in the diagrams, the students are not discussed as the protection scope of the application or are required to be subjected to reservation registration before taking meals in the same day in actual dining, and the students can take meals after the reservation is successful.
Step 2: traversing a potential dining student set, counting the historical dining conditions of each student, and calculating the dining influence factor of each student according to the historical dining conditions, wherein the dining influence factor characterizes the influence of the current student on dining of other surrounding classmates.
If the number of other students is influenced by the current student to eat is larger, or if the number of other students is influenced by the current student to eat is larger, the dining influence factor of the current student is larger, otherwise, the dining influence factor of the current student is smaller. For example, through statistics, if student a eats, the number of students eating on the day is obviously increased compared with the current day, or if student a does not eat, the number of students eating on the day is obviously reduced compared with the current day, and then the dining influence factor of student a is larger. The greater the number of people affected, the greater the meal impact factor for student a.
The dining influence factor of each student can be set to 0, that is, in a default state, whether each student takes a meal does not influence whether other surrounding students take a meal or not.
The specific calculation of the meal impact factor can be obtained by the following sub-steps:
step 21: calculating the average student number of historical dining at the current timeAnd current student dining in comparison to +.>An increased or decreased number of students b. For example, if the total number of students who have had dinner for the past 5 days is 200, the average number of students who have had dinner for the history is +.>200/5=40 people/day. Average student population for historic dining>Reflecting the number of daily students eating, in most cases, the number of students eating should be stable and not very different.
Wherein the current student is dining on day i as compared toThe number of students increasing or decreasing is calculated according to the formula (1):
wherein xi represents the total number of students taking meals on the i day, bi represents the number of students taking meals which is increased or decreased due to the fact that whether the current students take meals or not affects whether other surrounding classmates take meals, bi represents the number of students taking meals if the regular description is increased, and bi represents the number of students taking meals if the regular description is negative.
Step 22: calculating the average influence number of the current students on other surrounding classmates according to a formula (2)
Where n represents the total number of days the current student spent by the current time.
Average influence of other students around the current studentCompared with the temporary change meal number threshold y, ifThe current student is taken as an effective influence student, the effective influence mechanics student characterization is performed on students which have influence on other surrounding students in fact, and all effective influence mechanics students are formed into an effective influence mechanics student set.
The temporary change dining number threshold y can be set according to the difference value between the actual daily dining number and the dining number of the students in the potential dining student set. For example, the number of students in the potential dining student set is typically 70, but statistics show that the actual number of people in a certain day is 75, and then the 5 people can be considered as temporary change people. If the average value of the temporarily changed meal person is 5 after the statistics of a plurality of days, the temporarily changed meal person number threshold y may be set to 5.
In this step, by temporarily changing the threshold value y of the number of dinner, the number of dinner which is not increased or decreased due to the current presence or absence of dinner of students can be reduced to a great extent, and most of the increased or decreased number of dinner is compact and random, and belongs to temporarily increased number of dinner. For example, a student who is not a member of the set of potential dining students may not be affected by the current student's meal on a certain day, but may be temporarily required to have a meal, but the student may be counted as an increased number of people having a meal, for which reason further culling is required.
Step 23: in step 22, although the temporary change meal number threshold y is preset to reduce the meal number change that is not actually caused by the influence to a large extent, the reduced meal number change is often a temporary meal number that cannot be predicted in advance, and the remaining reduced change meal number is not necessarily caused by the influence of the current student. Because some newly added or reduced dining students do not know and do not meet the current students at all, the dining or non-dining of the students is not affected by the current students, and therefore the change of the number of people who have dining caused by the actual influence of the current students is further reduced.
And searching all students having intersections with the current students to obtain an intersection student set of the current students. Students who have an intersection with the current student refer to students who meet any one of the conditions:
condition one: the same class, adjacent classes, relatives, and the same cell address.
Adjacent classes refer to classes adjacent to the exclusive classroom for education. Of course, in practical applications, other conditions may be added to the first condition, which is merely exemplary and not exhaustive.
Traversing the intersection student set, finding out students meeting the second condition every day in the history dining, taking the students as unaffected students of the current students, and calculating the average unaffected student number of the current students according to the number of unaffected students every day
Condition II: there is at least one meal that is not synchronized with the current student in the historical meal that expires at the current time.
For example, if the current student is dining and another student is not dining on the same day, or if the current student is not dining and another student is dining on the same day, then the other student considers that condition two is satisfied and the other student is the unaffected student of the current student.
Will beAnd->As the dining influencing factor for the current student.
In an alternative embodiment, the absolute value normalized result is used as the meal impact factor for the current student.
Step 3: and traversing the potential dining student set, counting the motion quantity of each student after each meal so as to obtain the current average motion quantity of the students, comparing the current average motion quantity of the students with the historical average motion quantity, and judging whether the current food meal accords with the taste of the students according to the comparison result so as to adjust dishes of the subsequent food meal. If the average motion amount of the current student is higher than the average motion amount of the history, the current food meal accords with the taste of the student more than before; if the current average motion quantity of the students is equal to the historical average motion quantity, the current food meal is basically consistent with the previous food meal in accordance with the taste of the students; if the current average exercise amount of the students is lower than the historical average exercise amount, the current food meal is not in line with the taste of the students.
The current average motion quantity of students refers to the average motion quantity of all students currently, and the historical average motion quantity refers to the average motion quantity of all students in a historical meal every day.
Step 4: predicting the food meal quantity and dishes of the next meal according to the meal influencing factors, the student exercise quantity and the historical average exercise quantity, wherein if the meal influencing factors are positive, the food meal quantity is increased, otherwise, the food meal quantity is reduced; if the student exercise amount is more than or equal to the history average exercise amount, the dishes of the current food are maintained, and if the student exercise amount is less than the history average exercise amount, the dishes of the current food are replaced.
By maintaining or replacing the dishes of the current food meal, the nutritional needs of the students can be well maintained. Usually, only the current food meal accords with the current student, the student exercise amount of the student can be improved, the student health can be improved by increasing the exercise amount, otherwise, the exercise amount of the student is reduced, the exercise amount is reduced, the body of the student is often influenced by the explanation of the exercise amount reduction, the body health of the student is influenced, the body health condition of the student can be predicted through the exercise amount of the student, and the student can be prevented and arranged in advance.
In an alternative embodiment, after step 4, step 5 is further included:
step 5: traversing the effective influence mechanics student set, counting the quantity of motion of the effective influence students, and comparing the quantity of motion of the effective influence students with the historical average quantity of motion to judge whether the taste of the current food meal accords with the taste of the effective influence students or not, so that the food meal is adjusted to ensure that the next food meal accords with the taste of the effective influence students. Therefore, the dining is carried out before the mechanics is effectively influenced by guiding, other surrounding students are driven to carry out the dining before the mechanics is carried out, the large rise and fall of the number of people having the dining caused by dining or not dining of the students with influence are avoided, and the operation stability of dining after class is improved.
The embodiment disclosed in the present specification is merely an illustration of one-sided features of the present invention, and the protection scope of the present invention is not limited to this embodiment, and any other functionally equivalent embodiment falls within the protection scope of the present invention. Various other corresponding changes and modifications will occur to those skilled in the art from the foregoing description and the accompanying drawings, and all such changes and modifications are intended to be included within the scope of the present invention as defined in the appended claims.