A machine vision-based industrial product defect detection system and method

CN122836079APending Publication Date: 2026-09-29WUXI MICE DUOYOU PRECISE INSTR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611105668.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

以及在现有工业视觉检测系统仅采用PLC单向固定节拍交互逻辑,PLC按照人工预先设定的固定速度持续输送工件,视觉软件仅被动接收拍照触发信号,不存在基于自身算力负载反向调控产线输送速度的闭环机制

Benefits of technology

本发明完全依托软件模块化逻辑实现算力均衡与自适应调速,无需新增工控机、相机、独立输送伺服等硬件设备,大幅降低产线改造硬件成本与改造周期,适配存量多工位视觉检测产线快速升级。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122836079A_ABST
    Figure CN122836079A_ABST
Patent Text Reader

Abstract

The application discloses an industrial product defect detection system and method based on machine vision, and relates to the technical field of industrial detection.The system comprises a computing power collection grading module, a multi-station task scheduling module, a cooperative speed regulation communication module and a buffer early warning module.The computing power collection grading module is used for collecting parameters independently in the background, dividing multi-level load grades of each station, and selecting the highest load grade of all stations as the global reference load grade of the whole line.The multi-station task scheduling module is used for calculating the maximum storage threshold of the temporary cache in the memory to constrain the memory occupation.The cooperative speed regulation communication module is used for configuring multiple groups of Modbus value interaction registers on the PLC side, receiving the speed regulation completion handshake identifier returned by the PLC, and synchronously updating the internal reference beat parameter of the software to form a real-time closed loop of visual computing power reverse regulation and control of the production line beat.The buffer early warning module is used for triggering the cooperative speed regulation communication module to execute the speed reduction logic when the station buffer occupation ratio reaches the early warning threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial inspection technology, specifically to a machine vision-based industrial product defect detection system and method. Background Technology

[0002] The new energy battery cell manufacturing industry commonly uses multi-station parallel vision inspection production lines to identify welding defects in battery cell tabs. Multiple inspection stations share the same industrial control computer and the same vision inspection software, with the production line equipped with a unified belt conveyor mechanism and a single PLC control system. Furthermore, existing industrial vision inspection systems only use unidirectional fixed-cycle PLC interaction logic. The PLC continuously conveys workpieces at a fixed speed preset by the operator, and the vision software passively receives image trigger signals, lacking a closed-loop mechanism to adjust the production line's conveyor speed based on its own computing power load. When a large number of time-consuming defective products flow into any station in a short period, the station's image cache accumulates until it overflows and the images are discarded. This results in no inspection records for the corresponding workpieces, leading to batch missed inspections and serious quality risks. Meanwhile, the GPU and CPU computing power of other low-load stations remains idle for extended periods, locking the entire line's capacity due to localized computing power bottlenecks and resulting in low equipment utilization. To alleviate the above problems, existing technologies often involve hardware expansion methods such as adding industrial control computers, splitting workstations, and installing independent conveyor servos. This significantly increases the equipment procurement, production line modification cycle, and modification costs, and cannot rely on software logic optimization to solve the problems of missed detections and wasted production capacity caused by random and unbalanced loads at multiple workstations. Summary of the Invention

[0003] The purpose of this invention is to provide an industrial product defect detection system and method based on machine vision, so as to solve the problems raised in the prior art.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a machine vision-based method for detecting defects in industrial products, applied to a multi-station production line for detecting welding defects in battery cell tab sheets, which shares the same industrial control computer and the same set of vision inspection software. The multi-station production line is configured with a unified belt conveyor mechanism and a single PLC control system. The method includes the following steps: Step S1: An independent background polling thread continuously collects the full cycle time of single workpiece inspection, the number of remaining images in the workpiece image cache queue, and hardware resource usage parameters for all workstations. Based on the number of remaining images in the workpiece image cache queue and the maximum total number of images that the workpiece cache can hold, the workpiece cache usage ratio is calculated. Based on the full cycle time of single workpiece inspection, the workpiece cache usage ratio, and hardware resource usage parameters, each workstation is divided into multiple load levels, and the global baseline load level of the entire line is determined based on the load levels of all workstations. Step S2: Construct a priority detection task queue based on the real-time load level of each workstation, allocate GPU time-sharing inference computing power to the four priority workstations according to the preset computing power allocation ratio, set memory delay write buffer logic for the acquired images of light-load workstations, and prioritize scheduling computing power resources to process the backlog of detection tasks of high-load workstations. Step S3: Configure multiple Modbus communication registers for transmitting numerical data interaction on the PLC side in advance. Calculate the conveyor speed adjustment offset based on the global baseline load level superimposed with load weight attenuation and cross-station load integral compensation using a two-layer logic. Send speed adjustment numerical instructions from the vision software to the PLC. After the PLC executes the speed adjustment, it sends a speed adjustment completion handshake signal back to the vision software, forming a real-time closed loop of vision computing power reverse control of the production line cycle. Step S4: Set the workstation buffer occupancy warning threshold. When the workstation buffer reaches the warning threshold, the speed adjustment logic is triggered in advance, and short-term load fluctuation filtering rules and production line speed upper and lower limit constraints are configured.

[0005] The method achieves multi-station random unbalanced load balancing and eliminates image buffer overflow, frame loss, and missed detection problems only through software logic reconstruction. It does not require adding an industrial control computer, independent conveyor servo, or additional camera hardware. It solves the technical defects of the existing one-way fixed-cycle interaction mode, such as image loss due to instantaneous high load at local workstations, idle computing power at good product workstations, low production line utilization rate, and frequent manual adjustment of PLC fixed speed.

