Device and method for detecting front side and back side of smoke box
By combining position sensors and barcode readers with a controller, the problem of not being able to identify the front and back of the cigarette box during the filling process was solved, achieving accurate detection of the front and back of the cigarette box and ensuring the smooth operation of the production line and the consistency of product quality.
Patent Information
- Application Number
- CN202511189214.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-12-02
AI Technical Summary
The existing method of adding cigarette boxes cannot identify the front and back sides, causing defective products to flow into the next process, affecting the smooth operation of the production line and the consistency of product quality.
By combining a position sensor and a barcode reader with a controller, the system determines whether the surface of the cigarette box facing the barcode reader is the front by sensing the cigarette box's position information and reading the surface barcode. The controller controls the barcode reader's working status, and the system uses a speaker and alarm light to indicate any abnormalities.
It enables accurate identification of the front and back of the cigarette box, ensuring the smooth operation of subsequent processes on the production line and improving the consistency of product quality.
Smart Images

Figure CN121052274A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cigarette box inspection technology, and in particular to a device and method for inspecting the front and back of a cigarette box. Background Technology
[0002] Currently, packing and sealing cigarette boxes is an important step in the cigarette production process, during which cigarette boxes need to be filled.
[0003] Currently, cigarette boxes are mainly added using two methods: automated addition by robotic arms and manual addition. When using automated addition by robotic arms, due to cost constraints, existing robotic arms lack a vision camera system capable of identifying the front and back of the cigarette box, making it impossible to promptly detect misalignment. When using manual addition, due to the large production volume, it's also easy to miss misalignment issues during manual addition. Misalignment not only leads to defective products flowing into the next process, affecting the smooth operation of subsequent processes on the production line, but also impacts the consistency of product quality. Summary of the Invention
[0004] This invention provides a device and method for detecting the front and back of a cigarette box, in order to solve the problem that existing methods for adding cigarette boxes cannot identify the front and back of the cigarette box.
[0005] In a first aspect, embodiments of the present invention provide a front and back detection device for a cigarette box, the cigarette box including a front and a back side arranged opposite to each other, the front side being provided with a front barcode, and the front and back detection device including a position sensor, a barcode reader and a controller;
[0006] The position sensor is communicatively connected to the controller and is used to sense the position information of the cigarette box and transmit the position information to the controller;
[0007] The controller is also communicatively connected to the barcode reader and is used to control the working state of the barcode reader according to the location information;
[0008] The barcode reader is used to acquire the surface barcode information of the cigarette box facing the side of the barcode reader, and transmit the surface barcode information to the controller;
[0009] The controller is also used to determine whether the surface of the cigarette box facing the barcode reader is the front side based on the surface barcode information and the front barcode.
[0010] Optionally, the position sensor includes a first position sensor and a second position sensor;
[0011] The first position sensor is used to acquire the first position information of the cigarette box;
[0012] The second position sensor is used to acquire the second position information of the cigarette box;
[0013] The controller is communicatively connected to the first position sensor and the second position sensor respectively, and is used to acquire the first position information and the second position information, and control the working state of the barcode reader according to the first position information and the second position information.
[0014] Optionally, the first location information includes first time information when the first location sensor senses the cigarette box; the second location information includes second time information when the second location sensor senses the cigarette box.
[0015] The controller is configured to control the barcode reader to operate when the first time information is less than the second time information and the difference between the first time information and the second time information is within a preset time range.
[0016] Optionally, the front and back detection device also includes a power supply;
[0017] The power supply is electrically connected to the position sensor, the controller, and the barcode reader, respectively, and is used to supply power to the position sensor, the controller, and the barcode reader.
[0018] Optionally, the front and back detection device also includes a speaker;
[0019] The controller is also communicatively connected to the speaker and is used to control the speaker to operate when it is determined that the surface of the cigarette box facing the barcode reader is the reverse side.
[0020] Optionally, the front and back detection device also includes an alarm light;
[0021] The controller is also communicatively connected to the alarm light and is used to control the alarm light to operate when it is determined that the surface of the cigarette box facing the barcode reader is the reverse side.
[0022] Secondly, embodiments of the present invention provide a method for detecting the front and back sides of a cigarette box, applied to the front and back side detection device described in the first aspect, the method comprising:
[0023] Obtain the location information of the cigarette box;
[0024] The working state of the barcode reader is controlled according to the location information;
[0025] Obtain the surface barcode information of the cigarette box facing the barcode reader;
[0026] Based on the surface barcode information and the front barcode, determine whether the surface of the cigarette box facing the barcode reader is the front side.
[0027] Optionally, obtaining the location information of the cigarette box includes:
[0028] Obtain the first and second position information of the cigarette box;
[0029] Controlling the working state of the barcode reader based on the location information includes:
[0030] The operating state of the barcode reader is controlled based on the first location information and the second location information.
[0031] Optionally, the first location information includes first time information when the cigarette box is transported to the first preset location; the second location information includes second time information when the cigarette box is transported to the second preset location.
[0032] Controlling the operating state of the barcode reader based on the first location information and the second location information includes:
[0033] When the first time information is less than the second time information, and the difference between the first time information and the second time information is within a preset time range, the reader is controlled to work.
[0034] Optionally, the front and back detection method further includes:
[0035] When it is determined that the surface of the cigarette box facing the barcode reader is the reverse side, the speaker and / or alarm light are activated.
[0036] The technical solution of this invention, by setting a controller that can control the working state of the barcode reader based on the position information of the cigarette box sensed by the position sensor, and can determine whether the surface of the cigarette box facing the barcode reader is the front side based on the surface barcode information of the cigarette box facing the barcode reader and the front barcode of the cigarette box, solves the problem of not being able to identify the front and back of the cigarette box in the existing cigarette box adding method, which can ensure the smooth operation of subsequent processes on the production line and improve the consistency of product quality.
[0037] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a schematic diagram of the structure of a front and back detection device for a cigarette box provided in an embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram illustrating the communication connection between a controller and a barcode reader, provided in an embodiment of the present invention.
[0041] Figure 3 A schematic diagram of another front and back detection device for a cigarette box provided in an embodiment of the present invention;
[0042] Figure 4 A schematic diagram of the structure of another cigarette box front and back detection device provided in an embodiment of the present invention;
[0043] Figure 5 A schematic diagram of a front and back detection device for a cigarette box provided in an embodiment of the present invention;
[0044] Figure 6 A flowchart illustrating a method for detecting the front and back of a cigarette box according to an embodiment of the present invention;
[0045] Figure 7 A flowchart of another method for detecting the front and back of a cigarette box provided in an embodiment of the present invention;
[0046] Figure 8 A flowchart of another method for detecting the front and back of a cigarette box provided in an embodiment of the present invention. Detailed Implementation
[0047] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0048] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices. The terms "upper," "lower," "left," "right," etc., indicate orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings and are only used to describe the relative positional relationships between components or constituent parts, and do not specifically limit the specific installation orientation of each component or constituent part.
[0049] It should be noted that the cigarette box in this embodiment of the invention includes a front and a back side arranged opposite to each other, and the front side is provided with a front barcode. Figure 1 This is a schematic diagram of the front and back detection device for a cigarette box provided in an embodiment of the present invention. (Refer to...) Figure 1 The front and back detection device 100 in this embodiment of the invention includes a position sensor 10, a barcode reader 20, and a controller 30. The position sensor 10 is communicatively connected to the controller 30 and is used to sense the position information of the cigarette box and transmit the position information to the controller 30. The controller 30 is also communicatively connected to the barcode reader 20 and is used to control the working state of the barcode reader 20 based on the position information. The barcode reader 20 is used to acquire the surface barcode information of the cigarette box facing the barcode reader 20 and transmit the surface barcode information to the controller 30. The controller 30 is also used to determine whether the surface of the cigarette box facing the barcode reader 20 is the front side based on the surface barcode information and the front barcode.
[0050] For example, in this embodiment of the invention, the position sensor 10 can be a photoelectric sensor. It can be configured so that when the cigarette box is transported to a preset position, the light signal emitted by the photoelectric sensor can be blocked by the cigarette box, thus reflecting the light signal back to the photoelectric sensor. After receiving the light signal, the photoelectric sensor converts the received light signal into position information indicating that the cigarette box has reached the preset position, and transmits this position information to the controller 30. When the controller 30 receives the position information indicating that the cigarette box has reached the preset position, it controls the barcode reader 20 to start working. It should be noted that the preset position refers to the position where the barcode reader 20 can perform scanning and reading. The distance between the surface of the cigarette box facing the barcode reader 20 at the preset position and the barcode reader 20 is less than or equal to the effective scanning distance of the barcode reader 20.
[0051] The barcode reader 20, during operation, can scan the surface of the cigarette box facing the reader 20 using a camera or laser to obtain the barcode information on this side of the cigarette box and transmit it to the controller 30. The controller 30 then compares the obtained surface barcode information with the front barcode of the cigarette box to determine if the surface facing the reader 20 is the front side. Specifically, if the barcode information on the surface facing the reader 20 matches the information on the front barcode, the surface facing the reader 20 is determined to be the front of the cigarette box; if the barcode information on the surface facing the reader 20 differs from the information on the front barcode, the surface facing the reader 20 is determined to be the back side of the cigarette box. It should be noted that the information of the front barcode of the cigarette box can be pre-stored in a memory, and the controller 30 communicates with this memory to retrieve the information of the front barcode of the cigarette box.
[0052] The above embodiments of the present invention are illustrated using the example of a barcode on the reverse side of the cigarette box. In other feasible embodiments, the reverse side of the cigarette box may not have a barcode. In this case, if the barcode information on the surface of the cigarette box facing the barcode reader 20 is the same as the information on the front barcode of the cigarette box, then the surface of the cigarette box facing the barcode reader 20 is determined to be the front of the cigarette box; if the controller 30 does not receive the barcode information on the surface of the cigarette box facing the barcode reader 20 within a preset time after the controller starts working, then the surface of the cigarette box facing the barcode reader 20 is determined to be the reverse side of the cigarette box.
[0053] Figure 2 This is a schematic diagram illustrating the communication connection between the controller 30 and the barcode reader 20 according to an embodiment of the present invention. (Refer to...) Figure 2 In this embodiment of the invention, the controller 30 can be an STM32 microcontroller, whose pins include at least PB10, RXD, TXD, and GND. The reader 20 also has at least TRIG, TXD, RXD, and GND pins. The STM32 microcontroller's PB10 pin is electrically connected to the reader 20's TRIG pin. The STM32 microcontroller can input a start control signal to the reader 20's TRIG pin via its PB10 pin to control the reader 20's scan start. The STM32 microcontroller and reader 20 use serial communication, meaning the STM32 microcontroller's RXD pin is electrically connected to the reader 20's TXD pin, the STM32 microcontroller's TXD pin is electrically connected to the reader 20's RXD pin, and the STM32 microcontroller's GND pin is electrically connected to the reader 20's GND pin.
[0054] This invention, through the configuration of controller 30, can control the working state of barcode reader 20 based on the position information of the cigarette box sensed by position sensor 10. It can also determine whether the surface of the cigarette box facing barcode reader 20 is the front side based on the surface barcode information of the cigarette box facing barcode reader 20 and the front barcode of the cigarette box. This solves the problem of not being able to identify the front and back of the cigarette box in the existing cigarette box adding method, which can ensure the smooth operation of subsequent processes on the production line and improve the consistency of product quality.
[0055] Figure 3 This is a schematic diagram of another front and back detection device for a cigarette box provided in an embodiment of the present invention, with reference to... Figure 3 In this embodiment of the invention, the position sensor 10 includes a first position sensor 11 and a second position sensor 12. The first position sensor 11 is used to acquire first position information of the cigarette box. The second position sensor 12 is used to acquire second position information of the cigarette box. The controller 30 is communicatively connected to the first position sensor 11 and the second position sensor 12 respectively, and is used to acquire the first position information and the second position information, and control the working state of the barcode reader 20 according to the first position information and the second position information.
[0056] To avoid the position sensor 10 being falsely triggered due to human obstruction, this embodiment of the invention sets up two position sensors 10. The controller 30 determines whether the cigarette box has reached the preset position based on the position information sensed by the two position sensors 10, and then controls the working state of the code reader 20.
[0057] Specifically, in this embodiment of the invention, the first position information includes first time information when the first position sensor 11 senses the cigarette box. The second position information includes second time information when the second position sensor 12 senses the cigarette box. The controller 30 is configured to control the barcode reader 20 to operate when the first time information is less than the second time information and the difference between the first time information and the second time information is within a preset time range.
[0058] The two position sensors 10 have different effective detection distances, with the first position sensor 11 having an effective detection distance D1 greater than the second position sensor 12 having an effective detection distance D2. When the cigarette box moves along the conveyor belt in the cigarette box transmission direction, the first distance sensor is triggered first. After a certain period of time (which is determined by the cigarette box's moving speed and the conveyor belt length, and is measured after debugging), the second distance sensor is triggered, which in turn controls the barcode reader 20 to start and trigger the photo taking.
[0059] For example, the first position sensor 11 and the second position sensor 12 are installed on the tobacco box's travel path. Only when the two position sensors 10 are triggered in the correct order is the signal considered valid. This embodiment of the invention uses the rising edge triggering of the two position sensors 10 as an example for explanation. The valid triggering conditions are: the first position sensor 11 is triggered first (the electrical signal output by the first position sensor 11 to the controller 30 is a rising edge; at this time, the first time information refers to the time corresponding to the rising edge), and then the second position sensor 12 is triggered afterward (the electrical signal output by the second position sensor 12 to the controller 30 is a rising edge; at this time, the second time information refers to the time corresponding to the rising edge), and the time difference between the two triggering events is within a reasonable range. It should be noted that this reasonable range can be determined based on the tobacco box speed.
[0060] If the triggering sequence is incorrect (e.g., the second position sensor 12 triggers before the first position sensor 11), the controller 30 will not control the encoder to work. If the time difference between the two triggers is not within a reasonable range, it may indicate human interference or an abnormal cigarette box, and the controller 30 will also not control the encoder to work. After the first position sensor 11 is triggered, a timer can be started. If the second position sensor 12 is not triggered within the timeout period, the state is cleared. If the triggering is in the correct sequence and the code is successfully read, the read surface barcode information is immediately given; otherwise, the barcode reader 20 continues to read codes until the second position sensor 12 can no longer sense the cigarette box (i.e., the electrical signal output by the second position sensor 12 to the controller 30 is a falling edge). After the barcode reader 20 starts working, if the barcode reader 20 does not read a code, the controller 30 must wait until the carton leaves before giving a failure signal. During the barcode reading process of the barcode reader 20, if the second position sensor 12 outputs a falling edge before the first position sensor 11, it may indicate human interference or an abnormal cigarette box, which can be ignored, and the states of the first position sensor 11 and the second position sensor 12 are reset. It should be noted that, under normal circumstances, the first position sensor 11 should output a falling edge before the second position sensor 12.
[0061] The specific implementation steps are as follows: 1. Initialize the two position sensors 10 to be triggered by rising edges. 2. The controller 30, based on the received first and second position information and the states of the first and second position sensors 11 and 12, normally changes the following states: waiting for the first position sensor 11 to trigger, the first position sensor 11 has been triggered and is waiting for the second position sensor 12 to trigger, and the second position sensor 12 has triggered (or timed out without triggering). 3. When the first position sensor 11 triggers, the controller records the time and enters the state of waiting for the second position sensor 12 to trigger. 4. When the second position sensor 12 triggers, the controller checks whether it is in the state of waiting for the second position sensor 12 to trigger and whether the trigger time difference between the two position sensors 10 is within the range of [Min_Time, Max_Time]. If both are true, the detected cigarette box is considered a valid cigarette box, and then the barcode reader 20 is turned on to start scanning. 5. If the second position sensor 12 is not detected within a timeout t1 (e.g., 1 second), the controller resets the first position sensor 11. At the same time, we also need to consider the production cycle (e.g., an average of 30 seconds to pass through a smoke box), so the minimum interval between two valid triggers should be above Tmin (e.g., 25 seconds) to avoid repeated triggers, but the maximum interval should not exceed Tmax (35 seconds) to avoid missed detections.
[0062] refer to Figure 1 The front and back detection device 100 in this embodiment of the invention also includes a power supply 40. The power supply 40 is electrically connected to the position sensor 10, the controller 30 and the barcode reader 20 respectively, and is used to supply power to the position sensor 10, the controller 30 and the barcode reader 20.
[0063] For example, power supply 40 is electrically connected to position sensor 10 and can provide 5V DC power to position sensor 10. Power supply 40 is electrically connected to controller 30 and can provide 3.3V DC power to controller 30. Power supply 40 is electrically connected to barcode reader 20 and can provide 5V DC power to barcode reader 20.
[0064] Figure 4 This is a schematic diagram of the structure of another cigarette box front and back detection device provided in an embodiment of the present invention, with reference to... Figure 4 The front and back detection device 100 in this embodiment of the invention also includes a speaker 50. The controller 30 is also communicatively connected to the speaker 50 and is used to control the speaker 50 to operate when it is determined that the surface of the cigarette box facing the barcode reader 20 is the back side.
[0065] For example, if the barcode information on the side of the cigarette box facing the barcode reader 20 is different from the information on the front barcode of the cigarette box, or if the barcode information on the side of the cigarette box facing the barcode reader 20 is not received within a preset time after the barcode reader 20 starts working, then the side of the cigarette box facing the barcode reader 20 is determined to be the back of the cigarette box, and the speaker 50 is controlled to work, and the speaker 50 emits a sound to attract the staff to adjust the cigarette box with the wrong front and back.
[0066] refer to Figure 4 The front / back detection device 100 in this embodiment of the invention also includes an alarm light 60. The controller 30 is also communicatively connected to the alarm light 60 and is used to control the alarm light 60 to operate when it is determined that the surface of the cigarette box facing the barcode reader 20 is the back side.
[0067] For example, if the barcode information on the side of the cigarette box facing the barcode reader 20 is different from the information on the front barcode of the cigarette box, or if the barcode information on the side of the cigarette box facing the barcode reader 20 is not received within a preset time after the barcode reader 20 starts working, then the side of the cigarette box facing the barcode reader 20 is determined to be the back of the cigarette box, and the alarm light 60 is activated. The alarm light 60 illuminates to attract the staff to adjust the cigarette box with the incorrect front and back.
[0068] Figure 5 This is a schematic diagram of a front and back detection device for a cigarette box provided in an embodiment of the present invention. (Refer to...) Figure 5 For ease of installation, the front and back detection device 100 in this embodiment of the invention also includes a housing 70, in which the position sensor 10, barcode reader 20, controller 30, power supply 40, speaker 50, and alarm light 60 are all housed. The device is simple and compact, allowing for flexible installation at certain locations on the cigarette box production line (e.g., Figure 3 As shown, this system can monitor the orientation of cigarette boxes entering the production line in real time. During daily production, when an abnormal box passes by, it can quickly and accurately identify it and issue an alarm, prompting staff to handle the abnormality promptly. This effectively solves a series of problems caused by misaligned cigarette boxes.
[0069] This invention also provides a method for detecting the front and back of a cigarette box, which is applied to the front and back detection device 100 provided in the above embodiments of this invention. Figure 6 This is a flowchart of a method for detecting the front and back of a cigarette box according to an embodiment of the present invention, referred to... Figure 6 The method for detecting the front and back of a cigarette box in this embodiment of the invention includes:
[0070] S110, Obtain the location information of the cigarette box.
[0071] For example, refer to Figure 1The controller 30 can obtain the position information of the cigarette box through the position sensor 10.
[0072] S120. Control the working status of the barcode reader according to the location information.
[0073] For example, refer to Figure 1 When the received location information indicates that the cigarette box has reached the preset position, the controller 30 will control the barcode reader 20 to start working.
[0074] S130. Obtain the surface barcode information of the cigarette box facing the barcode reader.
[0075] For example, refer to Figure 1 After the controller 30 controls the barcode reader 20 to start working, the controller 30 can obtain the surface barcode information of the cigarette box facing the barcode reader 20 through the barcode reader 20.
[0076] S140. Determine whether the surface of the cigarette box facing the barcode reader is the front based on the surface barcode information and the front barcode.
[0077] For example, refer to Figure 1 If the barcode information on the side of the cigarette box facing the barcode reader 20 is the same as the information on the front barcode of the cigarette box, then the side of the cigarette box facing the barcode reader 20 is determined to be the front of the cigarette box; if the barcode information on the side of the cigarette box facing the barcode reader 20 is different from the information on the front barcode of the cigarette box, or if no barcode information on the side of the cigarette box facing the barcode reader 20 is received within a preset time after the barcode reader 20 starts working, then the side of the cigarette box facing the barcode reader 20 is determined to be the back of the cigarette box.
[0078] In this embodiment of the invention, the working state of the barcode reader 20 is first controlled based on the position information of the cigarette box sensed by the position sensor 10. Then, based on the surface barcode information of the cigarette box facing the barcode reader 20 and the front barcode of the cigarette box obtained by the barcode reader 20, it is determined whether the surface of the cigarette box facing the barcode reader 20 is the front. This can realize the detection of the front and back of the cigarette box, which solves the problem of not being able to identify the front and back of the cigarette box in the existing cigarette box adding method. This can ensure the smooth operation of subsequent processes on the production line and improve the consistency of product quality.
[0079] Figure 7 This is a flowchart illustrating a method for detecting the front and back of a cigarette box according to an embodiment of the present invention. Figure 7 The illustrated embodiment provides a detailed explanation of how to obtain the location information of the cigarette box and how to control the working state of the barcode reader 20 based on the location information. (Refer to...) Figure 7 The method for detecting the front and back of a cigarette box in this embodiment of the invention includes:
[0080] S210, Obtain the first and second position information of the cigarette box.
[0081] It should be noted that the first position information in this embodiment of the invention includes first time information when the first position sensor 11 senses the cigarette box. The second position information includes second time information when the second position sensor 12 senses the cigarette box.
[0082] For example, the effective detection distances of the two position sensors 10 are different, with the effective detection distance D1 of the first position sensor 11 being greater than the effective detection distance D2 of the second position sensor 12. When the cigarette box moves along the conveyor belt in the cigarette box transmission direction, the first distance sensor will be triggered first, and after a certain period of time (this time is determined by the cigarette box moving speed and the length of the conveyor belt, and is measured after debugging), the second distance sensor will be triggered.
[0083] S220. Control the working state of the barcode reader according to the first position information and the second position information.
[0084] As a feasible implementation method, controlling the working state of the barcode reader 20 according to the first position information and the second position information includes: controlling the barcode reader 20 to work when the first time information is less than the second time information and the difference between the first time information and the second time information is within a preset time range.
[0085] The first position sensor 11 and the second position sensor 12 are installed on the tobacco box's travel path. A valid signal is only confirmed when both position sensors 10 are triggered in the correct sequence. This embodiment of the invention uses the rising edge triggering of both position sensors 10 as an example. The valid triggering conditions are: the first position sensor 11 triggers first (the electrical signal output from the first position sensor 11 to the controller 30 is a rising edge; at this time, the first time information refers to the time corresponding to this rising edge), and then the second position sensor 12 triggers subsequently (the electrical signal output from the second position sensor 12 to the controller 30 is a rising edge; at this time, the second time information refers to the time corresponding to this rising edge), and the time difference between the two triggers is within a reasonable range. It should be noted that this reasonable range can be determined based on the tobacco box speed.
[0086] This invention, by setting the cigarette box to determine whether it has reached a preset position based on the position information sensed by the two position sensors 10, controls the working state of the code reader 20, thus avoiding the situation where the position sensors 10 are falsely triggered due to human obstruction.
[0087] S230. Obtain the surface barcode information of the cigarette box facing the barcode reader.
[0088] S240. Determine whether the surface of the cigarette box facing the barcode reader is the front based on the surface barcode information and the front barcode.
[0089] Figure 8The flowchart illustrates another method for detecting the front and back of a cigarette box according to an embodiment of the present invention. Figure 8 The illustrated embodiments enrich the process of the method for detecting the front and back of a cigarette box, see reference. Figure 8 The method for detecting the front and back of a cigarette box in this embodiment of the invention includes:
[0090] S310, Obtain the location information of the cigarette box.
[0091] S320: Control the working status of the barcode reader based on location information.
[0092] S330: Obtain the surface barcode information of the cigarette box facing the barcode reader.
[0093] S340. Determine whether the surface of the cigarette box facing the barcode reader is the front based on the surface barcode information and the front barcode.
[0094] S350: When it is determined that the surface of the cigarette box facing the barcode reader is reversed, control the speaker and / or alarm light to operate.
[0095] For example, refer to Figure 4 If the barcode information on the side of the cigarette box facing the barcode reader 20 is different from the information on the front barcode of the cigarette box, or if the barcode information on the side of the cigarette box facing the barcode reader 20 is not received within a preset time after the barcode reader 20 starts working, then the side of the cigarette box facing the barcode reader 20 is determined to be the back of the cigarette box, and then the speaker 50 and / or the alarm light 60 are controlled to work to attract the staff to adjust the cigarette box with the wrong front and back.
[0096] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A device for detecting the front and back sides of a cigarette box, the cigarette box comprising a front side and a back side arranged opposite to each other, the front side being provided with a front barcode, characterized in that, The front and back detection device includes a position sensor, a barcode reader, and a controller; The position sensor is communicatively connected to the controller and is used to sense the position information of the cigarette box and transmit the position information to the controller; The controller is also communicatively connected to the barcode reader and is used to control the working state of the barcode reader according to the location information; The barcode reader is used to acquire the surface barcode information of the cigarette box facing the side of the barcode reader, and transmit the surface barcode information to the controller; The controller is also used to determine whether the surface of the cigarette box facing the barcode reader is the front side based on the surface barcode information and the front barcode.
2. The front and back detection device according to claim 1, characterized in that, The position sensor includes a first position sensor and a second position sensor; The first position sensor is used to acquire the first position information of the cigarette box; The second position sensor is used to acquire the second position information of the cigarette box; The controller is communicatively connected to the first position sensor and the second position sensor respectively, and is used to acquire the first position information and the second position information, and control the working state of the barcode reader according to the first position information and the second position information.
3. The front and back detection device according to claim 2, characterized in that, The first location information includes first time information when the first location sensor senses the cigarette box; the second location information includes second time information when the second location sensor senses the cigarette box. The controller is configured to control the barcode reader to operate when the first time information is less than the second time information and the difference between the first time information and the second time information is within a preset time range.
4. The front and back detection device according to claim 1, characterized in that, The front and back detection device also includes a power supply; The power supply is electrically connected to the position sensor, the controller, and the barcode reader, respectively, and is used to supply power to the position sensor, the controller, and the barcode reader.
5. The front and back detection device according to claim 1, characterized in that, The front and back detection device also includes a speaker; The controller is also communicatively connected to the speaker and is used to control the speaker to operate when it is determined that the surface of the cigarette box facing the barcode reader is the reverse side.
6. The front and back detection device according to claim 1, characterized in that, The front and back detection device also includes an alarm light; The controller is also communicatively connected to the alarm light and is used to control the alarm light to operate when it is determined that the surface of the cigarette box facing the barcode reader is the reverse side.
7. A method for detecting the front and back of a cigarette box, applied to the front and back detection device according to any one of claims 1-6, characterized in that, The front and back detection method includes: Obtain the location information of the cigarette box; The working state of the barcode reader is controlled according to the location information; Obtain the surface barcode information of the cigarette box facing the barcode reader; Based on the surface barcode information and the front barcode, determine whether the surface of the cigarette box facing the barcode reader is the front side.
8. The front and back detection method according to claim 7, characterized in that, Obtaining the location information of the cigarette box includes: Obtain the first and second position information of the cigarette box; Controlling the working state of the barcode reader based on the location information includes: The operating state of the barcode reader is controlled based on the first location information and the second location information.
9. The front and back detection method according to claim 8, characterized in that, The first location information includes first time information when the first location sensor senses the cigarette box; the second location information includes second time information when the second location sensor senses the cigarette box. Controlling the operating state of the barcode reader based on the first location information and the second location information includes: When the first time information is less than the second time information, and the difference between the first time information and the second time information is within a preset time range, the code reader is controlled to work.
10. The front and back detection method according to claim 7, characterized in that, The front and back detection method further includes: When it is determined that the surface of the cigarette box facing the barcode reader is the reverse side, the speaker and / or alarm light are activated.