Disclosure of Invention
An object of the present disclosure is to provide a fresh food distribution prompting method and a fresh food distribution prompting apparatus capable of monitoring freshness, thereby overcoming, at least to some extent, one or more problems caused by the limitations and disadvantages of the related art.
According to one aspect of the present disclosure, there is provided a fresh food distribution prompting method capable of monitoring freshness, including:
receiving an initial image of fresh food, and carrying out graying processing on the initial image to obtain an initial gray value matrix;
receiving the fresh storage image at a preset time, and carrying out graying processing on the storage image to obtain a storage gray value matrix;
and comparing the storage gray value matrix with the initial gray value matrix, and prompting to adjust a distribution strategy when the difference between the storage gray value matrix and the initial gray value matrix exceeds a set threshold.
In an exemplary embodiment of the present disclosure, the fresh food delivery prompting method further includes:
receiving the initial image of the fresh food, storing the image and simultaneously receiving the environmental temperature of the environment where the image is located, calculating to obtain a first freshness, and transmitting the first freshness and the environmental temperature to a server;
the server calculates a loss factor and an environment variable parameter according to the first freshness and the environment temperature, and returns the loss factor and the environment variable parameter;
and calculating to obtain second freshness according to the environment temperature, the loss factor and an environment variable parameter, and adjusting the distribution strategy according to the second freshness.
In an exemplary embodiment of the present disclosure, the loss factor and the environment variable parameter are calculated by the following formula,
wherein the content of the first and second substances,
is the loss factor of the optical fiber,
is an environment variable parameter, x
iIs the ambient temperature of the i-th reception, y
iIs the first freshness calculated at the ith time,
is the average of the ambient temperature and is,
is the average of the first freshness.
In an exemplary embodiment of the present disclosure, by
Calculating the second freshness, wherein y
2iIs the second freshness calculated the ith time.
In an exemplary embodiment of the present disclosure, the fresh food delivery prompting method further includes:
and receiving an inquiry request of a user, and sending the second freshness and distribution information to the user according to the inquiry request.
In an exemplary embodiment of the present disclosure, comparing the stored gray-scale value matrix with the initial gray-scale value matrix, and when a difference between the stored gray-scale value matrix and the initial gray-scale value matrix exceeds a set threshold, prompting to adjust a distribution policy includes:
dividing the storage gray value matrix into a plurality of sub-matrices according to a set rule, and calculating to obtain a storage gray value average value of each sub-matrix;
dividing the initial gray value matrix into a plurality of sub-matrices according to the set rule, and calculating to obtain an initial gray value average value of each sub-matrix;
and comparing the storage gray level average value with the initial gray level average value of each sub-matrix, and prompting to adjust a distribution strategy when the difference between the storage gray level average value and the initial gray level average value exceeds a set threshold value.
According to another aspect of the present disclosure, there is provided a fresh food distribution prompting device capable of monitoring freshness, including:
the system comprises an initial gray value matrix acquisition unit, a gray value matrix acquisition unit and a gray value matrix generation unit, wherein the initial gray value matrix acquisition unit is used for receiving an initial image of a fresh food and carrying out gray processing on the initial image to obtain an initial gray value matrix;
the storage gray value matrix obtaining unit is used for receiving the fresh storage image at preset time and carrying out gray processing on the storage image to obtain a storage gray value matrix;
and the prompting unit is used for comparing the storage gray value matrix with the initial gray value matrix, and prompting to adjust the distribution strategy when the difference between the storage gray value matrix and the initial gray value matrix exceeds a set threshold.
In an exemplary embodiment of the present disclosure, the fresh food delivery prompting device further includes:
the first freshness calculation unit is used for receiving the initial image of the freshness, storing the image and receiving the environmental temperature of the environment where the image is located, calculating to obtain a first freshness, and transmitting the first freshness and the environmental temperature to a server;
the loss factor and environment variable parameter calculating unit is used for calculating to obtain a loss factor and an environment variable parameter according to the first freshness and the environment temperature through the server and returning the loss factor and the environment variable parameter;
and the second freshness calculation unit is used for calculating to obtain second freshness according to the environment temperature, the loss factor and the environment variable parameter, and adjusting the distribution strategy according to the second freshness.
In an exemplary embodiment of the present disclosure, the loss factor and the environment variable parameter are calculated by the following formula,
wherein the content of the first and second substances,
is the loss factor of the optical fiber,
is an environment variable parameter, x
iIs the ambient temperature of the i-th reception, y
iIs the first freshness calculated at the ith time,
is the average of the ambient temperature and is,
is the average of the first freshness.
In an exemplary embodiment of the present disclosure, by
The second freshness is calculated and the first freshness is calculated,
wherein, y2iThe second freshness obtained by the ith calculation.
In an exemplary embodiment of the present disclosure, the fresh food delivery prompting device further includes:
and the second freshness and distribution information sending unit is used for receiving an inquiry request of a user and sending the second freshness and distribution information to the user according to the inquiry request.
In an exemplary embodiment of the present disclosure, comparing the stored gray-scale value matrix with the initial gray-scale value matrix, and when a difference between the stored gray-scale value matrix and the initial gray-scale value matrix exceeds a set threshold, prompting to adjust a distribution policy includes:
dividing the storage gray value matrix into a plurality of sub-matrices according to a set rule, and calculating to obtain a storage gray value average value of each sub-matrix;
dividing the initial gray value matrix into a plurality of sub-matrices according to the set rule, and calculating to obtain an initial gray value average value of each sub-matrix;
and comparing the storage gray level average value with the initial gray level average value of each sub-matrix, and prompting to adjust a distribution strategy when the difference between the storage gray level average value and the initial gray level average value exceeds a set threshold value.
The fresh food distribution prompting method capable of monitoring freshness and the fresh food distribution prompting device capable of monitoring freshness convert an initial image of fresh food into an initial gray value matrix, receive a storage image of the fresh food at preset time, convert the storage image into a storage gray value matrix, finally compare the storage gray value matrix with the initial gray value matrix, and prompt a distributor to adjust a distribution strategy when the difference between the storage gray value matrix and the initial gray value matrix exceeds a set threshold value. On one hand, when the difference between the stored gray value matrix and the initial gray value matrix exceeds a set threshold value, a prompt is given to enable a distributor to adjust a distribution strategy, reference can be provided for the distributor to timely deliver fresh products to users, the satisfaction degree of the users is improved, the probability of signing by the users is increased, and the logistics loss is reduced. On the other hand, the state of the fresh products in the distribution process can be monitored in real time through storing the images, so that the freshness of the fresh products is sensed. On the other hand, the fresh initial image is converted into the initial gray value matrix, the stored image is converted into the stored gray value matrix, the gray value matrix is easy to calculate and compare, the calculation speed is increased, and therefore the efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In the present exemplary embodiment, firstly, a fresh food distribution prompting method capable of monitoring freshness is provided, and referring to fig. 1, the fresh food distribution prompting method capable of monitoring freshness may include the following steps:
and step S1, receiving the fresh initial image, and carrying out graying processing on the initial image to obtain an initial gray value matrix.
And step S2, receiving the fresh storage image at preset time, and carrying out graying processing on the storage image to obtain a storage gray value matrix.
Step S3, comparing the storage gray value matrix with the initial gray value matrix, and prompting to adjust the distribution strategy when the difference between the storage gray value matrix and the initial gray value matrix exceeds a set threshold.
According to the fresh product distribution prompting method capable of monitoring freshness in the embodiment, on one hand, when the difference between the stored gray value matrix and the initial gray value matrix exceeds the set threshold, prompting is performed to enable a distributor to adjust a distribution strategy, reference can be provided for the distributor to timely deliver fresh products to users, the satisfaction degree of the users is improved, the probability of signing by the users is increased, and logistics loss is reduced. On the other hand, the state of the fresh products in the distribution process can be monitored in real time through storing the images, so that the freshness of the fresh products is sensed. On the other hand, the fresh initial image is converted into the initial gray value matrix, the stored image is converted into the stored gray value matrix, the gray value matrix is easy to calculate and compare, the calculation speed is increased, and therefore the efficiency is improved.
As shown in fig. 3, when this method is used, an imaging device, a temperature sensor, a wireless transmission device, and a simple calculation device can be installed in the distribution box 5. The camera device can shoot images of fresh products in the distribution box 5 in real time; the temperature sensor can measure the temperature in the distribution box 5 in real time; the computing device can adopt a singlechip or a microprocessor; the wireless transmission device can perform wireless communication, can perform Bluetooth and can also perform wireless network. The distributor is equipped with terminal equipment 6, this terminal equipment 6 can be the cell-phone, install fresh food distribution APP in this terminal equipment 6, this fresh food distribution APP strides platform support Android and iOS system, this fresh food distribution APP can receive user 7's inquiry and also can carry out simple calculation and contrast, and send out the warning according to the threshold value that sets up and adjust own distribution strategy according to warning in order to remind the distributor, carry out the off-line calculation to data transfer server 4 simultaneously, receive the result that server 4 returned, the adjustment is delivered the strategy.
Next, a fresh food delivery prompting method capable of monitoring freshness in the present exemplary embodiment will be further described.
In step S1, a fresh original image is received, and the original image is grayed to obtain an original grayscale matrix.
In the present exemplary embodiment, the initial image may be an image captured by the imaging device immediately after the fresh product is put into the distribution box 5. After receiving the initial image, judging whether the transmitted initial image is an effective image or not, and if not, discarding the initial image; the initial image may then be reduced to a fixed size; and carrying out graying processing on the initial image to obtain an initial gray value matrix, and carrying out graying processing on the initial image so as to convert the initial image into a two-dimensional matrix array. The graying process of the initial image may employ several methods, for example, a component method, a maximum value method, an average value method, and a weighted average method.
In step S2, the fresh storage image is received at a preset time, and the storage image is grayed to obtain a storage gray value matrix.
In the present exemplary embodiment, the preset time may be every certain time, and the certain time may be 2 hours or 3 hours; in other embodiments of the present disclosure, the preset time may also be different time points such as 8 am, 4 pm, and 11 pm every day, which is not limited herein. The stored image may be an image captured by the image capturing device at the above-described point in time. After receiving the stored image, judging whether the transmitted stored image is an effective image or not, and discarding the stored image if the transmitted stored image is not the effective image; the stored image may then be reduced to a fixed size; the storage image is grayed to obtain a storage gray value matrix, and the storage image is grayed, so that the storage image is converted into a two-dimensional matrix array. The stored image may be grayed out by the following methods, for example, a component method, a maximum value method, an average value method, and a weighted average method.
In step S3, the stored gray-scale value matrix is compared with the initial gray-scale value matrix, and when the difference between the stored gray-scale value matrix and the initial gray-scale value matrix exceeds a set threshold, a prompt is given to adjust the distribution strategy.
In the present exemplary embodiment, the initial gray value matrix is divided into a plurality of sub-matrices according to the setting rule, and an initial gray value average value of each sub-matrix is calculated; dividing the storage gray value matrix into a plurality of sub-matrices according to a set rule, and calculating to obtain a storage gray value average value of each sub-matrix; and comparing the storage gray level average value with the initial gray level average value of each sub-matrix, and prompting to adjust a distribution strategy when the difference between the storage gray level average value and the initial gray level average value exceeds a set threshold value. The initial image and the storage image are shot by one camera device, and the positions of the camera device and the fresh product are not changed, so that the size of the initial image shot by the camera device is the same as that of the storage image, and the position of the fresh product recorded by each pixel point in the image is not changed basically, so that the size of a sub-matrix formed by dividing the initial gray value matrix and the storage gray value matrix according to the same set rule is also the same, the position of the fresh product recorded by each pixel point in the sub-matrix is not changed basically, and whether the fresh product is fresh or not can be determined more accurately through gray level.
The set rule can be that the matrix is divided according to n horizontal rows and m vertical columns from the upper left corner of the matrix, each sub-matrix is adjacent and not mutually overlapped, and n and m can be set as any natural number according to requirements; of course, it can be understood by those skilled in the art that the setting rule may also start from the lower left corner or the lower right corner of the matrix, and may also start from the middle; each sub-matrix may overlap several rows or columns in the horizontal or vertical direction. These specific settings are not particularly limited herein, and are set according to specific needs.
The set threshold value can be set as the difference between the average value of the stored gray scales of each sub-matrix and the average value of the initial gray scales, and can also be set as the difference between the sum of the average values of the stored gray scales of a plurality of sub-matrices and the sum of the average values of the initial gray scales; the matrix size can be set according to the nature of the fresh produce.
Further, the fresh food distribution prompting method may further include: receiving the initial image of the fresh food, storing the image and simultaneously receiving the environmental temperature of the environment where the image is located, calculating to obtain a first freshness, and transmitting the first freshness and the environmental temperature to a server 4; the server 4 calculates a loss factor and an environment variable parameter according to the first freshness and the environment temperature, and returns the loss factor and the environment variable parameter; and calculating to obtain second freshness according to the environment temperature, the loss factor and an environment variable parameter, and adjusting the distribution strategy according to the second freshness.
In this embodiment, the calculation is a cyclic calculation process using linear regression analysis, and receives the initial image of the fresh food captured by the camera device, the stored image, and the ambient temperature of the environment where the fresh food is located measured by the temperature sensor, and calculates a first freshness, a first freshness y for the first time1May be a set value, for example, the first freshness y of the first time may be set1Set to 100. The first freshness y of the first time is calculated1And the ambient temperature is transmitted to the garmentThe server 4, the server 4 calculates the loss factor and the environment variable parameter by the following formula,
wherein the content of the first and second substances,
is a loss factor, i.e. the freshness of the fresh produce with temperature change
Proportional acceleration loss of (1);
is an environment variable parameter, x
iIs the ambient temperature of the i-th reception, y
iIs the first freshness calculated at the ith time,
is the average of the ambient temperature and is,
is the average of the first freshness.
The
server 4 then passes back the loss factor and the environment variable parameter, via
Calculating the second freshness, wherein y
2iIs the second freshness calculated the ith time. Adjusting the distribution policy based on a second freshness degree, for example, the second freshness degree indicates that the freshness of the fresh food has decreased a lot and the distributor needs to distribute the fresh food immediately; the second freshness indicates that the freshness of the fresh food is not degraded and the dispenser may choose to deliver the fresh food more urgently and delay delivery slightly if the freshness is degraded better.
In addition, in the subsequent cycle calculation process, the second freshness obtained by the current calculation can be used as the first freshness of the next calculation, and the first freshness can also be obtained by comparing the storage image of the fresh food shot by the camera device with the initial image. And is not particularly limited herein.
Further, the fresh food distribution prompting method may further include: receiving an inquiry request of a user 7, and sending the second freshness and distribution information to the user 7 according to the inquiry request. In this exemplary embodiment, a mobile phone of the user 7 may be installed with a fresh food query APP, or the user 7 may query through a query function provided in online shopping, and the distributor sends the second freshness and the distribution information to the user 7 after receiving the query request, because the second freshness more accurately describes the freshness of the fresh food product, the information obtained by the user 7 is more accurate by sending the second freshness, and the purchase experience of the user 7 can be increased.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Further, the present exemplary embodiment also provides a fresh food distribution prompting device capable of monitoring freshness degree corresponding to the fresh food distribution prompting method capable of monitoring freshness degree. Referring to fig. 2, the fresh food distribution prompting device may include an initial gray value matrix obtaining unit 1, a storage gray value matrix obtaining unit 2, and a prompting unit 3. Wherein:
the initial gray value matrix obtaining unit 1 may be configured to receive an initial image of a fresh object, perform graying processing on the initial image, and obtain an initial gray value matrix.
The storage gray value matrix obtaining unit 2 may be configured to receive the fresh storage image at a preset time, and perform graying processing on the storage image to obtain a storage gray value matrix.
The prompting unit 3 may be configured to compare the stored gray value matrix with the initial gray value matrix, and prompt to adjust the distribution strategy when a difference between the stored gray value matrix and the initial gray value matrix exceeds a set threshold.
In this example embodiment, the fresh food delivery prompting device may further include:
the first freshness calculation unit is used for receiving the initial image of the freshness, storing the image and receiving the environmental temperature of the environment where the image is located, calculating to obtain a first freshness, and transmitting the first freshness and the environmental temperature to a server 4; the loss factor and environment variable parameter calculating unit may be configured to calculate, by the server 4, a loss factor and an environment variable parameter according to the first freshness and the environment temperature, and return the loss factor and the environment variable parameter; and the second freshness calculation unit can be used for calculating to obtain second freshness according to the environment temperature, the loss factor and the environment variable parameter, and adjusting the distribution strategy according to the second freshness.
In the present exemplary embodiment, the loss factor and the environment variable parameter are calculated by the following formulas,
wherein the content of the first and second substances,
is the loss factor of the optical fiber,
is an environment variable parameter, x
iIs the ambient temperature of the i-th reception, y
iIs the first freshness calculated at the ith time,
is the average of the ambient temperature and is,
is the average of the first freshness.
In the present exemplary embodiment, by
Calculating the second freshness, wherein y
2iThe second freshness obtained by the ith calculation.
In this example embodiment, the fresh food delivery prompting device may further include: the second freshness and delivery information sending unit may be configured to receive an inquiry request from a user 7, and send the second freshness and delivery information to the user 7 according to the inquiry request.
In this example embodiment, comparing the stored gray value matrix with the initial gray value matrix, and when a difference between the stored gray value matrix and the initial gray value matrix exceeds a set threshold, prompting to adjust a distribution policy may include:
dividing the storage gray value matrix into a plurality of sub-matrices according to a set rule, and calculating to obtain a storage gray value average value of each sub-matrix;
dividing the initial gray value matrix into a plurality of sub-matrices according to the set rule, and calculating to obtain an initial gray value average value of each sub-matrix;
and comparing the storage gray level average value with the initial gray level average value of each sub-matrix, and prompting to adjust a distribution strategy when the difference between the storage gray level average value and the initial gray level average value exceeds a set threshold value.
The details of each module in the fresh food distribution prompting device capable of monitoring freshness have been described in detail in the corresponding virtual object motion control method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.