[0006] Furthermore, step S1 includes the following steps: Step S101: After each workpiece inspection is completed, automatically accumulate and record the image acquisition time, deep learning model inference time, defect threshold determination time, and local image storage time to obtain the time T for a single workpiece complete inspection cycle; Step S102: Periodically read the remaining number of images in the image cache queue corresponding to each workstation and the hardware resource usage parameters, including the CPU usage rate and GPU memory usage rate of the industrial control computer. Step S103: Preset four load levels as light load, normal load, high load, and overload warning, and configure a first threshold, a second threshold, and a third threshold with a progressive numerical relationship, wherein the value of the first threshold is less than the value of the second threshold, and the value of the second threshold is less than the value of the third threshold. Simultaneously, three auxiliary judgment thresholds are preset: standard detection time, CPU saturation threshold, and GPU memory saturation threshold. First, the load labels of the four types of indicators are judged independently. Then, the weighted sum of the sub-labels is used to obtain the comprehensive load score of the workstation. Based on the comprehensive score range, four levels are distinguished: light load, normal load, high load, and overload warning. The third threshold is used as the cache overflow warning threshold. The process for determining the sub-item load labels includes the following: if the time taken for a complete inspection of a single workpiece is less than the standard inspection time, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the CPU utilization rate is less than the CPU saturation threshold, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the GPU memory utilization rate is less than the GPU memory saturation threshold, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the station cache utilization rate is lower than the first threshold, it is marked as a low-load sub-item; if it is between the first and second thresholds, it is marked as a medium-load sub-item; if it is between the second and third thresholds, it is marked as a second-highest-load sub-item; and if it is higher than the third threshold, it is marked as a high-load sub-item. The weighted summation of the workstation's overall load score includes pre-configured fixed weights for four categories of indicators: workstation cache occupancy ratio has the highest weight, single workpiece complete inspection time is the second highest, GPU memory usage is the third highest, and CPU usage has the lowest weight. Each low-load item is scored 0 points, medium-load item is scored 1 point, second-highest load item is scored 2 points, and high-load item is scored 3 points. The scores of each item are multiplied by their corresponding weights and then summed to obtain the overall workstation load score. The four-level classification includes four preset continuous score ranges. The comprehensive load score falling into the lowest range is judged as light load, falling into the second lowest range is judged as normal load, falling into the second highest range is judged as high load, and falling into the highest range is judged as overload warning. Step S104: Traverse all real-time load levels of all workstations, select the highest load level among all workstations as the global benchmark load level of the entire line, and use it as the basis for subsequent conveyor speed adjustment.

[0007] Furthermore, step S2 includes the following specific steps: Step S201: Establish a one-to-one correspondence between load levels and task priorities. Overload warning workstation tasks are the first priority, high load workstation tasks are the second priority, normal load workstation tasks are the third priority, and light load workstation tasks are the fourth priority. Step S202: Within a single inference cycle, the total GPU computing power resources of the industrial control computer are divided according to a fixed ratio. The first priority workstation is allocated computing power resources a1, the second priority workstation is allocated computing power resources a2, the third priority workstation is allocated computing power resources a3, and the fourth priority workstation is allocated computing power resources a4. The defect inference tasks of different workstations are executed in a time-sharing manner. At the same time, only one workstation occupies the corresponding proportion of computing power resources to complete the image defect inference; a1>a2>a3>a4, and a1+a2+a3+a4=100%. Step S203: For lightly loaded workstations that are determined to be of the fourth priority, the images that have been acquired are not immediately subjected to inference and storage operations. Instead, they are temporarily stored in the memory buffer area to release computing resources and prioritize the processing of backlogged images from high-priority workstations. Step S204: The maximum storage threshold for the temporary memory cache is calculated based on the available physical memory capacity of the industrial control computer, the memory usage of a single image, and a preset safe memory reservation value. The calculation process is as follows: first, subtract the safe memory reservation value from the total free physical memory of the industrial control computer to obtain the total available cache memory; then, divide the total available cache memory by the memory usage of a single image to obtain the maximum number of cacheable images. This value is the maximum storage threshold for the temporary memory cache. When the number of images in the memory buffer reaches the maximum storage threshold, adding new image buffers stops, and image inference within the cache is forcibly executed to prevent memory overflow.

[0008] Furthermore, step S3 includes the following specific details: All registers are of INT16 data type. Register functions include: The first register, written unidirectionally from the vision system to the PLC, stores the global baseline load level code; the second register, also written unidirectionally from the vision system to the PLC, stores the conveyor speed offset adjustment value (positive values ​​represent acceleration offset, negative values ​​represent deceleration offset); the third register, written unidirectionally from the PLC to the vision system, stores the current actual operating speed of the belt mechanism; the fourth register, used for bidirectional interaction between the vision system and the PLC, stores the speed adjustment completion handshake indicator. The basic execution flow includes the following: Step S301: Pre-calibrate the reference conveyor pulse frequency, the belt travel distance corresponding to a single pulse, and the standard workpiece conveyor interval duration. When the global reference load is light, calculate the positive acceleration offset. The calculation process for the positive acceleration offset is to subtract the average detection time per station from the standard workpiece conveyor interval duration to obtain the difference. Divide the difference by the reference conveyor pulse period to obtain the pulse increment value. The pulse increment value is the positive acceleration offset. When the global reference load is high or overload warning, calculate the negative deceleration offset. The calculation process for the negative deceleration offset is to subtract the standard workpiece conveyor interval duration from the average detection time per station to obtain the difference. Divide the difference by the reference conveyor pulse period to obtain the pulse reduction value. The pulse reduction value is the negative deceleration offset. Step S302: The vision system issues a speed adjustment command, and the global reference load code and speed offset base value are written to the corresponding registers every fixed period. Step S303: The PLC reads the speed offset pulse value stored in the second register, adds the pulse value to the original reference pulse frequency of the servo motor to obtain the updated pulse frequency, sends the updated pulse frequency to the servo driver, and the servo driver adjusts the output pulse rate to change the belt conveying speed. Step S304: After the PLC completes the pulse frequency modification and the belt speed is running stably, it writes a preset non-zero value to the fourth register as a handshake identifier. The vision continuously polls and reads the value of the fourth register. When the handshake identifier is detected, it means that the PLC speed adjustment action is completed. After reading the handshake identifier, the vision retrieves the actual belt running speed stored in the third register. Based on the actual belt running speed, it calculates the current workpiece conveying interval time and replaces the original benchmark cycle parameters in the software with the calculated current workpiece conveying interval time, so as to match the internal judgment logic of the software with the actual conveying interval of the production line on site. Step S305: Repeat steps S301 to S304 every preset millisecond period to continuously and dynamically fine-tune the conveying speed.

