Production line-based product counting method and system
By collecting and analyzing the on/off signals of ceramic production line products through a multi-sensor system, the problems of inaccurate counting and insufficient anti-interference ability have been solved, achieving higher accuracy and stable production statistics and reducing maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- KEDA INDUSTRIAL GROUP CO LTD
- Filing Date
- 2025-09-22
- Publication Date
- 2026-07-21
AI Technical Summary
Existing ceramic production line counting systems suffer from inaccurate counting, poor anti-interference capabilities, and a lack of redundancy verification mechanisms, leading to deviations in production statistics and increased costs for manual verification.
Multiple sensors are used to collect product on/off signals, a sensor status array is established, the sensor sequence and signal integrity are determined, abnormal sensors are detected and switched to redundant counting mode.
It improves counting accuracy and anti-interference ability, enhances stability, and reduces maintenance and management costs.
Smart Images

Figure CN121502571B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of conveyor belt product inspection technology, and in particular to a product counting method and system based on a production line. Background Technology
[0002] Against the backdrop of intelligent upgrading in the ceramics industry, accurate production line output counting is the core foundation for production scheduling, quality traceability, and cost accounting. With the diversification of ceramic product categories (such as tiles with different glazes and sizes) and the increase in production line speed, higher demands are placed on the real-time performance, anti-interference capabilities, and fault tolerance of the counting system. Currently, problems such as output statistical deviations and increased manual recounting costs caused by inaccurate counting in ceramic production have become key bottlenecks restricting the improvement of production efficiency, urgently requiring technological innovation to achieve high reliability and automation in the counting process.
[0003] In existing technologies, ceramic production lines mainly employ a single photoelectric sensor (photoelectric sensor) counting method. This method uses a single photoelectric sensor to detect the light obstruction signal from the product, and a counter counts the number of pulses to achieve counting. However, this method has significant limitations: differences in light absorption and reflection between different colored glazes can easily lead to signal misinterpretation; dust covering the sensor lens can cause optical path attenuation and lead to missed counts; and there is a lack of redundancy verification mechanisms, meaning the sensor cannot self-diagnose when it malfunctions, resulting in a large accumulation of errors over long-term operation. These problems not only affect the accuracy of production data but also increase hidden costs such as manual verification and dispute resolution. Therefore, it is particularly important to propose a technical solution that can improve counting accuracy, anti-interference capability, and counting stability. Summary of the Invention
[0004] This invention provides a product counting method and system based on a production line, which can help improve counting accuracy, anti-interference ability, and counting stability.
[0005] To address the aforementioned technical problems, the first aspect of this invention discloses a product counting method based on a production line. The method is applied to a product counting system based on a production line, the system including multiple sensors for product counting, and the method comprising: The sensor acquires the on / off signal when the target product passes by, and establishes a sensor state array to record the on / off signal of the sensor. Determine the sensor number corresponding to each sensor, and determine whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor state array; When each of the sensors sequentially acquires a complete on / off signal according to its sensor number, the target product is determined to be a single workpiece and counted. When at least one of the sensors fails to acquire a complete on / off signal sequentially according to its sensor number, an abnormal sensor is detected, and the system switches to a redundant counting mode to count the target product based on the abnormal sensor.
[0006] As an optional implementation, in the first aspect of the present invention, determining whether each of the sensors has sequentially acquired a complete on / off signal according to the sensor sequence number based on the sensor state array includes: Based on the sensor state array, determine whether the triggering order of the on / off signals of each sensor satisfies the sensor sequence number; When the triggering sequence of the on / off signals of each sensor satisfies the sensor number, and each sensor acquires a complete on / off signal, the signal triggering time interval between two adjacent sensors is determined according to the sensor number. Determine whether each signal trigger time interval meets the preset duration threshold range. When each signal trigger time interval meets the duration threshold range, determine that each sensor has sequentially collected a complete on / off signal according to the sensor number.
[0007] As an optional implementation, in the first aspect of the present invention, the on / off signal of each sensor includes a first rising edge signal, a falling edge signal and a second rising edge signal, and the sensor state array also records the timestamp corresponding to the on / off signal of each sensor, and the preset duration threshold range includes a minimum duration and a maximum duration. After the triggering sequence of the on / off signals of each of the sensors satisfies the sensor sequence number, the method further includes: Based on the sensor state array, determine the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal for each sensor; For each sensor, the duration range corresponding to the sensor is calculated based on the second timestamp corresponding to the previous sensor, the minimum duration, and the maximum duration. For each sensor, it is determined whether the sensor has collected a complete on / off signal within the time range corresponding to the sensor, based on the sensor state array. When each of the sensors acquires a complete on / off signal within the corresponding time range, the operation of determining the signal triggering time interval between two adjacent sensors based on the sensor number is triggered.
[0008] As an optional implementation, in the first aspect of the present invention, the method further includes: Determine the production line data of the production line, the production line data including the production line conveyor speed and the maximum conveyor length; For each of the signal triggering time intervals, determine whether the signal triggering time interval is less than the minimum duration; For each of the signal triggering time intervals, when the signal triggering time interval is less than the minimum duration, the product overlap coefficient of the target product is calculated based on the production line conveying speed, the maximum conveying length, and the signal triggering time interval. Determine whether the product overlap coefficient of the target product is greater than a preset overlap coefficient threshold. When the product overlap coefficient is greater than the overlap coefficient threshold, determine that the target products overlap, and determine the actual quantity of the target products based on the product overlap coefficient.
[0009] As an optional implementation, in the first aspect of the invention, the step of detecting an abnormal sensor when at least one of the sensors fails to sequentially acquire a complete on / off signal according to the sensor serial number includes: When at least one of the sensors fails to collect a complete on / off signal in sequence according to the sensor number, for each sensor, it is determined whether the sensor detects the falling edge signal within a preset abnormal time after detecting the first rising edge signal. When the sensor detects the falling edge signal within the abnormal time after detecting the first rising edge signal, the sensor is determined to be a first type of abnormal sensor, and the on / off signal detected by the first type of abnormal sensor is an interference signal. For each of the sensors, if the sensor fails to acquire a complete on / off signal within the time range corresponding to the sensor, the sensor is determined to be a second type of abnormal sensor, and the abnormal signal of the sensor is recorded through the sensor state array.
[0010] As an optional implementation, in the first aspect of the present invention, the method further includes: For each sensor, it is determined whether the sensor has continuously generated an abnormal signal a preset number of times based on the sensor state array; For each of the sensors, when the sensor continuously generates an abnormal signal a preset number of times, the sensor is determined to be faulty, and a fault prompt message is generated based on each of the abnormal signals of the sensor.
[0011] As an optional implementation, in the first aspect of the invention, the step of switching to a redundant counting mode based on the anomaly sensor to count the target product includes: When the abnormal sensor is detected to be an abnormal sensor of the second type, a new sensor number is determined for each of the sensors other than the abnormal sensor. Determine the sensor spacing between each of the sensors except for the abnormal sensor, and calculate a new duration threshold range based on the sensor spacing and the production line conveyor speed; The target products are counted based on the new sensor serial number and the new duration threshold range.
[0012] A second aspect of the present invention discloses a product counting system based on a production line, the system comprising multiple sensors for counting products, and the system further comprising: The acquisition module is used to acquire the on / off signal when the target product passes through the sensor, and to establish a sensor state array to record the on / off signal of the sensor; The determination module is used to determine the sensor number corresponding to each sensor, and to determine whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor state array; The counting module is used to determine that the target product is a single workpiece and count it when each of the sensors collects a complete on / off signal in sequence according to the sensor number; when at least one of the sensors fails to collect a complete on / off signal in sequence according to the sensor number, an abnormal sensor is detected, and the module switches to a redundant counting mode to count the target product based on the abnormal sensor.
[0013] As an optional implementation, in a second aspect of the present invention, the method by which the determining module determines whether each sensor has sequentially acquired a complete on / off signal according to the sensor number based on the sensor state array specifically includes: Based on the sensor state array, determine whether the triggering order of the on / off signals of each sensor satisfies the sensor sequence number; When the triggering sequence of the on / off signals of each sensor satisfies the sensor number, and each sensor acquires a complete on / off signal, the signal triggering time interval between two adjacent sensors is determined according to the sensor number. Determine whether each signal trigger time interval meets the preset duration threshold range. When each signal trigger time interval meets the duration threshold range, determine that each sensor has sequentially collected a complete on / off signal according to the sensor number.
[0014] As an optional implementation, in the second aspect of the present invention, the on / off signal of each sensor includes a first rising edge signal, a falling edge signal, and a second rising edge signal, and the sensor state array also records the timestamp corresponding to the on / off signal of each sensor, and the preset duration threshold range includes a minimum duration and a maximum duration. The determining module is further configured to, after the triggering order of the on / off signals of each sensor satisfies the sensor sequence number, determine, according to the sensor state array, the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal of each sensor. The system also includes: The calculation module is used to calculate the duration range corresponding to each sensor based on the second timestamp corresponding to the previous sensor, the minimum duration, and the maximum duration for each sensor. The judgment module is used to determine, for each sensor, whether the sensor has collected a complete on / off signal within the corresponding time range according to the sensor state array; when each sensor has collected a complete on / off signal within the corresponding time range, the determination module is triggered to perform the operation of determining the signal trigger time interval between two adjacent sensors according to the sensor number.
[0015] As an optional implementation, in a second aspect of the present invention, the determining module is further configured to determine the production line data of the production line, the production line data including the production line conveying speed and the maximum conveying length. The judgment module is also used to determine whether each signal triggering time interval is less than the minimum duration for each signal triggering time interval; The calculation module is also used to calculate the product overlap coefficient of the target product based on the production line conveying speed, the maximum conveying length, and the signal triggering time interval for each signal triggering time interval when the signal triggering time interval is less than the minimum duration. The judgment module is further configured to determine whether the product overlap coefficient of the target product is greater than a preset overlap coefficient threshold. When the product overlap coefficient is greater than the overlap coefficient threshold, the target products are determined to overlap, and the actual quantity of the target products is determined based on the product overlap coefficient.
[0016] As an optional implementation, in a second aspect of the present invention, the counting module detects abnormal sensors when at least one of the sensors fails to collect complete on / off signals sequentially according to the sensor serial numbers, specifically including: When at least one of the sensors fails to collect a complete on / off signal in sequence according to the sensor number, for each sensor, it is determined whether the sensor detects the falling edge signal within a preset abnormal time after detecting the first rising edge signal. When the sensor detects the falling edge signal within the abnormal time after detecting the first rising edge signal, the sensor is determined to be a first type of abnormal sensor, and the on / off signal detected by the first type of abnormal sensor is an interference signal. For each of the sensors, if the sensor fails to acquire a complete on / off signal within the time range corresponding to the sensor, the sensor is determined to be a second type of abnormal sensor, and the abnormal signal of the sensor is recorded through the sensor state array.
[0017] As an optional implementation, in a second aspect of the present invention, the judgment module is further configured to, for each sensor, determine whether the sensor has continuously generated an abnormal signal a preset number of times based on the sensor state array; The determining module is further configured to, for each of the sensors, determine that the sensor is faulty when the sensor continuously produces an abnormal signal a preset number of times, and generate a fault prompt message based on each of the abnormal signals of the sensor.
[0018] As an optional implementation, in a second aspect of the present invention, the method by which the counting module switches to a redundant counting mode based on the anomaly sensor to count the target product specifically includes: When the abnormal sensor is detected to be an abnormal sensor of the second type, a new sensor number is determined for each of the sensors other than the abnormal sensor. Determine the sensor spacing between each of the sensors except for the abnormal sensor, and calculate a new duration threshold range based on the sensor spacing and the production line conveyor speed; The target products are counted based on the new sensor serial number and the new duration threshold range.
[0019] A third aspect of the present invention discloses a product counting device based on a production line, the device comprising: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute some or all of the steps in the product counting method based on the production line according to any of the first aspects of the present invention.
[0020] The fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps in the product counting method based on a production line as described in any of the first aspects of the present invention.
[0021] Compared with the prior art, the present invention has the following beneficial effects: In this embodiment of the invention, sensors collect on / off signals when a target product passes through, and a sensor state array is established to record the on / off signals of the sensors. The sensor number corresponding to each sensor is determined, and the sensor state array is used to determine whether each sensor has collected a complete on / off signal sequentially according to its sensor number. When each sensor has collected a complete on / off signal sequentially according to its sensor number, the target product is determined to be a single workpiece and counted. When at least one sensor has not collected a complete on / off signal sequentially according to its sensor number, an abnormal sensor is detected, and the system switches to a redundant counting mode to count the target product based on the abnormal sensor. Therefore, implementing this invention can improve the accuracy of production line output statistics, enhance the anti-interference capability of production line statistics, improve counting stability, and reduce production line maintenance and management costs. Attached Figure Description
[0022] 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.
[0023] Figure 1 This is a flowchart illustrating a product counting method based on a production line disclosed in an embodiment of the present invention; Figure 2 This is a flowchart illustrating another product counting method based on a production line disclosed in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a product counting system based on a production line disclosed in an embodiment of the present invention; Figure 4 This is a schematic diagram of another product counting system based on a production line disclosed in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a product counting device based on a production line disclosed in an embodiment of the present invention. Detailed Implementation
[0024] 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 are within the scope of protection of the present invention.
[0025] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0026] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0027] This invention discloses a product counting method and system based on a production line, which can improve the accuracy of production line output statistics, enhance the anti-interference capability of production line statistics, improve counting stability, and reduce production line maintenance and management costs. These will be described in detail below.
[0028] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a product counting method based on a production line, as disclosed in an embodiment of the present invention. Figure 1 The described product counting method based on a production line can be applied to a product counting system based on a production line. This system may include multiple sensors for counting products, and these sensors detect and count products transported on the production line. This invention is not limited in its specific implementation. Figure 1 As shown, this product counting method based on the production line may include the following operations: 101. Collect the on / off signals of the target product as it passes through the sensor, and establish a sensor state array to record the on / off signals of the sensor.
[0029] In this embodiment of the invention, optionally, the production line may include one or more of the following: a conveyor belt production line, a roller conveyor production line, a chain production line, etc. Sensors are set on the production line to detect and count the target products conveyed on the production line. For example, based on the detection distance and performance of the sensors, they are set at a corresponding distance above the production line. The multiple sensors set on the conveyor belt may include multiple sensors set along the width direction of the conveyor belt, or multiple sensors set at equal intervals along the conveying direction of the conveyor belt, or multiple sensors set at an angle. This invention does not limit the scope of the invention.
[0030] In this embodiment of the invention, optionally, the product counting system based on a production line includes three sensors as an example. The product counting system based on a production line may also include a counter, which is used to collect the on / off signals of the sensors. The target product may include ceramic products, such as ceramic tiles. Specifically, the sensors may include photoelectric sensors, laser sensors, etc., such as diffuse reflection photoelectric sensors. The sensor model may include an Omron E3FA-DN122M diffuse reflection sensor with a detection distance of 300mm, a response time of 0.5ms, and an IP67 protection rating. The sensor spacing between each sensor can be set according to the maximum width of the target product. For example, when three sensors are included and the maximum width of the target product is 900mm, the sensor spacing can be set to 1 / 3 of the maximum width, i.e., 300mm. The counter model may include a Siemens S7-200 Smart PLC, used to collect the on / off signals of the sensors at a frequency of 200Hz. This invention is not limited to this.
[0031] In this embodiment of the invention, optionally, a sensor state array can be established by collecting the on / off signal of the target product passing through each sensor, which is used to record the on / off signal of each sensor and also to record the timestamp of the on / off signal. This invention does not limit this.
[0032] In this embodiment of the invention, optionally, after collecting the on / off signal of the target product passing through each sensor, the sensor signal can be processed using a median filtering algorithm to eliminate the burrs caused by the instantaneous obstruction of dust. Specifically, the on / off signal is processed with a filtering window size of N times, such as N=7. This invention does not limit the scope of the invention.
[0033] 102. Determine the sensor number corresponding to each sensor, and determine whether each sensor has collected complete on / off signals in sequence according to the sensor number based on the sensor status array.
[0034] In this embodiment of the invention, optionally, the sensor number corresponding to each sensor represents the order in which the sensor collects the on / off signal. Specifically, the first sensor to detect the on / off signal (rising edge signal) is defined as the first sensor, and its sensor number is one. The IO interface position of the first sensor is recorded through the sensor state array. During the on / off signal holding period of the first sensor, if other sensors detect the rising edge signal, then the sensor is determined to be the second sensor, and its sensor signal is two. The IO interface position of the second sensor is recorded through the sensor state array. And so on, to obtain the sensor number and IO interface position of each sensor. This invention does not limit this.
[0035] In this embodiment of the invention, optionally, it is determined whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor state array. That is, based on the on / off signal of each sensor recorded in the sensor state array, it is determined whether the signal triggering order of each sensor is triggered according to the sensor number, and whether each sensor has collected a complete on / off signal. The complete on / off signal includes a first rising edge signal, a falling edge signal, and a second rising edge signal. This invention does not limit the scope of the invention.
[0036] 103. When each sensor collects a complete on / off signal in sequence according to its sensor number, the target product is determined to be a single workpiece and counted.
[0037] In this embodiment of the invention, optionally, the process of each sensor sequentially acquiring a complete on / off signal according to the sensor number may include whether the signal triggering order of each sensor is triggered according to the sensor number, and whether each sensor acquires a complete first rising edge signal, falling edge signal, and second rising edge signal. When each sensor sequentially acquires a complete on / off signal according to the sensor number, the target product is determined to be a single workpiece and counted. This invention does not impose any limitations.
[0038] 104. When at least one sensor fails to collect a complete on / off signal in sequence according to the sensor number, detect the abnormal sensor and switch to the redundant counting mode to count the target product based on the abnormal sensor.
[0039] In this embodiment of the invention, optionally, when at least one sensor fails to collect a complete on / off signal in sequence according to the sensor number, situations such as reflection, dust, etc., may occur, causing abnormal sensor signal acquisition or sensor failure. In this case, abnormal sensors can be detected, and the counting of target products can be switched to a redundant counting mode based on the abnormal sensors. The redundant counting mode means that one or more faulty sensors will stop working, and the remaining normally operating sensors will be used to count the target products, so as to improve the fault tolerance of the production line counting and the overall operational stability. This invention does not limit this.
[0040] It is evident that implementation Figure 1 The described product counting method based on the production line can collect the on / off signal of the target product passing through each sensor, establish a sensor state array to record the on / off signal of each sensor, determine the corresponding sensor number of each sensor, and determine whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor state array. When each sensor has collected a complete on / off signal in sequence according to the sensor number, the target product is determined to be a single workpiece and counted, which can improve the accuracy of production line output statistics and counting. When at least one sensor has not collected a complete on / off signal in sequence according to the sensor number, an abnormal sensor is detected, and the redundant counting mode is switched to count the target product based on the abnormal sensor. This can improve the anti-interference capability of production line statistics and counting, improve counting stability, and reduce production line maintenance and management costs.
[0041] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating a product counting method based on a production line, as disclosed in an embodiment of the present invention. Figure 2 The described product counting method based on a production line can be applied to a product counting system based on a production line. This system may include multiple sensors for counting products, and these sensors detect and count products transported on the production line. This invention is not limited in its specific implementation. Figure 2 As shown, this product counting method based on the production line may include the following operations: 201. Collect the on / off signals of the target product as it passes through the sensor, and establish a sensor state array to record the on / off signals of the sensor.
[0042] 202. Determine the sensor number corresponding to each sensor, and determine whether the triggering order of the on / off signals of each sensor satisfies the sensor number based on the sensor state array.
[0043] In this embodiment of the invention, optionally, the triggering order of the on / off signals of each sensor can be determined according to the timestamp of the on / off signal of each sensor recorded in the sensor state array. The triggering order of the on / off signals of each sensor can be determined according to the IO interface position of each sensor recorded in the sensor state array. When the triggering order matches the sensor number, it means that the triggering order of the on / off signals of each sensor meets the sensor number. This invention does not impose any limitations.
[0044] 203. When the triggering sequence of the on / off signals of each sensor satisfies the sensor sequence number, and each sensor acquires a complete on / off signal, the signal triggering time interval between two adjacent sensors is determined according to the sensor sequence number.
[0045] In this embodiment of the invention, optionally, the complete on / off signal collected by each sensor may include a first rising edge signal, a falling edge signal, and a second rising edge signal. The signal triggering time interval between two adjacent sensors may represent the time interval between the timestamps corresponding to the falling edges of the two adjacent sensors, which is not limited in this invention.
[0046] 204. Determine whether the trigger time interval of each signal meets the preset duration threshold range. When the trigger time interval of each signal meets the duration threshold range, determine that each sensor has collected the complete on / off signal in sequence according to the sensor number.
[0047] In this embodiment of the invention, optionally, the preset duration threshold range may include a minimum duration and a maximum duration. The preset duration threshold range may be a time threshold set according to the production line speed, for example, setting the minimum duration to 1000ms and the maximum duration to 1500ms, corresponding to a production line speed of 0.5-0.8m / s. When the time interval between each signal triggering meets the duration threshold range, it can be determined that each sensor has collected the complete on / off signal in sequence according to the sensor number, that is, the count can be incremented by one. This invention does not impose any limitations.
[0048] 205. When each sensor collects a complete on / off signal in sequence according to its sensor number, the target product is determined to be a single workpiece and counted.
[0049] 206. When at least one sensor fails to collect a complete on / off signal in sequence according to the sensor number, detect the abnormal sensor and switch to the redundant counting mode to count the target product based on the abnormal sensor.
[0050] In this embodiment of the invention, for other descriptions of steps 201, 205 and 206, please refer to the detailed description of steps 101, 103 and 104 in Embodiment 1 of the invention. These descriptions will not be repeated in this embodiment of the invention.
[0051] It is evident that implementation Figure 2The described product counting method based on a production line can collect the on / off signals of a target product passing through each sensor, establish a sensor state array to record the on / off signals of each sensor, determine the sensor number corresponding to each sensor, and determine whether the triggering sequence of the on / off signals of each sensor meets the sensor number based on the sensor state array. When the triggering sequence of the on / off signals of each sensor meets the sensor number and each sensor collects a complete on / off signal, the signal triggering time interval between two adjacent sensors is determined based on the sensor number, and it is determined whether each signal triggering time interval meets a preset duration threshold range. Within the threshold range, ensuring that each sensor sequentially collects a complete on / off signal according to its sensor number provides dual assurance for the accuracy of product counting through the sensor signal triggering sequence and the completeness of the on / off signal, thereby improving the accuracy and reliability of product counting. When each sensor sequentially collects a complete on / off signal according to its sensor number, the target product is identified as a single workpiece and counted, which improves the production line's output statistical counting accuracy. When at least one sensor fails to collect a complete on / off signal according to its sensor number, an abnormal sensor is detected, and the system switches to redundant counting mode to count the target product based on the abnormal sensor. This improves the anti-interference capability of the production line's statistical counting, enhances counting stability, and reduces production line maintenance and management costs.
[0052] In an optional embodiment, the on / off signal of each sensor includes a first rising edge signal, a falling edge signal, and a second rising edge signal. The sensor state array also records the timestamp corresponding to the on / off signal of each sensor. The preset duration threshold range includes a minimum duration and a maximum duration. Once the triggering sequence of the on / off signals of each sensor meets the sensor sequence number, this product counting method based on the production line may also include the following operations: Based on the sensor state array, determine the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal for each sensor. For each sensor, calculate the duration range corresponding to that sensor based on the second timestamp of the previous sensor, as well as the minimum and maximum durations. For each sensor, determine whether the sensor has collected a complete on / off signal within the corresponding time range based on the sensor state array; When each sensor collects a complete on / off signal within its corresponding time range, it triggers the operation of determining the signal trigger time interval between two adjacent sensors based on the sensor number.
[0053] In this optional embodiment, the on / off signal of each sensor may include a first rising edge signal, a falling edge signal, and a second rising edge signal. The sensor state array may also record the timestamp corresponding to the on / off signal of each sensor. The preset duration threshold range includes a minimum duration and a maximum duration, which is not limited in this embodiment.
[0054] In this optional embodiment, the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal of each sensor can be determined according to the sensor state array. Then, the duration range corresponding to the sensor can be calculated based on the second timestamp corresponding to the previous sensor, the minimum duration, and the maximum duration. Taking the second sensor as an example, the sum of the second timestamp of the first sensor and the minimum duration is used as the left boundary of the duration range of the second sensor, and the sum of the second timestamp of the first sensor and the maximum duration is used as the right boundary of the duration range of the second sensor. The duration range corresponding to the second sensor is obtained. This embodiment does not limit this.
[0055] In this optional embodiment, for each sensor, it can be determined whether the sensor has collected a complete on / off signal within the corresponding time range based on the sensor state array, that is, whether the time range corresponding to the first time stamp to the third time stamp of the sensor is within the corresponding time range of the sensor. When each sensor collects a complete on / off signal within the corresponding time range, it is determined that each sensor has collected a complete on / off signal. At this time, the operation of determining the signal triggering time interval between two adjacent sensors based on the sensor sequence number is triggered. This embodiment does not limit this.
[0056] As can be seen, implementing this optional embodiment can determine the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal for each sensor based on the sensor state array. For each sensor, the duration range corresponding to the sensor is calculated based on the second timestamp of the previous sensor, the minimum duration, and the maximum duration. For each sensor, it is determined whether the sensor has collected a complete on / off signal within the duration range corresponding to the sensor based on the sensor state array. When each sensor collects a complete on / off signal within the corresponding duration range, the operation of determining the signal triggering time interval between two adjacent sensors based on the sensor number is triggered. The duration range of the current sensor can be calculated based on the second timestamp of the previous sensor, and it can be determined whether a complete signal has been collected within the duration range based on the current timestamp. By judging the continuity and completeness of multi-sensor signal acquisition, the accuracy and reliability of product counting are improved.
[0057] In another alternative embodiment, the product counting method based on the production line may further include the following operations: Determine the production line data, including the production line conveyor speed and maximum conveyor length; For each signal trigger time interval, determine whether the signal trigger time interval is less than the minimum duration; For each signal triggering time interval, when the signal triggering time interval is less than the minimum duration, the product overlap coefficient of the target product is calculated based on the production line conveying speed, the maximum conveying length, and the signal triggering time interval. Determine whether the product overlap coefficient of the target product is greater than the preset overlap coefficient threshold. If the product overlap coefficient is greater than the overlap coefficient threshold, the target product overlap is determined, and the actual quantity of the target product is determined based on the product overlap coefficient.
[0058] In this optional embodiment, production line data of the production line can be determined. The product data includes the production line conveying speed and the maximum conveying length. The maximum conveying length can be adjusted according to different products. For example, if the maximum conveying length is 800mm, then the length of the target product is less than or equal to 800mm. This embodiment does not limit this.
[0059] In this optional embodiment, for each signal triggering time interval, it is determined whether the signal triggering time interval is less than the minimum duration. When the signal triggering time interval is less than the minimum duration, the product overlap coefficient of the target product can be calculated based on the production line conveying speed, the maximum conveying length, and the signal triggering time interval. Specifically, the formula for calculating the overlap coefficient K may include:
[0060] Where L represents the maximum conveying length, and v represents the production line conveying speed. This indicates the signal trigger time interval, which is not limited in this embodiment.
[0061] In this optional embodiment, it can be determined whether the product overlap coefficient of the target product is greater than a preset overlap coefficient threshold. When the product overlap coefficient is greater than the overlap coefficient threshold, the target product overlap is determined, and the actual quantity of the target product is determined according to the product overlap coefficient. For example, the preset overlap coefficient threshold can be 1.5. When K=2, the target product overlap is determined, and it can be determined that the two products overlap, that is, the actual quantity of the target product is 2. At this time, the count is incremented by 2. This embodiment does not limit this.
[0062] As can be seen, implementing this optional embodiment can determine the production line data, including the production line conveying speed and maximum conveying length. For each signal triggering time interval, it is determined whether the signal triggering time interval is less than the minimum duration. For each signal triggering time interval, when the signal triggering time interval is less than the minimum duration, the product overlap coefficient of the target product is calculated based on the production line conveying speed, maximum conveying length, and the signal triggering time interval. It is then determined whether the product overlap coefficient of the target product is greater than a preset overlap coefficient threshold. When the product overlap coefficient is greater than the overlap coefficient threshold, the target product overlap is determined, and the actual quantity of the target product is determined based on the product overlap coefficient. This allows for the determination of product overlap based on the signal triggering time interval between two sensors, and the calculation of the number of overlapping products, improving the accuracy of product counting and reducing the impact of overlapping products on the counting results.
[0063] In another optional embodiment, when at least one sensor fails to acquire a complete on / off signal in sequence according to the sensor number, detecting the abnormal sensor may include the following operations: When at least one sensor fails to collect a complete on / off signal in sequence according to the sensor number, for each sensor, it is determined whether the sensor detects a falling edge signal within a preset abnormal time after detecting the first rising edge signal. If the sensor detects a falling edge signal within the abnormal time after detecting the first rising edge signal, the sensor is determined to be a first type of abnormal sensor, and the on / off signal detected by the first type of abnormal sensor is an interference signal. For each sensor, if the sensor fails to collect a complete on / off signal within its corresponding time range, the sensor is identified as a second type of abnormal sensor, and the abnormal signal of the sensor is recorded through the sensor state array.
[0064] In this optional embodiment, when at least one sensor fails to collect complete on / off signals sequentially according to sensor number, for each sensor, it can be determined whether the sensor detects a falling edge signal within a preset abnormal duration after detecting the first rising edge signal. The preset abnormal duration can be set based on experience, such as 200ms. When the sensor detects a falling edge signal within the abnormal duration after detecting the first rising edge signal, it can be determined that the sensor is a first type of abnormal sensor. The on / off signal detected by the first type of abnormal sensor is an interference signal, that is, the sensor is affected by factors such as dust and light, and the currently collected on / off signal is ignored. This embodiment does not limit this.
[0065] In this optional embodiment, for each sensor, if the sensor fails to collect a complete on / off signal within the time range corresponding to the sensor, the sensor can be determined to be a second type of abnormal sensor, that is, the sensor may be faulty. At this time, the abnormal signal of the sensor can be recorded by the sensor state array. This embodiment does not limit this.
[0066] As can be seen, implementing this optional embodiment enables the following for each sensor: when at least one sensor fails to collect a complete on / off signal according to its sensor number, it determines whether the sensor detects a falling edge signal within a preset abnormal time period after detecting the first rising edge signal. If the sensor detects a falling edge signal within the abnormal time period after detecting the first rising edge signal, it is identified as a first-type abnormal sensor. The on / off signal detected by the first-type abnormal sensor is an interference signal, which can reduce the impact of sensor false alarms caused by factors such as reflection and dust on the counting, and improve the overall anti-interference capability of the system. For each sensor, when the sensor fails to collect a complete on / off signal within its corresponding time range, it is identified as a second-type abnormal sensor, and the abnormal signal of the sensor is recorded through the sensor state array. This enables the identification and alarm of faulty sensors, reminding staff to replace them in time to avoid more serious failures, reduce the impact of sensor failures on the production line, and reduce production line maintenance costs.
[0067] In yet another optional embodiment, the product counting method based on the production line may further include the following operations: For each sensor, determine whether the sensor has continuously generated an abnormal signal a preset number of times based on the sensor state array; For each sensor, when the sensor continuously generates an abnormal signal a preset number of times, the sensor is determined to be faulty, and a fault prompt message is generated based on each abnormal signal of the sensor.
[0068] In this optional embodiment, it can be determined whether the sensor has continuously issued an abnormal signal a preset number of times based on the sensor state array. The preset number of times can be adjusted and set based on historical data or experience, for example, 10 times. When the sensor continuously issues an abnormal signal a preset number of times, that is, when the sensor issues an abnormal signal 10 times in a row, the sensor can be identified as faulty. Fault prompt information can be generated based on each abnormal signal of the sensor, and the fault prompt information can be used to prompt the staff to replace and repair the sensor.
[0069] As can be seen, implementing this optional embodiment can determine whether a sensor has continuously generated an abnormal signal a preset number of times based on the sensor state array for each sensor. For each sensor, when the sensor continuously generates an abnormal signal a preset number of times, the sensor is determined to be faulty, and a fault prompt message is generated based on each abnormal signal of the sensor. This can identify and alarm faulty sensors, reminding staff to replace them in time, avoiding more serious faults, reducing the impact of sensor faults on the production line, and reducing production line maintenance costs.
[0070] In yet another alternative embodiment, switching to a redundant counting mode based on an anomaly sensor to count the target product may include the following operations: When an abnormal sensor is detected as a second type of abnormal sensor, a new sensor number is determined for each sensor other than the abnormal sensor. Determine the sensor spacing between each sensor except for the faulty sensor, and calculate a new duration threshold range based on the sensor spacing and production line conveyor speed; The target products are counted based on the new sensor serial number and the new duration threshold range.
[0071] In this optional embodiment, when the detected abnormal sensor is a second type of abnormal sensor, a new sensor number can be determined for each sensor other than the abnormal sensor. Then, the sensor spacing between each sensor other than the abnormal sensor can be determined. Based on the sensor spacing and the production line conveying speed, a new duration threshold range can be calculated. Based on the new sensor number and the new duration threshold range, the target product can be counted. That is, without stopping the production line, the target product can be detected and counted using the remaining sensors other than the faulty sensor.
[0072] As can be seen, implementing this optional embodiment can determine a new sensor number for each sensor other than the faulty sensor when the faulty sensor is detected as a second type of faulty sensor, determine the sensor spacing between each sensor other than the faulty sensor, and calculate a new duration threshold range based on the sensor spacing and production line conveyor speed. Based on the new sensor number and the new duration threshold range, the target products can be counted. It can perform product counting operations based on the remaining sensors when a certain sensor fails. This redundant detection setting reduces the losses caused by counting errors or production line downtime due to sensor failures and improves the overall operational stability of the system.
[0073] Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of a product counting system based on a production line, as disclosed in an embodiment of the present invention. Figure 3The described product counting system based on a production line may include multiple sensors for counting products, and these sensors detect and count the products transported on the production line. This embodiment of the invention is not limited to this specific system. Figure 3 As shown, the product counting system based on the production line may include: The acquisition module 301 is used to acquire the on / off signal of the target product passing by through the sensor, and to establish a sensor status array to record the on / off signal of the sensor. The determination module 302 is used to determine the sensor number corresponding to each sensor, and to determine whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor status array; The counting module 303 is used to determine that the target product is a single workpiece and count it when each sensor collects a complete on / off signal in sequence according to the sensor number. When at least one sensor fails to collect a complete on / off signal in sequence according to the sensor number, the module detects an abnormal sensor and switches to a redundant counting mode to count the target product based on the abnormal sensor.
[0074] It is evident that implementation Figure 3 The described product counting system based on a production line can collect the on / off signals of a target product passing through each sensor, establish a sensor state array to record the on / off signals of each sensor, determine the sensor number corresponding to each sensor, and determine whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor state array. When each sensor has collected a complete on / off signal in sequence according to the sensor number, the target product is determined to be a single workpiece and counted, which can improve the accuracy of production line output statistics and counting. When at least one sensor has not collected a complete on / off signal in sequence according to the sensor number, an abnormal sensor is detected, and the system switches to a redundant counting mode to count the target product based on the abnormal sensor. This can improve the anti-interference capability of production line statistics and counting, improve counting stability, and reduce production line maintenance and management costs.
[0075] In an optional embodiment, such as Figure 4 As shown, the specific method by which the determining module 302 determines whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor state array includes: Determine whether the triggering order of the on / off signals of each sensor satisfies the sensor sequence number based on the sensor state array; When the triggering sequence of the on / off signals of each sensor satisfies the sensor sequence number, and each sensor acquires a complete on / off signal, the signal triggering time interval between two adjacent sensors is determined according to the sensor sequence number. Determine whether the trigger time interval of each signal meets the preset duration threshold range. When the trigger time interval of each signal meets the duration threshold range, determine that each sensor has collected the complete on / off signal in sequence according to the sensor number.
[0076] It is evident that implementation Figure 4 The described product counting system based on a production line can collect the on / off signals of a target product passing through each sensor, establish a sensor state array to record the on / off signals of each sensor, determine the sensor number corresponding to each sensor, and determine whether the triggering sequence of the on / off signals of each sensor meets the sensor number based on the sensor state array. When the triggering sequence of the on / off signals of each sensor meets the sensor number and each sensor collects a complete on / off signal, the system determines the signal triggering time interval between two adjacent sensors based on the sensor number, and determines whether each signal triggering time interval meets a preset duration threshold range. Within the specified time threshold range, ensuring that each sensor sequentially collects complete on / off signals according to its sensor number provides dual assurance for the accuracy of product counting through the sensor signal sequence and the completeness of the on / off signals, thereby improving the accuracy and reliability of product counting. When each sensor sequentially collects complete on / off signals according to its sensor number, the target product is identified as a single workpiece and counted, which improves the production line's output statistics and counting accuracy. When each sensor fails to collect complete on / off signals sequentially according to its sensor number, an abnormal sensor is detected, and the system switches to redundant counting mode to count the target product based on the abnormal sensor. This improves the anti-interference capability of the production line's statistical counting, enhances counting stability, and reduces production line maintenance and management costs.
[0077] In another alternative embodiment, such as Figure 4 As shown, the on / off signal of each sensor includes a first rising edge signal, a falling edge signal, and a second rising edge signal. The sensor state array also records the timestamp corresponding to the on / off signal of each sensor. The preset duration threshold range includes a minimum duration and a maximum duration. The determining module 302 is further configured to, after the triggering sequence of the on / off signals of each sensor satisfies the sensor sequence number, determine the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal of each sensor according to the sensor state array. This production line-based product counting system may also include: The calculation module 304 is used to calculate the duration range corresponding to each sensor based on the second timestamp corresponding to the previous sensor, as well as the minimum duration and the maximum duration. The judgment module 305 is used to determine, for each sensor, whether the sensor has collected a complete on / off signal within the corresponding time range according to the sensor state array; when each sensor has collected a complete on / off signal within the corresponding time range, the determination module 302 is triggered to perform the operation of determining the signal trigger time interval between two adjacent sensors according to the sensor number.
[0078] It is evident that implementation Figure 4 The described product counting system based on a production line can determine the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal for each sensor based on the sensor state array. For each sensor, the system calculates the corresponding duration range based on the second timestamp of the preceding sensor, the minimum duration, and the maximum duration. For each sensor, the system determines whether the sensor has collected a complete on / off signal within its corresponding duration range based on the sensor state array. When each sensor collects a complete on / off signal within its corresponding duration range, the system triggers the operation of determining the signal trigger time interval between two adjacent sensors based on the sensor number. The system can calculate the duration range of the current sensor based on the second timestamp of the preceding sensor and determine whether a complete signal has been collected within the duration range based on the current timestamp. By judging the continuity and completeness of multi-sensor signal acquisition, the system improves the accuracy and reliability of product counting.
[0079] In yet another alternative embodiment, such as Figure 4 As shown, the determining module 302 is also used to determine the production line data of the production line, which includes the production line conveying speed and the maximum conveying length. The judgment module 305 is also used to determine whether the signal triggering time interval is less than the minimum duration for each signal triggering time interval. The calculation module 304 is also used to calculate the product overlap coefficient of the target product based on the production line conveying speed, the maximum conveying length and the signal triggering time interval for each signal triggering time interval when the signal triggering time interval is less than the minimum duration. The judgment module 305 is also used to determine whether the product overlap coefficient of the target product is greater than a preset overlap coefficient threshold. When the product overlap coefficient is greater than the overlap coefficient threshold, the target product overlap is determined, and the actual quantity of the target product is determined based on the product overlap coefficient.
[0080] It is evident that implementation Figure 4The described product counting system based on a production line can determine production line data, including production line conveyor speed and maximum conveyor length. For each signal trigger time interval, it determines whether the signal trigger time interval is less than the minimum duration. For each signal trigger time interval, when the signal trigger time interval is less than the minimum duration, it calculates the product overlap coefficient of the target product based on the production line conveyor speed, maximum conveyor length, and the signal trigger time interval. It then determines whether the product overlap coefficient of the target product is greater than a preset overlap coefficient threshold. When the product overlap coefficient is greater than the overlap coefficient threshold, it determines that the target products are overlapping, and determines the actual quantity of the target products based on the product overlap coefficient. It can determine whether products overlap based on the signal trigger time interval between two sensors and calculate the number of overlapping products, thereby improving the accuracy of product counting and reducing the impact of overlapping products on the counting results.
[0081] In yet another alternative embodiment, such as Figure 4 As shown, when at least one sensor fails to collect a complete on / off signal in sequence according to the sensor number, the counting module 303 detects the abnormal sensor in the following specific ways: When at least one sensor fails to collect a complete on / off signal in sequence according to the sensor number, for each sensor, it is determined whether the sensor detects a falling edge signal within a preset abnormal time after detecting the first rising edge signal. If the sensor detects a falling edge signal within the abnormal time after detecting the first rising edge signal, the sensor is determined to be a first type of abnormal sensor, and the on / off signal detected by the first type of abnormal sensor is an interference signal. For each sensor, if the sensor fails to collect a complete on / off signal within its corresponding time range, the sensor is identified as a second type of abnormal sensor, and the abnormal signal of the sensor is recorded through the sensor state array.
[0082] It is evident that implementation Figure 4The described product counting system based on the production line can identify and alarm for each sensor when it fails to collect a complete on / off signal according to its sensor number. For each sensor, it determines whether a falling edge signal is detected within a preset abnormal time period after detecting the first rising edge signal. If the sensor detects a falling edge signal within the abnormal time period after detecting the first rising edge signal, it is identified as a first-type abnormal sensor. The on / off signal detected by the first-type abnormal sensor is an interference signal, which can reduce the impact of sensor false alarms caused by factors such as reflection and dust on the counting, and improve the overall anti-interference capability of the system. For each sensor, if it fails to collect a complete on / off signal within its corresponding time range, it is identified as a second-type abnormal sensor, and the abnormal signal of the sensor is recorded through the sensor state array. This allows for the identification and alarm of faulty sensors, reminding staff to replace them in time to avoid more serious failures, reduce the impact of sensor failures on the production line, and reduce production line maintenance costs.
[0083] In yet another alternative embodiment, such as Figure 4 As shown, the judgment module 305 is also used to determine, for each sensor, whether the sensor has continuously generated an abnormal signal a preset number of times based on the sensor state array; The determination module 302 is also used to determine that the sensor is faulty when the sensor continuously produces an abnormal signal a preset number of times, and to generate a fault prompt message based on each abnormal signal of the sensor.
[0084] It is evident that implementation Figure 4 The described product counting system based on the production line can determine whether a sensor has continuously generated a preset number of abnormal signals based on the sensor status array. When a sensor continuously generates a preset number of abnormal signals, the system determines that the sensor is faulty and generates fault prompt information based on each abnormal signal. This system can identify and alarm faulty sensors, reminding staff to replace them in time to avoid more serious faults, reduce the impact of sensor faults on the production line, and reduce production line maintenance costs.
[0085] In yet another alternative embodiment, such as Figure 4 As shown, the specific methods by which the counting module 303 switches to redundant counting mode to count the target product based on the abnormal sensor include: When an abnormal sensor is detected as a second type of abnormal sensor, a new sensor number is determined for each sensor other than the abnormal sensor. Determine the sensor spacing between each sensor except for the faulty sensor, and calculate a new duration threshold range based on the sensor spacing and production line conveyor speed; The target products are counted based on the new sensor serial number and the new duration threshold range.
[0086] It is evident that implementation Figure 4 The described production line-based product counting system can determine a new sensor number for each sensor other than the faulty one when a faulty sensor is detected as a Type II faulty sensor. It also determines the sensor spacing between each sensor other than the faulty one, calculates a new duration threshold range based on the sensor spacing and production line conveyor speed, and counts the target products based on the new sensor number and the new duration threshold range. It can perform product counting based on the remaining sensors when a sensor fails. This redundant detection setting reduces losses caused by counting errors or production line downtime due to sensor failures and improves the overall operational stability of the system.
[0087] Example 4 Please see Figure 5 , Figure 5 This is a schematic diagram of another product counting device based on a production line disclosed in an embodiment of the present invention. Figure 5 As shown, the product counting device based on the production line may include: Memory 401 storing executable program code; Processor 402 coupled to memory 401; The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the product counting method based on the production line described in Embodiment 1 or Embodiment 2 of the present invention.
[0088] Example 5 This invention discloses a computer storage medium storing computer instructions. When these computer instructions are invoked, they are used to execute some or all of the steps in any of the product counting methods based on a production line disclosed in Embodiment 1 of this invention.
[0089] Example 6 This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps in the production line-based product counting method described in Embodiment 1 or Embodiment 2.
[0090] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0091] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0092] Finally, it should be noted that the product counting method and system based on a production line disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A product counting method based on a production line, characterized in that, The method is applied to a product counting system based on a production line, the system including multiple sensors for counting products, and the method includes: The sensor acquires the on / off signal when the target product passes by, and establishes a sensor state array to record the on / off signal of the sensor. Determine the sensor number corresponding to each sensor, and determine whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor state array; When each of the sensors sequentially acquires a complete on / off signal according to the sensor number, the target product is determined to be a single workpiece and counted. When at least one of the sensors fails to acquire a complete on / off signal sequentially according to the sensor number, an abnormal sensor is detected, and the system switches to a redundant counting mode to count the target product based on the abnormal sensor. And, the step of determining whether each sensor has sequentially acquired a complete on / off signal according to its sensor number based on the sensor state array includes: Based on the sensor state array, determine whether the triggering order of the on / off signals of each sensor satisfies the sensor sequence number; When the triggering sequence of the on / off signals of each sensor satisfies the sensor number, and each sensor acquires a complete on / off signal, the signal triggering time interval between two adjacent sensors is determined according to the sensor number. Determine whether each signal trigger time interval meets the preset duration threshold range. When each signal trigger time interval meets the duration threshold range, determine that each sensor has sequentially collected the complete on / off signal according to the sensor number. In addition, the on / off signal of each sensor includes a first rising edge signal, a falling edge signal and a second rising edge signal, and the sensor state array also records the timestamp corresponding to the on / off signal of each sensor, and the preset duration threshold range includes a minimum duration and a maximum duration. After the triggering sequence of the on / off signals of each of the sensors satisfies the sensor sequence number, the method further includes: Based on the sensor state array, determine the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal for each sensor; For each sensor, the duration range corresponding to the sensor is calculated based on the second timestamp corresponding to the previous sensor, the minimum duration, and the maximum duration. For each sensor, it is determined whether the sensor has collected a complete on / off signal within the time range corresponding to the sensor, based on the sensor state array. When each of the sensors acquires a complete on / off signal within the corresponding time range, the operation of determining the signal triggering time interval between two adjacent sensors based on the sensor number is triggered.
2. The product counting method based on a production line according to claim 1, characterized in that, The method further includes: Determine the production line data of the production line, the production line data including the production line conveyor speed and the maximum conveyor length; For each of the signal triggering time intervals, determine whether the signal triggering time interval is less than the minimum duration; For each of the signal triggering time intervals, when the signal triggering time interval is less than the minimum duration, the product overlap coefficient of the target product is calculated based on the production line conveying speed, the maximum conveying length, and the signal triggering time interval. Determine whether the product overlap coefficient of the target product is greater than a preset overlap coefficient threshold. When the product overlap coefficient is greater than the overlap coefficient threshold, determine that the target products overlap, and determine the actual quantity of the target products based on the product overlap coefficient.
3. The product counting method based on a production line according to claim 1 or 2, characterized in that, The step of detecting abnormal sensors when at least one of the sensors fails to collect complete on / off signals sequentially according to the sensor serial numbers includes: When at least one of the sensors fails to collect a complete on / off signal in sequence according to the sensor number, for each sensor, it is determined whether the sensor detects the falling edge signal within a preset abnormal time after detecting the first rising edge signal. When the sensor detects the falling edge signal within the abnormal time after detecting the first rising edge signal, the sensor is determined to be a first type of abnormal sensor, and the on / off signal detected by the first type of abnormal sensor is an interference signal. For each of the sensors, if the sensor fails to acquire a complete on / off signal within the time range corresponding to the sensor, the sensor is determined to be a second type of abnormal sensor, and the abnormal signal of the sensor is recorded through the sensor state array.
4. The product counting method based on the production line according to claim 3, characterized in that, The method further includes: For each sensor, it is determined whether the sensor has continuously generated an abnormal signal a preset number of times based on the sensor state array; For each of the sensors, when the sensor continuously generates an abnormal signal a preset number of times, the sensor is determined to be faulty, and a fault prompt message is generated based on each of the abnormal signals of the sensor.
5. The product counting method based on a production line according to claim 3, characterized in that, The step of switching to redundant counting mode based on the abnormal sensor to count the target product includes: When the abnormal sensor is detected to be an abnormal sensor of the second type, a new sensor number is determined for each of the sensors other than the abnormal sensor. Determine the sensor spacing between each of the sensors except for the abnormal sensor, and calculate a new duration threshold range based on the sensor spacing and the production line conveying speed of the production line; The target products are counted based on the new sensor serial number and the new duration threshold range.
6. A product counting system based on a production line, characterized in that, The system includes multiple sensors for counting products, and the system also includes: The acquisition module is used to acquire the on / off signal when the target product passes through the sensor, and to establish a sensor state array to record the on / off signal of the sensor; The determination module is used to determine the sensor number corresponding to each sensor, and to determine whether each sensor has collected a complete on / off signal in sequence according to the sensor number based on the sensor state array; The counting module is used to determine that the target product is a single workpiece and count it when each of the sensors collects a complete on / off signal in sequence according to the sensor number; when at least one of the sensors does not collect a complete on / off signal in sequence according to the sensor number, it detects an abnormal sensor and switches to a redundant counting mode to count the target product based on the abnormal sensor. Furthermore, the method by which the determining module determines whether each sensor has sequentially acquired a complete on / off signal according to its sensor number based on the sensor state array specifically includes: Based on the sensor state array, determine whether the triggering order of the on / off signals of each sensor satisfies the sensor sequence number; When the triggering sequence of the on / off signals of each sensor satisfies the sensor number, and each sensor acquires a complete on / off signal, the signal triggering time interval between two adjacent sensors is determined according to the sensor number; Determine whether each signal trigger time interval meets the preset duration threshold range. When each signal trigger time interval meets the duration threshold range, determine that each sensor has sequentially collected a complete on / off signal according to the sensor number. In addition, the on / off signal of each sensor includes a first rising edge signal, a falling edge signal and a second rising edge signal, and the sensor state array also records the timestamp corresponding to the on / off signal of each sensor, and the preset duration threshold range includes a minimum duration and a maximum duration. The determining module is further configured to, after the triggering order of the on / off signals of each sensor satisfies the sensor sequence number, determine, according to the sensor state array, the first timestamp corresponding to the first rising edge signal, the second timestamp corresponding to the falling edge signal, and the third timestamp corresponding to the second rising edge signal of each sensor. The system also includes: The calculation module is used to calculate the duration range corresponding to each sensor based on the second timestamp corresponding to the previous sensor, the minimum duration, and the maximum duration for each sensor. The judgment module is used to determine, for each sensor, whether the sensor has collected a complete on / off signal within the corresponding time range according to the sensor state array; when each sensor has collected a complete on / off signal within the corresponding time range, the determination module is triggered to perform the operation of determining the signal trigger time interval between two adjacent sensors according to the sensor number.
7. A product counting device based on a production line, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the product counting method based on the production line as described in any one of claims 1-5.
8. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the product counting method based on the production line as described in any one of claims 1-5.