Disclosure of Invention
The invention provides a sales counter and an order generation method and system thereof, aiming at overcoming the defect that in the prior art, when an order generation mode of a vending machine is used for identifying commodities selected by a user, errors are easy to occur, and the order cannot be accurately generated.
The invention solves the technical problems through the following technical scheme:
an order generation method of a sales counter, the order generation method comprising the steps of:
acquiring weight change data of the articles in the sales counter;
generating at least one article selection list according to the weight change data;
acquiring image information of the selected article;
updating the article selection list according to the image information;
and generating an order according to the updated article selection list.
Preferably, the item selection list includes: selecting a probability;
generating at least one item selection list according to the weight change data, which specifically comprises the following steps:
calculating the similarity between the article selection list at the current moment and the article selection list at the previous moment;
calculating the selection probability according to the similarity;
the selection probability characterizes the matching probability of each item pick list with the actual picked item.
Preferably, after the step of generating the selection probability according to the similarity, the method further includes:
modifying the selection probability according to a weight coefficient.
Preferably, updating the item selection list according to the image information specifically includes:
And updating the selection probability according to the image information and based on a Bayesian inference algorithm.
Preferably, the image information includes: quantity of items and corresponding confidence;
updating the selection probability according to the image information and based on a Bayesian inference algorithm, specifically comprising:
updating the selection probability according to the quantity of the items and the confidence coefficient and based on a Bayesian inference algorithm.
Preferably, the step of generating an order according to the item selection list specifically includes:
and determining the item selection list with the maximum selection probability as the order.
Preferably, after the step of determining the item selection list with the highest selection probability as the order, the method further includes:
judging whether the maximum selection probability is smaller than a probability threshold value;
and when the judgment result is yes, prompting the article display prompt, and returning to the step of acquiring the image information of the article.
Preferably, the sales counter comprises: an electronic door lock;
before the step of acquiring the weight change of the articles in the sales counter, the method further comprises the following steps:
acquiring a shopping request; the shopping request includes user information;
and verifying the user information, and unlocking the electronic door lock when the verification is passed.
Preferably, after the step of generating an order according to the item selection list, the method further comprises:
judging whether the electronic door lock is locked or not;
if not, returning to the step of acquiring the weight change data of the articles in the sales counter;
if so, updating the inventory information of the sales counter according to the order; and/or generating payment information according to the order.
An order generating system for a sales counter, the order generating system comprising:
the weight sensor is used for acquiring weight change data of the articles in the sales counter;
the control module is used for generating at least one article selection list according to the weight change data;
the camera device is used for acquiring the image information of the selected article;
the control module is also used for updating the article selection list according to the image information and generating an order according to the updated article selection list.
Preferably, the item selection list includes: selecting a probability;
the control module specifically comprises:
the calculating unit is used for calculating the similarity between the article selection list at the current moment and the article selection list at the previous moment and calculating the selection probability according to the similarity;
The selection probability characterizes the matching probability of each item pick list with the actual picked item.
Preferably, the control module further comprises:
a modifying unit for modifying the selection probability according to a weight coefficient.
Preferably, the control module further comprises:
and the updating unit is used for updating the selection probability according to the image information and based on a Bayesian inference algorithm.
Preferably, the image information includes: quantity of items and corresponding confidence;
the updating unit is specifically configured to update the selection probability according to the quantity of the items and the confidence level and based on a bayesian inference algorithm.
Preferably, the control module further comprises:
and the selecting unit is used for determining the item selection list with the maximum selection probability as the order.
Preferably, the control module further comprises: a judging unit and a prompting unit;
the judging unit is used for calling the prompting unit when the maximum selection probability is judged to be smaller than the probability threshold;
the prompting unit is used for prompting article display reminding and calling the camera device.
Preferably, the sales counter comprises: an electronic door lock;
the order generating system further comprises:
The request acquisition module is used for acquiring a shopping request; the shopping request includes user information;
and the verification module is used for verifying the user information and unlocking the electronic door lock when the user information passes the verification.
Preferably, the order generation system further comprises: the system comprises a judgment module, an inventory updating module and/or a payment module;
the judging module is used for judging whether the electronic door lock is locked or not and calling the weight sensor when the judgment is negative; if so, calling the inventory updating module and/or the payment module;
the inventory updating module is used for updating the inventory information of the sales counter according to the order;
and the payment module is used for generating payment information according to the order.
A sales counter comprising an order generation system for a sales counter as claimed in any of the preceding claims.
The positive progress effects of the invention are as follows: the invention utilizes the gravity information of the articles in the sales counter and integrates the image recognition algorithm to carry out reasoning, can accurately recognize the articles selected by the user from the sales counter, and generates an accurate shopping order.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
The embodiment provides an order generation method for a sales counter, wherein the sales counter is a self-selection type unmanned sales counter, and an electronic door lock is arranged on a door of the sales counter. The user can select the needed articles from the sales counter according to the actual requirements.
As shown in fig. 1, the order generation method of the present embodiment includes the following steps:
step 110, obtaining a shopping request.
Wherein the shopping request includes user information. Specifically, the user can establish communication connection with the sales counter through the mobile terminal, and send a shopping request to the sales counter through a shopping APP (application program).
And 120, verifying the user information by the sales counter, and unlocking the electronic door lock when the verification is passed.
At this time, the user can select the articles in the sales counter, and when the user takes out an article from the sales counter, the stock amount and weight of the articles stored in the sales counter change.
And step 130, acquiring weight change data of the articles in the sales counter.
In step 130, the weight sensor may be used to obtain the weight change data of the articles in the sales counter in real time or at intervals. If the sales counter comprises a plurality of goods placing layers, each goods placing layer is provided with a weight sensor, and weight change data, namely the weight m of the articles on all the goods placing layers at the current momenttThe weight m of the articles on all the goods placing layers at the last momentt-1The difference of (a).
Step 140, generating at least one item selection list according to the weight change data.
The list of the selected items is the list of the items possibly selected by the user, the list can be represented by a vector, if N kinds of items are included in the sales counter, an N-dimensional vector can be adopted
Representing a pick list of items, where x
iThe number of the ith items selected by the user is represented, and i is more than or equal to 1 and less than or equal to N. By means of matrices
And representing all possible item selection lists at present, wherein M is the number of the possible item selection lists, and j is more than or equal to 1 and less than or equal to M.
For example, if the sales counter includes three articles A, B, C, the three articles weigh 50g, 100g, and 100g, respectively. When the weight sensor detects that the weight change data of the articles in the current sales counter is 100g, that is, the user takes 100g of the articles out of the sales counter, the article selection list of the user has three possibilities: 2 articles A; 1 item B; 1C article, corresponding to:
In this embodiment, the item selection list includes: a probability is selected. The selection probability is used for representing the matching probability of each item selection list and the item actually selected by the user, namely the probability of the item selection list, and the high probability indicates that the item is selected more frequently.
The following explains the calculation process of the selection probability:
step 140-1, calculating the similarity between the item selection list at the current moment and the item selection list at the previous moment.
There are many options for calculating the similarity, and in this embodiment, the number of elements in the matrix of the current item selection list that is the same as the number of elements in the matrix of the last item selection list is defined as the similarity.
For example, if the matrix of the current item selection list is:
the matrix of the item selection list at the previous moment is:
for X
tEach column vector of
And X
t-1Each column vector of
The similarity is recorded as
That is to say
And
the number of the same elements. Wherein n is more than or equal to 1 and less than or equal to M, and M is more than or equal to 1 and less than or equal to M.
R
21Represents
X t-12 nd column vector of
And
X t1 st column vector of
0,0]
TThe same number of elements, R
21R is calculated as 1
mnAnd obtaining a similarity matrix R as follows:
for easy calculation, for similar momentsThe array R is normalized to sigmanRmnI.e. such that the sum of the elements in each column vector in R is 1. The normalized results were:
And 140-2, generating selection probability according to the similarity.
By vectors
Representing the selection probability of all the items to be picked, the selection probability vector at the current moment
I.e. the selection probability of the similarity matrix and the previous moment
The product of (a); when the user sends a purchase request but does not pick an item, the initial item pick list X0 is [0 ]]Selection probability
Unlocking the electronic door lock, wherein after a user selects an article for the first time, the selection probability (initial selection probability) of the last moment is pi
t-1=[1]
TThe selection probability at the current time is
For the convenience of calculation, pair
Normalization is carried out to obtain
In this embodiment, after step 140-2, the selection probability may be further modified according to the weighting factor. Wherein the weighting coefficients may be obtained empirically. For example, the weight coefficient of the selection probability corresponding to the item selection list which is more favored by the user is increased.
Step 150, image information of the selected item is obtained.
Wherein, the image information of the article can be acquired by the camera. It should be noted that the number of the cameras may be one or more. In order to save the production cost, one camera is adopted in the embodiment. The image information includes a category of the item and a quantity of the item. Specifically, the image detection method based on the convolutional neural network detects the image to obtain the image information, and adopts the vector
Recording the detection result of the current time, wherein y
iIndicating the number of the detected ith product. The image detection method adopted in this step has various mature algorithms available for selection at present, such as fast Region-based Neural Networks (fast Convolutional Neural Networks), Solid State Disk (SSD) (Single Shot multi box Detector, Single scan Detector based on multiple detection frames), YOLO (young Only Look on, target detection system based on Single scan), and the like.
Or A, B, C, assuming that 1B item is detected in the current image, the detection vector is
And step 160, updating the article selection list according to the image information.
Specifically, the selection probability is updated in step 160 based on the image information. Preferably, the selection probability of the item selection list is updated based on a bayesian inference algorithm.
For X
tEach column vector of
Calculating prior probabilities
That is, the article selection list is
When the image is detected
The probability of (c). The calculation formula of the prior probability can be set according to the actual situation. For example, suppose as long as
Each element of (1) is not less than
The corresponding position element can be detected with a certain probability p
Then under this assumption there are:
to be provided with
And
for example, X
tOnly the second vector [0,1,0 ]]
TAll elements are not less than
Elements of the corresponding position, then
Calculating posterior probability according to Bayes formula
I.e. image detection
When the article is selected from the list of articles
The probability of (c). From bayes' formula, there are:
wherein, pi
jAnd pi
iTo select a probability vector
Element of (5), can be a posterior probability vector
Indicating image detection
The probability that the user picks the list of all possible items.
Thus, if the calculation in step 140-2 yields
Then
Posterior probability
Further, the selection probability is performed based on the image informationUpdated, new selection probabilities
Where β is the update rate, and can be set according to the actual requirement, for example, β is set to 0.4, and then the result is obtained
Step 170, generating an order according to the updated item selection list.
In
step 170, that is, in the updated item selection list, the item selection list with the highest selection probability is determined as the shopping order. If it is
Then pick the list of the articles
The determination is a shopping order, which indicates that the user actually picked 1 item B from the sales counter at that time.
In order to reduce the probability of image recognition error and further improve the accuracy, in this embodiment, after step 170, the method further includes:
Step 170-1, determine whether the maximum selection probability is less than a probability threshold.
The probability threshold may be set according to actual requirements, for example, set to 0.8.
If yes, go to step 170-2 in step 170-1; if not, go to step 180.
And step 170-2, prompting an article display reminder. And returns to step 150 to retrieve the image information of the selected item.
And step 180, judging whether the electronic door lock is locked.
If no, the user does not finish shopping, and the process returns to step 130. If yes, the user finishes shopping, and step 190 is executed.
Step 190, updating the inventory information of the sales counter according to the order; and/or generating payment information according to the order.
In the embodiment, all possible article selection lists are determined by utilizing the gravity information of the sales counter, the probability of the article selection lists is described by the selection probability and is used as a reliable criterion for judging whether the purchasing behavior of the user is normal, and the posterior probability is calculated by adopting a Bayesian formula by establishing the relation between the image recognition result and the article selection lists, so that the influence caused by the error of the image recognition result can be reduced, the articles selected by the user from the sales counter can be accurately verified, and the accuracy of a shopping order is improved.
Example 2
Embodiment 2 is basically the same as
embodiment 1, except that in this embodiment, the confidence is further considered when updating the selection probability. When detecting an image, the detection result is expressed as
Where θ represents the confidence of the detection result output by fast RCNN, SSD, or YOLO. The following describes the updating method of the selection probability:
first calculating prior probability
If it is not
Is greater than
Element of the corresponding position, then
Make an initial
Or whether it is
And
by way of example, obtaining
Then by
The calculation of the posterior probability, the formula for calculating the posterior probability and the subsequent steps are similar to those in
embodiment 1, and are not described herein again.
Example 3
In this embodiment, a plurality of cameras are arranged to acquire image information, and the plurality of cameras can be dispersedly arranged on the inner wall surface of a sales counter and above a cabinet door, which are beneficial to acquiring images of articles taken by a user, so as to improve the image detection precision.
The order generation method in this embodiment is basically the same as that in embodiment 2, except that the posterior probabilities of multiple cameras are fused in this embodiment to update the selection probability, specifically:
the detection result output by each camera is expressed as
K is more than or equal to 1 and less than or equal to q, and q represents the number of the cameras.
Calculating prior probability according to image information acquired by each camera in sequence
If it is used
Is greater than
Element of the corresponding position, then
Then to
Are normalized, i.e.
Then, the posterior probability is obtained, and the formula is as follows:
the posterior probability vector can then be used
Indicating detection in image information acquired by the k-th camera
The probability that the user picks the list of all possible items.
Finally, all the calculated values are compared
And (5) calculating an average value, and taking the average value as the overall posterior probability.
Example 4
The embodiment provides a sales counter, as shown in fig. 2-3, which comprises a cabinet door, a plurality of cargo layers 1, an electronic door lock 2 and an order generation system. Electronic lock installs on the cabinet door, puts the goods layer and is used for placing object article, and the quantity on putting the goods layer can set up by oneself according to actual demand. In this embodiment, the cabinet door can also be installed with the automatic door closer that helps the cabinet door close by oneself, still can install the display screen on the cabinet of selling goods.
Specifically, as shown in fig. 3, in this embodiment, the order generation system includes: a request acquisition module 31, a verification module 32, a weight sensor 33, a control module 34, a camera 35, a judgment module 36, an inventory update module 37, and a payment module 38. The weight sensor 33, the camera 35 and the determination module 36 are all electrically connected to the control module 32. The determination module 36 is also electrically connected to an inventory update module 37 and a payment module 38. The request acquisition module 31 and the electronic door lock 2 are both electrically connected to the verification module 32. The weight sensor 33 is arranged below each cargo layer; the camera device 33 is installed above the cabinet door of the sales counter, and the monitoring area is the front of the goods placing layer.
In this embodiment, the camera device 33 can be implemented by a camera. It should be noted that the number of the cameras may be one or more. In order to save the production cost, one camera is adopted in the embodiment.
The control module 34 of this embodiment specifically includes: a calculation unit 341, a correction unit 342, an update unit 343, and a selection unit 344.
When a user needs to buy goods through a sales counter, the user can establish communication connection with the sales counter through the mobile terminal and send a shopping request to the sales counter through a shopping APP (application program).
The request acquisition module 31 transmits the shopping request to the verification module 32 after acquiring the shopping request. Wherein the shopping request includes user information.
The authentication module 32 authenticates the user information and unlocks the electronic door lock 2 when the authentication is passed. At this time, the user can select the articles in the sales counter, and when the user takes out an article from the sales counter, the stock amount and weight of the articles stored in the sales counter change.
The weight sensor 33 is used for acquiring weight change data of the articles in the sales counter and sending the weight change data to the control module 34. Weight change data, i.e. the weight m of the articles on all the cargo layers at the present moment tThe weight m of the articles on all the goods placing layers at the last momentt-1The difference of (a).
The control module 34 is configured to generate at least one item selection list based on the weight change data.
The list of article selection, that is, the list of articles that the user may select, may be represented by a vector, if the sales counter includes N kinds of articlesThen an N-dimensional vector may be employed
Representing a pick list of items, where x
iThe number of the ith items selected by the user is represented, and i is more than or equal to 1 and less than or equal to N. By means of matrices
And representing all possible item selection lists at present, wherein M is the number of the possible item selection lists, and j is more than or equal to 1 and less than or equal to M.
For example, if the sales counter includes three articles A, B, C, the three articles weigh 50g, 100g, and 100g, respectively. When the weight sensor detects that the weight change data of the articles in the current sales counter is 100g, that is, the user takes 100g of the articles out of the sales counter, the article selection list of the user has three possibilities: 2 articles A; 1 item B; 1C article, corresponding to:
in this embodiment, the item selection list includes: a probability is selected. The selection probability is used for representing the matching probability of each item selection list and the item actually selected by the user, namely the probability of the item selection list, and the high probability indicates that the item is selected more frequently.
The following explains the calculation process of the selection probability:
the calculation unit 341 calculates the similarity between the item selection list at the present time and the item selection list at the previous time, and calculates the selection probability based on the similarity.
There are many options for calculating the similarity, and in this embodiment, the number of elements in the matrix of the current item selection list that is the same as the number of elements in the matrix of the last item selection list is defined as the similarity.
For example, if the matrix of the current item selection list is:
the matrix of the item selection list at the previous moment is:
for X
tEach column vector of
And X
t-1Each column vector of
The similarity is recorded as
That is to say
And
the number of the same elements. Wherein n is more than or equal to 1 and less than or equal to M, and M is more than or equal to 1 and less than or equal to M.
R
21Represents
X t-12 nd column vector of
And
X t1 st column vector of
Same number of elements, R
21R is calculated as 1
mnAnd obtaining a similarity matrix R as follows:
to is coming toThe calculation is convenient, the similar matrix R is normalized, and sigma is obtainednRmnI.e. such that the sum of the elements in each column vector in R is 1. The normalized results were:
using vectors
Representing the selection probability of all the items to be picked, the selection probability vector at the current moment
I.e. the selection probability of the similarity matrix and the previous moment
The product of (a); when the user sends a purchase request but does not select an item, the initial item selection list X is used
0=[0]Selection probability
The electronic door lock is unlocked, and after the user selects the object for the first time, the selection probability at the current moment is
For the convenience of calculation, for
Normalization is carried out to obtain
In this embodiment, the selection probability may also be fine-tuned. Specifically, the modification unit 342 modifies the selection probability according to the weight coefficient. Wherein the weighting coefficients may be obtained empirically. For example, the selection probability corresponding to the item selection list more favored by the user may be increased according to the weighting factor.
The imaging device 35 is used to acquire image information of the selected article.
Wherein the image information includes a category of the item and a quantity of the item. Specifically, the image detection method based on the convolutional neural network detects the image to obtain the image information, and adopts the vector
Recording the detection result of the current time, wherein y
iIndicating the number of the detected ith product. At present, various mature algorithms such as fast RCNN, SSD, YOLO network, etc. can be selected for the image detection method.
Or A, B, C, assuming that 1B item is detected in the current image, the detection vector is
The control module 34 updates the item selection list according to the image information and generates an order according to the item selection list.
Updating the item selection list, i.e. updating the selection probability of each item selection list. Specifically, the updating unit 343 updates the selection probability based on the bayesian inference algorithm according to the image information, and provides a possible implementation as follows:
for X
tEach column vector of
Calculating prior probabilities
That is, the article selection list is
When the image is detected
The probability of (c). The calculation formula of the prior probability can be set according to the actual situation. For example, suppose as long as
Each element of (1) is not less than
The corresponding position element can be detected with a certain probability p
Then under this assumption there are:
to be provided with
And
for example, X
tOnly the second vector [0,1,0 ]]
TAll elements are not less than
Elements of the corresponding position, then
Calculating posterior probability according to Bayes formula
I.e. image detection
When the article is selected from the list of articles
The probability of (c). From bayes' formula, there are:
wherein, pi
jAnd pi
iTo select a probability vector
Element of (5), can be a posterior probability vector
Indicating image detection
The probability that the user picks the list of all possible items.
Thus, if the calculation unit calculates
Then
Posterior probability
Furthermore, after the selection probability is updated according to the image information, the new selection probability
Where β is the update rate, and can be set according to the actual requirement, for example, β is set to 0.4, thenTo obtain finally
Another possible implementation of updating the selection probability is provided below, in which the confidence is further considered to improve the accuracy of image detection, in which the detection result is expressed as
Wherein θ represents the confidence of the detection result output by fast RCNN, SSD, or YOLO, specifically:
first calculating prior probability
If it is not
Is greater than
Element of the corresponding position, then
Make an initial
Or whether it is
And
by way of example, obtaining
Then by
The posterior probability is calculated, and the subsequent steps are similar to the above-mentioned probability updating process without considering the confidence coefficient, and are not described herein again.
The selecting
unit 344 determines the item picking list with the highest selection probability as the order. If it is
The selection unit selects the article list
The determination is a shopping order, which indicates that the user actually picked 1 item B from the sales counter at that time.
In order to reduce the probability of image recognition error and further improve the accuracy, in this embodiment, the control module further includes: a judging unit 345 and a prompting unit 346.
The judging unit 345 judges whether or not the maximum selection probability is smaller than the probability threshold value, and when judged yes, invokes the presentation unit 346. The probability threshold value can be set according to actual requirements, for example, set to 0.8.
The prompting unit 346 is used for prompting the article display reminder and calling the camera device 35 to retrieve the image information of the selected article.
The judging unit 345 calls the judging module 36 when judging that the maximum selection probability is not less than the probability threshold.
The judging module 36 is used for judging whether the electronic door lock is locked, and if not, the weight sensor 33 is called to monitor the weight information of the sales counter again, which indicates that the shopping of the user is not finished; if yes, indicating that the user is finished shopping, the inventory update module 37 and/or the payment module 38 are invoked.
The inventory updating module 37 is used for updating the inventory information of the sales counter according to the order; the payment module 38 is used to generate payment information according to the order.
In the embodiment, all possible article selection lists are determined by utilizing the gravity information of the sales counter, the probability of the article selection lists is described by the selection probability and is used as a reliable criterion for judging whether the purchasing behavior of the user is normal, and the posterior probability is calculated by adopting a Bayesian formula by establishing the relation between the image recognition result and the article selection lists, so that the influence caused by the error of the image recognition result can be reduced, the articles selected by the user from the sales counter can be accurately verified, and the accuracy of a shopping order is improved.
Example 5
Embodiment 5 is basically the same as embodiment 4, except that a plurality of cameras are provided for acquiring image information in this embodiment, and the plurality of cameras can be dispersedly disposed on the inner wall surface of a sales counter and above a cabinet door, which are favorable for acquiring an image of an article taken by a user, so as to improve the image detection precision.
In this embodiment, the updating unit 343 updates the selection probability in the following manner:
the detection result output by each camera is expressed as
K is more than or equal to 1 and less than or equal to q, and q represents the number of the cameras.
Calculating prior probability according to image information acquired by each camera in sequence
If it is not
Is greater than
Element of the corresponding position, then
To pair
Are normalized, i.e.
Then, the posterior probability is obtained, and the formula is as follows:
the posterior probability vector can then be used
Indicating detection in image information acquired by the k-th camera
The probability that the user picks the list of all possible items.
Finally, all the calculated values are compared
And (5) calculating an average value, and taking the average value as the overall posterior probability.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.