[0009] Furthermore, step S3 also includes: Step S306: Count the number of consecutive high load or overload warnings for each workstation, k. Preset a fixed base weight W0 and an attenuation coefficient α with a value greater than zero and less than one. Use the formula: W=W0*α (k-1) Calculate the real-time load weight W of the workstation. When the workstation load level drops back to normal or light load, the cycle count k is cleared to zero and the weight is reset. The cycle count k takes the value of a positive integer and there is no calculation scenario where k is equal to negative one. Step S307: Set a sliding statistical window with a length of M detection cycles, and accumulate the product of the load level code of all workstations and the corresponding workstation weight W within the window. The accumulated result is the global load integral S. Step S308: Retrieve the real-time load weight W corresponding to the highest load position in the world, multiply the speed adjustment offset base amount by the real-time load weight W to obtain the compensation offset V2, preset a fixed congestion deceleration compensation value V3, activate V3 when the global load integral S in the sliding window exceeds the preset integral threshold Sh, and set the value of V3 to zero when the global load integral S does not exceed the preset integral threshold Sh. The total speed offset Vt is obtained by adding the compensation offset V2 and the congestion deceleration compensation value V3. Step S309: Retrieve the maximum pulse offset value corresponding to the preset upper limit of belt speed and the minimum pulse offset value corresponding to the lower limit of belt speed. Compare the total speed offset Vt with the maximum pulse offset value and the minimum pulse offset value. If the total speed offset Vt is greater than the maximum pulse offset value, correct the total speed offset to the maximum pulse offset value. If the total speed offset Vt is less than the minimum pulse offset value, correct the total speed offset to the minimum pulse offset value. If the total speed offset Vt is within the range of the two values, keep the original value unchanged. After completing the limiting process, output the valid speed adjustment value and write it into the PLC register.

[0010] Furthermore, step S4 includes the following specific steps: Step S401: Set the third threshold as the warning threshold before buffer overflow. When the workstation buffer occupancy ratio reaches the third threshold, immediately execute the S3 speed regulation and deceleration logic to reduce the workpiece loading density in advance. Step S402: If a high load status at the workstation is detected in a single data acquisition but speed adjustment is not triggered, and the high load or overload warning is determined in N consecutive polls, a speed adjustment command is issued; this eliminates frequent speed adjustment jitter caused by instantaneous workpiece defect fluctuations. Step S403: Pre-configure the upper and lower speed limits allowed for production line operation. After the calculated speed offset is executed, the final belt speed must not exceed the upper or lower limit range. This prevents excessive speed from causing image blurring and excessive speed from reducing production capacity.

[0011] Furthermore, the method also includes a log recording step, which records in real time the load level of each workstation in each round, the computing power allocation ratio, the speed offset value sent by vision, the actual running speed fed back by PLC, and the timing data of speed adjustment handshake interaction, generating a global cycle analysis log. The log is associated with and stored with workpiece barcodes and defect detection records, and supports the later export of reports to complete production line capacity traceability analysis.

[0012] A machine vision-based industrial product defect detection system includes a computing power acquisition and classification module, a multi-station task scheduling module, a collaborative speed regulation and communication module, and a buffer early warning module. The computing power acquisition and classification module is used to independently poll and collect parameters such as the time taken to complete the inspection of a single workpiece at all workstations, the number of remaining images in the workstation image cache queue, the CPU utilization rate of the industrial control computer, and the GPU memory utilization rate in the background. Combined with the maximum number of images that the workstation cache can hold, the workstation cache utilization rate is calculated. Based on four indicators, namely the time taken to complete the inspection of a single workpiece, the workstation cache utilization rate, the CPU utilization rate, and the GPU memory utilization rate, the workstation is divided into multiple load levels. The highest load level of all workstations is selected as the global benchmark load level of the entire line. The multi-station task scheduling module is used to build a four-level priority detection task queue based on the workstation load level, allocate time-sharing GPU inference computing power to the four priority workstations in a fixed ratio, set memory delay write buffer logic for images acquired by light-load workstations, prioritize scheduling computing power to handle backlog tasks of high-load workstations, and calculate the maximum storage threshold of temporary memory cache based on the industrial control computer's idle memory, memory occupied by a single image, and safe reserved memory to constrain memory usage. The collaborative speed control communication module is used to configure multiple Modbus numerical interaction registers on the PLC side. Based on the global reference load level combined with the continuous weight decay of the load and the cross-station superimposed load integral compensation double-layer correction logic, it calculates the conveyor speed adjustment offset, sends speed control numerical instructions to the PLC, receives the speed control completion handshake mark returned by the PLC, and synchronously updates the internal reference cycle parameters of the software, forming a real-time closed loop of visual computing power reverse control of the production line cycle. The buffer early warning module is used to configure the first, second, and third thresholds for workstation buffer occupancy that are incremented step by step. The third threshold serves as the buffer overflow early warning threshold. When the workstation buffer occupancy reaches the early warning threshold, the collaborative speed control communication module is triggered to execute deceleration logic. At the same time, short-term load fluctuation filtering rules and production line speed upper and lower limit constraints are configured.

[0013] Compared with the prior art, the beneficial effects of the present invention are: This invention relies entirely on software modular logic to achieve balanced computing power and adaptive speed adjustment, eliminating the need for additional industrial control computers, cameras, independent conveyor servos, and other hardware equipment. This significantly reduces the hardware cost and cycle time for production line upgrades and allows for rapid upgrades of existing multi-station vision inspection production lines.

[0014] This invention employs a weighted comprehensive assessment of four types of indicators to determine the load level of workstations, which differs from the existing method of determining load level using a single cache percentage. This significantly improves the accuracy of load level determination and avoids speed adjustment logic failures caused by misjudgments of a single indicator. It also sets up a four-level task priority and a fixed-ratio time-sharing GPU computing power allocation mechanism, automatically tilting computing resources towards high-load workstations and buffering image delays at light-load workstations. This fully utilizes idle computing power, prevents batch missed inspections caused by cache overflow at local workstations, avoids the risk of battery cell product quality leakage, and meets the battery industry's quality inspection traceability compliance requirements.

[0015] This invention introduces a dual-layer correction logic of continuous load weight decay and cross-workstation superimposed load integral compensation. It distinguishes between short-term high load caused by instantaneous defects and long-term continuous computing power congestion. The speed adjustment range under instantaneous load is reduced, avoiding production capacity loss caused by long-term low speed of the entire line. When multiple workstations alternately and stagger peak superimposed computing power pressure, deceleration compensation is superimposed in advance to solve the problem of slow accumulation of implicit cache, taking into account both production capacity and detection stability. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the structure of an industrial product defect detection method based on machine vision according to the present invention. Detailed Implementation

