Disclosure of Invention
In order to solve the technical problems, the invention provides a method for improving the code scanning stability on a production line, which controls the travelling speed of a production line conveying device by sending a signal through a second bar code scanning device, so that the bar code scanning device of an information acquisition station can obtain images beneficial to decoding and rapidly decode, thereby reducing the missing scanning rate of a whole production line article bar code acquisition and entry system and reducing the condition of code scanning failure.
The first technical scheme of the invention is as follows:
a system for improving the code scanning stability of a production line comprises an upper computer, a production line conveying device, a first bar code scanning device for collecting bar code data, a second bar code scanning device for detecting whether bar codes exist on the production line, and a production line control device for controlling the speed of the production line; the first bar code scanning device, the second bar code scanning device and the production line control device are all in communication connection with the upper computer, the production line control device is also in communication connection with the production line conveying device, the first bar code scanning device is arranged at an information acquisition station on the production line, the second bar code scanning device is arranged in front of the information acquisition station, an article is transmitted on the production line and passes through the second bar code scanning device, the second bar code scanning device acquires an article image, whether the article image contains bar space features or positioning features is judged, if yes, the article is judged to have bar codes, and a notification message containing the detected bar codes is sent to the upper computer; the upper computer sends a deceleration instruction to the production line control equipment after receiving the deceleration instruction, the production line control equipment controls the assembly line conveying equipment to decelerate, so that the bar code-bearing article passes through the information acquisition station at a low speed, the first bar code scanning equipment acquires and decodes the bar code on the article, and then the decoding result is sent to the upper computer.
More preferably, when the upper computer receives the notification message for the first time, the upper computer sends a deceleration instruction to the production line control device and starts to accumulate the number of received notification messages to obtain the number of bar codes detected by the second bar code scanning device; and the upper computer receives the decoding result from the first bar code scanning device and judges whether the decoding is successful, if the decoding result is decoding data, the number of bar codes which are successfully decoded is accumulated, and if the decoding result is decoding failure information, the number of bar codes which are successfully decoded is not accumulated.
More preferably, when the upper computer does not receive the notification message and the decoded data within a preset time threshold T, the upper computer compares whether the number of the detected bar codes is consistent with the number of the received bar codes successfully decoded, if so, the upper computer sends a control instruction for recovering the speed to the production line control equipment, and the production line control equipment controls the production line transmission equipment to recover the speed; if not, the upper computer controls the production line control equipment to alarm.
More preferably, the system further comprises an alarm device, the production line control device is further connected with the alarm device, and the upper computer controls the production line control device to alarm, specifically: the upper computer sends an alarm and stop instruction to the production line control equipment, and the production line control equipment controls the pipeline conveying equipment to stop and controls the alarm equipment to send an alarm prompt.
More preferably, the bar space feature refers to that the image of the article contains bars and spaces which are arranged at intervals, and the positioning feature refers to the image feature used for judging the bar code.
The invention also provides a method for improving the code scanning stability of the assembly line.
The technical scheme II of the invention is as follows:
a method for improving the code scanning stability of a production line comprises the following steps: the system comprises an upper computer, a pipeline conveying device, a first bar code scanning device for collecting bar code data, a second bar code scanning device for detecting whether bar codes exist on a pipeline, and a production line control device for controlling the speed of the pipeline; the first bar code scanning equipment, the second bar code scanning equipment and the production line control equipment are all in communication connection with the upper computer, the production line control equipment is also in communication connection with the assembly line conveying equipment, the first bar code scanning equipment is arranged at an information acquisition station on an assembly line, the second bar code scanning equipment is arranged in front of the information acquisition station, and the method comprises the following steps: the article is transmitted on the assembly line and passes through the second bar code scanning equipment, the second bar code scanning equipment collects an article image, judges whether the article comprises bar space features or positioning features, if yes, judges that the article is provided with a bar code, and sends a notification message containing the detected bar code to the upper computer; the upper computer sends a deceleration instruction to the production line control equipment after receiving the deceleration instruction, the production line control equipment controls the assembly line conveying equipment to decelerate, so that the bar code-bearing article passes through the information acquisition station at a low speed, the first bar code scanning equipment acquires and decodes the bar code on the article, and then the decoding result is sent to the upper computer.
More preferably, the upper computer further performs the following steps: when the upper computer receives the notification message for the first time, sending a deceleration instruction to the production line control equipment and starting to accumulate the quantity of the received notification message to obtain the quantity of the bar codes detected by the second bar code scanning equipment; and the upper computer receives the decoding result from the first bar code scanning device and judges whether the decoding is successful, if the decoding result is decoding data, the number of bar codes which are successfully decoded is accumulated, and if the decoding result is decoding failure information, the number of bar codes which are successfully decoded is not accumulated.
More preferably, when the upper computer does not receive the notification message and the decoded data within a preset time threshold T, the upper computer compares whether the number of the detected bar codes is consistent with the number of the received bar codes successfully decoded, if so, the upper computer sends a control instruction for recovering the speed to the production line control equipment, and the production line control equipment controls the production line transmission equipment to recover the speed; if not, the upper computer controls the production line control equipment to alarm.
More preferably, the system further comprises an alarm device, the production line control device is further connected with the alarm device, and the upper computer controls the production line control device to alarm, specifically: the upper computer sends an alarm and stop instruction to the production line control equipment, and the production line control equipment controls the pipeline conveying equipment to stop and controls the alarm equipment to send an alarm prompt.
More preferably, the bar space feature refers to that the image of the article contains bars and spaces which are arranged at intervals, and the positioning feature refers to the image feature used for judging the bar code.
The invention has the following beneficial effects:
1. according to the system and the method for improving the code scanning stability of the assembly line, the bar code scanning equipment for detecting whether the articles are provided with bar codes is additionally arranged, so that the assembly line conveying equipment decelerates in advance, the bar code-provided articles can pass through the information acquisition station at a lower speed and in a stable state, and after the batch of articles pass through the information acquisition station, the assembly line conveying equipment recovers the original speed, thereby reducing the missing scanning rate of the bar code acquisition and input system of the assembly line articles and reducing the condition of code scanning failure, meanwhile, the conveying speed of the whole assembly line conveying equipment is not excessively dependent on the performance of the bar code scanning equipment, and the transmission efficiency of the assembly line is improved to a certain extent.
2. According to the system and the method for improving the code scanning stability of the assembly line, the end of the code scanning of the batch of articles is judged according to the time threshold T, the number of detected codes and the number of successfully decoded codes are compared, the problem of missing scanning is found in time, and the accuracy and the reliability of the code scanning of the assembly line are improved.
Detailed Description
The invention will now be described in detail with reference to the drawings and to specific embodiments.
Referring to fig. 3 and 4, a system for improving the code scanning stability of a pipeline includes an upper computer 1, a pipeline transmission device 2, a first bar code scanning device 3 for collecting bar code data, a second bar code scanning device 4 for detecting whether a bar code exists on the pipeline, and a production line control device 5 for controlling the speed of the pipeline; the first bar code scanning device 3, the second bar code scanning device 4 and the production line control device 5 are all in communication connection with the upper computer 1, the production line control device 5 is also in communication connection with the assembly line conveying device 2, the first bar code scanning device 3 is arranged at an information acquisition station on an assembly line, the second bar code scanning device 4 is arranged in front of the information acquisition station, an article is transmitted on the assembly line and passes through the second bar code scanning device 4, the second bar code scanning device 4 acquires an article image, whether the article contains a bar space feature or a positioning feature is judged, if yes, the article is judged to have a bar code, and a notification message containing the detected bar code is sent to the upper computer 1; the upper computer 1 receives the deceleration command and then sends the deceleration command to the production line control equipment 5, the production line control equipment 5 controls the production line conveying equipment 2 to decelerate, so that the bar code-bearing article passes through the information acquisition station at a low speed, the first bar code scanning equipment 3 acquires and decodes the bar code on the article, and then the decoding result is sent to the upper computer 1. The decoding result is decoding data or decoding failure information, and the upper computer 1 receives the decoding data to indicate that the bar code decoding is successful.
It should be noted that in practical industrial applications, the length of the pipeline and the number of stations are not determined, and therefore, the position of the information collecting station is not determined, and from the perspective of the relative position, the information collecting station cannot be at the start position of the pipeline, because the position is reserved for the barcode detecting station where the second barcode scanning device 4 is located, as shown in fig. 4. The second bar code scanning device 4 is arranged at the bar code detection station, articles on the production line need to pass through the bar code detection station and then pass through the information acquisition station, and lenses of the first bar code scanning device 3 and the second bar code scanning device 4 are aligned with the positions where the articles on the production line pass through. The setting distance between the first barcode scanning device 3 and the second barcode scanning device 4 is adjusted according to the pipeline conveying speed and the decoding speed of the first barcode scanning device 3, and meanwhile, the setting position is determined by considering the specific installation environment.
The characteristic of the strip and the blank is that the image of the article contains strips and blanks which are arranged at intervals, the color matching of the strip and the blank generally requires that the larger the color contrast between the strip and the blank is, the better the color matching is, and the matching mode of black strip and white blank is commonly used. Generally, the number of bars and spaces is set according to the number of bar spaces when the actually used code represents the least number of characters, for example, when the currently common bar code contains the least number of characters, the number of bar spaces is five bars and four spaces, so that the article image may be set to be determined to be a bar code image when the five bars and four spaces are contained, six bars and five spaces, seven bars and six spaces, and the like may be set to improve the detection accuracy. The positioning feature refers to an image feature used for judging as a bar code, and the positioning feature can be a bar space, a rectangular color block, a positioning point and the like which are arranged at intervals, for example, the existing commonly used two-dimensional code adopts a positioning point or a positioning block, the direction of the two-dimensional code is determined through the positioning feature, but for the PDF417 two-dimensional code, the positioning feature is a bar space image which is arranged at intervals, and is not the positioning point.
The first bar code scanning device 3 and the second bar code scanning device 4 can adopt fixed bar code scanners, the production line control device 5 can adopt PLC controllers, and the upper computer 1 can adopt industrial PCs.
Referring to fig. 5, specifically, the second barcode scanning device 4 performs the following steps:
step 1, decoding a bar code image after the second bar code scanning device 4 collects the bar code image, and judging whether the bar code exists in the image; if the bar code is not detected, executing the step 2, and if the bar code is detected, sending a notification message to the upper computer 1;
step 2, judging whether a detection stopping instruction is received, if not, repeatedly executing the step 1, and if so, ending detection; the stop detection instruction may be from the upper computer 1 or may be manually set.
Referring to fig. 6, the first barcode scanning device 3 performs the following steps:
step 10, the first bar code scanning device 3 collects images, judges whether a frame of image is successfully collected, if yes, decodes the frame of image, and if not, jumps to step 30;
step 20, judging whether the decoding is successful, if yes, transmitting the decoded data to the upper computer 1, and if not, transmitting a decoding failure message to the upper computer 1; then step 30 is performed;
step 30, judging whether an operation stopping instruction is received, if not, returning to the execution step 10, and if so, ending the operation; the stop instruction may be from the upper computer 1 or may be manually set.
According to the embodiment, the bar code objects are detected and informed to the upper computer 1 through the rapid detection of the second bar code scanning equipment 4, the upper computer 1 sends a deceleration instruction to the production line control equipment 5, the production line control equipment 5 controls the production line conveying equipment 2 to decelerate, so that the bar code objects pass through the information acquisition station at a low speed and stably, the first bar code scanning equipment 3 can acquire bar code images which are favorable for decoding in a sufficient time, the definition of the bar code images is improved, and rapid decoding is realized. Meanwhile, the transmission speed of the pipeline transmission device 2 does not depend on the performance of the bar code scanning device excessively, and the pipeline transmission efficiency is improved to a certain extent.
Example two
Referring to fig. 7, in order to find out the code scanning failure and the missing detection problem in time, the upper computer 1 further executes the following steps: when the upper computer 1 receives the notification message for the first time, the first time refers to the first time after the barcode information of a batch is collected each time, the first time is to take the recovered assembly line speed as a node, send a deceleration instruction to the production line control equipment 5 and start to accumulate the number of the received notification message, so as to obtain the number of barcodes detected by the second barcode scanning equipment 4; the upper computer 1 receives the decoding result from the first barcode scanning device 3 and judges whether the decoding is successful, if the decoding is the decoding data, the number of the barcodes which are successfully decoded is accumulated, and if the decoding is the decoding failure message, the number is not accumulated. When the upper computer 1 does not receive the notification message and the decoding data within the preset time threshold T, the upper computer 1 compares whether the number of the detected bar codes is consistent with the number of the received bar codes which are successfully decoded, if so, the upper computer 1 sends a control instruction for recovering the speed to the production line control equipment 5, and the production line control equipment 5 controls the pipeline conveying equipment 2 to recover the original speed; if not, the upper computer 1 controls the production line control equipment 5 to alarm.
The upper computer 1 controls the production line control equipment 5 to alarm, and specifically comprises the following steps: the system also comprises an alarm device 7, the production line control device 5 is also connected with the alarm device 7, the upper computer 1 sends an alarm and stop instruction to the production line control device 5, and the production line control device 5 controls the pipeline conveying device 2 to stop and controls the alarm device 7 to send an alarm prompt. The alert cues include audible and visual cues.
Referring to fig. 8, the implementation procedure of the present embodiment is as follows:
step 100, starting running after the system is powered on, and immediately sending a notification message to the upper computer 1 once the second bar code scanning device 4 detects the bar code;
step 200, when the upper computer 1 receives the notification message for the first time, sending a deceleration instruction to the production line control equipment 5, and starting to accumulate the number of received notification messages; for the subsequently received notification message, no deceleration instruction is sent any more, and the method is only used for accumulating the quantity;
step 300, the production line control device 5 controls the pipeline conveying device 2 to decelerate;
step 400, the first bar code scanning device 3 continuously collects images and decodes the images, and sends decoding results to the upper computer 1;
step 500, the upper computer 1 judges according to the decoding result, if the decoding result is decoding data, the number of bar codes successfully decoded is accumulated, and if the decoding result is decoding failure information, the number is not accumulated;
step 600, after the upper computer 1 runs for a period of time, when the notification message and the decoding data are not received within a preset time threshold T, comparing whether the number of the detected bar codes is consistent with the number of the received bar codes which are successfully decoded, if so, the upper computer 1 sends a control instruction for recovering the speed to the production line control equipment 5; if not, the upper computer 1 controls the production line control equipment 5 to alarm;
step 700, the production line control device 5 controls the pipeline conveying device 2 to resume the original speed transmission.
The upper computer 1 can upload the decoded data to the server 6 for backup after the code scanning of a batch of articles is finished.
According to the embodiment, on the basis of the first embodiment, the number counting step and the alarming step of the bar codes are added, so that once an error occurs, the error can be found at the first time, and the accuracy and the reliability of the code scanning of the assembly line are improved.
Example III
Referring to fig. 3 and 4, a method for improving code scanning stability of a pipeline includes: the system comprises an upper computer 1, a pipeline conveying device 2, a first bar code scanning device 3 for collecting bar code data, a second bar code scanning device 4 for detecting whether bar codes exist on a pipeline, and a production line control device 5 for controlling the speed of the pipeline; the first bar code scanning device 3, the second bar code scanning device 4 and the production line control device 5 are all in communication connection with the upper computer 1, the production line control device 5 is also in communication connection with the assembly line conveying device 2, the first bar code scanning device 3 is arranged at an information acquisition station on an assembly line, the second bar code scanning device 4 is arranged in front of the information acquisition station, and the method comprises the following steps: the articles are transmitted on the assembly line and pass through the second bar code scanning equipment 4, the second bar code scanning equipment 4 collects images of the articles, judges whether the images contain bar space features or positioning features, if yes, judges that the articles have bar codes, and sends a notification message containing the detected bar codes to the upper computer 1; the upper computer 1 receives and then sends a deceleration instruction to the production line control equipment 5, the production line control equipment 5 controls the assembly line conveying equipment 2 to decelerate, so that the bar code-bearing article passes through the information acquisition station at a low speed, the first bar code scanning equipment 3 acquires and decodes the bar code on the article, and then the decoding result is sent to the upper computer 1. The decoding result is decoding data or decoding failure information, and the upper computer 1 receives the decoding data to indicate that the bar code decoding is successful.
It should be noted that in practical industrial applications, the length of the pipeline and the number of stations are not determined, and therefore, the position of the information collecting station is not determined, and from the perspective of the relative position, the information collecting station cannot be at the start position of the pipeline, because the position is reserved for the barcode detecting station where the second barcode scanning device 4 is located, as shown in fig. 4. The second bar code scanning device 4 is arranged at the bar code detection station, articles on the production line need to pass through the bar code detection station and then pass through the information acquisition station, and lenses of the first bar code scanning device 3 and the second bar code scanning device 4 are aligned with the positions where the articles on the production line pass through. The setting distance between the first barcode scanning device 3 and the second barcode scanning device 4 is adjusted according to the pipeline conveying speed and the decoding speed of the first barcode scanning device 3, and meanwhile, the setting position is determined by considering the specific installation environment.
The characteristic of the strip and the blank is that the image of the article contains strips and blanks which are arranged at intervals, the color matching of the strip and the blank generally requires that the larger the color contrast between the strip and the blank is, the better the color matching is, and the matching mode of black strip and white blank is commonly used. Generally, the number of bars and spaces is set according to the number of bar spaces when the actually used code represents the least number of characters, for example, when the currently common bar code contains the least number of characters, the number of bar spaces is five bars and four spaces, so that the article image may be set to be determined to be a bar code image when the five bars and four spaces are contained, six bars and five spaces, seven bars and six spaces, and the like may be set to improve the detection accuracy. The positioning feature refers to an image feature used for judging as a bar code, and the positioning feature can be a bar space, a rectangular color block, a positioning point and the like which are arranged at intervals, for example, the existing commonly used two-dimensional code adopts a positioning point or a positioning block, the direction of the two-dimensional code is determined through the positioning feature, but for the PDF417 two-dimensional code, the positioning feature is a bar space image which is arranged at intervals, and is not the positioning point.
The first bar code scanning device 3 and the second bar code scanning device 4 can adopt fixed bar code scanners, the production line control device 5 can adopt PLC controllers, and the upper computer 1 can adopt industrial PCs.
Referring to fig. 5, specifically, the second barcode scanning device 4 performs the following steps:
step 1, decoding a bar code image after the second bar code scanning device 4 collects the bar code image, and judging whether the bar code exists in the image; if the bar code is not detected, executing the step 2, and if the bar code is detected, sending a notification message to the upper computer 1;
step 2, judging whether a detection stopping instruction is received, if not, repeatedly executing the step 1, and if so, ending detection; the stop detection instruction may be from the upper computer 1 or may be manually set.
Referring to fig. 6, the first barcode scanning device 3 performs the following steps:
step 10, the first bar code scanning device 3 collects images, judges whether a frame of image is successfully collected, if yes, decodes the frame of image, and if not, jumps to step 30;
step 20, judging whether the decoding is successful, if yes, transmitting the decoded data to the upper computer 1, and if not, transmitting a decoding failure message to the upper computer 1; then step 30 is performed;
step 30, judging whether an operation stopping instruction is received, if not, returning to the execution step 10, and if so, ending the operation; the stop instruction may be from the upper computer 1 or may be manually set.
According to the embodiment, the bar code objects are detected and informed to the upper computer 1 through the rapid detection of the second bar code scanning equipment 4, the upper computer 1 sends a deceleration instruction to the production line control equipment 5, the production line control equipment 5 controls the production line conveying equipment 2 to decelerate, so that the bar code objects pass through the information acquisition station at a low speed and stably, the first bar code scanning equipment 3 can acquire bar code images which are favorable for decoding in a sufficient time, the definition of the bar code images is improved, and rapid decoding is realized. Meanwhile, the transmission speed of the pipeline transmission device 2 does not depend on the performance of the bar code scanning device excessively, and the pipeline transmission efficiency is improved to a certain extent.
Example IV
Referring to fig. 7, in order to find out the code scanning failure and the missing detection problem in time, the upper computer 1 further executes the following steps: when the upper computer 1 receives the notification message for the first time, the first time refers to the first time after the barcode information of a batch is collected each time, the first time is to take the recovered assembly line speed as a node, send a deceleration instruction to the production line control equipment 5 and start to accumulate the number of the received notification message, so as to obtain the number of barcodes detected by the second barcode scanning equipment 4; the upper computer 1 receives the decoding result from the first barcode scanning device 3 and judges whether the decoding is successful, if the decoding is the decoding data, the number of the barcodes which are successfully decoded is accumulated, and if the decoding is the decoding failure message, the number is not accumulated. When the upper computer 1 does not receive the notification message and the decoding data within the preset time threshold T, the upper computer 1 compares whether the number of the detected bar codes is consistent with the number of the received bar codes which are successfully decoded, if so, the upper computer 1 sends a control instruction for recovering the speed to the production line control equipment 5, and the production line control equipment 5 controls the pipeline conveying equipment 2 to recover the original speed; if not, the upper computer 1 controls the production line control equipment 5 to alarm.
The upper computer 1 controls the production line control equipment 5 to alarm, and specifically comprises the following steps: the system also comprises an alarm device 7, the production line control device 5 is also connected with the alarm device 7, the upper computer 1 sends an alarm and stop instruction to the production line control device 5, and the production line control device 5 controls the pipeline conveying device 2 to stop and controls the alarm device 7 to send an alarm prompt. The alert cues include audible and visual cues.
Referring to fig. 8, the implementation procedure of the present embodiment is as follows:
step 100, starting running after the system is powered on, and immediately sending a notification message to the upper computer 1 once the second bar code scanning device 4 detects the bar code;
step 200, when the upper computer 1 receives the notification message for the first time, sending a deceleration instruction to the production line control equipment 5, and starting to accumulate the number of received notification messages; for the subsequently received notification message, no deceleration instruction is sent any more, and the method is only used for accumulating the quantity;
step 300, the production line control device 5 controls the pipeline conveying device 2 to decelerate;
step 400, the first bar code scanning device 3 continuously collects images and decodes the images, and sends decoding results to the upper computer 1;
step 500, the upper computer 1 judges according to the decoding result, if the decoding result is decoding data, the number of bar codes successfully decoded is accumulated, and if the decoding result is decoding failure information, the number is not accumulated;
step 600, after the upper computer 1 runs for a period of time, when the notification message and the decoding data are not received within a preset time threshold T, comparing whether the number of the detected bar codes is consistent with the number of the received bar codes which are successfully decoded, if so, the upper computer 1 sends a control instruction for recovering the speed to the production line control equipment 5; if not, the upper computer 1 controls the production line control equipment 5 to alarm;
step 700, the production line control device 5 controls the pipeline conveying device 2 to resume the original speed transmission.
The upper computer 1 can upload the decoded data to the server 6 for backup after the code scanning of a batch of articles is finished.
According to the method, on the basis of the third embodiment, the number counting step and the alarming step of the bar codes are added, so that once an error occurs, the error can be found at the first time, and the accuracy and the reliability of the code scanning of the assembly line are improved.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes or direct or indirect application in other related technical fields are included in the scope of the present invention.