Disclosure of Invention
The embodiment of the application provides a wine cabinet wine positioning method and device, and solves the technical problem that in the prior art, an infrared sensor is adopted to detect whether wine exists on a wine level or not, and misjudgment is easy to occur; the technical effect of improving the wine positioning accuracy is achieved.
In order to solve the above technical problem, the embodiment of the present application is implemented by using the following technical solutions:
a method for locating wine in a wine cabinet is provided, which comprises the following steps: receiving infrared signals within the range of the wine level; carrying out convolution operation on the received infrared signal and the orthogonal code corresponding to the wine level; judging whether the convolution result is larger than a first set proportion of the preset value of the wine level or not; if yes, determining that the wine exists on the wine position; the received infrared signals comprise orthogonally coded infrared signals which are emitted by the infrared emitter corresponding to the wine position and reflected back, infrared signals emitted by the infrared emitters corresponding to adjacent wine positions and/or ambient infrared signals.
Further, prior to receiving the infrared signal within the range of wine levels, the method further comprises: determining the coding bit number of all wine positions in the wine cabinet; performing orthogonal coding based on the coding bit number to obtain an orthogonal code on each wine position; and controlling an infrared transmitter on the wine position to transmit infrared rays according to the orthogonal codes.
Further, the method for determining the preset value comprises the following steps: obtaining an orthogonal code of the wine position; and carrying out convolution operation on the orthogonal codes of the wine positions to obtain preset values corresponding to the wine positions.
Further, after performing convolution operation on the received infrared signal and the orthogonal code corresponding to the wine position, the method further includes: judging whether the convolution result is smaller than a second set proportion of the wine level preset value or not; if yes, judging that no wine exists on the wine position.
The wine cabinet wine positioning device comprises an infrared transmitter and an infrared receiver which are arranged on each wine position; the device also comprises a convolution arithmetic unit and a judger; the infrared transmitter is used for transmitting an infrared signal of an orthogonal code to the corresponding wine position; the infrared receiver is used for receiving infrared signals in the corresponding wine level range; the convolution arithmetic unit is used for carrying out convolution operation on the infrared signal received by the infrared receiver on each wine position and the orthogonal code of the corresponding wine position; the judger is used for judging whether the convolution result on each wine level is larger than a first set proportion of the preset value of the corresponding wine level or not based on the operation result of the convolution operator; if yes, judging that wine exists on the corresponding wine position; the infrared signals received by the infrared receiver corresponding to the wine level comprise orthogonal coded infrared signals transmitted and reflected by the infrared transmitter corresponding to the wine level, infrared signals transmitted by the infrared transmitters corresponding to adjacent wine levels and/or environment infrared signals.
Further, the judger is further configured to judge whether the convolution result on each wine level is smaller than a second set proportion of the preset value of the corresponding wine level based on the operation result of the convolution operator; if yes, judging that no wine exists on the corresponding wine position.
Further, the apparatus further comprises a quadrature encoder and a transmit controller; the orthogonal encoder performs orthogonal encoding according to the encoding bit number determined by all wine positions in the wine cabinet to obtain the orthogonal encoding on each wine position; and the emission controller controls the infrared emitter on the wine position to emit infrared rays according to the orthogonal codes.
Further, the infrared receiver is an infrared receiving amplifier for receiving infrared rays with set frequency and set wavelength.
Furthermore, a shielding cover is arranged on the infrared receiver.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following technical effects or advantages: in the wine cabinet wine positioning method and device provided by the embodiment of the invention, an infrared transmitter and an infrared receiver are arranged below each wine position, the infrared transmitter transmits an orthogonal coded transmitting code on the wine position, and if wine exists on the wine position, the transmitted infrared ray is reflected back to be received by the infrared receiver on the wine position after touching the bottom of a bottle; besides the reflected infrared rays, the infrared receiver on the wine level receives the infrared rays emitted by the infrared emitter on the adjacent wine level and the ambient infrared rays; after the infrared receiver receives the infrared rays, carrying out convolution operation on the received infrared rays and the orthogonal code corresponding to the wine position, wherein the convolution operation comprises the convolution of the orthogonal code infrared signal transmitted and transmitted back by the wine position infrared transmitter and the wine position orthogonal code, the convolution of the orthogonal code infrared ray transmitted by the adjacent wine position infrared transmitter and the wine position orthogonal code and the convolution of the environment infrared signal and the wine position orthogonal code; the convolution value of the orthogonal coding infrared rays emitted by the adjacent wine position infrared emitters and the wine position orthogonal coding is zero, the ambient infrared rays are approximate to Gaussian noise, and the result of the convolution of the ambient infrared rays and the orthogonal coding is approximate to zero; therefore, the convolution result is greatly influenced by the infrared signal reflected back after being transmitted and the convolution result of the orthogonal coding; because the intensity of the emitted and reflected infrared rays is reduced due to attenuation, the convolution result of the emitted and reflected infrared rays and the orthogonal code is smaller than the ideal convolution value, namely the preset value, which is obtained by the convolution of the orthogonal code, and is assumed that the interference between the infrared rays emitted by the adjacent wine positions and the ambient infrared rays does not exist, therefore, if the wine positions exist, the convolution of the reflected infrared rays and the orthogonal code inevitably exists, and the convolution result is inevitably larger than a value, so that whether the wine exists on the wine positions or not can be judged. At this time, after setting the first setting proportion according to experience or statistical mode, comparing the convolution result with the first setting proportion of the preset value, if the convolution result is larger than the first setting proportion of the preset value, judging that the wine exists on the wine level,
further, if no wine exists on the wine level, most infrared signals and environment infrared signals on the adjacent wine level are received by the infrared receiver, the convolution value of the infrared rays emitted by the adjacent wine level and the wine level orthogonal code is zero, the convolution result is greatly influenced by the convolution result of the environment infrared rays and the wine level orthogonal code, if the environment infrared rays do not conform to Gaussian distribution, the convolution result is not zero but is certainly smaller than a value, at the moment, after a second set proportion is set according to experience or a statistical mode, the convolution result is compared with the second set proportion of a preset value, and if the convolution result is smaller than the second set proportion of the preset value, the wine level is judged to have no wine; therefore, errors in judgment when the ambient infrared ray is not Gaussian distributed can be effectively prevented.
Therefore, by means of the mode that the infrared emitter emits the infrared signals after the orthogonal codes, the method that the received infrared signals are convoluted with the orthogonal codes of the wine positions is adopted at the receiving end, interference of the infrared signals of adjacent wine positions and the infrared signals of the environment is eliminated, whether wine exists on the wine positions or not can be accurately judged, and the technical problem that in the prior art, when an infrared sensor is adopted to detect whether wine exists on the wine positions or not, misjudgment is easy to occur is solved.
Detailed Description
In order to better understand the technical solutions, the technical solutions will be described in detail below with reference to the drawings and specific embodiments.
As shown in fig. 1, the method for positioning wine in a wine cabinet according to the embodiment of the present invention includes the following steps:
step S11: an infrared signal within a spirit level range is received.
Taking an example that one wine cabinet comprises M wine positions, an infrared transmitter and an infrared receiver are arranged below each wine position; within a range of wine levels, the infrared signal received by the infrared transmitter includes the following three possibilities: 1. the infrared signal emitted by the infrared emitter of the wine level is reflected after meeting the bottom of the wine bottle, and the signal can be attenuated, especially under the condition that the bottle bottom is dark in color and can absorb infrared rays; 2. the infrared signal emitted by the infrared emitter on the adjacent wine position of the wine position; 3. an ambient infrared signal; these include, among others: when a user stores wine, an infrared signal is emitted by a human body; an infrared signal emitted by an LED lamp at the back of the wine cabinet; in the running process of the wine cabinet, infrared signals are emitted from the inner wall of the wine cabinet; when sunlight enters the wine cabinet through the door body, infrared signals in the sunlight are generated.
In the embodiment of the invention, the infrared signals emitted by the infrared emitters on all wine positions are orthogonal coded infrared signals, and if wine exists on the wine positions, the infrared receivers can receive the orthogonal coded infrared signals reflected by the bottle bottoms.
Therefore, before step S11, it is necessary to determine the orthogonal codes on all wine positions, specifically, the method includes step S100: and determining the coded digit number of all wine positions in the wine cabinet.
Or for example, a wine cabinet with M wine positions therein, according to 2mAnd (5) determining the number of encoding bits used for encoding the M wine bits.
Step S101: and carrying out orthogonal coding based on the coding bit number to obtain the orthogonal coding on each wine bit.
When m is known, the m bits are orthogonally encoded, and specifically, the orthogonal encoding table in the prior art may be referred to, which is not described herein again. Extending the M-bit encoding to n bits, implementing an orthogonal encoding Hi, i e [ 1.. to.. M ] at each of the M wine bits.
Step S102: and controlling an infrared transmitter on the wine position to transmit infrared rays according to the orthogonal codes.
Therefore, in the embodiment of the invention, the infrared transmitters on all wine positions transmit infrared signals which are orthogonally coded.
Step S12: and carrying out convolution operation on the received infrared signal and the orthogonal code corresponding to the wine position.
Taking the wine position coded as i as an example, the orthogonal coded infrared signal emitted by the infrared emitter on the wine position is Hi; then the infrared receiver at the wine position receiving the infrared signal comprises: the orthogonal coding infrared signal hi reflected from the bottom of the wine bottle on the wine position, the infrared signal Hj which is transmitted by the infrared transmitter on the adjacent wine position and is also subjected to orthogonal coding, and the environment infrared signal N exist in the form of hi + Hj + N.
Wherein, the reflected infrared signal Hi is the attenuated Hi.
Convolving the received infrared signal with the orthogonal code corresponding to the alcohol position coded as i to obtain Y ═ Hi (Hi + Hj + N), wherein Hi Hj is 0 due to the orthogonality among the alcohol position codes, thereby reducing the influence of the infrared signal emitted by the infrared emitter on the adjacent alcohol position on the misjudgment; the characteristics of the ambient infrared signal N are substantially subject to gaussian noise, so that Hi × N is approximately 0, thereby reducing the influence of the ambient infrared signal on erroneous determination, and finally leaving Y ═ Hi.
Hi is the convolution of the transmitted orthogonal code with the reflected attenuated orthogonal code, the result of which is less than or equal to Q Hi, i.e. the result of the convolution of the orthogonal code itself. When Q is used as a preset value, the Y result of the received infrared signal and the alcohol bit orthogonal code convolution is smaller than the preset value.
Step S13: and judging whether the convolution result is larger than a first set proportion of the preset value of the wine level.
According to the difference of the thickness and the color of the wine bottle, the degree of attenuation of the infrared signals reflected by the infrared reflector and reflected by the bottom of the wine is different, after experience or statistical analysis, a first set proportion can be determined, the first set proportion of a preset value is used as a threshold value, when the first set proportion is larger than the threshold value, the wine level is judged to have wine, and when the first set proportion is smaller than the threshold value, the wine level is judged to have no wine. That is, if the convolution result is greater than the first set proportion of the preset value of the alcohol level, then
Step S14: judging that the wine exists on the wine position.
And if the convolution result is smaller than the first set proportion of the preset value of the wine level, judging that no wine exists on the wine level.
The first set proportion is an empirical value or a statistical value, and the value can be adjusted according to actual conditions.
Theoretically, if there is no wine at the wine level, the infrared signal emitted from the infrared emitter cannot be reflected back, and Hi Hj is 0, Hi is 0, Hi N is approximately zero in the calculation of the value Y, and the convolution result should be approximately zero. However, in practical applications, if the characteristics of the ambient infrared rays do not comply with gaussian noise, the result of Hi × N cannot be approximated to 0, and at this time, a second set proportion may be determined according to experience or statistical analysis, and another condition for determining whether wine exists at the wine level is provided for the embodiment of the present invention.
Step S15: judging whether the convolution result is smaller than a second set proportion of the wine level preset value or not; if yes, step S16: judging that no wine exists on the wine level.
Similarly, the second setting ratio is also an empirical value or a statistical value, and the value can be adjusted according to the actual situation.
In the wine cabinet wine positioning method provided by the embodiment of the invention, the infrared transmitter and the infrared receiver are arranged below each wine position, the infrared transmitter transmits the orthogonal coded transmitting code on the wine position, and if wine exists on the wine position, the transmitted infrared ray is reflected back to be received by the infrared receiver on the wine position after touching the bottom of the bottle; besides the reflected infrared rays, the infrared receiver on the wine level receives the infrared rays emitted by the infrared emitter on the adjacent wine level and the ambient infrared rays; after the infrared receiver receives the infrared rays, carrying out convolution operation on the received infrared rays and the orthogonal code corresponding to the wine position, wherein the convolution operation comprises the convolution of the orthogonal code infrared signal transmitted and transmitted back by the wine position infrared transmitter and the wine position orthogonal code, the convolution of the orthogonal code infrared ray transmitted by the adjacent wine position infrared transmitter and the wine position orthogonal code and the convolution of the environment infrared signal and the wine position orthogonal code; the convolution value of the orthogonal coding infrared rays emitted by the adjacent wine position infrared emitters and the wine position orthogonal coding is zero, the ambient infrared rays are approximate to Gaussian noise, and the result of the convolution of the ambient infrared rays and the orthogonal coding is approximate to zero; therefore, the convolution result is greatly influenced by the infrared signal reflected back after being transmitted and the convolution result of the orthogonal coding; because the intensity of the emitted and reflected infrared rays is reduced due to attenuation, the convolution result of the emitted and reflected infrared rays and the orthogonal code is smaller than the ideal convolution value, namely the preset value, which is obtained by the convolution of the orthogonal code, and is assumed that the interference between the infrared rays emitted by the adjacent wine positions and the ambient infrared rays does not exist, therefore, if the wine positions exist, the convolution of the reflected infrared rays and the orthogonal code inevitably exists, and the convolution result is inevitably larger than a value, so that whether the wine exists on the wine positions or not can be judged. At this time, after setting the first setting proportion according to experience or statistical mode, comparing the convolution result with the first setting proportion of the preset value, if the convolution result is larger than the first setting proportion of the preset value, judging that the wine exists on the wine level,
further, if no wine exists on the wine level, most infrared signals and environment infrared signals on the adjacent wine level are received by the infrared receiver, the convolution value of the infrared rays emitted by the adjacent wine level and the wine level orthogonal code is zero, the convolution result is greatly influenced by the convolution result of the environment infrared rays and the wine level orthogonal code, if the environment infrared rays do not conform to Gaussian distribution, the convolution result is not zero but is certainly smaller than a value, at the moment, after a second set proportion is set according to experience or a statistical mode, the convolution result is compared with the second set proportion of a preset value, and if the convolution result is smaller than the second set proportion of the preset value, the wine level is judged to have no wine; therefore, errors in judgment when the ambient infrared ray is not Gaussian distributed can be effectively prevented.
Therefore, by means of the mode that the infrared emitter emits the infrared signals after the orthogonal codes, the method that the received infrared signals are convoluted with the orthogonal codes of the wine positions is adopted at the receiving end, interference of the infrared signals of adjacent wine positions and the infrared signals of the environment is eliminated, whether wine exists on the wine positions or not can be accurately judged, and the technical problem that in the prior art, when an infrared sensor is adopted to detect whether wine exists on the wine positions or not, misjudgment is easy to occur is solved.
Based on the above-mentioned wine cabinet wine positioning method, the embodiment of the present invention further provides a wine cabinet wine positioning apparatus, as shown in fig. 2, including an infrared emitter 21 and an infrared receiver 22 disposed on each wine level, a convolution calculator 23 and a determiner 24.
The infrared emitter 21 emits an infrared signal of an orthogonal code to the corresponding wine position; the infrared receiver 22 receives infrared signals within the corresponding wine level range; the received infrared signals comprise orthogonally coded infrared signals transmitted by the infrared transmitter corresponding to the wine level and reflected back, infrared signals transmitted by the infrared transmitters corresponding to adjacent wine levels and/or ambient infrared signals. The convolution arithmetic unit 23 carries out convolution operation on the infrared signal received by the infrared receiver on each wine position and the orthogonal code of the corresponding wine position; the judger 24 judges whether the convolution result on each wine level is larger than a first set proportion of the preset value of the corresponding wine level based on the operation result of the convolution operator; if yes, judging that the corresponding wine position has wine.
In another embodiment, the decider 24 may further determine whether the convolution result at each wine level is smaller than a second set proportion of the preset value of the corresponding wine level based on the operation result of the convolution operator; if yes, judging that no wine exists on the corresponding wine position.
In order to obtain the orthogonal code corresponding to each wine position, the wine cabinet wine positioning device provided by the implementation of the invention further comprises an orthogonal encoder 25 and an emission controller 26; the orthogonal encoder 25 carries out orthogonal encoding according to the encoding bit number determined by all the wine positions in the wine cabinet to obtain the orthogonal encoding on each wine position; the emission controller 26 controls the infrared emitter on the wine level to emit infrared rays according to the orthogonal code.
Preferably, the infrared receiver is an infrared receiving amplifier that receives infrared rays of a set frequency setting and wavelength. For example, by adopting a 38KHZ receiving amplifier, only when 940nm infrared signals with 38KHZ frequency are received, signals are output, but no signals are output when infrared signals with other frequencies are received, and the characteristic can effectively prevent the infrared signals in sunlight in the environment infrared signals from interfering.
In practical application, because infrared transmitter and infrared receiver on same wine position are close, when not having the beverage on corresponding wine position, because the reflector has certain radiant surface, can lead to the infrared signal of receiver direct reception transmission, lead to the misjudgement, to this kind of condition, can add a shield cover on infrared transmitter, for example metal circle or stereoplasm sponge circle all can.
The wine cabinet adopting the device effectively improves the positioning of wine in the wine cabinet because the infrared interference emitted by the infrared emitters of adjacent wine positions and the interference of environment infrared signals are eliminated, so that the strength of reflected signals can be improved by a method of increasing the emission power under the condition of deep color of the bottle bottom of a wine bottle, and because the received infrared signals are judged after being processed, the received infrared signals cannot be influenced by the infrared signals emitted by the infrared emitters of the adjacent wine positions and the environment infrared signals, the positioning precision and the positioning distance can be improved, and tests prove that the wine cabinet positioning device provided by the embodiment of the invention can be used for detecting the bottle cap of the wine to 12cm and detecting the bottle bottom to 10 cm.
It should be noted that the above description is not intended to limit the present invention, and the present invention is not limited to the above examples, and those skilled in the art may make variations, modifications, additions or substitutions within the spirit and scope of the present invention.