[0017] 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.

[0018] Example: Figure 1 As shown, this invention provides a machine vision-based method for detecting defects in industrial products. This method is applied to a multi-station production line for detecting welding defects in battery tabs, which shares the same industrial control computer and the same vision inspection software. The multi-station production line is equipped with a unified belt conveyor mechanism and a single PLC control system. The method includes the following steps: Step S1: An independent background polling thread continuously collects the full cycle time of single workpiece inspection, the number of remaining images in the workpiece image cache queue, and hardware resource usage parameters for all workstations. Based on the number of remaining images in the workpiece image cache queue and the maximum total number of images that the workpiece cache can hold, the workpiece cache usage ratio is calculated. Based on the full cycle time of single workpiece inspection, the workpiece cache usage ratio, and hardware resource usage parameters, each workstation is divided into multiple load levels, and the global baseline load level of the entire line is determined based on the load levels of all workstations. Step S2: Construct a priority detection task queue based on the real-time load level of each workstation, allocate GPU time-sharing inference computing power to the four priority workstations according to the preset computing power allocation ratio, set memory delay write buffer logic for the acquired images of light-load workstations, and prioritize scheduling computing power resources to process the backlog of detection tasks of high-load workstations. Step S3: Configure multiple Modbus communication registers for transmitting numerical data interaction on the PLC side in advance. Calculate the conveyor speed adjustment offset based on the global baseline load level superimposed with load weight attenuation and cross-station load integral compensation using a two-layer logic. Send speed adjustment numerical instructions from the vision software to the PLC. After the PLC executes the speed adjustment, it sends a speed adjustment completion handshake signal back to the vision software, forming a real-time closed loop of vision computing power reverse control of the production line cycle. Step S4: Set the workstation buffer occupancy warning threshold. When the workstation buffer reaches the warning threshold, the speed adjustment logic is triggered in advance, and short-term load fluctuation filtering rules and production line speed upper and lower limit constraints are configured.

[0019] The method achieves multi-station random unbalanced load balancing and eliminates image buffer overflow, frame loss, and missed detection problems only through software logic reconstruction. It does not require adding an industrial control computer, independent conveyor servo, or additional camera hardware. It solves the technical defects of the existing one-way fixed-cycle interaction mode, such as image loss due to instantaneous high load at local workstations, idle computing power at good product workstations, low production line utilization rate, and frequent manual adjustment of PLC fixed speed.

[0020] Step S1 includes the following steps: Step S101: After each workpiece inspection is completed, automatically accumulate and record the image acquisition time, deep learning model inference time, defect threshold determination time, and local image storage time to obtain the time T for a single workpiece complete inspection cycle; Step S102: Periodically read the remaining number of images in the image cache queue corresponding to each workstation and the hardware resource usage parameters, including the CPU usage rate and GPU memory usage rate of the industrial control computer. Step S103: Preset four load levels as light load, normal load, high load, and overload warning, and configure a first threshold, a second threshold, and a third threshold with a progressive numerical relationship, wherein the value of the first threshold is less than the value of the second threshold, and the value of the second threshold is less than the value of the third threshold. Simultaneously, three auxiliary judgment thresholds are preset: standard detection time, CPU saturation threshold, and GPU memory saturation threshold. First, the load labels of the four types of indicators are judged independently. Then, the weighted sum of the sub-labels is used to obtain the comprehensive load score of the workstation. Based on the comprehensive score range, four levels are distinguished: light load, normal load, high load, and overload warning. The third threshold is used as the cache overflow warning threshold. The process for determining the sub-item load labels includes the following: if the time taken for a complete inspection of a single workpiece is less than the standard inspection time, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the CPU utilization rate is less than the CPU saturation threshold, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the GPU memory utilization rate is less than the GPU memory saturation threshold, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the station cache utilization rate is lower than the first threshold, it is marked as a low-load sub-item; if it is between the first and second thresholds, it is marked as a medium-load sub-item; if it is between the second and third thresholds, it is marked as a second-highest-load sub-item; and if it is higher than the third threshold, it is marked as a high-load sub-item. The weighted summation of the workstation's overall load score includes pre-configured fixed weights for four categories of indicators: workstation cache occupancy ratio has the highest weight, single workpiece complete inspection time is the second highest, GPU memory usage is the third highest, and CPU usage has the lowest weight. Each low-load item is scored 0 points, medium-load item is scored 1 point, second-highest load item is scored 2 points, and high-load item is scored 3 points. The scores of each item are multiplied by their corresponding weights and then summed to obtain the overall workstation load score. The four-level classification includes four preset continuous score ranges. The comprehensive load score falling into the lowest range is judged as light load, falling into the second lowest range is judged as normal load, falling into the second highest range is judged as high load, and falling into the highest range is judged as overload warning. Step S104: Traverse all real-time load levels of all workstations, select the highest load level among all workstations as the global benchmark load level of the entire line, and use it as the basis for subsequent conveyor speed adjustment.

[0021] Step S2 includes the following specific steps: Step S201: Establish a one-to-one correspondence between load levels and task priorities. Overload warning workstation tasks are the first priority, high load workstation tasks are the second priority, normal load workstation tasks are the third priority, and light load workstation tasks are the fourth priority. Step S202: Within a single inference cycle, the total GPU computing power resources of the industrial control computer are divided according to a fixed ratio. The first priority workstation is allocated computing power resources a1, the second priority workstation is allocated computing power resources a2, the third priority workstation is allocated computing power resources a3, and the fourth priority workstation is allocated computing power resources a4. The defect inference tasks of different workstations are executed in a time-sharing manner. At the same time, only one workstation occupies the corresponding proportion of computing power resources to complete the image defect inference; a1>a2>a3>a4, and a1+a2+a3+a4=100%. Step S203: For lightly loaded workstations that are determined to be of the fourth priority, the images that have been acquired are not immediately subjected to inference and storage operations. Instead, they are temporarily stored in the memory buffer area to release computing resources and prioritize the processing of backlogged images from high-priority workstations. Step S204: The maximum storage threshold for the temporary memory cache is calculated based on the available physical memory capacity of the industrial control computer, the memory usage of a single image, and a preset safe memory reservation value. The calculation process is as follows: first, subtract the safe memory reservation value from the total free physical memory of the industrial control computer to obtain the total available cache memory; then, divide the total available cache memory by the memory usage of a single image to obtain the maximum number of cacheable images. This value is the maximum storage threshold for the temporary memory cache. When the number of images in the memory buffer reaches the maximum storage threshold, adding new image buffers stops, and image inference within the cache is forcibly executed to prevent memory overflow.

