Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In this embodiment, a delivery device is provided, and fig. 1 is a block diagram of a delivery device according to an embodiment of the present invention, as shown in fig. 1, the delivery device includes:
the image acquisition module 12 is connected with the main control module and is used for shooting a target area of the launching device to obtain an area image of the target area and sending the area image to the main control module, wherein the target area is used for placing a target container;
the main control module 14 is configured to receive the area image, determine a container mouth position of the target container based on the area image, determine a target rotation angle of the first detection module based on the container mouth position, and send the target rotation angle to the first detection module;
the first detection module 16 is connected to the main control module, and configured to rotate according to the target rotation angle, detect a first distance from a target object carried in the target container to the first detection module when it is determined that the target object is injected into the target container by the launch device, and send the first distance to the main control module;
the second detection module 18 is connected with the main control module, and is configured to detect a second distance from the second detection module to the target container, and send the second distance to the main control module;
the main control module 14 is further configured to receive the first distance and the second distance, and control the delivering device to inject the target object into the target container based on the first distance and the second distance.
In the above embodiment, the throwing device may be a device for throwing liquid in a water dispenser, a water purifier, a coffee machine, a beverage machine, or a device for throwing solid in an ice cream machine, a rice jar, a coarse cereal barrel, or the like. When the dispensing device is a device for dispensing liquid, the target object is liquid, such as water, coffee, beverages, and the like, and when the dispensing device is a device for dispensing solid, the target object is solid, such as ice cream, rice, coarse cereals, and the like. The target area can be a cup, a measuring cup, a bowl and other containers.
In the above embodiment, the delivering device is provided with an area for placing the target container, and after the target container is placed in the target area, the image acquisition module may capture the target image to obtain an area image including the target container, and send the area image to the main control module. The main control module can analyze the area image and determine the position of the container opening of the target container. And determining the target rotation angle of the first detection module according to the position of the target container port.
In the above embodiment, after receiving the target rotation angle, the first detection module may rotate according to the target rotation angle, so as to align the first detection module with the container mouth, for example, align the detection center of the first detection module with the center of the container mouth. The first detection module may be an ultrasonic module, that is, the first detection module may determine a first distance from a target object carried in the target container to the first detection module by emitting an ultrasonic wave and receiving a returned ultrasonic wave.
In the above embodiment, the dispensing device may further include an electronic control module, the electronic control module is connected to the main control module, when the electronic control module is triggered, the dispensing device starts to dispense the target object, and when the main control module determines that the target container bears a full target object through the first distance and the second distance, the main control module may send a stop instruction to the electronic control module to stop dispensing the target object.
According to the invention, the releasing device comprises an image acquisition module, a main control module, a first detection module and a second detection module. The image acquisition module is used for shooting a target area of the releasing equipment to obtain an area image and sending the area image to the main control module, the main control module determines the position of a container opening of a target container according to the area image, determines the target rotation angle of the first detection module according to the position of the container opening and sends the target rotation angle to the first detection module. The first detection module rotates according to the target rotation angle after receiving the target rotation angle, detects a first distance of a target object carried in the target container under the condition that the target object is determined to be injected into the target container by the releasing device, and sends the first distance to the main control module. The second detection module detects a second distance between the second detection module and the target container and sends the second distance to the main control module. And after receiving the first distance and the second distance, the main control module controls the throwing device to inject the target object into the target container according to the first distance and the second distance. The target rotation angle of the first detection module can be determined according to the container mouth position of the target container, so that the first detection module can be over against the first distance of the target object carried in the target container detected by the container mouth, and the problem that the first distance detected by the first detection module is inaccurate due to the fact that the container wall or other positions are detected by the first detection module is solved. The second distance between the target container and the second detection module can be accurately determined through the second detection module, and the target object can be accurately controlled to be injected into the target container by the releasing device through the first distance and the second distance. Therefore, the problem that the object injection into the container cannot be immediately stopped when the full object is borne in the container by the throwing device in the related technology can be solved, the effect that the object injection into the container is immediately stopped when the full object is borne in the container is achieved, and the user experience is improved.
In an exemplary embodiment, the image acquisition module and the first detection module are both disposed above the target area in the delivery device; the second detection module is arranged on the side wall of the throwing device. In this embodiment, a schematic diagram of the delivering device can be seen in fig. 2, as shown in fig. 2, the ultrasonic module 2 (i.e. the first detecting module) and the camera (i.e. the image capturing module) are both disposed above the target area of the delivering device, and the ultrasonic module 1 (i.e. the second detecting module) is disposed on a sidewall of the delivering device.
In the above embodiment, the delivery device is taken as a water purifier for explanation: the purifier includes ultrasonic wave module 2 and the camera that the purifier goes out tap next door and sets up, the lift slide rail and the ultrasonic wave module 1 that set up on the purifier front end lateral wall. The ultrasonic module 2 is fixed on the rotating mechanism, can adjust the angle position and is used for detecting the water level in the water cup; the camera is used for shooting a picture of the cup opening of the water cup, and the position of the cup opening is identified at the main control board end through an algorithm, so that the rotating mechanism is guided to rotate by a proper angle, and the ultrasonic module is aligned to the cup opening; the ultrasonic module 1 can be fixed on the lifting slide rail, can move up and down along with the lifting slide rail and is used for determining the height of the placed water cup.
In one exemplary embodiment, the first detection module includes: a rotation submodule supporting rotation by a first angle in a first direction and rotation by a second angle in a second direction; the first detection submodule is mounted on the rotating submodule and rotates along with the rotation of the rotating submodule. In this embodiment, the first detection module may include a rotation sub-module and a first detection sub-module. The rotation sub-module may be a rotation motor and the first detection sub-module may be an ultrasonic sensor. The first direction may be a left-right direction and the second direction may be an up-down direction, or the first direction may be an up-down direction and the second direction may be a left-right direction. The first angle and the second angle may be 0 to 180 degrees (the value is only an exemplary illustration, and may also be 0 to 150 degrees, 0 to 270 degrees, 0 to 360 degrees, and the like, which is not limited in the present invention). The schematic diagram of the first detection module can be seen in fig. 3, and as shown in fig. 3, the rotating mechanism can drive the ultrasonic module 2 to rotate front and back and left and right, the front and back rotation range can be 0-180 degrees, and the left and right rotation range can be 0-180 degrees. The rotating motor is used for driving the ultrasonic module 2 to rotate and is driven by the main control panel.
In one exemplary embodiment, the second detection module includes: the lifting sub-module supports the lifting up and down in the placing direction of the target container; the second detection submodule is installed on the lifting submodule and moves along with the movement of the lifting submodule. In this embodiment, the second detection module may include a lifting sub-module and a second detection sub-module. The lifting submodule can be a lifting slide rail, the lifting slide rail can be connected with a lifting motor, the lifting motor is used for driving the lifting slide rail to move up and down, and the lifting motor is driven by the main control board. The second detection submodule may be an ultrasonic sensor. The ultrasonic sensor can be arranged on the lifting slide rail, so that the ultrasonic sensor can move along with the up-and-down movement of the lifting slide rail. Wherein, the schematic diagram of the lifting submodule can be seen in figure 4.
In the above embodiment, the schematic structural diagram of the dispensing device may refer to fig. 5, and as shown in fig. 5, the dispensing device includes a main control board (corresponding to the main control module), a camera (corresponding to the image capturing module), an ultrasonic module 1 (corresponding to the second detecting submodule), an ultrasonic module 2 (corresponding to the first detecting module), a rotation motor (corresponding to the rotating submodule), a lifting motor (corresponding to the lifting submodule), and an electronic control module. The main control board can carry out data interaction with the camera through the USB interface, carry out distance information's interaction with the ultrasonic wave module through the UART interface, control rotation motor and lift motor through PWM's mode, send the water full message in the cup to electric control module through the UART interface, thereby electric control module control stops throwing in the target object.
In an exemplary embodiment, the main control module controls the delivering device to inject the target object into the target container based on the first distance and the second distance by: determining a first height of the first detection module from the target area; determining a second height of the target object carried in the target container based on the first distance, the first height, and the target angle of rotation; determining a third height of the target container based on the second distance; controlling the delivery device to inject the target object into the target container based on the second height and the third height. In this embodiment, after receiving the first distance and the second distance, the main control module may determine a first height of the first detection module from the target area, and determine a second height of the target object carried in the target container according to the first height, the first distance, and the target rotation angle. And determining the third height of the target container according to the second distance, and controlling the throwing device to throw the target object by comparing the second height and the third height.
In the above embodiment, when determining the second height, a first height of the first detection module from the target area may be determined first, then a first distance of the target object carried in the target container from the first detection module is determined by the first detection module, and the second height is determined according to the first height, the first distance, and the target rotation angle. The first height may be a predetermined height, that is, when the first detection module is installed, a vertical height of the first detection module from the target area may be determined, and the vertical height is determined as the first height. Of course, the first height may also be determined by the first detection module, for example, first adjusting the measurement angle of the first detection module to be opposite to the target area, controlling the first detection module to emit the ultrasonic wave and receive the reflected ultrasonic wave, and determining the first height according to the time difference between the emission time and the reception time and the wave speed of the ultrasonic wave. The first distance can also be measured by the first detection module, the first detection module is controlled to send out ultrasonic waves and receive reflected ultrasonic waves, and the first distance is determined according to the time difference between the sending time and the receiving time and the wave speed of the ultrasonic waves.
In an exemplary embodiment, the main control module determines the second height of the target object carried in the target container based on the first distance, the first height and the target rotation angle by: determining a deviation angle of the detection direction of the first detection module from a vertical direction based on the target rotation angle; determining a product of the first distance and a cosine of the deflection angle; determining a difference of the first height and the product as the second height. In this embodiment, referring to fig. 6, the second height diagram is determined, and as shown in fig. 6, the ultrasonic module 2 starts to continuously transmit ultrasonic signals to detect the distance r (corresponding to the first distance) from the water surface and transmits the data to the main control board in real time. The calculation of the water level height (second height) h2, i.e. h2 ═ b-r × cos α, is carried out in the main control panel. Wherein b is the distance (namely the first height) between the ultrasonic module 2 and the table top for placing the water cup and is a fixed value; r is the distance (i.e. the first distance) from the water surface detected by the ultrasonic module 2; and alpha is the angle of the first detection module from the vertical middle line.
In an exemplary embodiment, the master control module determines the third height of the target container based on the second distance by: determining a relationship between the second distance and a predetermined threshold when the second detection module is at an initial position; if the relationship indicates that the second distance is less than a predetermined threshold, adjusting the height of the second detection module, and determining, by the second detection module, a third distance of the target container from the second detection module when the second detection module is at the current height, and if the third distance is greater than the predetermined threshold, determining the current height as the third height of the target container; adjusting the height of the second detection module if the relationship indicates that the second distance is greater than the predetermined threshold, and determining, by the second detection module, a fourth distance of the target container from the second detection module when the second detection module is at the current height, and determining, if the fourth distance is less than the predetermined threshold, the current height as the third height of the target container. In this embodiment, the initial position may be a position of a plane where the bottom of the target container is located, or may be a position of a predetermined height from the plane where the target area is located. When the initial position is the position of the plane in which the bottom of the target container is located, the second distance detected by the second detection module may be determined first. When the second distance is less than the predetermined threshold, the target container is considered to have been placed in the target area at that time. Therefore, the height of the second detection module can be adjusted, that is, the second detection module is controlled to move upwards, and the third distance is detected by the second detection module. And when the third distance is greater than the predetermined threshold value, determining the height of the second detection module at the moment as a third height.
In the above embodiment, when the height of the second detection module is adjusted, the second detection module may be controlled to move upward by a first fixed distance, a third distance from the target container to the second detection module when the height of the second detection module from the target area is the first fixed distance is determined by the second detection module, when the third distance is smaller than a predetermined threshold, the second detection module is controlled to move upward by the second fixed distance and detect the third distance by the second detection module, and when the third distance is larger than the predetermined threshold, the current height is determined as the third height of the target container. For example, the second detection module may be controlled to move upward from the bottom of the target container at a constant speed, first move upward by 8cm (i.e., a first fixed distance, which is only an exemplary illustration, and the present invention is not limited thereto), and the first fixed distance may be determined by the type of the target container, for example, the height of the cup is generally higher than 8cm, so the first fixed distance may be determined to be 8cm, and then the second detection module transmits a signal every time the second detection module moves upward by 1cm (i.e., a second fixed distance), and calculates a third distance according to the received reflected ultrasonic signal (from transmitting the ultrasonic signal to receiving the ultrasonic signal, the second detection module may stop waiting for 50 ms). And comparing the third distance with a preset threshold, controlling the second detection module to move upwards by 1cm when the third distance is less than or equal to the preset threshold, and detecting the third distance, wherein the preset threshold is 10 cm. Until the third distance is greater than the predetermined threshold, calculating and storing a height h1 of the target container, h1 ═ x + ny, where x is the first fixed distance, y is the second fixed distance, and n is the number of times the second detection module is controlled to move upward by the second fixed distance. For example, h1 is 8cm + n 1cm, where n is the number of times the second detection module is controlled to move up 1 cm.
In the above embodiment, after the second detection module moves upward from the bottom by the first fixed distance, the second detection module measures the third distance, and when the third distance is greater than the predetermined threshold, the second detection module may be controlled to move downward by the second fixed distance and move once to detect the third distance, until the third distance is less than the predetermined threshold, the current distance is determined as the third height.
In the above embodiment, when the initial position is a position at a predetermined height from the plane where the target area is located, the second distance may be greater than a predetermined threshold, when the second distance is greater than the predetermined threshold, the second detection module may be controlled to move downward and move once to detect the fourth distance, and when the fourth distance is less than the predetermined threshold, the current distance is determined as the third height.
In an exemplary embodiment, the main control module controls the delivering device to inject the target object into the target container based on the second height and the third height by: determining a product of the third height and a target constant, wherein the target constant is a positive number less than 1; and controlling the throwing device to stop injecting the target object into the target container under the condition that the second height is greater than or equal to the product. In this embodiment, after the third height of the target container is determined, a product of the third height and the target constant may be determined, and when the second height of the target object carried in the target container is greater than or equal to the product, the throwing device is controlled to stop injecting the target object into the target container. The target constant may be self-defined, for example, 0.9 (the value is only an exemplary illustration, and may also be 0.8, 0.95, and the like, which is not limited by the present invention). And when the second height is smaller than the product, controlling the releasing device to continuously release the target object until the second height is larger than or equal to the product.
In the above embodiment, a difference between the second height and the third height may also be determined in real time, and when the difference between the second height and the third height is smaller than a preset difference, the delivering device is controlled to stop delivering the target object.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of the operation on the mobile terminal, fig. 7 is a hardware structure block diagram of the mobile terminal of a delivery method according to an embodiment of the present invention. As shown in fig. 7, the mobile terminal may comprise one or more (only one shown in fig. 7) processors 702 (the processors 702 may comprise, but are not limited to, a processing means such as a microprocessor MCU or a programmable logic device FPGA), and a memory 704 for storing data, wherein the mobile terminal may further comprise a transmission device 706 for communication functions and an input-output device 708. It will be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
The memory 704 may be used for storing computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the delivery method in the embodiment of the present invention, and the processor 702 executes the computer programs stored in the memory 704, thereby executing various functional applications and data processing, i.e., implementing the method described above. The memory 704 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 704 may further include memory located remotely from the processor 702, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmitting device 706 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 706 includes a Network adapter (NIC) that can be connected to other Network devices via a base station to communicate with the internet. In one example, the transmitting device 706 can be a Radio Frequency (RF) module configured to communicate with the internet via wireless.
In this embodiment, a delivery method is provided, which may be applied to the delivery apparatus described in any of the above embodiments, and fig. 8 is a flowchart of the delivery method according to an embodiment of the present invention, as shown in fig. 8, where the flowchart includes the following steps:
step S802, acquiring a regional image acquired by shooting the target region by the image acquisition module;
step S804, determining the target rotation angle of the first detection module based on the area image;
step S806, controlling the first detection module to rotate according to the target rotation angle, and controlling the first detection module to detect a first distance from the target object carried in the target container to the first detection module when the target object is injected into the target container by the launching device;
step S808, receiving the first distance and a second distance, from the target container, of the second detection module detected by the second detection module;
step S810, controlling the delivering device to inject the target object into the target container based on the first distance and the second distance.
In the above embodiment, the throwing device may be a device for throwing liquid in a water dispenser, a water purifier, a coffee machine, a beverage machine, or a device for throwing solid in an ice cream machine, a rice jar, a coarse cereal barrel, or the like. When the dispensing device is a device for dispensing liquid, the target object is liquid, such as water, coffee, beverages, and the like, and when the dispensing device is a device for dispensing solid, the target object is solid, such as ice cream, rice, coarse cereals, and the like. The target area can be a cup, a measuring cup, a bowl and other containers.
In the above embodiment, the delivering device is provided with an area for placing the target container, and after the target container is placed in the target area, the image acquisition module may capture the target image to obtain an area image including the target container, and send the area image to the main control module. The main control module can analyze the area image and determine the position of the container opening of the target container. And determining the target rotation angle of the first detection module according to the position of the target container port.
In the above embodiment, after receiving the target rotation angle, the first detection module may rotate according to the target rotation angle, so as to align the first detection module with the container mouth, for example, align the detection center of the first detection module with the center of the container mouth. The first detection module may be an ultrasonic module, that is, the first detection module may determine a first distance from a target object carried in the target container to the first detection module by emitting an ultrasonic wave and receiving a returned ultrasonic wave.
In the above embodiment, the dispensing device may further include an electronic control module, the electronic control module is connected to the main control module, when the electronic control module is triggered, the dispensing device starts to dispense the target object, and when the main control module determines that the target container bears a full target object through the first distance and the second distance, the main control module may send a stop instruction to the electronic control module to stop dispensing the target object.
According to the method and the device, the area image acquired by shooting the target area by the image acquisition module is acquired, the target rotation angle of the first detection module is determined according to the area image, the first detection module is controlled to rotate according to the target rotation angle, the first detection module is controlled to detect the first distance from the target object carried in the target container to the first detection module under the condition that the target object is injected into the target container by the throwing device, the first distance and the second distance from the target container detected by the second detection module to the second detection module are received, and the throwing device is controlled to inject the target object into the target container according to the first distance and the second distance. The target rotation angle of the first detection module can be determined according to the container mouth position of the target container, so that the first detection module can be over against the first distance of the target object carried in the target container detected by the container mouth, and the problem that the first distance detected by the first detection module is inaccurate due to the fact that the container wall or other positions are detected by the first detection module is solved. The second distance between the target container and the second detection module can be accurately determined through the second detection module, and the target object can be accurately controlled to be injected into the target container by the releasing device through the first distance and the second distance. Therefore, the problem that the object injection into the container cannot be immediately stopped when the full object is borne in the container by the throwing device in the related technology can be solved, the effect that the object injection into the container is immediately stopped when the full object is borne in the container is achieved, and the user experience is improved.
Optionally, the execution main body of the above steps may be a main control module.
In an exemplary embodiment, controlling the launching device to inject the target object into the target container based on the first distance and the second distance comprises: determining a first height of the first detection module from the target area; determining a second height of the target object carried in the target container based on the first distance, the first height, and the target angle of rotation; determining a third height of the target container based on the second distance; controlling the delivery device to inject the target object into the target container based on the second height and the third height. In this embodiment, after receiving the first distance and the second distance, the main control module may determine a first height of the first detection module from the target area, and determine a second height of the target object carried in the target container according to the first height, the first distance, and the target rotation angle. And determining the third height of the target container according to the second distance, and controlling the throwing device to throw the target object by comparing the second height and the third height.
In the above embodiment, when determining the second height, a first height of the first detection module from the target area may be determined first, then a first distance of the target object carried in the target container from the first detection module is determined by the first detection module, and the second height is determined according to the first height, the first distance, and the target rotation angle. The first height may be a predetermined height, that is, when the first detection module is installed, a vertical height of the first detection module from the target area may be determined, and the vertical height is determined as the first height. Of course, the first height may also be determined by the first detection module, for example, first adjusting the measurement angle of the first detection module to be opposite to the target area, controlling the first detection module to emit the ultrasonic wave and receive the reflected ultrasonic wave, and determining the first height according to the time difference between the emission time and the reception time and the wave speed of the ultrasonic wave. The first distance can also be measured by the first detection module, the first detection module is controlled to send out ultrasonic waves and receive reflected ultrasonic waves, and the first distance is determined according to the time difference between the sending time and the receiving time and the wave speed of the ultrasonic waves.
In an exemplary embodiment, determining a second height of the target object carried in the target container based on the first distance, the first height, and the target angle of rotation comprises: determining a deviation angle of the detection direction of the first detection module from a vertical direction based on the target rotation angle; determining a product of the first distance and a cosine of the deflection angle; determining a difference of the first distance and the product as the second distance. In this embodiment, referring to fig. 6, the second height diagram is determined, and as shown in fig. 6, the ultrasonic module 2 starts to continuously transmit ultrasonic signals to detect the distance r (corresponding to the first distance) from the water surface and transmits the data to the main control board in real time. The calculation of the water level height (second height) h2, i.e. h2 ═ b-r × cos α, is carried out in the main control panel. Wherein b is the distance (namely the first height) between the ultrasonic module 2 and the table top for placing the water cup and is a fixed value; r is the distance (i.e. the first distance) from the water surface detected by the ultrasonic module 2; and alpha is the angle of the first detection module from the vertical middle line.
In one exemplary embodiment, determining the third height of the target container based on the second distance comprises: determining a relationship between the second distance and a predetermined threshold when the second detection module is at an initial position; if the relationship indicates that the second distance is less than a predetermined threshold, adjusting the height of the second detection module, and determining, by the second detection module, a third distance of the target container from the second detection module when the second detection module is at the current height, and if the third distance is greater than the predetermined threshold, determining the current height as the third height of the target container; adjusting the height of the second detection module if the relationship indicates that the second distance is greater than the predetermined threshold, and determining, by the second detection module, a fourth distance of the target container from the second detection module when the second detection module is at the current height, and determining, if the fourth distance is less than the predetermined threshold, the current height as the third height of the target container. In this embodiment, the initial position may be a position of a plane where the bottom of the target container is located, or may be a position of a predetermined height from the plane where the target area is located. When the initial position is the position of the plane in which the bottom of the target container is located, the second distance detected by the second detection module may be determined first. When the second distance is less than the predetermined threshold, the target container is considered to have been placed in the target area at that time. Therefore, the height of the second detection module can be adjusted, that is, the second detection module is controlled to move upwards, and the third distance is detected by the second detection module. And when the third distance is greater than the predetermined threshold value, determining the height of the second detection module at the moment as a third height.
In the above embodiment, when the height of the second detection module is adjusted, the second detection module may be controlled to move upward by a first fixed distance, a third distance from the target container to the second detection module when the height of the second detection module from the target area is the first fixed distance is determined by the second detection module, when the third distance is smaller than a predetermined threshold, the second detection module is controlled to move upward by the second fixed distance and detect the third distance by the second detection module, and when the third distance is larger than the predetermined threshold, the current height is determined as the third height of the target container. For example, the second detection module may be controlled to move upward from the bottom of the target container at a constant speed, first move upward by 8cm (i.e., a first fixed distance, which is only an exemplary illustration, and the present invention is not limited thereto), and the first fixed distance may be determined by the type of the target container, for example, the height of the cup is generally higher than 8cm, so the first fixed distance may be determined to be 8cm, and then the second detection module transmits a signal every time the second detection module moves upward by 1cm (i.e., a second fixed distance), and calculates a third distance according to the received reflected ultrasonic signal (from transmitting the ultrasonic signal to receiving the ultrasonic signal, the second detection module may stop waiting for 50 ms). And comparing the third distance with a preset threshold, controlling the second detection module to move upwards by 1cm when the third distance is less than or equal to the preset threshold, and detecting the third distance, wherein the preset threshold is 10 cm. Until the third distance is greater than the predetermined threshold, calculating and storing a height h1 of the target container, h1 ═ x + ny, where x is the first fixed distance, y is the second fixed distance, and n is the number of times the second detection module is controlled to move upward by the second fixed distance. For example, h1 is 8cm + n 1cm, where n is the number of times the second detection module is controlled to move up 1 cm.
In the above embodiment, after the second detection module moves upward from the bottom by the first fixed distance, the second detection module measures the third distance, and when the third distance is greater than the predetermined threshold, the second detection module may be controlled to move downward by the second fixed distance and move once to detect the third distance, until the third distance is less than the predetermined threshold, the current distance is determined as the third height.
In the above embodiment, when the initial position is a position at a predetermined height from the plane where the target area is located, the second distance may be greater than a predetermined threshold, when the second distance is greater than the predetermined threshold, the second detection module may be controlled to move downward and move once to detect the fourth distance, and when the fourth distance is less than the predetermined threshold, the current distance is determined as the third height.
In an exemplary embodiment, controlling the launching device to inject the target object into the target container based on the second height and the third height comprises: determining a product of the third height and a target constant, wherein the target constant is a positive number less than 1; and controlling the throwing device to stop injecting the target object into the target container under the condition that the second height is greater than or equal to the product. In this embodiment, after the third height of the target container is determined, a product of the third height and the target constant may be determined, and when the second height of the target object carried in the target container is greater than or equal to the product, the throwing device is controlled to stop injecting the target object into the target container. The target constant may be self-defined, for example, 0.9 (the value is only an exemplary illustration, and may also be 0.8, 0.95, and the like, which is not limited by the present invention). And when the second height is smaller than the product, controlling the releasing device to continuously release the target object until the second height is larger than or equal to the product.
In the above embodiment, a difference between the second height and the third height may also be determined in real time, and when the difference between the second height and the third height is smaller than a preset difference, the delivering device is controlled to stop delivering the target object.
The following describes the delivery method with reference to specific embodiments:
fig. 9 is a flowchart of a delivery method according to an embodiment of the present invention, and as shown in fig. 9, the method includes:
step S902, a user places a water cup;
step S904, the user presses the water intake switch;
step S906, the main control board triggers a camera (corresponding to the image acquisition module) to shoot a picture of the cup mouth of the water cup and sends the picture to the main control board (corresponding to the main control module);
step S908, the main control board performs image recognition, and outputs an angle α (corresponding to the target rotation angle) to be adjusted of the ultrasonic module 2 (corresponding to the first detection module);
step S910, the main control board drives the rotation motor (corresponding to the rotation sub-module) to adjust the corresponding angle α of the ultrasonic module 2;
step S912, the ultrasonic module 1 (corresponding to the second detection module) moves upward from the bottom of the cup at a constant speed, and firstly moves upward by 8cm (the height of the cup is larger than 8cm in general);
step S914, every time the ultrasonic module 1 moves up 1cm, transmitting 1 time of ultrasonic signal, calculating the distance D from the ultrasonic module to the cup wall according to the received reflected ultrasonic signal (corresponding to the third distance, from transmitting the ultrasonic signal to receiving the signal, the ultrasonic module needs to stop waiting for 50 ms);
step S916, comparing the distance D with a threshold value a (corresponding to the predetermined threshold value mentioned above), where a is assumed to be 10cm, repeating step S914 when D < ═ a, and moving the ultrasonic module 1 up by 1 cm; step S918 is executed when D > a;
step S918, when D > a, calculating and storing a cup height h1, h1 being 8cm + n × 1cm, where n refers to the number of times step e is performed;
step S920, the water purifier starts to inject water;
step S922, the ultrasonic module 2 starts to continuously transmit ultrasonic signals to detect the distance r from the ultrasonic module to the water surface and sends the data to the main control board in real time. The calculation of the water level height h2 is realized in the main control board, wherein h2 is b-r cos alpha, and b is the distance between the ultrasonic module 2 and the table top on which the water cup is placed and is a fixed value; r is the distance from the ultrasonic module 2 to the water surface; alpha is the angle of the ultrasonic module 2 deviating from the vertical central line;
step S924, comparing the water level height h2 with 0.9 × h1, executing step S922 when h2<0.9 × h1, and executing step S926 when h2> is 0.9 × h 1;
in step S926, the main control board notifies the water purifier to stop water injection.
In the embodiment, the ultrasonic sensor is adopted to be matched with the image recognition technology, so that the water level can be judged relatively accurately, and the function of stopping when the water is full is realized. The ultrasonic mode can realize the detection of the water level in the water cup, but because the position of the water cup placed by a user is not fixed, the ultrasonic wave can be blocked by the cup wall and cannot reach the water surface, and the water level cannot be detected correctly; the water level in the water cup is shot through the camera, the water level can be detected by using an image recognition algorithm, but the internal light of part of the cylindrical water cup is dark or the inner wall of the water cup reflects light, the water level cannot be distinguished by naked eyes of people in a shot picture, and the water level cannot be recognized by the image recognition algorithm. Therefore, the ultrasonic technology and the image recognition technology can be combined, the water level and the height of the water cup are detected by the ultrasonic technology, and the position of the cup rim of the water cup is detected by the image recognition technology, so that the ultrasonic module is guided to rotate by a proper angle, and the ultrasonic waves are aligned to the cup rim to be prevented from being shielded by the cup wall.
In the embodiment, the water level in the water cup when the water purifier is used can be accurately detected, and water injection can be automatically stopped when the water is full. The problem that the water in the cup is not full or overflows due to inaccurate judgment of the capacity of the cup by a user in the quantitative water taking method is solved, and the adopted ultrasonic technology does not need a complex algorithm, so that the requirement on hardware resources is not high, and the cost is greatly reduced.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method as set forth in any of the above.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.