[0022] Step S3 includes the following specific contents: All registers are of INT16 data type. Register functions include: The first register, written unidirectionally from the vision system to the PLC, stores the global baseline load level code; the second register, also written unidirectionally from the vision system to the PLC, stores the conveyor speed offset adjustment value (positive values ​​represent acceleration offset, negative values ​​represent deceleration offset); the third register, written unidirectionally from the PLC to the vision system, stores the current actual operating speed of the belt mechanism; the fourth register, used for bidirectional interaction between the vision system and the PLC, stores the speed adjustment completion handshake indicator. The basic execution flow includes the following: Step S301: Pre-calibrate the reference conveyor pulse frequency, the belt travel distance corresponding to a single pulse, and the standard workpiece conveyor interval duration. When the global reference load is light, calculate the positive acceleration offset. The calculation process for the positive acceleration offset is to subtract the average detection time per station from the standard workpiece conveyor interval duration to obtain the difference. Divide the difference by the reference conveyor pulse period to obtain the pulse increment value. The pulse increment value is the positive acceleration offset. When the global reference load is high or overload warning, calculate the negative deceleration offset. The calculation process for the negative deceleration offset is to subtract the standard workpiece conveyor interval duration from the average detection time per station to obtain the difference. Divide the difference by the reference conveyor pulse period to obtain the pulse reduction value. The pulse reduction value is the negative deceleration offset. Step S302: The vision system issues a speed adjustment command, and the global reference load code and speed offset base value are written to the corresponding registers every fixed period. Step S303: The PLC reads the speed offset pulse value stored in the second register, adds the pulse value to the original reference pulse frequency of the servo motor to obtain the updated pulse frequency, sends the updated pulse frequency to the servo driver, and the servo driver adjusts the output pulse rate to change the belt conveying speed. Step S304: After the PLC completes the pulse frequency modification and the belt speed is running stably, it writes a preset non-zero value to the fourth register as a handshake identifier. The vision continuously polls and reads the value of the fourth register. When the handshake identifier is detected, it means that the PLC speed adjustment action is completed. After reading the handshake identifier, the vision retrieves the actual belt running speed stored in the third register. Based on the actual belt running speed, it calculates the current workpiece conveying interval time and replaces the original benchmark cycle parameters in the software with the calculated current workpiece conveying interval time, so as to match the internal judgment logic of the software with the actual conveying interval of the production line on site. Step S305: Repeat steps S301 to S304 every preset millisecond period to continuously and dynamically fine-tune the conveying speed.

[0023] Step S3 also includes: Step S306: Count the number of consecutive high load or overload warnings for each workstation, k. Preset a fixed base weight W0 and an attenuation coefficient α with a value greater than zero and less than one. Use the formula: W=W0*α (k-1) Calculate the real-time load weight W of the workstation. When the workstation load level drops back to normal or light load, the cycle count k is cleared to zero and the weight is reset. The cycle count k takes the value of a positive integer and there is no calculation scenario where k is equal to negative one. Step S307: Set a sliding statistical window with a length of M detection cycles, and accumulate the product of the load level code of all workstations and the corresponding workstation weight W within the window. The accumulated result is the global load integral S. Step S308: Retrieve the real-time load weight W corresponding to the highest load position in the world, multiply the speed adjustment offset base amount by the real-time load weight W to obtain the compensation offset V2, preset a fixed congestion deceleration compensation value V3, activate V3 when the global load integral S in the sliding window exceeds the preset integral threshold Sh, and set the value of V3 to zero when the global load integral S does not exceed the preset integral threshold Sh. The total speed offset Vt is obtained by adding the compensation offset V2 and the congestion deceleration compensation value V3. Step S309: Retrieve the maximum pulse offset value corresponding to the preset upper limit of belt speed and the minimum pulse offset value corresponding to the lower limit of belt speed. Compare the total speed offset Vt with the maximum pulse offset value and the minimum pulse offset value. If the total speed offset Vt is greater than the maximum pulse offset value, correct the total speed offset to the maximum pulse offset value. If the total speed offset Vt is less than the minimum pulse offset value, correct the total speed offset to the minimum pulse offset value. If the total speed offset Vt is within the range of the two values, keep the original value unchanged. After completing the limiting process, output the valid speed adjustment value and write it into the PLC register.

[0024] Step S4 includes the following specific steps: Step S401: Set the third threshold as the warning threshold before buffer overflow. When the workstation buffer occupancy ratio reaches the third threshold, immediately execute the S3 speed regulation and deceleration logic to reduce the workpiece loading density in advance. Step S402: If a high load status at the workstation is detected in a single data acquisition but speed adjustment is not triggered, and the high load or overload warning is determined in N consecutive polls, a speed adjustment command is issued; this eliminates frequent speed adjustment jitter caused by instantaneous workpiece defect fluctuations. Step S403: Pre-configure the upper and lower speed limits allowed for production line operation. After the calculated speed offset is executed, the final belt speed must not exceed the upper or lower limit range. This prevents excessive speed from causing image blurring and excessive speed from reducing production capacity.

[0025] The method also includes a log recording step, which records in real time the load level of each workstation in each round, the computing power allocation ratio, the speed offset value sent by vision, the actual running speed fed back by PLC, and the timing data of speed adjustment handshake interaction, generating a global cycle analysis log. The log is associated with and stored with workpiece barcodes and defect detection records, and supports the later export of reports to complete production line capacity traceability analysis.

[0026] As shown in the example: This example is applied to a 4-station parallel inspection production line for new energy battery cells. The 4 inspection stations share one industrial control computer and one vision software of this invention. The production line is equipped with a unified belt conveyor mechanism and a single Modbus / TCP PLC. The inspection time for a single good product is 40ms, and the inspection time for multiple defective products is 150~190ms. Under the existing fixed 80ms conveying cycle, the buffer of the defective product station continuously overflows, resulting in batch frame loss and missed inspection. The background polls and collects the detection time of a single workpiece at 4 workstations, the number of remaining cached images, CPU utilization, and GPU memory utilization every 50ms. The maximum number of images that a single workstation can hold is set to 200. The workstation cache utilization rate = number of remaining cached images / 200. Configure progressive thresholds: first threshold 0.3, second threshold 0.7, third threshold 0.9; supporting auxiliary thresholds: standard detection time 80ms, CPU saturation threshold 80%, GPU memory saturation threshold 75%; The weighting of four categories of indicators is as follows: station cache usage ratio weight 0.5, single workpiece inspection time weight 0.25, GPU memory usage weight 0.15, and CPU utilization rate weight 0.1. Each indicator is scored as follows: low load 0 points, medium load 1 point, second-highest load 2 points, and high load 3 points. The weighted sum is used to obtain the comprehensive load score. The score range of 0~1 is considered light load, 1~3 is considered normal load, 3~6 is considered high load, and 6~9 is considered overload warning. The highest load level among the four stations is taken as the global benchmark load level. First priority - overload warning, allocate 60% of GPU computing power; second priority - high load, allocate 25% of computing power; third priority - normal load, allocate 10% of computing power; fourth priority - light load, allocate 5% of computing power. The industrial computer has 16GB of free physical memory, 4GB of preset safety reserve memory, 100MB of memory usage per image, 12GB of available cache memory, and a maximum of 120 cached images. When the memory cache reaches 120 images, image inference is forcibly executed. Images at lightly loaded workstations are temporarily stored in the memory buffer, and computing power is prioritized to handle images backlogged at overloaded and high-load workstations.

[0027] The PLC is configured with 4 INT16 Modbus registers: register 2000 stores the global load code, register 2001 stores the speed offset pulse value, register 2002 transmits the actual belt speed, and register 2003 stores the speed control handshake flag. The reference conveyor pulse frequency is 1000Hz, and the standard workpiece interval is 80ms; under light load, the positive acceleration offset = (80 - average detection time) / pulse period; under high / overload conditions, the negative deceleration offset = (average detection time - 80) / pulse period; Set the base weight W0=1, the attenuation coefficient α=0.7, the sliding window period M=10, the integral threshold=12, and the preset fixed congestion deceleration compensation value V3=-50 pulses; Total speed offset Vt = base offset × real-time load weight W + V3. Vt exceeding ±200 pulse limit is corrected to the upper and lower limits. The PLC reads the offset pulse and superimposes it onto the reference pulse frequency to adjust the belt speed. After the speed stabilizes, it writes the value 1 to register 2003 as a handshake identifier. After visually recognizing the identifier, it reads the actual speed to calculate the conveying interval and replaces the internal reference cycle parameters in the software.

[0028] The third threshold of 0.9 serves as the pre-warning threshold for the cache. When the workstation cache ratio reaches 0.9, a deceleration command is immediately issued. Short-time filtering is used to determine high load before speed regulation is triggered. The belt speed upper limit pulse is 1200Hz and the lower limit pulse is 600Hz, which limits the speed regulation range.

[0029] A machine vision-based industrial product defect detection system includes a computing power acquisition and classification module, a multi-station task scheduling module, a collaborative speed regulation and communication module, and a buffer early warning module. The computing power acquisition and classification module is used to independently poll and collect parameters such as the time taken to complete the inspection of a single workpiece at all workstations, the number of remaining images in the workstation image cache queue, the CPU utilization rate of the industrial control computer, and the GPU memory utilization rate in the background. Combined with the maximum number of images that the workstation cache can hold, the workstation cache utilization rate is calculated. Based on four indicators, namely the time taken to complete the inspection of a single workpiece, the workstation cache utilization rate, the CPU utilization rate, and the GPU memory utilization rate, the workstation is divided into multiple load levels. The highest load level of all workstations is selected as the global benchmark load level of the entire line. The multi-station task scheduling module is used to build a four-level priority detection task queue based on the workstation load level, allocate time-sharing GPU inference computing power to the four priority workstations in a fixed ratio, set memory delay write buffer logic for images acquired by light-load workstations, prioritize scheduling computing power to handle backlog tasks of high-load workstations, and calculate the maximum storage threshold of temporary memory cache based on the industrial control computer's idle memory, memory occupied by a single image, and safe reserved memory to constrain memory usage. The collaborative speed control communication module is used to configure multiple Modbus numerical interaction registers on the PLC side. Based on the global reference load level combined with the continuous weight decay of the load and the cross-station superimposed load integral compensation double-layer correction logic, it calculates the conveyor speed adjustment offset, sends speed control numerical instructions to the PLC, receives the speed control completion handshake mark returned by the PLC, and synchronously updates the internal reference cycle parameters of the software, forming a real-time closed loop of visual computing power reverse control of the production line cycle. The buffer early warning module is used to configure the first, second, and third thresholds for workstation buffer occupancy that are incremented step by step. The third threshold serves as the buffer overflow early warning threshold. When the workstation buffer occupancy reaches the early warning threshold, the collaborative speed control communication module is triggered to execute deceleration logic. At the same time, short-term load fluctuation filtering rules and production line speed upper and lower limit constraints are configured.

[0030] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A machine vision-based method for detecting defects in industrial products, characterized in that: A method for detecting welding defects in battery cell tab sheets, applied to a multi-station production line that shares the same industrial control computer and the same set of vision inspection software, wherein the multi-station production line is configured with a unified belt conveyor mechanism and a single PLC control system, includes the following steps: Step S1: An independent background polling thread continuously collects the full cycle time of single workpiece inspection, the number of remaining images in the workpiece image cache queue, and hardware resource usage parameters for all workstations. Based on the number of remaining images in the workpiece image cache queue and the maximum total number of images that the workpiece cache can hold, the workpiece cache usage ratio is calculated. Based on the full cycle time of single workpiece inspection, the workpiece cache usage ratio, and hardware resource usage parameters, each workstation is divided into multiple load levels, and the global baseline load level of the entire line is determined based on the load levels of all workstations. Step S2: Construct a priority detection task queue based on the real-time load level of each workstation, allocate GPU time-sharing inference computing power to the four priority workstations according to the preset computing power allocation ratio, set memory delay write buffer logic for the acquired images of light-load workstations, and prioritize scheduling computing power resources to process the backlog of detection tasks of high-load workstations. Step S3: Configure multiple Modbus communication registers for transmitting numerical data interaction on the PLC side in advance. Calculate the conveyor speed adjustment offset based on the global baseline load level superimposed with load weight attenuation and cross-station load integral compensation using a two-layer logic. Send speed adjustment numerical instructions from the vision software to the PLC. After the PLC executes the speed adjustment, it sends a speed adjustment completion handshake signal back to the vision software, forming a real-time closed loop of vision computing power reverse control of the production line cycle. Step S4: Set the workstation buffer occupancy warning threshold. When the workstation buffer reaches the warning threshold, the speed adjustment logic is triggered in advance, and short-term load fluctuation filtering rules and production line speed upper and lower limit constraints are configured.

2. The industrial product defect detection method based on machine vision according to claim 1, characterized in that: Step S1 includes the following steps: Step S101: After each workpiece inspection is completed, automatically accumulate and record the image acquisition time, deep learning model inference time, defect threshold determination time, and local image storage time to obtain the time T for a single workpiece complete inspection cycle; Step S102: Periodically read the remaining number of images in the image cache queue and the hardware resource usage parameters corresponding to each workstation. The hardware resource usage parameters include the CPU usage rate and GPU memory usage rate of the industrial control computer. Step S103: Preset four load levels as light load, normal load, high load, and overload warning, and configure a first threshold, a second threshold, and a third threshold with a progressive numerical relationship, wherein the value of the first threshold is less than the value of the second threshold, and the value of the second threshold is less than the value of the third threshold. Simultaneously, three auxiliary judgment thresholds are preset: standard detection time, CPU saturation threshold, and GPU memory saturation threshold. First, the load labels of the four types of indicators are judged independently. Then, the weighted sum of the sub-labels is used to obtain the comprehensive load score of the workstation. Based on the comprehensive score range, four levels are distinguished: light load, normal load, high load, and overload warning. The third threshold is used as the cache overflow warning threshold. The process for determining the sub-item load labels includes: if the time taken for a complete inspection of a single workpiece is less than the standard inspection time, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the CPU utilization rate is less than the CPU saturation threshold, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the GPU memory utilization rate is less than the GPU memory saturation threshold, the sub-item is marked as a low-load sub-item; otherwise, it is marked as a high-load sub-item. If the station cache utilization rate is lower than the first threshold, it is marked as a low-load sub-item; if it is between the first and second thresholds, it is marked as a medium-load sub-item; if it is between the second and third thresholds, it is marked as a second-highest-load sub-item; and if it is higher than the third threshold, it is marked as a high-load sub-item. The weighted summation to obtain the overall workstation load score includes pre-configured fixed weights for four categories of indicators: workstation cache occupancy ratio has the highest weight, single workpiece complete inspection time is the second highest, GPU memory occupancy has the third highest weight, and CPU occupancy has the lowest weight. Each low-load item is scored 0 points, medium-load item is scored 1 point, second-highest load item is scored 2 points, and high-load item is scored 3 points. The overall workstation load score is obtained by multiplying each item score by its corresponding weight and then summing them up. The four-level classification includes four preset continuous score ranges. The comprehensive load score falling into the lowest range is judged as light load, falling into the second lowest range is judged as normal load, falling into the second highest range is judged as high load, and falling into the highest range is judged as overload warning. Step S104: Traverse all real-time load levels of all workstations, select the highest load level among all workstations as the global benchmark load level of the entire line, and use it as the basis for subsequent conveyor speed adjustment.

3. The industrial product defect detection method based on machine vision according to claim 1, characterized in that: Step S2 includes the following specific steps: Step S201: Establish a one-to-one correspondence between load levels and task priorities. Overload warning workstation tasks are the first priority, high load workstation tasks are the second priority, normal load workstation tasks are the third priority, and light load workstation tasks are the fourth priority. Step S202: Within a single inference cycle, the total GPU computing power resources of the industrial control computer are divided according to a fixed ratio. The first priority workstation is allocated computing power resources a1, the second priority workstation is allocated computing power resources a2, the third priority workstation is allocated computing power resources a3, and the fourth priority workstation is allocated computing power resources a4. The defect inference tasks of different workstations are executed in a time-sharing manner. At the same time, only one workstation occupies the corresponding proportion of computing power resources to complete the image defect inference; a1>a2>a3>a4, and a1+a2+a3+a4=100%. Step S203: For lightly loaded workstations that are determined to be of the fourth priority, the images that have been acquired are not immediately subjected to inference and storage operations. Instead, they are temporarily stored in the memory buffer area to release computing resources and prioritize the processing of backlogged images from high-priority workstations. Step S204: The maximum storage threshold for temporary memory cache is calculated based on the available physical memory capacity of the industrial control computer, the memory usage of a single image, and the preset safe memory reservation value. The calculation process is as follows: first, the total available physical memory of the industrial control computer is subtracted from the safe memory reservation value to obtain the total available cache memory. Then, the total available cache memory is divided by the memory usage value of a single image to obtain the maximum number of cacheable images. The value is the maximum storage threshold for temporary memory cache. When the number of images in the memory buffer reaches the maximum storage threshold, the addition of new image buffers is stopped, and image inference in the cache is forcibly executed.

4. The industrial product defect detection method based on machine vision according to claim 1, characterized in that: Step S3 includes the following specific contents: All registers are of INT16 data type. The register functions are defined as follows: The first register, written unidirectionally from the vision system to the PLC, stores the global baseline load level code; the second register, also written unidirectionally from the vision system to the PLC, stores the conveyor speed offset adjustment value (positive values ​​represent acceleration offset, negative values ​​represent deceleration offset); the third register, written unidirectionally from the PLC to the vision system, stores the current actual operating speed of the belt mechanism; the fourth register, used for bidirectional interaction between the vision system and the PLC, stores the speed adjustment completion handshake indicator. The basic execution flow includes the following: Step S301: Pre-calibrate the reference conveyor pulse frequency, the belt travel distance corresponding to a single pulse, and the standard workpiece conveyor interval duration. When the global reference load is light, calculate the positive acceleration offset. The calculation process for the positive acceleration offset is to subtract the average detection time per station from the standard workpiece conveyor interval duration to obtain the difference. Divide the difference by the reference conveyor pulse period to obtain the pulse increment value. The pulse increment value is the positive acceleration offset. When the global reference load is high or overload warning, calculate the negative deceleration offset. The calculation process for the negative deceleration offset is to subtract the standard workpiece conveyor interval duration from the average detection time per station to obtain the difference. Divide the difference by the reference conveyor pulse period to obtain the pulse reduction value. The pulse reduction value is the negative deceleration offset. Step S302: The vision system issues a speed adjustment command, and the global reference load code and speed offset base value are written to the corresponding registers every fixed period. Step S303: The PLC reads the speed offset pulse value stored in the second register, adds the pulse value to the original reference pulse frequency of the servo motor to obtain the updated pulse frequency, sends the updated pulse frequency to the servo driver, and the servo driver adjusts the output pulse rate to change the belt conveying speed. Step S304: After the PLC completes the pulse frequency modification and the belt speed is running stably, it writes a preset non-zero value to the fourth register as a handshake identifier. The vision continuously polls and reads the value of the fourth register. When the handshake identifier is detected, it means that the PLC speed adjustment action is completed. After reading the handshake identifier, the vision retrieves the actual belt running speed stored in the third register. Based on the actual belt running speed, it calculates the current workpiece conveying interval time and replaces the original benchmark cycle parameters in the software with the calculated current workpiece conveying interval time, so as to match the internal judgment logic of the software with the actual conveying interval of the production line on site. Step S305: Repeat steps S301 to S304 every preset millisecond period to continuously and dynamically fine-tune the conveying speed.

5. The industrial product defect detection method based on machine vision according to claim 4, characterized in that: Step S3 further includes: Step S306: Count the number of consecutive high load or overload warnings for each workstation, k. Preset a fixed base weight W0 and an attenuation coefficient α with a value greater than zero and less than one. Use the formula: W=W0*α (k-1) Calculate the real-time load weight W of the workstation. When the workstation load level drops back to normal or light load, the cycle count k is cleared to zero and the weight is reset. The cycle count k takes the value of a positive integer and there is no calculation scenario where k is equal to negative one. Step S307: Set a sliding statistical window with a length of M detection cycles, and accumulate the product of the load level code of all workstations and the corresponding workstation weight W within the window. The accumulated result is the global load integral S. Step S308: Retrieve the real-time load weight W corresponding to the highest load position in the world, multiply the speed adjustment offset base amount by the real-time load weight W to obtain the compensation offset V2, preset a fixed congestion deceleration compensation value V3, activate V3 when the global load integral S in the sliding window exceeds the preset integral threshold Sh, and set the value of V3 to zero when the global load integral S does not exceed the preset integral threshold Sh. The total speed offset Vt is obtained by adding the compensation offset V2 and the congestion deceleration compensation value V3. Step S309: Retrieve the maximum pulse offset value corresponding to the preset upper limit of belt speed and the minimum pulse offset value corresponding to the lower limit of belt speed. Compare the total speed offset Vt with the maximum pulse offset value and the minimum pulse offset value. If the total speed offset Vt is greater than the maximum pulse offset value, correct the total speed offset to the maximum pulse offset value. If the total speed offset Vt is less than the minimum pulse offset value, correct the total speed offset to the minimum pulse offset value. If the total speed offset Vt is within the range of the two values, keep the original value unchanged. After completing the limiting process, output the valid speed adjustment value and write it into the PLC register.

6. The industrial product defect detection method based on machine vision according to claim 1, characterized in that: Step S4 includes the following specific steps: Step S401: Set the third threshold as the warning threshold before buffer overflow. When the workstation buffer occupancy ratio reaches the third threshold, immediately execute the S3 speed regulation and deceleration logic to reduce the workpiece loading density in advance. Step S402: If a high load status at the workstation is detected in a single data collection but speed adjustment is not triggered, and if the high load or overload warning is determined in N consecutive polls, a speed adjustment command is issued. Step S403: Pre-configure the upper and lower speed limits that the production line is allowed to operate at. After the calculated speed offset is executed, the final belt speed must not exceed the upper and lower limit range.

7. The industrial product defect detection method based on machine vision according to claim 1, characterized in that: The method also includes a log recording step, which records in real time the load level of each workstation in each round, the computing power allocation ratio, the speed offset value sent by vision, the actual running speed fed back by PLC, and the timing data of speed adjustment handshake interaction, and generates a global cycle analysis log. The log is associated with and stored with workpiece barcodes and defect detection records, and supports the later export of reports to complete production line capacity traceability analysis.

8. A machine vision-based industrial product defect detection system, using the machine vision-based industrial product defect detection method according to any one of claims 1-7, characterized in that: The system includes a computing power acquisition and classification module, a multi-station task scheduling module, a collaborative speed regulation and communication module, and a buffer early warning module; The computing power acquisition and classification module is used to independently poll and collect parameters such as the time taken to complete single workpiece detection at all workstations, the number of remaining images in the workstation image cache queue, the CPU utilization rate of the industrial control computer, and the GPU memory utilization rate in the background. It calculates the workstation cache utilization ratio based on the maximum total number of images that the workstation cache can hold. It classifies the multi-level load levels of each workstation based on four indicators: the time taken to complete single workpiece detection, the workstation cache utilization ratio, the CPU utilization rate, and the GPU memory utilization rate. The highest load level of all workstations is selected as the global benchmark load level of the entire line. The multi-station task scheduling module is used to construct a four-level priority detection task queue based on the workstation load level, allocate time-sharing GPU inference computing power to the four priority workstations in a fixed ratio, set memory delay write buffer logic for images acquired by light-load workstations, prioritize scheduling computing power to process backlog tasks of high-load workstations, and calculate the maximum storage threshold of temporary memory cache based on the industrial control computer's idle memory, memory occupied by a single image, and safe reserved memory to constrain memory usage. The collaborative speed regulation communication module is used to configure multiple Modbus numerical interaction registers on the PLC side. Based on the global benchmark load level combined with the continuous weight decay of the load and the cross-workstation superimposed load integral compensation double-layer correction logic, it calculates the conveying speed adjustment offset, sends speed regulation numerical instructions to the PLC, receives the speed regulation completion handshake mark returned by the PLC, and synchronously updates the internal benchmark cycle parameters of the software, forming a real-time closed loop of visual computing power reverse regulation of the production line cycle. The buffer early warning module is used to configure the first, second and third thresholds for workstation buffer occupancy that are incremented step by step. The third threshold is used as the buffer overflow early warning threshold. When the workstation buffer occupancy reaches the early warning threshold, the collaborative speed regulation communication module is triggered to execute the deceleration logic. At the same time, short-term load fluctuation filtering rules and production line speed upper and lower limit constraints are configured.